mirror of
https://github.com/lvgl/lvgl.git
synced 2026-08-17 18:22:42 +08:00
chore(decoder): only premultiply for images have alpha (#5370)
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -308,6 +308,8 @@ lv_draw_buf_t * lv_image_decoder_post_process(lv_image_decoder_dsc_t * dsc, lv_d
|
||||
|
||||
/*Premultiply alpha channel*/
|
||||
if(args->premultiply
|
||||
&& !LV_COLOR_FORMAT_IS_ALPHA_ONLY(decoded->header.cf)
|
||||
&& lv_color_format_has_alpha(decoded->header.cf)
|
||||
&& !lv_draw_buf_has_flag(decoded, LV_IMAGE_FLAGS_PREMULTIPLIED) /*Hasn't done yet*/
|
||||
) {
|
||||
LV_LOG_TRACE("Alpha premultiply.");
|
||||
|
||||
@@ -76,7 +76,13 @@ uint8_t lv_color_format_get_bpp(lv_color_format_t cf)
|
||||
bool lv_color_format_has_alpha(lv_color_format_t cf)
|
||||
{
|
||||
switch(cf) {
|
||||
case LV_COLOR_FORMAT_A1:
|
||||
case LV_COLOR_FORMAT_A2:
|
||||
case LV_COLOR_FORMAT_A4:
|
||||
case LV_COLOR_FORMAT_A8:
|
||||
case LV_COLOR_FORMAT_I1:
|
||||
case LV_COLOR_FORMAT_I2:
|
||||
case LV_COLOR_FORMAT_I4:
|
||||
case LV_COLOR_FORMAT_I8:
|
||||
case LV_COLOR_FORMAT_RGB565A8:
|
||||
case LV_COLOR_FORMAT_ARGB8888:
|
||||
|
||||
Reference in New Issue
Block a user