diff --git a/Kconfig b/Kconfig index bcc5f5488..561cbe35c 100644 --- a/Kconfig +++ b/Kconfig @@ -1119,7 +1119,7 @@ menu "LVGL configuration" endif config LV_USE_RLE - bool "RLE compressed bin image decoder library" + bool "LVGL's version of RLE compression method" config LV_USE_QRCODE bool "QR code library" diff --git a/docs/libs/rle.rst b/docs/libs/rle.rst index 7603e9399..9de9dbb40 100644 --- a/docs/libs/rle.rst +++ b/docs/libs/rle.rst @@ -1,14 +1,12 @@ -RLE Decoder +RLE Compress =========== -The RLE Decoder is a part of LVGL that is responsible for decoding RLE -compressed original LVGL binary files. The file name suffix is always set -to '.rle' and the file header is added with another 64-bit value that -includes a 32-bit magic number and 32-bit RLE information. +LVGL provides a custom RLE compression method. It can be used to reduce binary +image size. The RLE compression is a lossless compression method. +The LVGL's built-in binary image decoder supports RLE compressed images. The decoder supports both variable and file as image sources. The original -binary data is directly decompressed to RAM, and further decoded by LVGL's -built-in decoder. +binary data is directly decoded to RAM Benefits -------- @@ -73,12 +71,12 @@ The RLE image can be used same as other images. lv_image_set_src(img, "path/to/image.rle"); -Generate RLE images -------------------- +Generate RLE compressed binary images +------------------------------------- The image can be directly generated using script `lvgl/script/LVGLImage.py` .. code:: bash - ./script/LVGLImage.py --ofmt RLE --cf I8 cogwheel.png + ./script/LVGLImage.py --ofmt BIN --cf I8 --compress RLE cogwheel.png diff --git a/env_support/cmsis-pack/LVGL.lvgl.pdsc b/env_support/cmsis-pack/LVGL.lvgl.pdsc index 3e3dd1600..27b06f2f3 100644 --- a/env_support/cmsis-pack/LVGL.lvgl.pdsc +++ b/env_support/cmsis-pack/LVGL.lvgl.pdsc @@ -785,14 +785,14 @@ - Add RLE compressed bin image decoder support + Add LVGL's version of RLE compression method support - + -/*! \brief enable RLE compressed bin image decoder support */ +/*! \brief LVGL's version of RLE compression method support */ #define LV_USE_RLE 1 diff --git a/lv_conf_template.h b/lv_conf_template.h index 90becd27a..f36c99f51 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -623,7 +623,7 @@ /*Decode bin images to RAM*/ #define LV_BIN_DECODER_RAM_LOAD 0 -/*RLE decoder library*/ +/*RLE decompress library*/ #define LV_USE_RLE 0 /*QR code library*/ diff --git a/lvgl.h b/lvgl.h index a8afdc3a7..6ec256db7 100644 --- a/lvgl.h +++ b/lvgl.h @@ -95,7 +95,7 @@ extern "C" { #include "src/libs/barcode/lv_barcode.h" #include "src/libs/bin_decoder/lv_bin_decoder.h" #include "src/libs/bmp/lv_bmp.h" -#include "src/libs/rle/lv_rle_decoder.h" +#include "src/libs/rle/lv_rle.h" #include "src/libs/fsdrv/lv_fsdrv.h" #include "src/libs/lodepng/lv_lodepng.h" #include "src/libs/libpng/lv_libpng.h" diff --git a/scripts/LVGLImage.py b/scripts/LVGLImage.py index a563ed9c0..ae708e4b3 100755 --- a/scripts/LVGLImage.py +++ b/scripts/LVGLImage.py @@ -995,7 +995,6 @@ class RLEImage(LVGLImage): class OutputFormat(Enum): C_ARRAY = "C" BIN_FILE = "BIN" - RLE_FILE = "RLE" RAW_DATA = "RAW" # option of not writing any file PNG_FILE = "PNG" # convert to lvgl image and then to png @@ -1033,27 +1032,17 @@ class PNGConverter: def convert(self): output = [] for f in self.files: - if self.ofmt == OutputFormat.RLE_FILE: - rle = RLEImage().from_png(f, - self.cf, - background=self.background) - rle.adjust_stride(align=self.align) - output.append((f, rle)) - rle.to_rle(self._replace_ext(f, ".rle")) - else: - img = LVGLImage().from_png(f, - self.cf, - background=self.background) - img.adjust_stride(align=self.align) - output.append((f, img)) - if self.ofmt == OutputFormat.BIN_FILE: - img.to_bin(self._replace_ext(f, ".bin"), + img = LVGLImage().from_png(f, self.cf, background=self.background) + img.adjust_stride(align=self.align) + output.append((f, img)) + if self.ofmt == OutputFormat.BIN_FILE: + img.to_bin(self._replace_ext(f, ".bin"), + compress=self.compress) + elif self.ofmt == OutputFormat.C_ARRAY: + img.to_c_array(self._replace_ext(f, ".c"), compress=self.compress) - elif self.ofmt == OutputFormat.C_ARRAY: - img.to_c_array(self._replace_ext(f, ".c"), - compress=self.compress) - elif self.ofmt == OutputFormat.PNG_FILE: - img.to_png(self._replace_ext(f, ".png")) + elif self.ofmt == OutputFormat.PNG_FILE: + img.to_png(self._replace_ext(f, ".png")) return output @@ -1063,7 +1052,7 @@ def main(): parser.add_argument('--ofmt', help="output filename format, C or BIN", default="BIN", - choices=["C", "BIN", "PNG", "RLE"]) + choices=["C", "BIN", "PNG"]) parser.add_argument( '--cf', help=("bin image color format, use AUTO for automatically " diff --git a/src/libs/rle/lv_rle_decoder.c b/src/libs/rle/lv_rle_decoder.c deleted file mode 100644 index 7b54285cb..000000000 --- a/src/libs/rle/lv_rle_decoder.c +++ /dev/null @@ -1,524 +0,0 @@ -/** - * @file lv_rle_decoder.c - * Decode RLE compressed original lvgl binary file. File name suffix is always - * set to '.rle' and the file header is added with another 64bit including - * 32bit magic number and 32bit rle information. - * - * Decoder support both variable and file as image source. - * - * The original binary data is directly decompressed to ram, and decoded by - * lvgl built-in decoder. - */ - -/********************* - * INCLUDES - *********************/ -#include -#include "lv_rle_decoder.h" -#include "../bin_decoder/lv_bin_decoder.h" - -#if LV_USE_RLE - -/********************* - * DEFINES - *********************/ - -#define RLE_HEADER_MAGIC 0x5aa521e0 -#define RLE_DECODER_OPTIMIZE_FS 1 /* load file to RAM to decode. */ -#define RLE_DECODER_PERF 0 /* output file load decoder performance */ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_image_decoder_dsc_t decoder_dsc; - lv_image_dsc_t img_dsc; -} lv_rle_decoder_data_t; - -typedef struct { - uint32_t magic; /* 0x5aa521e0 */ - uint32_t blksize: 4; /* block size, the encoded data unit bytes. */ - uint32_t len_orig: 24; /* Original data length. */ - uint32_t reserved: 4; -} lv_rle_header_t; - -typedef struct { - lv_rle_header_t rleheader; - lv_image_header_t header; -} lv_rle_file_header_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, - const void * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_image_decoder_args_t * args); -static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_rle_decoder_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_close_cb(dec, decoder_close); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if RLE_DECODER_OPTIMIZE_FS == 0 -static int rle_decompress_from_file(lv_fs_file_t * f, uint8_t * output, - uint32_t len, uint32_t blk_size) -{ - uint8_t ctrl_byte; - uint32_t wr_len = 0; - lv_fs_res_t res; - - while(1) { - uint32_t rd; - res = lv_fs_read(f, &ctrl_byte, 1, &rd); - if(res != LV_FS_RES_OK) { - return 0; - } - - if(rd == 0) - break; - - if(ctrl_byte & 0x80) { - /* copy directly from input to output */ - uint32_t bytes = blk_size * (ctrl_byte & 0x7f); - - wr_len += bytes; - if(wr_len > len) - return 0; - - res = lv_fs_read(f, output, bytes, &rd); - if(rd != bytes || res != LV_FS_RES_OK) { - return 0; - } - output += bytes; - } - else { - wr_len += blk_size * ctrl_byte; - if(wr_len > len) - return 0; - - uint8_t input[blk_size]; - res = lv_fs_read(f, input, blk_size, &rd); - if(rd != blk_size || res != LV_FS_RES_OK) { - return 0; - } - - if(blk_size == 1) { - /* optimize the most common case. */ - memset(output, input[0], ctrl_byte); - output += ctrl_byte; - } - else { - for(int i = 0; i < ctrl_byte; i++) { - memcpy(output, input, blk_size); - output += blk_size; - } - } - - } - } - - return wr_len; -} -#endif - -static int rle_decompress_from_mem(const uint8_t * input, - uint32_t input_buff_len, uint8_t * output, - uint32_t output_buff_len, uint8_t blk_size) -{ - uint32_t ctrl_byte; - uint32_t rd_len = 0; - uint32_t wr_len = 0; - - while(rd_len < input_buff_len) { - ctrl_byte = input[0]; - rd_len++; - input++; - if(rd_len > input_buff_len) - return 0; - - if(ctrl_byte & 0x80) { - /* copy directly from input to output */ - uint32_t bytes = blk_size * (ctrl_byte & 0x7f); - rd_len += bytes; - if(rd_len > input_buff_len) - return 0; - - wr_len += bytes; - if(wr_len > output_buff_len) - return 0; - - memcpy(output, input, bytes); - output += bytes; - input += bytes; - } - else { - rd_len += blk_size; - if(rd_len > input_buff_len) - return 0; - - wr_len += blk_size * ctrl_byte; - if(wr_len > output_buff_len) - return 0; - - if(blk_size == 1) { - /* optimize the most common case. */ - memset(output, input[0], ctrl_byte); - output += ctrl_byte; - } - else { - for(uint32_t i = 0; i < ctrl_byte; i++) { - memcpy(output, input, blk_size); - output += blk_size; - } - } - input += blk_size; - } - } - - return wr_len; -} - -static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, - const void * src, lv_image_header_t * header) -{ - (void) decoder; /*Unused*/ - lv_image_src_t src_type = lv_image_src_get_type(src); /*Get the source type*/ - - if(src_type == LV_IMAGE_SRC_FILE) { - lv_fs_res_t res; - uint32_t rn; - lv_fs_file_t f; - lv_rle_file_header_t file_header = { 0 }; - /*Support only "*.rle" files*/ - if(lv_strcmp(lv_fs_get_ext(src), "rle") != 0) - return LV_RES_INV; - - res = lv_fs_open(&f, src, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) - return LV_RES_INV; - - res = lv_fs_read(&f, &file_header, sizeof(lv_rle_file_header_t), &rn); - lv_fs_close(&f); - - if((res != LV_FS_RES_OK) || (rn != sizeof(lv_rle_file_header_t))) { - LV_LOG_WARN("Image get info get read file header"); - return LV_RES_INV; - } - - if(file_header.rleheader.magic != RLE_HEADER_MAGIC) { - return LV_RES_INV; - } - - *header = file_header.header; - - return LV_RES_OK; - } - else if(src_type == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = src; - const lv_rle_header_t * rleheader = (const lv_rle_header_t *)img_dsc->data; - if(rleheader->magic != RLE_HEADER_MAGIC) { - return LV_RES_INV; - } - - header->cf = img_dsc->header.cf; - header->w = img_dsc->header.w; - header->h = img_dsc->header.h; - - return LV_RES_OK; - } - - return LV_RES_INV; -} - -static inline lv_res_t decode_from_file(lv_image_decoder_t * decoder, - lv_image_decoder_dsc_t * dsc, - lv_rle_file_header_t * fileheader, - void ** img_data) -{ - LV_UNUSED(decoder); - lv_fs_res_t res; - lv_fs_file_t f; - uint32_t rd_cnt; - uint32_t px_size; - void * img_buf; - uint32_t buf_len; - uint32_t decoded_len; - lv_image_header_t * header = &fileheader->header; - lv_rle_header_t * rleheader = &fileheader->rleheader; - const char * fn = dsc->src; - - res = lv_fs_open(&f, fn, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - LV_LOG_WARN("RLE image decoder can't open the file"); - return LV_RES_INV; - } - - res = lv_fs_read(&f, fileheader, sizeof(lv_rle_file_header_t), &rd_cnt); - if(rleheader->magic != RLE_HEADER_MAGIC) { - return LV_RES_INV; - } - - if((res != LV_FS_RES_OK) || (rd_cnt != sizeof(lv_rle_file_header_t))) { - LV_LOG_WARN("RLE image decoder read header failed."); - goto error_file; - } - - px_size = lv_color_format_get_size(header->cf); - if(px_size == 0) { - goto error_file; - } - - if(px_size != rleheader->blksize) { - LV_LOG_WARN("Invalid rle file, blksize mismatch, expect: %" LV_PRIu32", got %d", px_size, rleheader->blksize); - goto error_file; - } - - buf_len = rleheader->len_orig; - if(buf_len == 0) { - LV_LOG_WARN("Invalid rle file, len_orig %d", rleheader->len_orig); - goto error_file; - } - - img_buf = lv_draw_buf_malloc(buf_len, header->cf); - if(img_buf == NULL) { - LV_LOG_ERROR("alloc img buf failed: %" LV_PRId32, buf_len); - goto error_file; - } - -#if RLE_DECODER_OPTIMIZE_FS - uint32_t size = 0; - if(lv_fs_seek(&f, 0, LV_FS_SEEK_END) != 0) { - goto error_with_img_buf; - } - - lv_fs_tell(&f, &size); - size -= sizeof(lv_rle_file_header_t); - - if(lv_fs_seek(&f, sizeof(lv_rle_file_header_t), LV_FS_SEEK_SET) != 0) { - goto error_with_img_buf; - } - - void * file_buffer = lv_malloc(size); - if(file_buffer == NULL) { - goto error_with_img_buf; - } - -#if RLE_DECODER_PERF - int start, read_cost, decompress_cost; - - start = lv_tick_get(); -#endif - - res = lv_fs_read(&f, file_buffer, size, &rd_cnt); - if(res != LV_RES_INV || rd_cnt != size) { - lv_free(file_buffer); - goto error_with_img_buf; - } - - lv_fs_close(&f); - -#if RLE_DECODER_PERF - read_cost = lv_tick_elaps(start); - start = lv_tick_get(); -#endif - - decoded_len = rle_decompress_from_mem(file_buffer, size, img_buf, buf_len, - rleheader->blksize); - -#if RLE_DECODER_PERF - decompress_cost = lv_tick_elaps(start); - LV_LOG_USER("file size: %" LV_PRIu32 ", img size: %" LV_PRIu32 ", readtime: %d, decode: %d\n", - size, buf_len, read_cost, decompress_cost); -#endif - - lv_free(file_buffer); - - if(decoded_len != buf_len) { - LV_LOG_WARN("rle decode failed, decoded len: %" LV_PRIu32 - ", expected %" LV_PRIu32 ".", - decoded_len, buf_len); - lv_free(img_buf); - return LV_RES_INV; - } -#else - /** - * Read and decompress data. - */ - decoded_len = rle_decompress_from_file(&f, img_buf, buf_len, - rleheader->blksize); - - lv_fs_close(&f); - if(decoded_len != buf_len) { - LV_LOG_WARN("rle decode failed, decoded len: %d, expect %d.", - decoded_len, buf_len); - lv_free(img_buf); - return LV_RES_INV; - } -#endif - - *img_data = img_buf; - return LV_RES_OK; - -#if RLE_DECODER_OPTIMIZE_FS -error_with_img_buf: - lv_free(img_buf); -#endif - -error_file: - lv_fs_close(&f); - return LV_RES_INV; -} - -static inline lv_res_t decode_from_variable(lv_image_decoder_t * decoder, - lv_image_decoder_dsc_t * dsc, - lv_rle_file_header_t * fileheader, - void ** img_data) -{ - LV_UNUSED(decoder); - uint32_t px_size; - void * img_buf; - uint32_t buf_len; - uint32_t decoded_len; - const lv_image_dsc_t * img_dsc = dsc->src; - const lv_rle_header_t * rleheader = (const lv_rle_header_t *)img_dsc->data; - const lv_image_header_t * header = &img_dsc->header; - - if(rleheader->magic != RLE_HEADER_MAGIC) { - return LV_RES_INV; - } - - px_size = lv_color_format_get_size(header->cf); - if(px_size == 0) { - return LV_RES_INV; - } - - if(px_size != rleheader->blksize) { - LV_LOG_WARN("Invalid rle file, blksize mismatch, expect: %" LV_PRIu32 - ", got %d", - px_size, rleheader->blksize); - return LV_RES_INV; - } - - buf_len = rleheader->len_orig; - if(buf_len == 0) { - LV_LOG_WARN("Invalid rle file, len_orig %d", rleheader->len_orig); - return LV_RES_INV; - } - - img_buf = lv_malloc(buf_len); - if(img_buf == NULL) { - return LV_RES_INV; - } - - const uint8_t * compressed_data = img_dsc->data + sizeof(lv_rle_header_t); - uint32_t compressed_data_len = img_dsc->data_size - sizeof(lv_rle_header_t); - - decoded_len = rle_decompress_from_mem(compressed_data, compressed_data_len, - img_buf, buf_len, rleheader->blksize); - - if(decoded_len != buf_len) { - LV_LOG_WARN("rle decode failed, decoded len: %" LV_PRIu32 - ", expected %" LV_PRIu32 ".", - decoded_len, buf_len); - lv_free(img_buf); - return LV_RES_INV; - } - - fileheader->header = *header; - fileheader->rleheader = *rleheader; - *img_data = img_buf; - return LV_RES_OK; -} - -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_image_decoder_args_t * args) -{ - LV_UNUSED(args); - lv_fs_res_t res; - lv_rle_file_header_t fileheader; - lv_rle_decoder_data_t * data; - void * img_data; - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - res = decode_from_file(decoder, dsc, &fileheader, &img_data); - if(res != LV_RES_OK) - return res; - } - - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - res = decode_from_variable(decoder, dsc, &fileheader, &img_data); - - if(res != LV_RES_OK) - return res; - } - else { - return LV_RES_INV; - } - - /*Decoder private data.*/ - data = lv_malloc(sizeof(*data)); - if(data == NULL) { - return LV_RES_INV; - } - - lv_memcpy(&data->decoder_dsc, dsc, sizeof(*dsc)); - - data->img_dsc.header = fileheader.header; - data->img_dsc.data = img_data; - data->img_dsc.data_size = fileheader.rleheader.len_orig; - - data->decoder_dsc.img_data = NULL; - data->decoder_dsc.src_type = LV_IMAGE_SRC_VARIABLE; - data->decoder_dsc.src = &data->img_dsc; - - res = lv_bin_decoder_open(decoder, &data->decoder_dsc, dsc->args); - if(res != LV_RES_OK) { - lv_free(img_data); - lv_free(data); - return LV_RES_INV; - } - - dsc->img_data = data->decoder_dsc.img_data; - dsc->header = data->decoder_dsc.header; - dsc->user_data = data; - return LV_RES_OK; -} - -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - if(dsc->user_data) { - lv_rle_decoder_data_t * decoder_data = dsc->user_data; - lv_bin_decoder_close(decoder, &decoder_data->decoder_dsc); - if(decoder_data->img_dsc.data) - lv_free((void *)decoder_data->img_dsc.data); - lv_free(dsc->user_data); - dsc->user_data = NULL; - } - - if(dsc->img_data) { - dsc->img_data = NULL; - } -} - -#endif /*LV_USE_RLE*/ diff --git a/src/libs/rle/lv_rle_decoder.h b/src/libs/rle/lv_rle_decoder.h deleted file mode 100644 index 7ff0493d9..000000000 --- a/src/libs/rle/lv_rle_decoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file lv_rle_decoder.h - * - */ - -#ifndef LV_RLE_DECODER_H -#define LV_RLE_DECODER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../lvgl.h" - -#if LV_USE_RLE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Register the RLE decoder functions in LVGL - */ -void lv_rle_decoder_init(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_RLE*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_RLE_DECODER_H*/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 8c329b3ef..b0364d6c7 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -2089,7 +2089,7 @@ #endif #endif -/*RLE decoder library*/ +/*RLE decompress library*/ #ifndef LV_USE_RLE #ifdef CONFIG_LV_USE_RLE #define LV_USE_RLE CONFIG_LV_USE_RLE diff --git a/src/lv_init.c b/src/lv_init.c index 1a3c9c802..609619847 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -268,10 +268,6 @@ void lv_init(void) lv_bmp_init(); #endif -#if LV_USE_RLE - lv_rle_decoder_init(); -#endif - /*Make FFMPEG last because the last converter will be checked first and *it's superior to any other */ #if LV_USE_FFMPEG diff --git a/tests/src/test_cases/draw/test_image_formats.c b/tests/src/test_cases/draw/test_image_formats.c index 2980852b1..302825be5 100644 --- a/tests/src/test_cases/draw/test_image_formats.c +++ b/tests/src/test_cases/draw/test_image_formats.c @@ -157,69 +157,6 @@ void test_image_built_in_decode_rotate_and_recolor(void) TEST_ASSERT_EQUAL_SCREENSHOT("draw/image_format_rotate_and_recolor.png"); } -void test_image_rle_decode(void) -{ -#if LV_USE_RLE - img_create("rleA1", "A:src/test_files/binimages/cogwheel.A1.rle", false, false); - img_create("rleA2", "A:src/test_files/binimages/cogwheel.A2.rle", false, false); - img_create("rleA4", "A:src/test_files/binimages/cogwheel.A4.rle", false, false); - img_create("rleA8", "A:src/test_files/binimages/cogwheel.A8.rle", false, false); - img_create("rleI1", "A:src/test_files/binimages/cogwheel.I1.rle", false, false); - img_create("rleI2", "A:src/test_files/binimages/cogwheel.I2.rle", false, false); - img_create("rleI4", "A:src/test_files/binimages/cogwheel.I4.rle", false, false); - img_create("rleI8", "A:src/test_files/binimages/cogwheel.I8.rle", false, false); - img_create("rleRGB565A8", "A:src/test_files/binimages/cogwheel.RGB565A8.rle", false, false); - img_create("rleRGB565", "A:src/test_files/binimages/cogwheel.RGB565.rle", false, false); - img_create("rleRGB888", "A:src/test_files/binimages/cogwheel.RGB888.rle", false, false); - img_create("rleXRGB8888", "A:src/test_files/binimages/cogwheel.XRGB8888.rle", false, false); - img_create("rleARGB8888", "A:src/test_files/binimages/cogwheel.ARGB8888.rle", false, false); - - TEST_ASSERT_EQUAL_SCREENSHOT("draw/image_format_rle.png"); -#endif -} - -void test_image_rle_decode_rotate(void) -{ -#if LV_USE_RLE - img_create("rleA1", "A:src/test_files/binimages/cogwheel.A1.rle", true, false); - img_create("rleA2", "A:src/test_files/binimages/cogwheel.A2.rle", true, false); - img_create("rleA4", "A:src/test_files/binimages/cogwheel.A4.rle", true, false); - img_create("rleA8", "A:src/test_files/binimages/cogwheel.A8.rle", true, false); - img_create("rleI1", "A:src/test_files/binimages/cogwheel.I1.rle", true, false); - img_create("rleI2", "A:src/test_files/binimages/cogwheel.I2.rle", true, false); - img_create("rleI4", "A:src/test_files/binimages/cogwheel.I4.rle", true, false); - img_create("rleI8", "A:src/test_files/binimages/cogwheel.I8.rle", true, false); - img_create("rleRGB565A8", "A:src/test_files/binimages/cogwheel.RGB565A8.rle", true, false); - img_create("rleRGB565", "A:src/test_files/binimages/cogwheel.RGB565.rle", true, false); - img_create("rleRGB888", "A:src/test_files/binimages/cogwheel.RGB888.rle", true, false); - img_create("rleXRGB8888", "A:src/test_files/binimages/cogwheel.XRGB8888.rle", true, false); - img_create("rleARGB8888", "A:src/test_files/binimages/cogwheel.ARGB8888.rle", true, false); - - TEST_ASSERT_EQUAL_SCREENSHOT("draw/image_format_rle_rotate.png"); -#endif -} - -void test_image_rle_decode_rotate_recolor(void) -{ -#if LV_USE_RLE - img_create("rleA1", "A:src/test_files/binimages/cogwheel.A1.rle", true, true); - img_create("rleA2", "A:src/test_files/binimages/cogwheel.A2.rle", true, true); - img_create("rleA4", "A:src/test_files/binimages/cogwheel.A4.rle", true, true); - img_create("rleA8", "A:src/test_files/binimages/cogwheel.A8.rle", true, true); - img_create("rleI1", "A:src/test_files/binimages/cogwheel.I1.rle", true, true); - img_create("rleI2", "A:src/test_files/binimages/cogwheel.I2.rle", true, true); - img_create("rleI4", "A:src/test_files/binimages/cogwheel.I4.rle", true, true); - img_create("rleI8", "A:src/test_files/binimages/cogwheel.I8.rle", true, true); - img_create("rleRGB565A8", "A:src/test_files/binimages/cogwheel.RGB565A8.rle", true, true); - img_create("rleRGB565", "A:src/test_files/binimages/cogwheel.RGB565.rle", true, true); - img_create("rleRGB888", "A:src/test_files/binimages/cogwheel.RGB888.rle", true, true); - img_create("rleXRGB8888", "A:src/test_files/binimages/cogwheel.XRGB8888.rle", true, true); - img_create("rleARGB8888", "A:src/test_files/binimages/cogwheel.ARGB8888.rle", true, true); - - TEST_ASSERT_EQUAL_SCREENSHOT("draw/image_format_rle_rotate_recolor.png"); -#endif -} - void test_image_rle_compressed_decode(void) { #if LV_USE_RLE diff --git a/tests/src/test_files/binimages/cogwheel.A1.rle b/tests/src/test_files/binimages/cogwheel.A1.rle deleted file mode 100644 index 1af077883..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.A1.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.A2.rle b/tests/src/test_files/binimages/cogwheel.A2.rle deleted file mode 100644 index 069df364e..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.A2.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.A4.rle b/tests/src/test_files/binimages/cogwheel.A4.rle deleted file mode 100644 index affa9fd16..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.A4.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.A8.rle b/tests/src/test_files/binimages/cogwheel.A8.rle deleted file mode 100644 index 25b620d58..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.A8.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.ARGB8888.rle b/tests/src/test_files/binimages/cogwheel.ARGB8888.rle deleted file mode 100644 index 94ddef4b0..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.ARGB8888.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.I1.rle b/tests/src/test_files/binimages/cogwheel.I1.rle deleted file mode 100644 index 88ed27d7a..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.I1.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.I2.rle b/tests/src/test_files/binimages/cogwheel.I2.rle deleted file mode 100644 index 18d4a5064..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.I2.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.I4.rle b/tests/src/test_files/binimages/cogwheel.I4.rle deleted file mode 100644 index df3791a3c..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.I4.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.I8.rle b/tests/src/test_files/binimages/cogwheel.I8.rle deleted file mode 100644 index 3461657e5..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.I8.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.RGB565.rle b/tests/src/test_files/binimages/cogwheel.RGB565.rle deleted file mode 100644 index 2deb1d7f0..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.RGB565.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.RGB565A8.rle b/tests/src/test_files/binimages/cogwheel.RGB565A8.rle deleted file mode 100644 index f1a3e58b4..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.RGB565A8.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.RGB888.rle b/tests/src/test_files/binimages/cogwheel.RGB888.rle deleted file mode 100644 index 5e517e545..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.RGB888.rle and /dev/null differ diff --git a/tests/src/test_files/binimages/cogwheel.XRGB8888.rle b/tests/src/test_files/binimages/cogwheel.XRGB8888.rle deleted file mode 100644 index 7889ac47b..000000000 Binary files a/tests/src/test_files/binimages/cogwheel.XRGB8888.rle and /dev/null differ