diff --git a/.devcontainer/__lv_conf.h__ b/.devcontainer/__lv_conf.h__ index 0a15b8abd..2ebdde6f6 100755 --- a/.devcontainer/__lv_conf.h__ +++ b/.devcontainer/__lv_conf.h__ @@ -627,8 +627,8 @@ #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif -/*PNG decoder library*/ -#define LV_USE_PNG 0 +/*LODEPNG decoder library*/ +#define LV_USE_LODEPNG 0 /*BMP decoder library*/ #define LV_USE_BMP 0 diff --git a/Kconfig b/Kconfig index 6eb4c2302..fd12a4696 100644 --- a/Kconfig +++ b/Kconfig @@ -1020,7 +1020,7 @@ menu "LVGL configuration" default 0 depends on LV_USE_FS_FATFS - config LV_USE_PNG + config LV_USE_LODEPNG bool "PNG decoder library" config LV_USE_BMP diff --git a/docs/libs/index.rst b/docs/libs/index.rst index b43b45aab..ad2b3860b 100644 --- a/docs/libs/index.rst +++ b/docs/libs/index.rst @@ -9,7 +9,7 @@ fs bmp sjpg - png + lodepng gif freetype tiny_ttf diff --git a/docs/libs/png.rst b/docs/libs/lodepng.rst similarity index 78% rename from docs/libs/png.rst rename to docs/libs/lodepng.rst index 2e4ba979f..f79df3285 100644 --- a/docs/libs/png.rst +++ b/docs/libs/lodepng.rst @@ -1,11 +1,11 @@ -=========== -PNG decoder -=========== +=============== +LODEPNG decoder +=============== Allow the use of PNG images in LVGL. This implementation uses `lodepng `__ library. -If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_PNG` LVGL will register a new +If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_LODEPNG` LVGL will register a new image decoder automatically so PNG files can be directly used as any other image sources. @@ -21,7 +21,7 @@ As it might take significant time to decode PNG images LVGL's :ref:`image-cachin Example ------- -.. include:: ../examples/libs/png/index.rst +.. include:: ../examples/libs/lodepng/index.rst API --- diff --git a/env_support/cmsis-pack/LVGL.lvgl.pdsc b/env_support/cmsis-pack/LVGL.lvgl.pdsc index 84299a15e..2b31e4c7f 100644 --- a/env_support/cmsis-pack/LVGL.lvgl.pdsc +++ b/env_support/cmsis-pack/LVGL.lvgl.pdsc @@ -479,8 +479,8 @@ - - + + @@ -706,14 +706,14 @@ Add PNG support - - + + /*! \brief enable PNG support */ -#define LV_USE_PNG 1 +#define LV_USE_LODEPNG 1 diff --git a/env_support/cmsis-pack/README.md b/env_support/cmsis-pack/README.md index 8d8d30553..5d61ac6cc 100644 --- a/env_support/cmsis-pack/README.md +++ b/env_support/cmsis-pack/README.md @@ -151,7 +151,7 @@ Make sure `LV_MEM_SIZE` is no less than `(64*1024U)`. - \#define LV_USE_FS_POSIX 0 - \#define LV_USE_FS_WIN32 0 - \#define LV_USE_FS_FATFS 0 - - \#define LV_USE_PNG 0 + - \#define LV_USE_LODEPNG 0 - \#define LV_USE_BMP 0 - \#define LV_USE_SJPG 0 - \#define LV_USE_GIF 0 diff --git a/examples/libs/png/img_wink_png.c b/examples/libs/lodepng/img_wink_png.c similarity index 99% rename from examples/libs/png/img_wink_png.c rename to examples/libs/lodepng/img_wink_png.c index 7c7d5d31e..a26724f3c 100644 --- a/examples/libs/png/img_wink_png.c +++ b/examples/libs/lodepng/img_wink_png.c @@ -1,5 +1,5 @@ #include "../../../lvgl.h" -#if LV_USE_PNG && LV_BUILD_EXAMPLES +#if LV_USE_LODEPNG && LV_BUILD_EXAMPLES #ifndef LV_ATTRIBUTE_MEM_ALIGN @@ -345,4 +345,4 @@ const lv_image_dsc_t img_wink_png = { .data = img_wink_png_map, }; -#endif /*LV_USE_PNG && LV_BUILD_EXAMPLES*/ +#endif /*LV_USE_LODEPNG && LV_BUILD_EXAMPLES*/ diff --git a/examples/libs/png/img_wink_png.py b/examples/libs/lodepng/img_wink_png.py similarity index 100% rename from examples/libs/png/img_wink_png.py rename to examples/libs/lodepng/img_wink_png.py diff --git a/examples/libs/png/index.rst b/examples/libs/lodepng/index.rst similarity index 67% rename from examples/libs/png/index.rst rename to examples/libs/lodepng/index.rst index 8179d8dfc..f4957a5ee 100644 --- a/examples/libs/png/index.rst +++ b/examples/libs/lodepng/index.rst @@ -1,6 +1,6 @@ Open a PNG image from file and variable --------------------------------------- -.. lv_example:: libs/png/lv_example_png_1 +.. lv_example:: libs/lodepng/lv_example_png_1 :language: c diff --git a/examples/libs/png/lv_example_png.h b/examples/libs/lodepng/lv_example_lodepng.h similarity index 88% rename from examples/libs/png/lv_example_png.h rename to examples/libs/lodepng/lv_example_lodepng.h index c964f3ab8..ecf37a08f 100644 --- a/examples/libs/png/lv_example_png.h +++ b/examples/libs/lodepng/lv_example_lodepng.h @@ -1,5 +1,5 @@ /** - * @file lv_example_png.h + * @file lv_example_lodepng.h * */ @@ -25,7 +25,7 @@ extern "C" { /********************** * GLOBAL PROTOTYPES **********************/ -void lv_example_png_1(void); +void lv_example_lodepng_1(void); /********************** * MACROS diff --git a/examples/libs/png/lv_example_png_1.c b/examples/libs/lodepng/lv_example_lodepng_1.c similarity index 76% rename from examples/libs/png/lv_example_png_1.c rename to examples/libs/lodepng/lv_example_lodepng_1.c index 9532a9049..baaccbb67 100644 --- a/examples/libs/png/lv_example_png_1.c +++ b/examples/libs/lodepng/lv_example_lodepng_1.c @@ -1,10 +1,10 @@ #include "../../lv_examples.h" -#if LV_USE_PNG && LV_USE_IMG && LV_BUILD_EXAMPLES +#if LV_USE_LODEPNG && LV_USE_IMG && LV_BUILD_EXAMPLES /** * Open a PNG image from a file and a variable */ -void lv_example_png_1(void) +void lv_example_lodepng_1(void) { LV_IMAGE_DECLARE(img_wink_png); lv_obj_t * img; @@ -16,7 +16,7 @@ void lv_example_png_1(void) img = lv_image_create(lv_scr_act()); /* Assuming a File system is attached to letter 'A' * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ - lv_image_set_src(img, "A:lvgl/examples/libs/png/wink.png"); + lv_image_set_src(img, "A:lvgl/examples/libs/lodepng/wink.png"); lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0); } diff --git a/examples/libs/png/lv_example_png_1.py b/examples/libs/lodepng/lv_example_lodepng_1.py similarity index 100% rename from examples/libs/png/lv_example_png_1.py rename to examples/libs/lodepng/lv_example_lodepng_1.py diff --git a/examples/libs/png/wink.png b/examples/libs/lodepng/wink.png similarity index 100% rename from examples/libs/png/wink.png rename to examples/libs/lodepng/wink.png diff --git a/examples/libs/lv_example_libs.h b/examples/libs/lv_example_libs.h index d7da2110b..baa9cdd5b 100644 --- a/examples/libs/lv_example_libs.h +++ b/examples/libs/lv_example_libs.h @@ -18,7 +18,7 @@ extern "C" { #include "ffmpeg/lv_example_ffmpeg.h" #include "freetype/lv_example_freetype.h" #include "gif/lv_example_gif.h" -#include "png/lv_example_png.h" +#include "lodepng/lv_example_lodepng.h" #include "qrcode/lv_example_qrcode.h" #include "rlottie/lv_example_rlottie.h" #include "jpg/lv_example_jpg.h" diff --git a/examples/others/imgfont/lv_example_imgfont_1.c b/examples/others/imgfont/lv_example_imgfont_1.c index 1421384f4..cfa4d834c 100644 --- a/examples/others/imgfont/lv_example_imgfont_1.c +++ b/examples/others/imgfont/lv_example_imgfont_1.c @@ -22,7 +22,7 @@ static const void * get_imgfont_path(const lv_font_t * font, uint32_t unicode, u else if(unicode == 0xF600) { #if LV_USE_FFMPEG return "lvgl/examples/assets/emoji/F600.png"; -#elif LV_USE_PNG +#elif LV_USE_LODEPNG return "A:lvgl/examples/assets/emoji/F600.png"; #endif } diff --git a/lv_conf_template.h b/lv_conf_template.h index 2b4f97f48..46e4ea082 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -248,7 +248,7 @@ #endif /*Default cache size in bytes. - *Used by image decoders such as `lv_png` to keep the decoded image in the memory. + *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. *Data larger than the size of the cache also can be allocated but *will be dropped immediately after usage.*/ #define LV_CACHE_DEF_SIZE 0 @@ -575,8 +575,8 @@ #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ #endif -/*PNG decoder library*/ -#define LV_USE_PNG 0 +/*LODEPNG decoder library*/ +#define LV_USE_LODEPNG 0 /*BMP decoder library*/ #define LV_USE_BMP 0 diff --git a/lvgl.h b/lvgl.h index 00128d19b..e2f0305f8 100644 --- a/lvgl.h +++ b/lvgl.h @@ -92,7 +92,7 @@ extern "C" { #include "src/libs/barcode/lv_barcode.h" #include "src/libs/bmp/lv_bmp.h" #include "src/libs/fsdrv/lv_fsdrv.h" -#include "src/libs/png/lv_png.h" +#include "src/libs/lodepng/lv_lodepng.h" #include "src/libs/gif/lv_gif.h" #include "src/libs/qrcode/lv_qrcode.h" #include "src/libs/jpg/lv_jpg.h" diff --git a/scripts/code-format.cfg b/scripts/code-format.cfg index 743b2b2ce..e13e1c45f 100644 --- a/scripts/code-format.cfg +++ b/scripts/code-format.cfg @@ -32,8 +32,8 @@ --exclude=../src/core/lv_obj_style_gen.h --exclude=../src/extra/libs/gif/gifdec.c --exclude=../src/extra/libs/gif/gifdec.h ---exclude=../src/extra/libs/png/lodepng.c ---exclude=../src/extra/libs/png/lodepng.h +--exclude=../src/extra/libs/lodepng/lodepng.c +--exclude=../src/extra/libs/lodepng/lodepng.h --exclude=../src/extra/libs/qrcode/qrcodegen.c --exclude=../src/extra/libs/qrcode/qrcodegen.h --exclude=../src/extra/libs/sjpg/tjpgd.c diff --git a/src/libs/png/lodepng.c b/src/libs/lodepng/lodepng.c similarity index 99% rename from src/libs/png/lodepng.c rename to src/libs/lodepng/lodepng.c index 61b8f7204..ebd95aba9 100644 --- a/src/libs/png/lodepng.c +++ b/src/libs/lodepng/lodepng.c @@ -29,7 +29,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for */ #include "lodepng.h" -#if LV_USE_PNG +#if LV_USE_LODEPNG #ifdef LODEPNG_COMPILE_DISK #include /* LONG_MAX */ @@ -7039,4 +7039,4 @@ unsigned encode(const std::string & filename, } /* namespace lodepng */ #endif /*LODEPNG_COMPILE_CPP*/ -#endif /*LV_USE_PNG*/ +#endif /*LV_USE_LODEPNG*/ diff --git a/src/libs/png/lodepng.h b/src/libs/lodepng/lodepng.h similarity index 99% rename from src/libs/png/lodepng.h rename to src/libs/lodepng/lodepng.h index 26ef991eb..db112b51f 100644 --- a/src/libs/png/lodepng.h +++ b/src/libs/lodepng/lodepng.h @@ -29,7 +29,7 @@ freely, subject to the following restrictions: #include /*for size_t*/ #include "../../../lvgl.h" -#if LV_USE_PNG +#if LV_USE_LODEPNG extern const char * LODEPNG_VERSION_STRING; /* @@ -1090,7 +1090,7 @@ TODO: [X] provide alternatives for C library functions not present on some platforms (memcpy, ...) */ -#endif /*LV_USE_PNG*/ +#endif /*LV_USE_LODEPNG*/ #endif /*LODEPNG_H inclusion guard*/ diff --git a/src/libs/png/lv_png.c b/src/libs/lodepng/lv_lodepng.c similarity index 98% rename from src/libs/png/lv_png.c rename to src/libs/lodepng/lv_lodepng.c index 5e360022f..5ef606008 100644 --- a/src/libs/png/lv_png.c +++ b/src/libs/lodepng/lv_lodepng.c @@ -1,5 +1,5 @@ /** - * @file lv_png.c + * @file lv_lodepng.c * */ @@ -7,9 +7,9 @@ * INCLUDES *********************/ #include "../../../lvgl.h" -#if LV_USE_PNG +#if LV_USE_LODEPNG -#include "lv_png.h" +#include "lv_lodepng.h" #include "lodepng.h" #include @@ -46,7 +46,7 @@ static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc); /** * Register the PNG decoder functions in LVGL */ -void lv_png_init(void) +void lv_lodepng_init(void) { lv_image_decoder_t * dec = lv_image_decoder_create(); lv_image_decoder_set_info_cb(dec, decoder_info); @@ -283,6 +283,6 @@ static void convert_color_depth(uint8_t * img_p, uint32_t px_cnt) } } -#endif /*LV_USE_PNG*/ +#endif /*LV_USE_LODEPNG*/ diff --git a/src/libs/png/lv_png.h b/src/libs/lodepng/lv_lodepng.h similarity index 76% rename from src/libs/png/lv_png.h rename to src/libs/lodepng/lv_lodepng.h index 5131c5414..5e51924f1 100644 --- a/src/libs/png/lv_png.h +++ b/src/libs/lodepng/lv_lodepng.h @@ -1,10 +1,10 @@ /** - * @file lv_png.h + * @file lv_lodepng.h * */ -#ifndef LV_PNG_H -#define LV_PNG_H +#ifndef LV_LODEPNG_H +#define LV_LODEPNG_H #ifdef __cplusplus extern "C" { @@ -14,7 +14,7 @@ extern "C" { * INCLUDES *********************/ #include "../../lv_conf_internal.h" -#if LV_USE_PNG +#if LV_USE_LODEPNG /********************* * DEFINES @@ -31,16 +31,16 @@ extern "C" { /** * Register the PNG decoder functions in LVGL */ -void lv_png_init(void); +void lv_lodepng_init(void); /********************** * MACROS **********************/ -#endif /*LV_USE_PNG*/ +#endif /*LV_USE_LODEPNG*/ #ifdef __cplusplus } /* extern "C" */ #endif -#endif /*LV_PNG_H*/ +#endif /*LV_LODEPNG_H*/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 925b90e7a..83e693964 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -690,7 +690,7 @@ #endif /*Default cache size in bytes. - *Used by image decoders such as `lv_png` to keep the decoded image in the memory. + *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. *Data larger than the size of the cache also can be allocated but *will be dropped immediately after usage.*/ #ifndef LV_CACHE_DEF_SIZE @@ -1937,12 +1937,12 @@ #endif #endif -/*PNG decoder library*/ -#ifndef LV_USE_PNG - #ifdef CONFIG_LV_USE_PNG - #define LV_USE_PNG CONFIG_LV_USE_PNG +/*LODEPNG decoder library*/ +#ifndef LV_USE_LODEPNG + #ifdef CONFIG_LV_USE_LODEPNG + #define LV_USE_LODEPNG CONFIG_LV_USE_LODEPNG #else - #define LV_USE_PNG 0 + #define LV_USE_LODEPNG 0 #endif #endif diff --git a/src/lv_init.c b/src/lv_init.c index 3de1888ce..e847a9df5 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -16,7 +16,7 @@ #include "libs/freetype/lv_freetype.h" #include "libs/fsdrv/lv_fsdrv.h" #include "libs/gif/lv_gif.h" -#include "libs/png/lv_png.h" +#include "libs/lodepng/lv_lodepng.h" #include "libs/jpg/lv_jpg.h" #include "draw/lv_draw.h" #include "misc/lv_cache.h" @@ -215,8 +215,8 @@ void lv_init(void) lv_fs_memfs_init(); #endif -#if LV_USE_PNG - lv_png_init(); +#if LV_USE_LODEPNG + lv_lodepng_init(); #endif #if LV_USE_JPG diff --git a/tests/src/lv_test_conf_full.h b/tests/src/lv_test_conf_full.h index 791f75dc8..16eb967d5 100644 --- a/tests/src/lv_test_conf_full.h +++ b/tests/src/lv_test_conf_full.h @@ -61,7 +61,7 @@ #define LV_USE_FS_MEMFS 1 #define LV_FS_MEMFS_LETTER 'M' -#define LV_USE_PNG 1 +#define LV_USE_LODEPNG 1 #define LV_USE_BMP 1 #define LV_USE_JPG 1 #define LV_USE_GIF 1 diff --git a/tests/src/lv_test_conf_minimal.h b/tests/src/lv_test_conf_minimal.h index d0bd99aa4..831c8434f 100644 --- a/tests/src/lv_test_conf_minimal.h +++ b/tests/src/lv_test_conf_minimal.h @@ -16,7 +16,7 @@ #define LV_USE_THEME_BASIC 1 #define LV_USE_THEME_DEFAULT 0 -#define LV_USE_PNG 1 +#define LV_USE_LODEPNG 1 #define LV_USE_BMP 1 #define LV_USE_GIF 1 #define LV_USE_QRCODE 1 diff --git a/tests/src/test_cases/libs/test_png.c b/tests/src/test_cases/libs/test_lodepng.c similarity index 98% rename from tests/src/test_cases/libs/test_png.c rename to tests/src/test_cases/libs/test_lodepng.c index b200102b1..4fe88a845 100644 --- a/tests/src/test_cases/libs/test_png.c +++ b/tests/src/test_cases/libs/test_lodepng.c @@ -39,7 +39,7 @@ static void create_images(void) lv_obj_align(label, LV_ALIGN_CENTER, 100, 20); } -void test_png_1(void) +void test_lodepng_1(void) { create_images();