diff --git a/examples/libs/jpg/img_lvgl_logo.jpg b/examples/libs/jpg/img_lvgl_logo.jpg new file mode 100644 index 000000000..0bfa5e65e Binary files /dev/null and b/examples/libs/jpg/img_lvgl_logo.jpg differ diff --git a/examples/libs/sjpg/index.rst b/examples/libs/jpg/index.rst similarity index 100% rename from examples/libs/sjpg/index.rst rename to examples/libs/jpg/index.rst diff --git a/examples/libs/sjpg/lv_example_sjpg.h b/examples/libs/jpg/lv_example_jpg.h similarity index 75% rename from examples/libs/sjpg/lv_example_sjpg.h rename to examples/libs/jpg/lv_example_jpg.h index 113557c44..09cf60e7e 100644 --- a/examples/libs/sjpg/lv_example_sjpg.h +++ b/examples/libs/jpg/lv_example_jpg.h @@ -1,10 +1,10 @@ /** - * @file lv_example_sjpg.h + * @file lv_example_jpg.h * */ -#ifndef LV_EXAMPLE_SJPG_H -#define LV_EXAMPLE_SJPG_H +#ifndef LV_EXAMPLE_JPG_H +#define LV_EXAMPLE_JPG_H #ifdef __cplusplus extern "C" { @@ -25,7 +25,7 @@ extern "C" { /********************** * GLOBAL PROTOTYPES **********************/ -void lv_example_sjpg_1(void); +void lv_example_jpg_1(void); /********************** * MACROS @@ -35,4 +35,4 @@ void lv_example_sjpg_1(void); } /*extern "C"*/ #endif -#endif /*LV_EXAMPLE_SJPG_H*/ +#endif /*LV_EXAMPLE_JPG_H*/ diff --git a/examples/libs/sjpg/lv_example_sjpg_1.c b/examples/libs/jpg/lv_example_jpg_1.c similarity index 53% rename from examples/libs/sjpg/lv_example_sjpg_1.c rename to examples/libs/jpg/lv_example_jpg_1.c index 8c9cd3f69..3d4026d96 100644 --- a/examples/libs/sjpg/lv_example_sjpg_1.c +++ b/examples/libs/jpg/lv_example_jpg_1.c @@ -1,20 +1,17 @@ #include "../../lv_examples.h" -#if LV_USE_SJPG && LV_BUILD_EXAMPLES +#if LV_USE_JPG && LV_BUILD_EXAMPLES /** - * Load an SJPG image + * Load a JPG image */ -void lv_example_sjpg_1(void) +void lv_example_jpg_1(void) { lv_obj_t * wp; - LV_IMAGE_DECLARE(codeblocks) - 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:codeblocks.jpg"); - // lv_image_set_src(wp, &codeblocks); + lv_image_set_src(wp, "A:lvgl/examples/libs/jpg/img_lvgl_logo.jpg"); lv_obj_center(wp); } diff --git a/examples/libs/sjpg/lv_example_sjpg_1.py b/examples/libs/jpg/lv_example_jpg_1.py similarity index 87% rename from examples/libs/sjpg/lv_example_sjpg_1.py rename to examples/libs/jpg/lv_example_jpg_1.py index babc97edf..d16516931 100755 --- a/examples/libs/sjpg/lv_example_sjpg_1.py +++ b/examples/libs/jpg/lv_example_jpg_1.py @@ -9,5 +9,5 @@ fs_driver.fs_register(fs_drv, 'S') wp = lv.image(lv.scr_act()) # The File system is attached to letter 'S' -wp.set_src("S:small_image.sjpg") +wp.set_src("S:img_lvgl_logo.jpg") wp.center() diff --git a/examples/libs/lv_example_libs.h b/examples/libs/lv_example_libs.h index 0324ab79f..d7da2110b 100644 --- a/examples/libs/lv_example_libs.h +++ b/examples/libs/lv_example_libs.h @@ -21,7 +21,7 @@ extern "C" { #include "png/lv_example_png.h" #include "qrcode/lv_example_qrcode.h" #include "rlottie/lv_example_rlottie.h" -#include "sjpg/lv_example_sjpg.h" +#include "jpg/lv_example_jpg.h" #include "tiny_ttf/lv_example_tiny_ttf.h" /********************* diff --git a/examples/libs/sjpg/small_image.sjpg b/examples/libs/sjpg/small_image.sjpg deleted file mode 100644 index cab12e6db..000000000 Binary files a/examples/libs/sjpg/small_image.sjpg and /dev/null differ diff --git a/lv_conf_template.h b/lv_conf_template.h index d6a84bc73..6207c396d 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_SJPG 0 +#define LV_USE_JPG 0 /*GIF decoder library*/ #define LV_USE_GIF 0 diff --git a/src/libs/jpg/lv_jpg.c b/src/libs/jpg/lv_jpg.c index c78cab573..e6a73ec58 100644 --- a/src/libs/jpg/lv_jpg.c +++ b/src/libs/jpg/lv_jpg.c @@ -46,7 +46,7 @@ *********************/ #include "../../../lvgl.h" -#if LV_USE_SJPG +#if LV_USE_JPG #include "tjpgd.h" #include "lv_jpg.h" @@ -85,7 +85,7 @@ static int is_jpg(const uint8_t * raw_data, size_t len); * GLOBAL FUNCTIONS **********************/ -void lv_jpeg_init(void) +void lv_jpg_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_SJPG*/ +#endif /*LV_USE_JPG*/ diff --git a/src/libs/jpg/lv_jpg.h b/src/libs/jpg/lv_jpg.h index c301dca20..3158d80a9 100644 --- a/src/libs/jpg/lv_jpg.h +++ b/src/libs/jpg/lv_jpg.h @@ -14,7 +14,7 @@ extern "C" { * INCLUDES *********************/ -#if LV_USE_SJPG +#if LV_USE_JPG /********************* * DEFINES @@ -28,13 +28,13 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ -void lv_jpeg_init(void); +void lv_jpg_init(void); /********************** * MACROS **********************/ -#endif /*LV_USE_SJPG*/ +#endif /*LV_USE_JPG*/ #ifdef __cplusplus } diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index d5e93b789..615565998 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_SJPG - #ifdef CONFIG_LV_USE_SJPG - #define LV_USE_SJPG CONFIG_LV_USE_SJPG +#ifndef LV_USE_JPG + #ifdef CONFIG_LV_USE_JPG + #define LV_USE_JPG CONFIG_LV_USE_JPG #else - #define LV_USE_SJPG 0 + #define LV_USE_JPG 0 #endif #endif diff --git a/src/lv_init.c b/src/lv_init.c index 4adc35116..40eef1f14 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -219,8 +219,8 @@ void lv_init(void) lv_png_init(); #endif -#if LV_USE_SJPG - lv_jpeg_init(); +#if LV_USE_JPG + lv_jpg_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 e6eec2138..791f75dc8 100644 --- a/tests/src/lv_test_conf_full.h +++ b/tests/src/lv_test_conf_full.h @@ -63,7 +63,7 @@ #define LV_USE_PNG 1 #define LV_USE_BMP 1 -#define LV_USE_SJPG 1 +#define LV_USE_JPG 1 #define LV_USE_GIF 1 #define LV_USE_QRCODE 1 #define LV_USE_BARCODE 1