chore(gif): move GIF Widget to widgets/ directory (#9617)
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Compare file templates with file names / template-check (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Install LVGL using CMake / build-examples (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/benchmark_results_comment/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/filter_docker_logs/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/serialize_results/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 32b - lv_conf_perf32b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 64b - lv_conf_perf64b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Save PR Number (push) Has been cancelled
Hardware Performance Test / Hardware Performance Benchmark (push) Has been cancelled
Hardware Performance Test / HW Benchmark - Save PR Number (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled

This commit is contained in:
Victor Wheeler
2026-01-26 22:36:02 -05:00
committed by GitHub
parent 7c1e0684f5
commit b5b73db5f7
15 changed files with 46 additions and 21 deletions
+1
View File
@@ -33,3 +33,4 @@ src/libs/gstreamer @AndreCostaaa
src/libs/tiny_ttf @AndreCostaaa
src/libs/vg_lite_driver @uLipe
src/misc/cache @AndreCostaaa @FASTSHIFT
src/widgets/gif @liamHowatt
+1 -1
View File
@@ -59,7 +59,7 @@ For the licenses, see the corresponding `LICENSE.txt` file in each librarys f
- Source: https://github.com/RudolphRiedel/FT800-FT813
**AnimatedGIF (GIF decoder library)**
- Path: src/libs/gif/AnimatedGIF
- Path: src/libs/gif
- Source: https://github.com/bitbank2/AnimatedGIF
**FrogFS (read-only filesystem)**
+1
View File
@@ -70,6 +70,7 @@ COMPONENT_SRCDIRS := . \
src/widgets/checkbox \
src/widgets/colorwheel \
src/widgets/dropdown \
src/widgets/gif \
src/widgets/image \
src/widgets/imgbtn \
src/widgets/keyboard \
+1 -1
View File
@@ -9,7 +9,7 @@ Image Support
:maxdepth: 2
bmp
gif
../../widgets/gif
libjpeg_turbo
libpng
lodepng
@@ -1,14 +1,21 @@
.. include:: /include/substitutions.txt
.. _gif:
===========
GIF Decoder
===========
============
GIF (lv_gif)
============
**GIF Decoder** is an LVGL extension that enables you to use GIF images in your LVGL UI.
The GIF Widget internally uses the
`AnimatedGIF <https://github.com/bitbank2/AnimatedGIF/tree/master>`__
GIF Decoder library, enabling you to use GIF images in your LVGL UI.
The implementation uses the `AnimatedGIF <https://github.com/bitbank2/AnimatedGIF/tree/master>`__
library.
Parts and Styles
****************
- :cpp:enumerator:`LV_PART_MAIN` A background rectangle that uses the :ref:`typical
background style properties <typical bg props>`.
@@ -16,9 +23,9 @@ Usage
*****
Once enabled in ``lv_conf.h`` by setting :c:macro:`LV_USE_GIF` to ``1``,
:cpp:expr:`lv_gif_create(parent)` can be used to create a gif widget.
:cpp:expr:`lv_gif_create(parent)` can be used to create a GIF Widget.
Set the color format of the gif framebuffer with :cpp:expr:`lv_gif_set_color_format(widget, color_format)`.
Set the color format of the GIF framebuffer with :cpp:expr:`lv_gif_set_color_format(widget, color_format)`.
Use :cpp:enumerator:`LV_COLOR_FORMAT_ARGB8888` for gifs with transparency.
It is set to :cpp:enumerator:`LV_COLOR_FORMAT_ARGB8888` by default.
Significant RAM can be saved by using a smaller color format.
@@ -47,7 +54,7 @@ converter since LVGL v9.0. However, there is still a way to do it through the
.. code-block:: bash
python ./scripts/LVGLImage.py --cf RAW --ofmt C -o . --name my_gif_image_array input.gif
python ./scripts/LVGLImage.py --cf RAW --ofmt C -o . --name my_gif_image_array input.gif
will produce all the bytes from the ``input.gif`` in unaltered form in a C array,
ready to use in this code:
@@ -69,7 +76,7 @@ Example:
.. code-block:: c
lv_gif_set_src(widget, "S:path/to/example.gif");
lv_gif_set_src(widget, "S:path/to/example.gif");
Note that, a file system driver needs to be registered to open images
from files. To do so, follow the instructions in :ref:`file_system`.
@@ -85,6 +92,21 @@ RGB565 has a pixel size of 2, RGB888 has a pixel size of 3, and
ARGB8888 has a pixel size of 4.
Events
******
- :cpp:enumerator:`LV_EVENT_READY` is emitted when the GIF animation has completed
rendering its last frame.
.. admonition:: Further Reading
Learn more about :ref:`lv_obj_events` emitted by all Widgets.
Learn more about :ref:`events`.
.. _gif_example:
Example
+1
View File
@@ -28,6 +28,7 @@ All Widgets
chart
checkbox
dropdown
gif
image
imagebutton
ime_pinyin
+1 -1
View File
@@ -1875,7 +1875,7 @@
<files>
<!-- src/libs/gif -->
<file category="sourceC" name="src/libs/gif/lv_gif.c" />
<file category="sourceC" name="src/libs/gif/AnimatedGIF/src/gif.c" />
<file category="sourceC" name="src/libs/gif/gif.c" />
</files>
<RTE_Components_h>
+1 -1
View File
@@ -67,6 +67,7 @@ extern "C" {
#include "src/widgets/chart/lv_chart.h"
#include "src/widgets/checkbox/lv_checkbox.h"
#include "src/widgets/dropdown/lv_dropdown.h"
#include "src/widgets/gif/lv_gif.h"
#include "src/widgets/image/lv_image.h"
#include "src/widgets/imagebutton/lv_imagebutton.h"
#include "src/widgets/keyboard/lv_keyboard.h"
@@ -110,7 +111,6 @@ extern "C" {
#include "src/libs/libwebp/lv_libwebp.h"
#include "src/libs/gltf/gltf_data/lv_gltf_model.h"
#include "src/libs/gltf/gltf_view/lv_gltf.h"
#include "src/libs/gif/lv_gif.h"
#include "src/libs/gstreamer/lv_gstreamer.h"
#include "src/libs/qrcode/lv_qrcode.h"
#include "src/libs/tjpgd/lv_tjpgd.h"
+1 -1
View File
@@ -37,7 +37,7 @@
--exclude=../src/lv_conf_internal.h
--exclude=../src/core/lv_obj_style_gen.c
--exclude=../src/core/lv_obj_style_gen.h
--exclude=../src/libs/gif/AnimatedGIF
--exclude=../src/libs/gif
--exclude=../src/libs/frogfs
--exclude=../src/libs/lodepng/lodepng.c
--exclude=../src/libs/lodepng/lodepng.h
@@ -13,11 +13,11 @@
#ifndef __ANIMATEDGIF__
#define __ANIMATEDGIF__
#include "../../../../lv_conf_internal.h"
#include "../../lv_conf_internal.h"
#if LV_USE_GIF
#include "../../../../misc/lv_fs.h"
#include "../../misc/lv_fs.h"
//
// GIF Animator
@@ -22,8 +22,8 @@
#if LV_USE_GIF
#include "../../../../misc/lv_log.h"
#include "../../../../stdlib/lv_string.h"
#include "../../misc/lv_log.h"
#include "../../stdlib/lv_string.h"
static const unsigned char cGIFBits[9] = {1,4,4,4,8,8,8,8,8}; // convert odd bpp values to ones we can handle
+1 -1
View File
@@ -25,7 +25,6 @@
#include "libs/ffmpeg/lv_ffmpeg.h"
#include "libs/freetype/lv_freetype.h"
#include "libs/fsdrv/lv_fsdrv.h"
#include "libs/gif/lv_gif.h"
#include "libs/tjpgd/lv_tjpgd.h"
#include "libs/libjpeg_turbo/lv_libjpeg_turbo.h"
#include "libs/lodepng/lv_lodepng.h"
@@ -35,6 +34,7 @@
#include "draw/lv_draw.h"
#include "misc/lv_async.h"
#include "misc/lv_fs_private.h"
#include "widgets/gif/lv_gif.h"
#include "widgets/span/lv_span.h"
#include "themes/simple/lv_theme_simple.h"
#include "misc/lv_fs.h"
@@ -13,7 +13,7 @@
#include "../../misc/cache/lv_cache.h"
#include "../../core/lv_obj_class_private.h"
#include "../../widgets/image/lv_image_private.h"
#include "AnimatedGIF/src/AnimatedGIF.h"
#include "../../libs/gif/AnimatedGIF.h"
/*********************
* DEFINES