「App:Library:LVGL:docs:3rd party libraries:GIF decoder」の版間の差分
1行目: | 1行目: | ||
https://docs.lvgl.io/8.2/libs/gif.html | https://docs.lvgl.io/8.2/libs/gif.html | ||
__NOTOC__ | __NOTOC__ | ||
+ | = GIF decoder = | ||
{| class="wikitable" | {| class="wikitable" | ||
!英文 | !英文 | ||
6行目: | 7行目: | ||
|- | |- | ||
| | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Allow using GIF images in LVGL. Based on <nowiki>https://github.com/lecram/gifdec</nowiki> | Allow using GIF images in LVGL. Based on <nowiki>https://github.com/lecram/gifdec</nowiki> | ||
− | When enabled in <code>lv_conf.h</code> with <code>LV_USE_GIF</code> <code>lv_gif_create(parent)</code> can be used to create a gif widget. | + | When enabled in <code style="color: #bb0000;">lv_conf.h</code> with <code style="color: #bb0000;">LV_USE_GIF</code> <code style="color: #bb0000;">lv_gif_create(parent)</code> can be used to create a gif widget. |
− | <code>lv_gif_set_src(obj, src)</code> works very similarly to <code>lv_img_set_src</code>. As source, it also accepts images as variables (<code>lv_img_dsc_t</code>) or files. | + | <code style="color: #bb0000;">lv_gif_set_src(obj, src)</code> works very similarly to <code style="color: #bb0000;">lv_img_set_src</code>. As source, it also accepts images as variables (<code style="color: #bb0000;">lv_img_dsc_t</code>) or files. |
== Convert GIF files to C array == | == Convert GIF files to C array == | ||
To convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format. | To convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format. | ||
+ | | | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
+ | |||
== Use GIF images from file == | == Use GIF images from file == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
For example: | For example: | ||
lv_gif_set_src(obj, "S:path/to/example.gif"); | lv_gif_set_src(obj, "S:path/to/example.gif"); | ||
− | Note that, a file system driver needs to be 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 be registered to open images from files. Read more about it here or just enable one in <code style="color: #bb0000;">lv_conf.h</code> with <code style="color: #bb0000;">LV_USE_FS_...</code> |
+ | | | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
+ | |||
== Memory requirements == | == Memory requirements == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
To decode and display a GIF animation the following amount of RAM is required: | To decode and display a GIF animation the following amount of RAM is required: | ||
− | * <code>LV_COLOR_DEPTH 8</code>: 3 x image width x image height | + | * <code style="color: #bb0000;">LV_COLOR_DEPTH 8</code>: 3 x image width x image height |
− | * <code>LV_COLOR_DEPTH 16</code>: 4 x image width x image height | + | * <code style="color: #bb0000;">LV_COLOR_DEPTH 16</code>: 4 x image width x image height |
− | * <code>LV_COLOR_DEPTH 32</code>: 5 x image width x image height | + | * <code style="color: #bb0000;">LV_COLOR_DEPTH 32</code>: 5 x image width x image height |
+ | | | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
+ | |||
== Example == | == Example == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
=== Open a GIF image from file and variable === | === Open a GIF image from file and variable === | ||
− | [[file:LVGL docs 3rdPartyLibs GifDecoder 01.png|link=https://docs.lvgl.io/8.2/libs/gif.html#open-a-gif-image-from-file-and-variable]] | + | [[file:LVGL docs 3rdPartyLibs GifDecoder 01.png|link=https://docs.lvgl.io/8.2/libs/gif.html#open-a-gif-image-from-file-and-variable]]| |
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
− | |||
== API == | == API == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
Functions | Functions | ||
− | ; | + | ; lv_obj_t *lv_gif_create(lv_obj_t *parent) |
: | : | ||
− | ; | + | ; void lv_gif_set_src(lv_obj_t *obj, const void *src) |
: | : | ||
− | ; | + | ; void lv_gif_restart(lv_obj_t *gif) |
− | : | + | : |
Variables | Variables | ||
− | ; | + | ; const lv_obj_class_t lv_gif_class |
: | : | ||
− | ; | + | ; struct lv_gif_t |
− | : | + | : Public Members |
− | :; | + | :; lv_img_t img |
:: | :: | ||
− | :; | + | :; gd_GIF *gif |
:: | :: | ||
− | :; | + | :; lv_timer_t *timer |
:: | :: | ||
− | :; | + | :; lv_img_dsc_t imgdsc |
:: | :: | ||
− | :; | + | :; uint32_t last_call |
− | + | | | |
− | + | |} | |
− | |||
− | |||
− | |||
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] |
2022年6月29日 (水) 15:39時点における版
https://docs.lvgl.io/8.2/libs/gif.html
GIF decoder
英文 | 自動翻訳 |
---|---|
Allow using GIF images in LVGL. Based on https://github.com/lecram/gifdec When enabled in
Convert GIF files to C arrayTo convert a GIF file to byte values array use LVGL's online converter. Select "Raw" color format and "C array" Output format. |
Use GIF images from file
英文 | 自動翻訳 |
---|---|
For example: lv_gif_set_src(obj, "S:path/to/example.gif"); Note that, a file system driver needs to be registered to open images from files. Read more about it here or just enable one in |
Memory requirements
英文 | 自動翻訳 |
---|---|
To decode and display a GIF animation the following amount of RAM is required:
|
Example
英文 | 自動翻訳 |
---|---|
Open a GIF image from file and variable |
API
英文 | 自動翻訳 |
---|---|
Functions
Variables
|