feat(libs): add libjpeg-turbo decoder (#4567)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2023-09-22 16:43:59 +08:00
committed by GitHub
parent 2a9c2ede43
commit c4c4627ae0
22 changed files with 735 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,6 @@
Load an JPG image
-----------------
.. lv_example:: libs/libjpeg_turbo/lv_example_libjpeg_turbo_1
:language: c

View File

@@ -0,0 +1,38 @@
/**
* @file lv_example_libjpeg_turbo.h
*
*/
#ifndef LV_EXAMPLE_LIBJPEG_TURBO_H
#define LV_EXAMPLE_LIBJPEG_TURBO_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_example_libjpeg_turbo_1(void);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_LIBJPEG_TURBO_H*/

View File

@@ -0,0 +1,18 @@
#include "../../lv_examples.h"
#if LV_USE_LIBJPEG_TURBO && LV_BUILD_EXAMPLES
/**
* Load a JPG image
*/
void lv_example_libjpeg_turbo_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/libjpeg_turbo/flower.jpg");
lv_obj_center(wp);
}
#endif

View File

@@ -0,0 +1,13 @@
#!/opt/bin/lv_micropython -i
import lvgl as lv
import display_driver
import fs_driver
fs_drv = lv.fs_drv_t()
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:flower.jpg")
wp.center()