fix(draw_sw): make the images invisible on full recolor to the background color (#7868)
Arduino Lint / lint (push) Waiting to run
MicroPython CI / Build esp32 port (push) Waiting to run
MicroPython CI / Build rp2 port (push) Waiting to run
MicroPython CI / Build stm32 port (push) Waiting to run
MicroPython CI / Build unix port (push) Waiting to run
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_VG_LITE - Ubuntu (push) Waiting to run
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_VG_LITE - cl - Windows (push) Waiting to run
C/C++ CI / Build OPTIONS_VG_LITE - gcc - Windows (push) Waiting to run
C/C++ CI / Build ESP IDF ESP32S3 (push) Waiting to run
C/C++ CI / Run tests with 32bit build (push) Waiting to run
C/C++ CI / Run tests with 64bit build (push) Waiting to run
BOM Check / bom-check (push) Waiting to run
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Waiting to run
Verify the widget property name / verify-property-name (push) Waiting to run
Verify code formatting / verify-formatting (push) Waiting to run
Build docs / build-and-deploy (push) Waiting to run
Test API JSON generator / Test API JSON (push) Waiting to run
Check Makefile / Build using Makefile (push) Waiting to run
Check Makefile for UEFI / Build using Makefile for UEFI (push) Waiting to run
Port repo release update / run-release-branch-updater (push) Waiting to run
Verify Kconfig / verify-kconfig (push) Waiting to run
Close stale issues and PRs / stale (push) Has been cancelled
@@ -554,23 +554,37 @@ static void recolor(lv_area_t relative_area, uint8_t * src_buf, uint8_t * dest_b
|
||||
const uint8_t * src_buf_tmp = src_buf + src_stride * relative_area.y1 + relative_area.x1 * 2;
|
||||
int32_t img_stride_px = src_stride / 2;
|
||||
|
||||
uint16_t c_mult[3];
|
||||
c_mult[0] = (color.blue >> 3) * mix;
|
||||
c_mult[1] = (color.green >> 2) * mix;
|
||||
c_mult[2] = (color.red >> 3) * mix;
|
||||
uint16_t * buf16_src = (uint16_t *)src_buf_tmp;
|
||||
uint16_t * buf16_dest = (uint16_t *)dest_buf;
|
||||
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
*buf16_dest = (((c_mult[2] + ((buf16_src[x] >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) +
|
||||
(((c_mult[1] + ((buf16_src[x] >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) +
|
||||
((c_mult[0] + (buf16_src[x] & 0x1F) * mix_inv) >> 8);
|
||||
buf16_dest++;
|
||||
uint16_t color16 = lv_color_to_u16(color);
|
||||
if(mix >= LV_OPA_MAX) {
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
*buf16_dest = color16;
|
||||
buf16_dest++;
|
||||
}
|
||||
buf16_src += img_stride_px;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint16_t c_mult[3];
|
||||
c_mult[0] = (color.blue >> 3) * mix;
|
||||
c_mult[1] = (color.green >> 2) * mix;
|
||||
c_mult[2] = (color.red >> 3) * mix;
|
||||
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
*buf16_dest = (((c_mult[2] + ((buf16_src[x] >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) +
|
||||
(((c_mult[1] + ((buf16_src[x] >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) +
|
||||
((c_mult[0] + (buf16_src[x] & 0x1F) * mix_inv) >> 8);
|
||||
buf16_dest++;
|
||||
}
|
||||
buf16_src += img_stride_px;
|
||||
}
|
||||
buf16_src += img_stride_px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,22 +592,39 @@ static void recolor(lv_area_t relative_area, uint8_t * src_buf, uint8_t * dest_b
|
||||
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_RECOLOR(dest_buf, blend_area, color, mix, cf_final)) {
|
||||
uint32_t px_size = lv_color_format_get_size(cf);
|
||||
src_buf += src_stride * relative_area.y1 + relative_area.x1 * px_size;
|
||||
uint16_t c_mult[3];
|
||||
c_mult[0] = color.blue * mix;
|
||||
c_mult[1] = color.green * mix;
|
||||
c_mult[2] = color.red * mix;
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
dest_buf[0] = (c_mult[0] + (src_buf[0] * mix_inv)) >> 8;
|
||||
dest_buf[1] = (c_mult[1] + (src_buf[1] * mix_inv)) >> 8;
|
||||
dest_buf[2] = (c_mult[2] + (src_buf[2] * mix_inv)) >> 8;
|
||||
if(cf == LV_COLOR_FORMAT_ARGB8888) dest_buf[3] = src_buf[3];
|
||||
src_buf += px_size;
|
||||
dest_buf += px_size;
|
||||
if(mix >= LV_OPA_MAX) {
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
dest_buf[0] = color.blue;
|
||||
dest_buf[1] = color.green;
|
||||
dest_buf[2] = color.red;
|
||||
if(cf == LV_COLOR_FORMAT_ARGB8888) dest_buf[3] = src_buf[3];
|
||||
src_buf += px_size;
|
||||
dest_buf += px_size;
|
||||
}
|
||||
src_buf += src_stride - w * px_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint16_t c_mult[3];
|
||||
c_mult[0] = color.blue * mix;
|
||||
c_mult[1] = color.green * mix;
|
||||
c_mult[2] = color.red * mix;
|
||||
int32_t y;
|
||||
for(y = 0; y < h; y++) {
|
||||
int32_t x;
|
||||
for(x = 0; x < w; x++) {
|
||||
dest_buf[0] = (c_mult[0] + (src_buf[0] * mix_inv)) >> 8;
|
||||
dest_buf[1] = (c_mult[1] + (src_buf[1] * mix_inv)) >> 8;
|
||||
dest_buf[2] = (c_mult[2] + (src_buf[2] * mix_inv)) >> 8;
|
||||
if(cf == LV_COLOR_FORMAT_ARGB8888) dest_buf[3] = src_buf[3];
|
||||
src_buf += px_size;
|
||||
dest_buf += px_size;
|
||||
}
|
||||
src_buf += src_stride - w * px_size;
|
||||
}
|
||||
src_buf += src_stride - w * px_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg)
|
||||
if(fg.alpha <= LV_OPA_MIN) {
|
||||
return bg;
|
||||
}
|
||||
bg.red = (uint32_t)((uint32_t)fg.red * fg.alpha + (uint32_t)bg.red * (255 - fg.alpha)) >> 8;
|
||||
bg.green = (uint32_t)((uint32_t)fg.green * fg.alpha + (uint32_t)bg.green * (255 - fg.alpha)) >> 8;
|
||||
bg.blue = (uint32_t)((uint32_t)fg.blue * fg.alpha + (uint32_t)bg.blue * (255 - fg.alpha)) >> 8;
|
||||
bg.red = LV_UDIV255((uint32_t)((uint32_t)fg.red * fg.alpha + (uint32_t)bg.red * (255 - fg.alpha)));
|
||||
bg.green = LV_UDIV255((uint32_t)((uint32_t)fg.green * fg.alpha + (uint32_t)bg.green * (255 - fg.alpha)));
|
||||
bg.blue = LV_UDIV255((uint32_t)((uint32_t)fg.blue * fg.alpha + (uint32_t)bg.blue * (255 - fg.alpha)));
|
||||
return bg;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |