forked from enlightenment/efl
ector: correct implementation for color multiplication.
This commit is contained in:
parent
f5fe46ec3c
commit
472f3a72ff
|
@ -40,6 +40,7 @@ lib_LTLIBRARIES += lib/ector/libector.la
|
||||||
installed_ectormainheadersdir = $(includedir)/ector-@VMAJ@
|
installed_ectormainheadersdir = $(includedir)/ector-@VMAJ@
|
||||||
dist_installed_ectormainheaders_DATA = \
|
dist_installed_ectormainheaders_DATA = \
|
||||||
lib/ector/Ector.h \
|
lib/ector/Ector.h \
|
||||||
|
lib/ector/ector_util.h \
|
||||||
lib/ector/cairo/Ector_Cairo.h \
|
lib/ector/cairo/Ector_Cairo.h \
|
||||||
lib/ector/software/Ector_Software.h
|
lib/ector/software/Ector_Software.h
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,7 @@ EAPI int ector_shutdown(void);
|
||||||
|
|
||||||
#include "ector_surface.h"
|
#include "ector_surface.h"
|
||||||
#include "ector_renderer.h"
|
#include "ector_renderer.h"
|
||||||
|
#include "ector_util.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef ECTOR_UTIL_H
|
||||||
|
# define ECTOR_UTIL_H
|
||||||
|
|
||||||
|
static inline unsigned int
|
||||||
|
ector_color_multiply(unsigned int c1, unsigned int c2)
|
||||||
|
{
|
||||||
|
return ( ((((((c1) >> 16) & 0xff00) * (((c2) >> 16) & 0xff00)) + 0xff0000) & 0xff000000) +
|
||||||
|
((((((c1) >> 8) & 0xff00) * (((c2) >> 16) & 0xff)) + 0xff00) & 0xff0000) +
|
||||||
|
((((((c1) & 0xff00) * ((c2) & 0xff00)) + 0xff00) >> 16) & 0xff00) +
|
||||||
|
(((((c1) & 0xff) * ((c2) & 0xff)) + 0xff) >> 8) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue