feat(draw/sw): add support for LV_COLOR_FORMAT_I1 (#6345)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Fabian Blatz
2024-07-19 12:10:28 +02:00
committed by GitHub
parent e3f8d167cd
commit 790aa5a529
146 changed files with 2163 additions and 46 deletions

View File

@@ -239,6 +239,11 @@ menu "LVGL configuration"
default y
depends on LV_USE_DRAW_SW
config LV_DRAW_SW_SUPPORT_I1
bool "Enable support for I1 color format"
default y
depends on LV_USE_DRAW_SW
config LV_DRAW_SW_DRAW_UNIT_CNT
int "Number of draw units"
default 1

View File

@@ -0,0 +1,73 @@
#ifdef __has_include
#if __has_include("lvgl.h")
#ifndef LV_LVGL_H_INCLUDE_SIMPLE
#define LV_LVGL_H_INCLUDE_SIMPLE
#endif
#endif
#endif
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_I1
#define LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_I1
#endif
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_I1
uint8_t img_render_lvgl_logo_i1_map[] = {
0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
0x20,0x00,0x00,0x18,
0xc0,0x00,0x00,0x04,
0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x70,
0x00,0x00,0x00,0xf0,
0x00,0x00,0x00,0x60,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xff,0x80,0x00,0x00,
0xff,0xc0,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0x80,0x60,0x00,0x00,
0xff,0xe0,0x00,0x00,
0x7f,0x9f,0xf0,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x00,
0x80,0x60,0x18,0x04,
0x40,0x00,0x18,0x0c,
};
const lv_image_dsc_t img_render_lvgl_logo_i1 = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_I1,
.header.flags = 0,
.header.w = 30,
.header.h = 30,
.header.stride = 4,
.data_size = sizeof(img_render_lvgl_logo_i1_map),
.data = img_render_lvgl_logo_i1_map,
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

@@ -14,54 +14,58 @@
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_RENDER_LVGL_LOGO_L8
#define LV_ATTRIBUTE_IMG_IMG_RENDER_LVGL_LOGO_L8
#ifndef LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_L8
#define LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_L8
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_RENDER_LVGL_LOGO_L8 uint8_t
img_render_lvgl_logo_l8_map[] = {
/*Pixel format: Grayscale 8 bit*/
0xfd,0xfd,0xdf,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xcb,0xed,0xfd,0xfd,
0xfd,0xa8,0x1d,0x1d,0x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,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0xf2,0xdc,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x56,0xe1,0xfd,
0xfd,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xee,0xfd,0xfd,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xee,0xfd,0xfd,0xed,0xe6,0xe6,0xe6,0xe6,0xe6,0xfa,0xfd,0xfd,
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_RENDER_LVGL_LOGO_L8
uint8_t img_render_lvgl_logo_l8_map[] = {
0x00,0x00,0x40,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x48,0x47,0x47,0x47,0x46,0x47,0x20,0x00,
0x02,0x4b,0x2f,0x32,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x2c,0x2a,0x2e,0x3e,0x29,
0x40,0x2f,0x35,0x36,0x35,0x36,0x36,0x37,0x36,0x35,0x36,0x36,0x35,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x35,0x31,0x5e,0x69,0x35,0x2a,0x45,
0x47,0x32,0x36,0x35,0x36,0x36,0x35,0x36,0x35,0x36,0x36,0x35,0x36,0x35,0x36,0x35,0x37,0x36,0x36,0x36,0x36,0x35,0x37,0x2d,0x7a,0xfb,0xfd,0x9c,0x2c,0x38,
0x47,0x33,0x35,0x36,0x35,0x36,0x36,0x36,0x36,0x35,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x35,0x36,0x35,0x36,0x36,0x37,0x29,0xb1,0xfd,0xfd,0xd8,0x2f,0x39,
0x47,0x33,0x36,0x36,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x36,0x36,0x35,0x35,0x35,0x37,0x35,0x36,0x36,0x36,0x36,0x37,0x2f,0x60,0xe7,0xf1,0x7f,0x2d,0x39,
0x47,0x33,0x36,0x36,0x36,0x36,0x36,0x35,0x36,0x36,0x35,0x36,0x36,0x36,0x35,0x35,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x30,0x43,0x49,0x2f,0x35,0x39,
0x46,0x33,0x36,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x35,0x36,0x36,0x35,0x36,0x36,0x37,0x36,0x36,0x35,0x36,0x36,0x35,0x36,0x36,0x32,0x31,0x35,0x35,0x39,
0x49,0x27,0x29,0x2a,0x29,0x2a,0x2a,0x29,0x29,0x2f,0x37,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x35,0x37,0x35,0x35,0x37,0x36,0x36,0x37,0x35,0x36,0x35,0x39,
0x17,0x41,0x45,0x45,0x45,0x45,0x45,0x44,0x45,0x47,0x2e,0x36,0x35,0x37,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x05,0x35,0x3c,0x3a,0x3a,0x3a,0x3a,0x3d,0x33,0x07,0x49,0x2e,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x35,0x36,0x36,0x35,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x67,0x71,0x72,0x71,0x71,0x71,0x72,0x72,0x6c,0x48,0x32,0x2b,0x36,0x36,0x36,0x35,0x35,0x36,0x36,0x37,0x35,0x36,0x36,0x36,0x36,0x36,0x35,0x35,0x35,0x39,
0x72,0x77,0x79,0x79,0x79,0x79,0x79,0x79,0x6f,0x5a,0x30,0x2b,0x35,0x37,0x36,0x36,0x36,0x36,0x36,0x35,0x36,0x36,0x35,0x36,0x35,0x36,0x36,0x36,0x35,0x39,
0x72,0x77,0x79,0x79,0x78,0x79,0x79,0x79,0x70,0x59,0x31,0x2c,0x36,0x37,0x35,0x36,0x36,0x36,0x36,0x35,0x35,0x36,0x35,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x72,0x77,0x79,0x79,0x79,0x79,0x79,0x79,0x70,0x59,0x31,0x2c,0x35,0x36,0x36,0x36,0x37,0x35,0x36,0x36,0x36,0x36,0x35,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x72,0x77,0x79,0x79,0x79,0x79,0x79,0x79,0x70,0x59,0x31,0x2b,0x36,0x36,0x35,0x36,0x36,0x36,0x35,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x35,0x36,0x35,0x39,
0x72,0x77,0x79,0x79,0x79,0x79,0x78,0x79,0x70,0x59,0x31,0x2c,0x36,0x36,0x36,0x35,0x35,0x36,0x35,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x71,0x77,0x79,0x79,0x78,0x79,0x79,0x79,0x70,0x59,0x32,0x2b,0x36,0x36,0x35,0x36,0x35,0x36,0x36,0x37,0x36,0x36,0x35,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x72,0x71,0x74,0x74,0x74,0x73,0x74,0x74,0x6b,0x5a,0x31,0x23,0x2f,0x2e,0x2f,0x2f,0x2f,0x2d,0x2e,0x32,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x41,0x70,0x72,0x72,0x72,0x72,0x72,0x72,0x6f,0x29,0x0e,0x49,0x46,0x47,0x48,0x48,0x48,0x48,0x48,0x3f,0x2e,0x36,0x35,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x00,0x07,0x11,0x10,0x10,0x10,0x10,0x11,0x07,0x00,0x00,0x01,0x13,0x11,0x11,0x11,0x11,0x11,0x0e,0x0b,0x4b,0x2e,0x36,0x36,0x36,0x36,0x36,0x36,0x35,0x39,
0x51,0x9d,0xa4,0xa4,0xa4,0xa4,0xa4,0xa4,0x9b,0x2e,0x1a,0x62,0x65,0x65,0x65,0x65,0x65,0x65,0x60,0x52,0x15,0x36,0x34,0x36,0x36,0x36,0x35,0x36,0x35,0x39,
0x91,0xaf,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xac,0x60,0x35,0x59,0x63,0x63,0x63,0x63,0x63,0x63,0x5d,0x65,0x0d,0x3d,0x32,0x36,0x35,0x36,0x36,0x36,0x35,0x39,
0x8f,0xb1,0xb3,0xb3,0xb3,0xb3,0xb3,0xb3,0xae,0x5b,0x32,0x5e,0x65,0x65,0x65,0x65,0x65,0x65,0x60,0x65,0x11,0x3f,0x31,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x8d,0xb1,0xb3,0xb3,0xb3,0xb3,0xb3,0xb3,0xad,0x5c,0x32,0x5e,0x65,0x65,0x65,0x65,0x65,0x65,0x60,0x65,0x11,0x3f,0x32,0x36,0x35,0x36,0x36,0x36,0x35,0x39,
0x8f,0xb1,0xb3,0xb3,0xb3,0xb3,0xb3,0xb3,0xae,0x5c,0x32,0x5e,0x65,0x65,0x65,0x65,0x65,0x65,0x60,0x65,0x11,0x3f,0x32,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x8f,0xb1,0xb3,0xb3,0xb3,0xb3,0xb3,0xb3,0xad,0x5b,0x32,0x5e,0x65,0x65,0x65,0x65,0x65,0x65,0x60,0x65,0x11,0x3f,0x32,0x35,0x36,0x36,0x36,0x36,0x35,0x39,
0x6e,0xb0,0xb3,0xb3,0xb3,0xb3,0xb3,0xb3,0xae,0x5c,0x32,0x5e,0x65,0x65,0x65,0x65,0x65,0x65,0x5f,0x65,0x11,0x3f,0x32,0x36,0x36,0x36,0x36,0x36,0x33,0x3d,
0x1b,0x9c,0xaf,0xb1,0xb1,0xb1,0xb1,0xb1,0xad,0x5e,0x35,0x5b,0x65,0x65,0x65,0x65,0x65,0x65,0x5e,0x65,0x11,0x3a,0x31,0x35,0x35,0x35,0x35,0x33,0x26,0x48,
0x00,0x26,0x8a,0xa7,0xac,0xab,0xab,0xac,0xa3,0x35,0x1c,0x62,0x65,0x65,0x65,0x65,0x65,0x65,0x5e,0x58,0x03,0x49,0x33,0x39,0x39,0x3a,0x38,0x3d,0x49,0x02,
};
const lv_image_dsc_t img_render_lvgl_logo_l8 = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_L8,
.header.flags = 0,
.header.w = 30,
.header.h = 30,
.data = img_render_lvgl_logo_l8_map,
.header.stride = 30,
.data_size = sizeof(img_render_lvgl_logo_l8_map),
.data = img_render_lvgl_logo_l8_map,
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -336,6 +336,7 @@ static void image_core_cb(lv_obj_t * parent, bool recolor, uint32_t startAt)
LV_IMAGE_DECLARE(img_render_lvgl_logo_rgb565);
LV_IMAGE_DECLARE(img_render_lvgl_logo_argb8888);
LV_IMAGE_DECLARE(img_render_lvgl_logo_l8);
LV_IMAGE_DECLARE(img_render_lvgl_logo_i1);
const void * srcs[] = {
&img_render_lvgl_logo_argb8888,
@@ -343,6 +344,7 @@ static void image_core_cb(lv_obj_t * parent, bool recolor, uint32_t startAt)
&img_render_lvgl_logo_rgb888,
&img_render_lvgl_logo_rgb565,
&img_render_lvgl_logo_l8,
&img_render_lvgl_logo_i1,
};
const void * names[] = {
@@ -351,6 +353,7 @@ static void image_core_cb(lv_obj_t * parent, bool recolor, uint32_t startAt)
"RGB\n888",
"RGB\n565",
"L8",
"I1",
};
uint32_t stopAt = startAt + LV_MIN(sizeof(srcs) / sizeof(void *) - startAt, 4);

View File

@@ -172,7 +172,8 @@ The default color format of the display is set according to :c:macro:`LV_COLOR_D
- :c:macro:`LV_COLOR_DEPTH` ``32``: XRGB8888 (4 bytes/pixel)
- :c:macro:`LV_COLOR_DEPTH` ``24``: RGB888 (3 bytes/pixel)
- :c:macro:`LV_COLOR_DEPTH` ``16``: RGB565 (2 bytes/pixel)
- :c:macro:`LV_COLOR_DEPTH` ``8``: L8 (1 bytes/pixel) Not supported yet
- :c:macro:`LV_COLOR_DEPTH` ``8``: L8 (1 bytes/pixel)
- :c:macro:`LV_COLOR_DEPTH` ``1``: I1 (1 bit/pixel) Only support for horizontal mapped buffers.
The ``color_format`` can be changed with
:cpp:expr:`lv_display_set_color_depth(display, LV_COLOR_FORMAT_...)`.

View File

@@ -137,6 +137,7 @@
#define LV_DRAW_SW_SUPPORT_L8 1
#define LV_DRAW_SW_SUPPORT_AL88 1
#define LV_DRAW_SW_SUPPORT_A8 1
#define LV_DRAW_SW_SUPPORT_I1 1
/* Set the number of draw unit.
* > 1 requires an operating system enabled in `LV_USE_OS`

View File

@@ -22,7 +22,9 @@
#if LV_DRAW_SW_SUPPORT_RGB888
#include "lv_draw_sw_blend_to_rgb888.h"
#endif
#if LV_DRAW_SW_SUPPORT_I1
#include "lv_draw_sw_blend_to_i1.h"
#endif
#if LV_USE_DRAW_SW
/*********************
@@ -73,9 +75,11 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
else if(blend_dsc->mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) fill_dsc.mask_buf = NULL;
else fill_dsc.mask_buf = blend_dsc->mask_buf;
fill_dsc.relative_area = blend_area;
lv_area_move(&fill_dsc.relative_area, -layer->buf_area.x1, -layer->buf_area.y1);
fill_dsc.dest_buf = lv_draw_layer_go_to_xy(layer, blend_area.x1 - layer->buf_area.x1,
blend_area.y1 - layer->buf_area.y1);
if(fill_dsc.mask_buf) {
fill_dsc.mask_stride = blend_dsc->mask_stride == 0 ? lv_area_get_width(blend_dsc->mask_area) : blend_dsc->mask_stride;
fill_dsc.mask_buf += fill_dsc.mask_stride * (blend_area.y1 - blend_dsc->mask_area->y1) +
@@ -112,6 +116,11 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
case LV_COLOR_FORMAT_AL88:
lv_draw_sw_blend_color_to_al88(&fill_dsc);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
lv_draw_sw_blend_color_to_i1(&fill_dsc);
break;
#endif
default:
break;
@@ -139,11 +148,12 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
image_dsc.src_color_format = blend_dsc->src_color_format;
const uint8_t * src_buf = blend_dsc->src_buf;
uint32_t src_px_size = lv_color_format_get_size(blend_dsc->src_color_format);
uint32_t src_px_size = lv_color_format_get_bpp(blend_dsc->src_color_format);
src_buf += image_dsc.src_stride * (blend_area.y1 - blend_dsc->src_area->y1);
src_buf += (blend_area.x1 - blend_dsc->src_area->x1) * src_px_size;
src_buf += ((blend_area.x1 - blend_dsc->src_area->x1) * src_px_size) >> 3;
image_dsc.src_buf = src_buf;
if(blend_dsc->mask_buf == NULL) image_dsc.mask_buf = NULL;
else if(blend_dsc->mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) image_dsc.mask_buf = NULL;
else image_dsc.mask_buf = blend_dsc->mask_buf;
@@ -155,6 +165,12 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
(blend_area.x1 - blend_dsc->mask_area->x1);
}
image_dsc.relative_area = blend_area;
lv_area_move(&image_dsc.relative_area, -layer->buf_area.x1, -layer->buf_area.y1);
image_dsc.src_area = *blend_dsc->src_area;
lv_area_move(&image_dsc.src_area, -layer->buf_area.x1, -layer->buf_area.y1);
image_dsc.dest_buf = lv_draw_layer_go_to_xy(layer, blend_area.x1 - layer->buf_area.x1,
blend_area.y1 - layer->buf_area.y1);
@@ -189,6 +205,11 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
case LV_COLOR_FORMAT_AL88:
lv_draw_sw_blend_image_to_al88(&image_dsc);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
lv_draw_sw_blend_image_to_i1(&image_dsc);
break;
#endif
default:
break;

View File

@@ -53,6 +53,7 @@ typedef struct {
int32_t mask_stride;
lv_color_t color;
lv_opa_t opa;
lv_area_t relative_area;
} _lv_draw_sw_blend_fill_dsc_t;
typedef struct {
@@ -67,6 +68,8 @@ typedef struct {
lv_color_format_t src_color_format;
lv_opa_t opa;
lv_blend_mode_t blend_mode;
lv_area_t relative_area; /**< The blend area relative to the layer's buffer area. */
lv_area_t src_area; /**< The original src area. */
} _lv_draw_sw_blend_image_dsc_t;
/**********************

View File

@@ -50,6 +50,12 @@ typedef struct {
static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#endif
#if LV_DRAW_SW_SUPPORT_I1
static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx);
#endif
static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#if LV_DRAW_SW_SUPPORT_RGB565
@@ -168,6 +174,22 @@ static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_16a_16a_mix(lv_color16a_
#define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -315,6 +337,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_al88(_lv_draw_sw_blend_imag
case LV_COLOR_FORMAT_AL88:
al88_image_blend(dsc);
break;
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
i1_image_blend(dsc);
break;
#endif
default:
LV_LOG_WARN("Not supported source color format");
break;
@@ -324,9 +351,100 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_al88(_lv_draw_sw_blend_imag
/**********************
* STATIC FUNCTIONS
**********************/
#if LV_DRAW_SW_SUPPORT_I1
static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
lv_color16a_t * dest_buf_al88 = dsc->dest_buf;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_i1 = dsc->src_buf;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
int32_t mask_stride = dsc->mask_stride;
lv_color_mix_alpha_cache_t cache;
lv_color_mix_with_alpha_cache_init(&cache);
int32_t x, y;
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
dest_buf_al88[x].lumi = get_bit(src_buf_i1, x) * 255;
dest_buf_al88[x].alpha = 255;
}
dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
lv_color16a_t src_color;
src_color.lumi = get_bit(src_buf_i1, x) * 255;
src_color.alpha = opa;
lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache);
}
dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
lv_color16a_t src_color;
src_color.lumi = get_bit(src_buf_i1, x) * 255;
src_color.alpha = mask_buf[x];
lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache);
}
dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else if(mask_buf && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
lv_color16a_t src_color;
src_color.lumi = get_bit(src_buf_i1, x) * 255;
src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa);
lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache);
}
dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
lv_color16a_t src_color;
src_color.lumi = get_bit(src_buf_i1, x) * 255;
if(mask_buf == NULL) src_color.alpha = opa;
else src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa);
blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache);
}
if(mask_buf) mask_buf += mask_stride;
dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
}
#endif
#if LV_DRAW_SW_SUPPORT_L8
static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
@@ -877,6 +995,15 @@ void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache)
cache->ratio_saved = 255;
}
#if LV_DRAW_SW_SUPPORT_I1
static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx)
{
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
}
#endif
static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(lv_color16a_t * dest, lv_color16a_t src,
lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache)
{

View File

@@ -50,6 +50,12 @@ typedef struct {
static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#endif
#if LV_DRAW_SW_SUPPORT_I1
static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx);
#endif
#if LV_DRAW_SW_SUPPORT_L8
static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#endif
@@ -180,6 +186,22 @@ static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * b
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -323,6 +345,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_argb8888(_lv_draw_sw_blend_
case LV_COLOR_FORMAT_AL88:
al88_image_blend(dsc);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
i1_image_blend(dsc);
break;
#endif
default:
LV_LOG_WARN("Not supported source color format");
@@ -334,8 +361,100 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_argb8888(_lv_draw_sw_blend_
* STATIC FUNCTIONS
**********************/
#if LV_DRAW_SW_SUPPORT_AL88
#if LV_DRAW_SW_SUPPORT_I1
static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
lv_color32_t * dest_buf_c32 = dsc->dest_buf;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_i1 = dsc->src_buf;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
int32_t y;
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_c32[dest_x].alpha = chan_val;
dest_buf_c32[dest_x].red = chan_val;
dest_buf_c32[dest_x].green = chan_val;
dest_buf_c32[dest_x].blue = chan_val;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], opa);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], mask_buf[src_x]);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else if(mask_buf && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa));
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
}
else {
lv_color32_t src_argb;
lv_color_mix_alpha_cache_t cache;
lv_color_mix_with_alpha_cache_init(&cache);
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
src_argb.red = get_bit(src_buf_i1, src_x) * 255;
src_argb.green = src_argb.red;
src_argb.blue = src_argb.red;
if(mask_buf == NULL) src_argb.alpha = opa;
else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa);
blend_non_normal_pixel(&dest_buf_c32[dest_x], src_argb, dsc->blend_mode, &cache);
}
if(mask_buf) mask_buf += mask_stride;
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
#endif
#if LV_DRAW_SW_SUPPORT_AL88
static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
@@ -898,6 +1017,15 @@ void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache)
cache->ratio_saved = 255;
}
#if LV_DRAW_SW_SUPPORT_I1
static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx)
{
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
}
#endif
static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(lv_color32_t * dest, lv_color32_t src,
lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache)
{

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
/**
* @file lv_draw_sw_blend_i1.h
*
*/
#ifndef LV_DRAW_SW_BLEND_I1_H
#define LV_DRAW_SW_BLEND_I1_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_draw_sw.h"
#if LV_USE_DRAW_SW
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_i1(_lv_draw_sw_blend_fill_dsc_t * dsc);
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_i1(_lv_draw_sw_blend_image_dsc_t * dsc);
/**********************
* MACROS
**********************/
#endif /*LV_USE_DRAW_SW*/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_DRAW_SW_BLEND_I1_H*/

View File

@@ -38,6 +38,12 @@
* STATIC PROTOTYPES
**********************/
#if LV_DRAW_SW_SUPPORT_I1
static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx);
#endif
static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#if LV_DRAW_SW_SUPPORT_AL88
@@ -152,6 +158,22 @@ static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * b
#define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -288,6 +310,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_l8(_lv_draw_sw_blend_image_
case LV_COLOR_FORMAT_AL88:
al88_image_blend(dsc);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
i1_image_blend(dsc);
break;
#endif
default:
LV_LOG_WARN("Not supported source color format");
@@ -299,6 +326,94 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_l8(_lv_draw_sw_blend_image_
* STATIC FUNCTIONS
**********************/
#if LV_DRAW_SW_SUPPORT_I1
static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint8_t * dest_buf_l8 = dsc->dest_buf;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_i1 = dsc->src_buf;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
int32_t y;
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], opa);
}
dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], opa);
}
dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], mask_buf[src_x]);
}
dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else if(mask_buf && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa));
}
dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
}
else {
lv_color32_t src_argb;
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) {
src_argb.red = get_bit(src_buf_i1, src_x) * 255;
src_argb.green = src_argb.red;
src_argb.blue = src_argb.red;
if(mask_buf == NULL) src_argb.alpha = opa;
else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa);
blend_non_normal_pixel(&dest_buf_l8[dest_x], src_argb, dsc->blend_mode);
}
if(mask_buf) mask_buf += mask_stride;
dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
#endif
static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
@@ -741,6 +856,16 @@ static inline void LV_ATTRIBUTE_FAST_MEM lv_color_8_8_mix(const uint8_t src, uin
}
}
#if LV_DRAW_SW_SUPPORT_I1
static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx)
{
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
}
#endif
static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(uint8_t * dest, lv_color32_t src, lv_blend_mode_t mode)
{
uint8_t res;

View File

@@ -42,6 +42,12 @@
static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#endif
#if LV_DRAW_SW_SUPPORT_I1
static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx);
#endif
#if LV_DRAW_SW_SUPPORT_L8
static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc);
#endif
@@ -169,6 +175,22 @@ static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * b
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -367,6 +389,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb565(_lv_draw_sw_blend_im
case LV_COLOR_FORMAT_AL88:
al88_image_blend(dsc);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
i1_image_blend(dsc);
break;
#endif
default:
LV_LOG_WARN("Not supported source color format");
@@ -378,8 +405,124 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb565(_lv_draw_sw_blend_im
* STATIC FUNCTIONS
**********************/
#if LV_DRAW_SW_SUPPORT_AL88
#if LV_DRAW_SW_SUPPORT_I1
static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint16_t * dest_buf_u16 = dsc->dest_buf;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_i1 = dsc->src_buf;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
int32_t y;
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_u16[dest_x] = l8_to_rgb565(chan_val);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], opa);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], mask_buf[dest_x]);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else if(mask_buf && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa));
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
}
else {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
uint16_t res = 0;
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
switch(dsc->blend_mode) {
case LV_BLEND_MODE_ADDITIVE:
// Additive blending mode
res = (LV_MIN(dest_buf_u16[dest_x] + l8_to_rgb565(chan_val), 0xFFFF));
break;
case LV_BLEND_MODE_SUBTRACTIVE:
// Subtractive blending mode
res = (LV_MAX(dest_buf_u16[dest_x] - l8_to_rgb565(chan_val), 0));
break;
case LV_BLEND_MODE_MULTIPLY:
// Multiply blending mode
res = ((((dest_buf_u16[dest_x] >> 11) * (l8_to_rgb565(chan_val) >> 3)) & 0x1F) << 11) |
((((dest_buf_u16[dest_x] >> 5) & 0x3F) * ((l8_to_rgb565(chan_val) >> 2) & 0x3F) >> 6) << 5) |
(((dest_buf_u16[dest_x] & 0x1F) * (l8_to_rgb565(chan_val) & 0x1F)) >> 5);
break;
default:
LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode);
return;
}
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
dest_buf_u16[dest_x] = res;
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], opa);
}
else {
if(opa >= LV_OPA_MAX)
dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]);
else
dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa));
}
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
if(mask_buf) mask_buf += mask_stride;
}
}
}
#endif
#if LV_DRAW_SW_SUPPORT_AL88
static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc)
{
int32_t w = dsc->dest_w;
@@ -988,6 +1131,15 @@ static inline uint16_t LV_ATTRIBUTE_FAST_MEM lv_color_24_16_mix(const uint8_t *
}
}
#if LV_DRAW_SW_SUPPORT_I1
static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx)
{
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
}
#endif
static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride)
{
return (void *)((uint8_t *)buf + stride);

View File

@@ -42,6 +42,12 @@
static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size);
#endif
#if LV_DRAW_SW_SUPPORT_I1
static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size);
static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx);
#endif
#if LV_DRAW_SW_SUPPORT_L8
static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size);
#endif
@@ -155,6 +161,22 @@ static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * b
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK(...) LV_RESULT_INVALID
#endif
#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA
#define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -317,6 +339,11 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb888(_lv_draw_sw_blend_im
case LV_COLOR_FORMAT_AL88:
al88_image_blend(dsc, dest_px_size);
break;
#endif
#if LV_DRAW_SW_SUPPORT_I1
case LV_COLOR_FORMAT_I1:
i1_image_blend(dsc, dest_px_size);
break;
#endif
default:
LV_LOG_WARN("Not supported source color format");
@@ -328,8 +355,97 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb888(_lv_draw_sw_blend_im
* STATIC FUNCTIONS
**********************/
#if LV_DRAW_SW_SUPPORT_AL88
#if LV_DRAW_SW_SUPPORT_I1
static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size)
{
int32_t w = dsc->dest_w;
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint8_t * dest_buf_u8 = dsc->dest_buf;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_i1 = dsc->src_buf;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
int32_t y;
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
dest_buf_u8[dest_x + 2] = chan_val;
dest_buf_u8[dest_x + 1] = chan_val;
dest_buf_u8[dest_x + 0] = chan_val;
}
dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], opa);
}
dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
else if(mask_buf && opa >= LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], mask_buf[src_x]);
}
dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
else if(mask_buf && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255;
lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x]));
}
dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
mask_buf += mask_stride;
}
}
}
}
else {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color32_t src_argb;
src_argb.red = get_bit(src_buf_i1, src_x) * 255;
src_argb.green = src_argb.red;
src_argb.blue = src_argb.red;
if(mask_buf == NULL) src_argb.alpha = opa;
else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa);
blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode);
}
if(mask_buf) mask_buf += mask_stride;
dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride);
src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride);
}
}
}
#endif
#if LV_DRAW_SW_SUPPORT_AL88
static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size)
{
int32_t w = dsc->dest_w;
@@ -849,6 +965,16 @@ static inline void LV_ATTRIBUTE_FAST_MEM lv_color_24_24_mix(const uint8_t * src,
}
}
#if LV_DRAW_SW_SUPPORT_I1
static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx)
{
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
}
#endif
static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride)
{
return (void *)((uint8_t *)buf + stride);

View File

@@ -226,6 +226,37 @@ void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px)
}
void lv_draw_sw_i1_invert(void * buf, uint32_t buf_size)
{
if(buf == NULL) return;
uint8_t * byte_buf = (uint8_t *)buf;
uint32_t i;
/*Make the buffer aligned*/
while(((uintptr_t)(byte_buf) & (sizeof(int) - 1)) && buf_size > 0) {
*byte_buf = ~(*byte_buf);
byte_buf++;
buf_size--;
}
if(buf_size >= sizeof(uint32_t)) {
uint32_t * aligned_addr = (uint32_t *)byte_buf;
uint32_t word_count = buf_size / 4;
for(i = 0; i < word_count; ++i) {
aligned_addr[i] = ~aligned_addr[i];
}
byte_buf = (uint8_t *)(aligned_addr + word_count);
buf_size = buf_size % sizeof(uint32_t);
}
for(i = 0; i < buf_size; ++i) {
byte_buf[i] = ~byte_buf[i];
}
}
void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t src_height, int32_t src_stride,
int32_t dest_stride, lv_display_rotation_t rotation, lv_color_format_t color_format)
{

View File

@@ -179,6 +179,16 @@ void lv_draw_sw_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_task_dsc
*/
void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px);
/**
* Invert a draw buffer in the I1 color format.
* Conventionally, a bit is set to 1 during blending if the luminance is greater than 127.
* Depending on the display controller used, you might want to have different behavior.
* The inversion will be performed in place.
* @param buf pointer to the buffer to be inverted
* @param buf_size size of the buffer in bytes
*/
void lv_draw_sw_i1_invert(void * buf, uint32_t buf_size);
/**
* Rotate a buffer into another buffer
* @param src the source buffer

View File

@@ -426,6 +426,17 @@
#define LV_DRAW_SW_SUPPORT_A8 1
#endif
#endif
#ifndef LV_DRAW_SW_SUPPORT_I1
#ifdef _LV_KCONFIG_PRESENT
#ifdef CONFIG_LV_DRAW_SW_SUPPORT_I1
#define LV_DRAW_SW_SUPPORT_I1 CONFIG_LV_DRAW_SW_SUPPORT_I1
#else
#define LV_DRAW_SW_SUPPORT_I1 0
#endif
#else
#define LV_DRAW_SW_SUPPORT_I1 1
#endif
#endif
/* Set the number of draw unit.
* > 1 requires an operating system enabled in `LV_USE_OS`

View File

@@ -81,6 +81,7 @@ lv_result_t lv_snapshot_take_to_draw_buf(lv_obj_t * obj, lv_color_format_t cf, l
case LV_COLOR_FORMAT_XRGB8888:
case LV_COLOR_FORMAT_ARGB8888:
case LV_COLOR_FORMAT_L8:
case LV_COLOR_FORMAT_I1:
break;
default:
LV_LOG_WARN("Not supported color format");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show More