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:
BIN
examples/libs/libjpeg_turbo/flower.jpg
Normal file
BIN
examples/libs/libjpeg_turbo/flower.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
6
examples/libs/libjpeg_turbo/index.rst
Normal file
6
examples/libs/libjpeg_turbo/index.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
Load an JPG image
|
||||
-----------------
|
||||
|
||||
.. lv_example:: libs/libjpeg_turbo/lv_example_libjpeg_turbo_1
|
||||
:language: c
|
||||
|
||||
38
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo.h
Normal file
38
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo.h
Normal 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*/
|
||||
18
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c
Normal file
18
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.c
Normal 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
|
||||
13
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py
Executable file
13
examples/libs/libjpeg_turbo/lv_example_libjpeg_turbo_1.py
Executable 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()
|
||||
Reference in New Issue
Block a user