diff --git a/Kconfig b/Kconfig index fd12a4696..ae0d617ed 100644 --- a/Kconfig +++ b/Kconfig @@ -1026,8 +1026,8 @@ menu "LVGL configuration" config LV_USE_BMP bool "BMP decoder library" - config LV_USE_JPG - bool "JPG decoder library" + config LV_USE_TJPGD + bool "TJPGD decoder library" config LV_USE_GIF bool "GIF decoder library" diff --git a/docs/libs/index.rst b/docs/libs/index.rst index ad2b3860b..185baaee3 100644 --- a/docs/libs/index.rst +++ b/docs/libs/index.rst @@ -8,6 +8,7 @@ fs bmp + tjpgd sjpg lodepng gif diff --git a/docs/libs/sjpg.rst b/docs/libs/tjpgd.rst similarity index 95% rename from docs/libs/sjpg.rst rename to docs/libs/tjpgd.rst index 21eb19f30..8594520d8 100644 --- a/docs/libs/sjpg.rst +++ b/docs/libs/tjpgd.rst @@ -1,6 +1,6 @@ -=========== -JPG decoder -=========== +============= +TJPGD decoder +============= Allow the use of JPG images in LVGL. Besides that it also allows the use of a custom format, called Split JPG (SJPG), which can be decoded in @@ -83,13 +83,13 @@ The expected result is: Example ------- -.. include:: ../examples/libs/jpg/index.rst +.. include:: ../examples/libs/tjpgd/index.rst API --- -:ref:`lv_sjpg` +:ref:`lv_tjpgd` :ref:`tjpgd` diff --git a/env_support/cmsis-pack/LVGL.lvgl.pdsc b/env_support/cmsis-pack/LVGL.lvgl.pdsc index 2b31e4c7f..742751339 100644 --- a/env_support/cmsis-pack/LVGL.lvgl.pdsc +++ b/env_support/cmsis-pack/LVGL.lvgl.pdsc @@ -486,8 +486,8 @@ - - + + @@ -787,9 +787,9 @@ Add sJPG support - - - + + + diff --git a/examples/libs/lv_example_libs.h b/examples/libs/lv_example_libs.h index baa9cdd5b..8413586db 100644 --- a/examples/libs/lv_example_libs.h +++ b/examples/libs/lv_example_libs.h @@ -21,7 +21,7 @@ extern "C" { #include "lodepng/lv_example_lodepng.h" #include "qrcode/lv_example_qrcode.h" #include "rlottie/lv_example_rlottie.h" -#include "jpg/lv_example_jpg.h" +#include "tjpgd/lv_example_tjpgd.h" #include "tiny_ttf/lv_example_tiny_ttf.h" /********************* diff --git a/examples/libs/jpg/img_lvgl_logo.jpg b/examples/libs/tjpgd/img_lvgl_logo.jpg similarity index 100% rename from examples/libs/jpg/img_lvgl_logo.jpg rename to examples/libs/tjpgd/img_lvgl_logo.jpg diff --git a/examples/libs/jpg/index.rst b/examples/libs/tjpgd/index.rst similarity index 54% rename from examples/libs/jpg/index.rst rename to examples/libs/tjpgd/index.rst index 68b57f500..c59536c87 100644 --- a/examples/libs/jpg/index.rst +++ b/examples/libs/tjpgd/index.rst @@ -1,6 +1,6 @@ Load an SJPG image ------------------ -.. lv_example:: libs/sjpg/lv_example_sjpg_1 +.. lv_example:: libs/tjpgd/lv_example_tjpgd_1 :language: c diff --git a/examples/libs/jpg/lv_example_jpg.h b/examples/libs/tjpgd/lv_example_tjpgd.h similarity index 75% rename from examples/libs/jpg/lv_example_jpg.h rename to examples/libs/tjpgd/lv_example_tjpgd.h index 09cf60e7e..4926168f2 100644 --- a/examples/libs/jpg/lv_example_jpg.h +++ b/examples/libs/tjpgd/lv_example_tjpgd.h @@ -1,10 +1,10 @@ /** - * @file lv_example_jpg.h + * @file lv_example_tjpgd.h * */ -#ifndef LV_EXAMPLE_JPG_H -#define LV_EXAMPLE_JPG_H +#ifndef LV_EXAMPLE_TJPGD_H +#define LV_EXAMPLE_TJPGD_H #ifdef __cplusplus extern "C" { @@ -25,7 +25,7 @@ extern "C" { /********************** * GLOBAL PROTOTYPES **********************/ -void lv_example_jpg_1(void); +void lv_example_tjpgd_1(void); /********************** * MACROS @@ -35,4 +35,4 @@ void lv_example_jpg_1(void); } /*extern "C"*/ #endif -#endif /*LV_EXAMPLE_JPG_H*/ +#endif /*LV_EXAMPLE_TJPGD_H*/ diff --git a/examples/libs/jpg/lv_example_jpg_1.c b/examples/libs/tjpgd/lv_example_tjpgd_1.c similarity index 64% rename from examples/libs/jpg/lv_example_jpg_1.c rename to examples/libs/tjpgd/lv_example_tjpgd_1.c index 3d4026d96..5531e4a80 100644 --- a/examples/libs/jpg/lv_example_jpg_1.c +++ b/examples/libs/tjpgd/lv_example_tjpgd_1.c @@ -1,17 +1,17 @@ #include "../../lv_examples.h" -#if LV_USE_JPG && LV_BUILD_EXAMPLES +#if LV_USE_TJPGD && LV_BUILD_EXAMPLES /** * Load a JPG image */ -void lv_example_jpg_1(void) +void lv_example_tjpgd_1(void) { lv_obj_t * wp; wp = 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(wp, "A:lvgl/examples/libs/jpg/img_lvgl_logo.jpg"); + lv_image_set_src(wp, "A:lvgl/examples/libs/tjpgd/img_lvgl_logo.jpg"); lv_obj_center(wp); } diff --git a/examples/libs/jpg/lv_example_jpg_1.py b/examples/libs/tjpgd/lv_example_tjpgd_1.py similarity index 100% rename from examples/libs/jpg/lv_example_jpg_1.py rename to examples/libs/tjpgd/lv_example_tjpgd_1.py diff --git a/lv_conf_template.h b/lv_conf_template.h index 46e4ea082..a65a20fec 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -583,7 +583,7 @@ /* JPG + split JPG decoder library. * Split JPG is a custom format optimized for embedded systems. */ -#define LV_USE_JPG 0 +#define LV_USE_TJPGD 0 /*GIF decoder library*/ #define LV_USE_GIF 0 diff --git a/lvgl.h b/lvgl.h index e2f0305f8..744f260d4 100644 --- a/lvgl.h +++ b/lvgl.h @@ -95,7 +95,7 @@ extern "C" { #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" +#include "src/libs/tjpgd/lv_tjpgd.h" #include "src/libs/freetype/lv_freetype.h" #include "src/libs/rlottie/lv_rlottie.h" #include "src/libs/ffmpeg/lv_ffmpeg.h" diff --git a/scripts/code-format.cfg b/scripts/code-format.cfg index e13e1c45f..dd4052a6e 100644 --- a/scripts/code-format.cfg +++ b/scripts/code-format.cfg @@ -36,9 +36,9 @@ --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 ---exclude=../src/extra/libs/sjpg/tjpgd.h ---exclude=../src/extra/libs/sjpg/tjpgdcnf.h +--exclude=../src/extra/libs/tjpgd/tjpgd.c +--exclude=../src/extra/libs/tjpgd/tjpgd.h +--exclude=../src/extra/libs/tjpgd/tjpgdcnf.h --exclude=../tests/unity/unity.c --exclude=../tests/unity/unity_internals.h --exclude=../tests/unity/unity_support.c diff --git a/src/libs/jpg/lv_jpg.c b/src/libs/tjpgd/lv_tjpgd.c similarity index 98% rename from src/libs/jpg/lv_jpg.c rename to src/libs/tjpgd/lv_tjpgd.c index 625dd03da..22a7811bc 100644 --- a/src/libs/jpg/lv_jpg.c +++ b/src/libs/tjpgd/lv_tjpgd.c @@ -1,5 +1,5 @@ /** - * @file lv_sjpg.c + * @file lv_tjpgd.c * */ @@ -46,10 +46,10 @@ *********************/ #include "../../../lvgl.h" -#if LV_USE_JPG +#if LV_USE_TJPGD #include "tjpgd.h" -#include "lv_jpg.h" +#include "lv_tjpgd.h" #include "../../misc/lv_fs.h" /********************* @@ -85,7 +85,7 @@ static int is_jpg(const uint8_t * raw_data, size_t len); * GLOBAL FUNCTIONS **********************/ -void lv_jpg_init(void) +void lv_tjpgd_init(void) { lv_image_decoder_t * dec = lv_image_decoder_create(); lv_image_decoder_set_info_cb(dec, decoder_info); @@ -288,4 +288,4 @@ static int is_jpg(const uint8_t * raw_data, size_t len) return memcmp(jpg_signature, raw_data, sizeof(jpg_signature)) == 0; } -#endif /*LV_USE_JPG*/ +#endif /*LV_USE_TJPGD*/ diff --git a/src/libs/jpg/lv_jpg.h b/src/libs/tjpgd/lv_tjpgd.h similarity index 73% rename from src/libs/jpg/lv_jpg.h rename to src/libs/tjpgd/lv_tjpgd.h index 3158d80a9..3d2a5f40c 100644 --- a/src/libs/jpg/lv_jpg.h +++ b/src/libs/tjpgd/lv_tjpgd.h @@ -1,10 +1,10 @@ /** - * @file lv_sjpg.h + * @file lv_tjpgd.h * */ -#ifndef LV_SJPEG_H -#define LV_SJPEG_H +#ifndef LV_TJPGD_H +#define LV_TJPGD_H #ifdef __cplusplus extern "C" { @@ -14,7 +14,7 @@ extern "C" { * INCLUDES *********************/ -#if LV_USE_JPG +#if LV_USE_TJPGD /********************* * DEFINES @@ -28,16 +28,16 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ -void lv_jpg_init(void); +void lv_tjpgd_init(void); /********************** * MACROS **********************/ -#endif /*LV_USE_JPG*/ +#endif /*LV_USE_TJPGD*/ #ifdef __cplusplus } #endif -#endif /* LV_SJPEG_H */ +#endif /* LV_TJPGD_H */ diff --git a/src/libs/jpg/tjpgd.c b/src/libs/tjpgd/tjpgd.c similarity index 100% rename from src/libs/jpg/tjpgd.c rename to src/libs/tjpgd/tjpgd.c diff --git a/src/libs/jpg/tjpgd.h b/src/libs/tjpgd/tjpgd.h similarity index 100% rename from src/libs/jpg/tjpgd.h rename to src/libs/tjpgd/tjpgd.h diff --git a/src/libs/jpg/tjpgdcnf.h b/src/libs/tjpgd/tjpgdcnf.h similarity index 100% rename from src/libs/jpg/tjpgdcnf.h rename to src/libs/tjpgd/tjpgdcnf.h diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 83e693964..d60c1c3a7 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -1957,11 +1957,11 @@ /* JPG + split JPG decoder library. * Split JPG is a custom format optimized for embedded systems. */ -#ifndef LV_USE_JPG - #ifdef CONFIG_LV_USE_JPG - #define LV_USE_JPG CONFIG_LV_USE_JPG +#ifndef LV_USE_TJPGD + #ifdef CONFIG_LV_USE_TJPGD + #define LV_USE_TJPGD CONFIG_LV_USE_TJPGD #else - #define LV_USE_JPG 0 + #define LV_USE_TJPGD 0 #endif #endif diff --git a/src/lv_init.c b/src/lv_init.c index e847a9df5..e4069ed02 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -16,8 +16,8 @@ #include "libs/freetype/lv_freetype.h" #include "libs/fsdrv/lv_fsdrv.h" #include "libs/gif/lv_gif.h" +#include "libs/tjpgd/lv_tjpgd.h" #include "libs/lodepng/lv_lodepng.h" -#include "libs/jpg/lv_jpg.h" #include "draw/lv_draw.h" #include "misc/lv_cache.h" #include "misc/lv_cache_builtin.h" @@ -219,8 +219,8 @@ void lv_init(void) lv_lodepng_init(); #endif -#if LV_USE_JPG - lv_jpg_init(); +#if LV_USE_TJPGD + lv_tjpgd_init(); #endif #if LV_USE_BMP diff --git a/tests/src/lv_test_conf_full.h b/tests/src/lv_test_conf_full.h index 16eb967d5..59ad269ab 100644 --- a/tests/src/lv_test_conf_full.h +++ b/tests/src/lv_test_conf_full.h @@ -63,7 +63,7 @@ #define LV_USE_LODEPNG 1 #define LV_USE_BMP 1 -#define LV_USE_JPG 1 +#define LV_USE_TJPGD 1 #define LV_USE_GIF 1 #define LV_USE_QRCODE 1 #define LV_USE_BARCODE 1 diff --git a/tests/src/test_cases/libs/test_jpg.c b/tests/src/test_cases/libs/test_tjpgd.c similarity index 98% rename from tests/src/test_cases/libs/test_jpg.c rename to tests/src/test_cases/libs/test_tjpgd.c index 3abff6e10..9695a5f0b 100644 --- a/tests/src/test_cases/libs/test_jpg.c +++ b/tests/src/test_cases/libs/test_tjpgd.c @@ -39,7 +39,7 @@ static void create_images(void) lv_obj_align(label, LV_ALIGN_CENTER, 100, 20); } -void test_jpg_1(void) +void test_tjpgd_1(void) { create_images();