mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
parent
273a0eb32f
commit
7a95fa9e2d
@ -365,7 +365,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
if(obj->styles[i].is_trans) continue;
|
||||
|
||||
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
|
||||
/*The style is valid for a stat but not the other*/
|
||||
/*The style is valid for a state but not the other*/
|
||||
bool valid1 = state_act & (~state1) ? false : true;
|
||||
bool valid2 = state_act & (~state2) ? false : true;
|
||||
if(valid1 != valid2) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "gifdec.h"
|
||||
#include "../../../misc/lv_log.h"
|
||||
#include "../../../misc/lv_mem.h"
|
||||
#include "../../../misc/lv_color.h"
|
||||
#if LV_USE_GIF
|
||||
|
||||
#include <stdio.h>
|
||||
@ -111,7 +112,7 @@ static gd_GIF * gif_open(gd_GIF * gif_base)
|
||||
gif = lv_mem_alloc(sizeof(gd_GIF) + 5 * width * height);
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
gif = lv_mem_alloc(sizeof(gd_GIF) + 4 * width * height);
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
#elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
|
||||
gif = lv_mem_alloc(sizeof(gd_GIF) + 3 * width * height);
|
||||
#endif
|
||||
|
||||
@ -130,7 +131,7 @@ static gd_GIF * gif_open(gd_GIF * gif_base)
|
||||
gif->frame = &gif->canvas[4 * width * height];
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
gif->frame = &gif->canvas[3 * width * height];
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
#elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
|
||||
gif->frame = &gif->canvas[2 * width * height];
|
||||
#endif
|
||||
if (gif->bgindex)
|
||||
@ -498,6 +499,10 @@ render_frame_rect(gd_GIF *gif, uint8_t *buffer)
|
||||
lv_color_t c = lv_color_make(*(color + 0), *(color + 1), *(color + 2));
|
||||
buffer[(i+k)*2 + 0] = c.full;
|
||||
buffer[(i+k)*2 + 1] = 0xff;
|
||||
#elif LV_COLOR_DEPTH == 1
|
||||
uint8_t b = (*(color + 0)) | (*(color + 1)) | (*(color + 2));
|
||||
buffer[(i+k)*2 + 0] = b > 128 ? 1 : 0;
|
||||
buffer[(i+k)*2 + 1] = 0xff;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -534,6 +539,10 @@ dispose(gd_GIF *gif)
|
||||
lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2));
|
||||
gif->canvas[(i+k)*2 + 0] = c.full;
|
||||
gif->canvas[(i+k)*2 + 1] = opa;
|
||||
#elif LV_COLOR_DEPTH == 1
|
||||
uint8_t b = (*(bgcolor + 0)) | (*(bgcolor + 1)) | (*(bgcolor + 2));
|
||||
gif->canvas[(i+k)*2 + 0] = b > 128 ? 1 : 0;
|
||||
gif->canvas[(i+k)*2 + 1] = opa;
|
||||
#endif
|
||||
}
|
||||
i += gif->width;
|
||||
|
@ -222,13 +222,22 @@ static void convert_color_depth(uint8_t * img, uint32_t px_cnt)
|
||||
}
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
lv_color32_t * img_argb = (lv_color32_t*)img;
|
||||
lv_color_t c;
|
||||
uint32_t i;
|
||||
for(i = 0; i < px_cnt; i++) {
|
||||
c = lv_color_make(img_argb[i].red, img_argb[i].green, img_argb[i].blue);
|
||||
img[i*2 + 1] = img_argb[i].alpha;
|
||||
img[i*2 + 0] = c.full
|
||||
}
|
||||
lv_color_t c;
|
||||
uint32_t i;
|
||||
for(i = 0; i < px_cnt; i++) {
|
||||
c = lv_color_make(img_argb[i].ch.red, img_argb[i].ch.green, img_argb[i].ch.blue);
|
||||
img[i*2 + 1] = img_argb[i].ch.alpha;
|
||||
img[i*2 + 0] = c.full;
|
||||
}
|
||||
#elif LV_COLOR_DEPTH == 1
|
||||
lv_color32_t * img_argb = (lv_color32_t*)img;
|
||||
uint8_t b;
|
||||
uint32_t i;
|
||||
for(i = 0; i < px_cnt; i++) {
|
||||
b = img_argb[i].ch.red | img_argb[i].ch.green | img_argb[i].ch.blue;
|
||||
img[i*2 + 1] = img_argb[i].ch.alpha;
|
||||
img[i*2 + 0] = b > 128 ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,10 @@ set(LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME
|
||||
-DLV_USE_ARABIC_PERSIAN_CHARS=0
|
||||
-DLV_BUILD_EXAMPLES=1
|
||||
-DLV_FONT_DEFAULT=&lv_font_montserrat_14
|
||||
-DLV_USE_PNG=1
|
||||
-DLV_USE_BMP=1
|
||||
-DLV_USE_GIF=1
|
||||
-DLV_USE_QRCODE=1
|
||||
)
|
||||
|
||||
set(LVGL_TEST_OPTIONS_NORMAL_8BIT
|
||||
@ -51,6 +55,11 @@ set(LVGL_TEST_OPTIONS_NORMAL_8BIT
|
||||
-DLV_USE_ARABIC_PERSIAN_CHARS=0
|
||||
-DLV_BUILD_EXAMPLES=1
|
||||
-DLV_FONT_DEFAULT=&lv_font_montserrat_14
|
||||
-DLV_USE_PNG=1
|
||||
-DLV_USE_BMP=1
|
||||
-DLV_USE_SJPG=1
|
||||
-DLV_USE_GIF=1
|
||||
-DLV_USE_QRCODE=1
|
||||
)
|
||||
|
||||
set(LVGL_TEST_OPTIONS_16BIT
|
||||
@ -72,6 +81,11 @@ set(LVGL_TEST_OPTIONS_16BIT
|
||||
-DLV_USE_ARABIC_PERSIAN_CHARS=0
|
||||
-DLV_BUILD_EXAMPLES=1
|
||||
-DLV_FONT_DEFAULT=&lv_font_montserrat_14
|
||||
-DLV_USE_PNG=1
|
||||
-DLV_USE_BMP=1
|
||||
-DLV_USE_SJPG=1
|
||||
-DLV_USE_GIF=1
|
||||
-DLV_USE_QRCODE=1
|
||||
)
|
||||
|
||||
set(LVGL_TEST_OPTIONS_16BIT_SWAP
|
||||
@ -93,6 +107,11 @@ set(LVGL_TEST_OPTIONS_16BIT_SWAP
|
||||
-DLV_USE_ARABIC_PERSIAN_CHARS=0
|
||||
-DLV_BUILD_EXAMPLES=1
|
||||
-DLV_FONT_DEFAULT=&lv_font_montserrat_14
|
||||
-DLV_USE_PNG=1
|
||||
-DLV_USE_BMP=1
|
||||
-DLV_USE_SJPG=1
|
||||
-DLV_USE_GIF=1
|
||||
-DLV_USE_QRCODE=1
|
||||
)
|
||||
|
||||
set(LVGL_TEST_OPTIONS_FULL_32BIT
|
||||
|
Loading…
x
Reference in New Issue
Block a user