「App:Library:LVGL:docs:3rd party libraries:JPG decoder」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動40行目: | 40行目: | ||
|- | |- | ||
| | | | ||
− | If enabled in <code>lv_conf.h</code> by <code>LV_USE_SJPG</code> LVGL will register a new image decoder automatically so JPG and SJPG files can be directly used as image sources. For example: | + | If enabled in <code>lv_conf.h</code> by <code>LV_USE_SJPG</code> LVGL will register a new image decoder automatically so JPG and SJPG<syntaxhighlight lang="C++" style="border:1px dashed gray;"> |
+ | files can be directly used as image sources. For example: | ||
lv_img_set_src(my_img, "S:path/to/picture.jpg"); | lv_img_set_src(my_img, "S:path/to/picture.jpg"); | ||
+ | </syntaxhighlight> | ||
Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in <code>lv_conf.h</code> with <code>LV_USE_FS_...</code> | Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in <code>lv_conf.h</code> with <code>LV_USE_FS_...</code> | ||
| | | |
2022年6月29日 (水) 15:23時点における版
https://docs.lvgl.io/8.2/libs/sjpg.html
JPG 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 more optimal way on embedded systems. |
Overview
英文 | 自動翻訳 |
---|---|
|
Usage
英文 | 自動翻訳 |
---|---|
If enabled in lv_conf.h by LV_USE_SJPG LVGL will register a new image decoder automatically so JPG and SJPG files can be directly used as image sources. For example:
lv_img_set_src(my_img, "S:path/to/picture.jpg");
Note that, a file system driver needs to registered to open images from files. Read more about it here or just enable one in |
Converter
Converting JPG to C array
英文 | 自動翻訳 |
---|---|
|
Converting JPG to SJPG
英文 | 自動翻訳 |
---|---|
python3 and the PIL library required. (PIL can be installed with To create SJPG from JPG:
The expected result is: Conversion started...
Input:
image_to_convert.jpg
RES = 640 x 480
Output:
Time taken = 1.66 sec
bin size = 77.1 KB
walpaper.sjpg (bin file)
walpaper.c (c array)
All good!
ExampleLoad an SJPG image |
API
英文 | 自動翻訳 |
---|---|
Functions
|