App:Library:LVGL:docs:3rd party libraries:GIF decoder

提供: robot-jp wiki
2022年6月28日 (火) 12:57時点におけるTakashi (トーク | 投稿記録)による版
ナビゲーションに移動検索に移動

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 lv_conf.h with LV_USE_GIF lv_gif_create(parent) can be used to create a gif widget.

lv_gif_set_src(obj, src) works very similarly to lv_img_set_src. As source, it also accepts images as variables (lv_img_dsc_t) or files.

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.

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 lv_conf.h with LV_USE_FS_...

Memory requirements

To decode and display a GIF animation the following amount of RAM is required:

  • LV_COLOR_DEPTH 8: 3 x image width x image height
  • LV_COLOR_DEPTH 16: 4 x image width x image height
  • LV_COLOR_DEPTH 32: 5 x image width x image height

Example

Open a GIF image from file and variable

LVGL docs 3rdPartyLibs GifDecoder 01.png


https://docs.lvgl.io/8.2/libs/gif.html#open-a-gif-image-from-file-and-variable


API

Functions

lv_obj_t *lv_gif_create(lv_obj_t *parent)[1]
void lv_gif_set_src(lv_obj_t *o[2]bj, const void *src)[3]
void lv_gif_restart(lv_obj_t *gif)[4]
[5]

Variables

const lv_obj_[6]class_t lv_gif_class[7]
struct lv_gif_t[8]
Pu[9]blic Memb[10]ers
lv_img_t img[11]
gd[12]_GIF *gif[13]
l[14]v_timer_t *timer[15]
lv_img_[16]dsc_t imgdsc[17]
uint32_t [18]last_call





戻る : Previous