59 typedef uint32_t leColor;
61 #define LE_COLOR_MAX_SIZE 4 63 #define RGB_8_BITS 255 69 #define RGB_332_RED_MASK 0xE0 70 #define RGB_332_GREEN_MASK 0x1C 71 #define RGB_332_BLUE_MASK 0x3 73 #define RGB_565_RED_MASK 0xF800 74 #define RGB_565_GREEN_MASK 0x7E0 75 #define RGB_565_BLUE_MASK 0x1F 77 #define RGBA_5551_RED_MASK 0xF800 78 #define RGBA_5551_GREEN_MASK 0x7C0 79 #define RGBA_5551_BLUE_MASK 0x3E 80 #define RGBA_5551_ALPHA_MASK 0x1 82 #define RGB_888_RED_MASK 0xFF0000 83 #define RGB_888_GREEN_MASK 0xFF00 84 #define RGB_888_BLUE_MASK 0xFF 86 #define RGBA_8888_RED_MASK 0xFF000000 87 #define RGBA_8888_GREEN_MASK 0xFF0000 88 #define RGBA_8888_BLUE_MASK 0xFF00 89 #define RGBA_8888_ALPHA_MASK 0xFF 91 #define ARGB_8888_RED_MASK 0xFF0000 92 #define ARGB_8888_GREEN_MASK 0xFF00 93 #define ARGB_8888_BLUE_MASK 0xFF 94 #define ARGB_8888_ALPHA_MASK 0xFF000000 119 LE_COLOR_MASK_GS_8 = 0x1,
120 LE_COLOR_MASK_PALETTE = 0x1,
121 LE_COLOR_MASK_RGB_332 = 0x4,
122 LE_COLOR_MASK_RGB_565 = 0x8,
123 LE_COLOR_MASK_RGBA_5551 = 0x10,
124 LE_COLOR_MASK_RGB_888 = 0x20,
125 LE_COLOR_MASK_RGBA_8888 = 0x40,
126 LE_COLOR_MASK_ARGB_8888 = 0x80,
127 LE_COLOR_MASK_ALL = LE_COLOR_MASK_GS_8 |
128 LE_COLOR_MASK_RGB_332 |
129 LE_COLOR_MASK_RGB_565 |
130 LE_COLOR_MASK_RGBA_5551 |
131 LE_COLOR_MASK_RGB_888 |
132 LE_COLOR_MASK_RGBA_8888 |
133 LE_COLOR_MASK_ARGB_8888
150 LE_COLOR_MODE_GS_8 = 0,
151 LE_COLOR_MODE_RGB_332 = 1,
152 LE_COLOR_MODE_RGB_565 = 2,
153 LE_COLOR_MODE_RGBA_5551 = 3,
154 LE_COLOR_MODE_RGB_888 = 4,
155 LE_COLOR_MODE_RGBA_8888 = 5,
156 LE_COLOR_MODE_ARGB_8888 = 6,
157 LE_COLOR_MODE_INDEX_1 = 7,
158 LE_COLOR_MODE_INDEX_4 = 8,
159 LE_COLOR_MODE_INDEX_8 = 9,
160 LE_COLOR_MODE_PALETTE = LE_COLOR_MODE_INDEX_8,
161 LE_COLOR_MODE_MONOCHROME = 10
164 #define LE_COLOR_MODE_LAST_COLOR (LE_COLOR_MODE_MONOCHROME) 165 #define LE_COLOR_MODE_COUNT (LE_COLOR_MODE_LAST_COLOR + 1) 167 #define LE_COLOR_MODE_IS_PIXEL(mode) ((mode >= LE_COLOR_MODE_GS_8) && (mode <= LE_COLOR_MODE_ARGB_8888)) 168 #define LE_COLOR_MODE_IS_INDEX(mode) ((mode >= LE_COLOR_MODE_INDEX_1) && (mode <= LE_COLOR_MODE_INDEX_8)) 170 #define LE_COLOR_MODE_IS_ALPHA(mode) ((mode == LE_COLOR_MODE_RGBA_5551) || (mode == LE_COLOR_MODE_RGBA_8888) || (mode == LE_COLOR_MODE_ARGB_8888)) leColorMode mode
Definition: legato_color.h:297
uint32_t leColorChannelGreen(leColor clr, leColorMode mode)
Get green color channel.
Definition: legato_color.c:49
leColor leColorSwap(leColor clr, leColorMode mode)
Swaps the red and blue channels for a given color value.
Definition: legato_color.c:69
Common macros and definitions used by Legato.
leColor leColorBilerp(leColor c00, leColor c01, leColor c10, leColor c11, uint32_t xper, uint32_t yper, leColorMode mode)
Get color from bi-linear interpolation of four colors.
Definition: legato_color_lerp.c:301
leColor foreground
Definition: legato_color.h:295
This struct represents color mode information.
Definition: legato_color.h:216
leColorName
This enum represents predefined color options.
Definition: legato_color.h:264
leColorMask
This enum represents the color masks for color modes.
Definition: legato_color.h:117
const leColorModeInfo leColorInfoTable[]
This array represents information reference table.
Definition: legato_color.c:29
leColor leColorBlend_ARGB_8888(leColor fore, leColor back)
Get color from ARGB blend.
Definition: legato_color_blend.c:116
struct leColorModeInfo leColorModeInfo
This struct represents color mode information.
const void * data
Definition: legato_color.h:299
uint32_t leColorChannelBlue(leColor clr, leColorMode mode)
Get blue color channel.
Definition: legato_color.c:54
leColor leColorLerp(leColor l, leColor r, uint32_t percent, leColorMode mode)
Get color from linear interpolate of two colors.
Definition: legato_color_lerp.c:284
leColor background
Definition: legato_color.h:296
uint32_t size
Definition: legato_color.h:218
This struct represents a blend color lookup table.
Definition: legato_color.h:293
struct leColorModeInfo::@22 mask
leColor leColorConvert(leColorMode mode_in, leColorMode mode_out, leColor color)
Convert to color value.
Definition: legato_color_convert.c:589
leColorMode
This enum represents the supported RGB color formats.
Definition: legato_color.h:148
struct leBlendLookupTable leBlendLookupTable
This struct represents a blend color lookup table.
leColor leColorBlend_RGBA_8888(leColor fore, leColor back)
Get color from RGBA blend.
Definition: legato_color_blend.c:56
uint32_t bpp
Definition: legato_color.h:219
uint32_t leColorChannelRed(leColor clr, leColorMode mode)
Get red color channel.
Definition: legato_color.c:44
leColor leColorValue(leColorMode mode, leColorName name)
Get color by name and mode.
Definition: legato_color_value.c:51
leBitsPerPixel bppOrdinal
Definition: legato_color.h:220
uint32_t leColorChannelAlpha(leColor clr, leColorMode mode)
Get alpha color channel.
Definition: legato_color.c:59
leBitsPerPixel
This enum represents the bits per pixel (bpp) options.
Definition: legato_color.h:185