1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

chore(color): add A1/2/4 format bpp info (#4722)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu 2023-10-29 23:58:21 +08:00 committed by GitHub
parent 52f375975e
commit 44912f290f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -47,10 +47,13 @@ uint8_t lv_color_format_get_bpp(lv_color_format_t cf)
case LV_COLOR_FORMAT_NATIVE_REVERSED:
return LV_COLOR_DEPTH / 8;
case LV_COLOR_FORMAT_I1:
case LV_COLOR_FORMAT_A1:
return 1;
case LV_COLOR_FORMAT_I2:
case LV_COLOR_FORMAT_A2:
return 2;
case LV_COLOR_FORMAT_I4:
case LV_COLOR_FORMAT_A4:
return 4;
case LV_COLOR_FORMAT_L8:
case LV_COLOR_FORMAT_A8:

View File

@ -146,6 +146,7 @@ typedef _lv_color_format_t lv_color_format_t;
typedef uint8_t lv_color_format_t;
#endif /*DOXYGEN*/
#define LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf) ((cf) >= LV_COLOR_FORMAT_A1 && (cf) <= LV_COLOR_FORMAT_A8)
#define LV_COLOR_FORMAT_IS_INDEXED(cf) ((cf) >= LV_COLOR_FORMAT_I1 && (cf) <= LV_COLOR_FORMAT_I8)
#define LV_COLOR_INDEXED_PALETTE_SIZE(cf) ((cf) == LV_COLOR_FORMAT_I1 ? 2 :\
(cf) == LV_COLOR_FORMAT_I2 ? 4 :\