fix(docs): fix most sphinx warnings (#6916)
Co-authored-by: Kevin Schlosser <kdschlosser@users.noreply.github.com> Co-authored-by: Liam <30486941+liamHowatt@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,7 @@ If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_BMP` LVGL will register a new
|
||||
image decoder automatically so BMP files can be directly used as image
|
||||
sources. For example:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_image_set_src(my_img, "S:path/to/picture.bmp");
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Install FFmpeg
|
||||
|
||||
Download first FFmpeg from `here <https://www.ffmpeg.org/download.html>`__, then install it:
|
||||
|
||||
.. code:: shell
|
||||
.. code-block:: shell
|
||||
|
||||
./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib
|
||||
make
|
||||
@@ -33,9 +33,10 @@ Enable :c:macro:`LV_USE_FFMPEG` in ``lv_conf.h``.
|
||||
|
||||
See the examples below.
|
||||
|
||||
:Note: FFmpeg extension doesn't use LVGL's file system. You can
|
||||
simply pass the path to the image or video as usual on your operating
|
||||
system or platform.
|
||||
:note: FFmpeg extension doesn't use LVGL's file system. You can
|
||||
simply pass the path to the image or video as usual on your operating
|
||||
system or platform.
|
||||
|
||||
|
||||
.. _ffmpeg_example:
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ FLASH space.
|
||||
- Copy the FreeType source code to your project directory.
|
||||
- Refer to the following ``Makefile`` for configuration:
|
||||
|
||||
.. code:: make
|
||||
.. code-block:: make
|
||||
|
||||
# FreeType custom configuration header file
|
||||
CFLAGS += -DFT2_BUILD_LIBRARY
|
||||
|
||||
@@ -57,7 +57,7 @@ To use the memory-mapped file emulation an ``lv_fs_path_ex_t`` object must be
|
||||
created and initialized. This object can be passed to :cpp:func:`lv_fs_open` as
|
||||
the file name:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_fs_path_ex_t mempath;
|
||||
lv_fs_file_t file;
|
||||
|
||||
@@ -27,7 +27,7 @@ Use GIF images from file
|
||||
|
||||
For example:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_gif_set_src(obj, "S:path/to/example.gif");
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ When enabled :c:macro:`lv_littlefs_set_handler` can be used to set up a mount po
|
||||
Example
|
||||
-------
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
#include "lfs.h"
|
||||
|
||||
// configuration of the filesystem is provided by this struct
|
||||
|
||||
@@ -16,14 +16,14 @@ Library source: https://github.com/libjpeg-turbo/libjpeg-turbo
|
||||
Install
|
||||
-------
|
||||
|
||||
.. code:: bash
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt install libjpeg-turbo8-dev
|
||||
|
||||
Add libjpeg-turbo to your project
|
||||
---------------------------------
|
||||
|
||||
.. code:: cmake
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(JPEG REQUIRED)
|
||||
include_directories(${JPEG_INCLUDE_DIR})
|
||||
|
||||
@@ -11,14 +11,14 @@ Detailed introduction: http://www.libpng.org/pub/png/libpng.html
|
||||
Install
|
||||
-------
|
||||
|
||||
.. code:: bash
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt install libpng-dev
|
||||
|
||||
Add libpng to your project
|
||||
--------------------------
|
||||
|
||||
.. code:: cmake
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
include_directories(${PNG_INCLUDE_DIR})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. _lodepng:
|
||||
.. _lodepng_rst:
|
||||
|
||||
===============
|
||||
LodePNG decoder
|
||||
@@ -12,11 +12,12 @@ If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_LODEPNG` LVGL will register a ne
|
||||
image decoder automatically so PNG files can be directly used as any
|
||||
other image sources.
|
||||
|
||||
:Note: a file system driver needs to be registered to open images from
|
||||
files. Read more about it :ref:`overview_file_system` or just
|
||||
enable one in ``lv_conf.h`` with ``LV_USE_FS_...``
|
||||
:note: a file system driver needs to be registered to open images from
|
||||
files. Read more about it :ref:`overview_file_system` or just
|
||||
enable one in ``lv_conf.h`` with ``LV_USE_FS_...``
|
||||
|
||||
The whole PNG image is decoded, so ``width x height x 4`` bytes free RAM space is required.
|
||||
|
||||
The whole PNG image is decoded, so ``width x height x 4`` bytes free RAM space is required.
|
||||
The decoded image is stored in RGBA pixel format.
|
||||
|
||||
As it might take significant time to decode PNG images LVGL's :ref:`overview_image_caching` feature can be useful.
|
||||
@@ -25,13 +26,13 @@ Compress PNG files
|
||||
------------------
|
||||
|
||||
PNG file format supports True color (24/32 bit), and 8-bit palette colors.
|
||||
Usually cliparts, drawings, icons and simple graphics are stored in PNG format,
|
||||
that do not use the whole color space, so it is possible to compress further
|
||||
Usually cliparts, drawings, icons and simple graphics are stored in PNG format,
|
||||
that do not use the whole color space, so it is possible to compress further
|
||||
the image by using 8-bit palette colors, instead of 24/32 bit True color format.
|
||||
Because embedded devices have limited (flash) storage, it is recommended
|
||||
Because embedded devices have limited (flash) storage, it is recommended
|
||||
to compress images.
|
||||
|
||||
One option is to use a free online PNG compressor site,
|
||||
One option is to use a free online PNG compressor site,
|
||||
for example Compress PNG: https://compresspng.com/
|
||||
|
||||
.. _lodepng_example:
|
||||
|
||||
@@ -34,7 +34,7 @@ If the coming pixels are not repeated, it stores the non-repeat count value and
|
||||
original color value. For more details, the script used to compress the image
|
||||
can be found from ``lvgl/script/LVGLImage.py``.
|
||||
|
||||
.. code:: python
|
||||
.. code-block:: python
|
||||
|
||||
def rle_compress(self, data: bytearray, blksize: int, threshold=16):
|
||||
index = 0
|
||||
@@ -71,7 +71,7 @@ Usage
|
||||
To use the RLE Decoder, enable it in ``lv_conf.h`` configuration file by setting :c:macro:`LV_USE_RLE` to `1`.
|
||||
The RLE image can be used same as other images.
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_image_set_src(img, "path/to/image.rle");
|
||||
|
||||
@@ -81,6 +81,6 @@ Generate RLE compressed binary images
|
||||
The image can be directly generated using script ``lvgl/script/LVGLImage.py``
|
||||
|
||||
|
||||
.. code:: bash
|
||||
.. code-block:: bash
|
||||
|
||||
./script/LVGLImage.py --ofmt BIN --cf I8 --compress RLE cogwheel.png
|
||||
|
||||
@@ -24,7 +24,7 @@ To build on desktop you can follow the instructions from Rlottie's
|
||||
|
||||
In the most basic case it looks like this:
|
||||
|
||||
.. code:: shell
|
||||
.. code-block:: shell
|
||||
|
||||
mkdir rlottie_workdir
|
||||
cd rlottie_workdir
|
||||
@@ -59,7 +59,7 @@ Use Rlottie from file
|
||||
|
||||
To create a Lottie animation from file use:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_obj_t * lottie = lv_rlottie_create_from_file(parent, width, height, "path/to/lottie.json");
|
||||
|
||||
@@ -79,13 +79,13 @@ following reasons:
|
||||
``lvgl/scripts/filetohex.py`` can be used to convert a Lottie file a hex
|
||||
array. E.g.:
|
||||
|
||||
.. code:: shell
|
||||
.. code-block:: shell
|
||||
|
||||
./filetohex.py path/to/lottie.json > out.txt
|
||||
|
||||
To create an animation from raw data:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
extern const uint8_t lottie_data[];
|
||||
lv_obj_t* lottie = lv_rlottie_create_from_raw(parent, width, height, (const char *)lottie_data);
|
||||
@@ -107,7 +107,7 @@ LVGL provides two functions to control the animation mode:
|
||||
You'll combine your intentions when calling the first method, like in
|
||||
these examples:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_obj_t * lottie = lv_rlottie_create_from_file(scr, 128, 128, "test.json");
|
||||
lv_obj_center(lottie);
|
||||
@@ -180,7 +180,7 @@ limitations:
|
||||
- Build the lottie animation to be sized for the intended size
|
||||
- it can scale/resize, but performance will be best when the base lottie size is as intended
|
||||
- Limit total number of frames, the longer the lottie animation is,
|
||||
the more memory it will consume for rendering (rlottie consumes IRAM for rendering)
|
||||
the more memory it will consume for rendering (rlottie consumes IRAM for rendering)
|
||||
- Build the lottie animation for the intended frame rate
|
||||
- default lottie is 60fps, embedded LCDs likely won't go above 30fps
|
||||
|
||||
@@ -190,7 +190,7 @@ IDF Setup
|
||||
Where the LVGL simulator uses the installed rlottie lib, the IDF works
|
||||
best when using rlottie as a submodule under the components directory.
|
||||
|
||||
.. code:: shell
|
||||
.. code-block:: shell
|
||||
|
||||
cd 'your/project/directory'
|
||||
git add submodule
|
||||
@@ -224,7 +224,7 @@ Copy this CMakeLists file to
|
||||
In addition to the component CMakeLists file, you'll also need to tell
|
||||
your project level CMakeLists in your IDF project to require rlottie:
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
REQUIRES "lvgl" "rlottie"
|
||||
|
||||
@@ -274,7 +274,7 @@ your espressif project. This is as simple as swapping
|
||||
IDF) with the appropriate :cpp:expr:`MALLOC_CAP` call - for SPIRAM usage this is
|
||||
:cpp:expr:`MALLOC_CAP_SPIRAM`.
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
rlottie->allocated_buf = heap_caps_malloc(allocated_buf_size+1, MALLOC_CAP_SPIRAM);
|
||||
|
||||
|
||||
@@ -30,19 +30,20 @@ as image sources.
|
||||
|
||||
For example:
|
||||
|
||||
.. code:: c
|
||||
.. code-block:: c
|
||||
|
||||
lv_image_set_src(my_img, "S:path/to/picture.jpg");
|
||||
|
||||
:Note: a file system driver needs to be registered to open images from
|
||||
files. Read more about :ref:`overview_file_system` or just
|
||||
enable one in ``lv_conf.h`` with ``LV_USE_FS_...`` config.
|
||||
:note: a file system driver needs to be registered to open images from
|
||||
files. Read more about :ref:`overview_file_system` or just
|
||||
enable one in ``lv_conf.h`` with ``LV_USE_FS_...`` config.
|
||||
|
||||
|
||||
Converter
|
||||
---------
|
||||
|
||||
Converting JPEG to C array
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Use lvgl online tool https://lvgl.io/tools/imageconverter
|
||||
- Color format = RAW, output format = C Array
|
||||
|
||||
Reference in New Issue
Block a user