|
|
|
|
@@ -108,9 +108,9 @@ enum {
|
|
|
|
|
* Macros for all existing color depths
|
|
|
|
|
* to set/get values of the color channels
|
|
|
|
|
*------------------------------------------*/
|
|
|
|
|
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1);
|
|
|
|
|
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1);
|
|
|
|
|
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1);
|
|
|
|
|
# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1)
|
|
|
|
|
# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1)
|
|
|
|
|
# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1)
|
|
|
|
|
# define LV_COLOR_SET_A1(c, v)
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_GET_R1(c) (c).ch.red
|
|
|
|
|
@@ -118,9 +118,9 @@ enum {
|
|
|
|
|
# define LV_COLOR_GET_B1(c) (c).ch.blue
|
|
|
|
|
# define LV_COLOR_GET_A1(c) 1
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U;
|
|
|
|
|
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U;
|
|
|
|
|
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U;
|
|
|
|
|
# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)(v) & 0x7U
|
|
|
|
|
# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)(v) & 0x7U
|
|
|
|
|
# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)(v) & 0x3U
|
|
|
|
|
# define LV_COLOR_SET_A8(c, v) do {} while(0)
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_GET_R8(c) (c).ch.red
|
|
|
|
|
@@ -128,10 +128,10 @@ enum {
|
|
|
|
|
# define LV_COLOR_GET_B8(c) (c).ch.blue
|
|
|
|
|
# define LV_COLOR_GET_A8(c) 0xFF
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU;
|
|
|
|
|
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU;
|
|
|
|
|
# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)(v) & 0x1FU
|
|
|
|
|
# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)(v) & 0x3FU
|
|
|
|
|
# define LV_COLOR_SET_G16_SWAP(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);}
|
|
|
|
|
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU;
|
|
|
|
|
# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)(v) & 0x1FU
|
|
|
|
|
# define LV_COLOR_SET_A16(c, v) do {} while(0)
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_GET_R16(c) (c).ch.red
|
|
|
|
|
@@ -140,10 +140,10 @@ enum {
|
|
|
|
|
# define LV_COLOR_GET_B16(c) (c).ch.blue
|
|
|
|
|
# define LV_COLOR_GET_A16(c) 0xFF
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF);
|
|
|
|
|
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF);
|
|
|
|
|
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF);
|
|
|
|
|
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF);
|
|
|
|
|
# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint32_t)((v) & 0xFF)
|
|
|
|
|
# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint32_t)((v) & 0xFF)
|
|
|
|
|
# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint32_t)((v) & 0xFF)
|
|
|
|
|
# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint32_t)((v) & 0xFF)
|
|
|
|
|
|
|
|
|
|
# define LV_COLOR_GET_R32(c) (c).ch.red
|
|
|
|
|
# define LV_COLOR_GET_G32(c) (c).ch.green
|
|
|
|
|
|