cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4ecb51025b4983334d6ba984236dae1db674fbff
commit 4ecb51025b4983334d6ba984236dae1db674fbff Author: se.osadchy <se.osad...@samsung.com> Date: Mon Jan 4 12:16:44 2016 -0800 evas: factorize of data structure with evas_color and ector. Summary: Move data structure and functionality to ector_color from evas_color. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3393 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/ector/ector_util.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/lib/ector/ector_util.h b/src/lib/ector/ector_util.h index 2dafaaf..6cf4e0a 100644 --- a/src/lib/ector/ector_util.h +++ b/src/lib/ector/ector_util.h @@ -1,6 +1,20 @@ #ifndef ECTOR_UTIL_H # define ECTOR_UTIL_H +#define ECTOR_COLOR_SET(value) (value << 8) + +#define ECTOR_COLOR16_SET(value) (value) + +typedef struct _Ector_Color Ector_Color; + +struct _Ector_Color +{ + unsigned short r; + unsigned short g; + unsigned short b; + unsigned short a; +}; + static inline void ector_color_argb_premul(int a, int *r, int *g, int *b) { @@ -29,4 +43,24 @@ ector_color_multiply(unsigned int c1, unsigned int c2) (((((c1) & 0xff) * ((c2) & 0xff)) + 0xff) >> 8) ); } +static inline void +ector_color_set(Ector_Color *color, unsigned char r, unsigned char g, + unsigned char b, unsigned char a) +{ + color->r = ECTOR_COLOR_SET(r); + color->g = ECTOR_COLOR_SET(g); + color->b = ECTOR_COLOR_SET(b); + color->a = ECTOR_COLOR_SET(a); +} + +static inline void +ector_color16_set(Ector_Color *color, unsigned short r, unsigned short g, + unsigned short b, unsigned short a) +{ + color->r = ECTOR_COLOR16_SET(r); + color->g = ECTOR_COLOR16_SET(g); + color->b = ECTOR_COLOR16_SET(b); + color->a = ECTOR_COLOR16_SET(a); +} + #endif --