docs(rlottie): fix heading levels

This commit is contained in:
Gabor Kiss-Vamosi 2022-10-02 17:15:46 +02:00
parent adced46ecc
commit d214b00386

View File

@ -93,8 +93,8 @@ If you don't enable looping, a `LV_EVENT_READY` is sent when the animation can n
To get the number of frames in an animation or the current frame index, you can cast the `lv_obj_t` instance to a `lv_rlottie_t` instance and inspect the `current_frame` and `total_frames` members.
# ESP-IDF Example
## Background
## ESP-IDF Example
### Background
Rlottie can be expensive to render on embedded hardware. Lottie animations tend to use a large amount of CPU time and can use large portions of RAM. This will vary from lottie to lottie but in general for best performance:
* Limit total # of frames in the animation
* Where possible, try to avoid bezier type animations
@ -119,12 +119,12 @@ When picking/designing a lottie animation consider the following limitations:
- Limit total number of frames, the longer the lottie animation is, 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 wont go above 30fps
## IDF Setup
### 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.
```
cd 'your/project/directory'
git add submodule
git add submodule
git add submodule https://github.com/Samsung/rlottie.git ./components/rlottie/rlottie
git submodule update --init --recursive
```
@ -132,14 +132,14 @@ git submodule update --init --recursive
Now, Rlottie is available as a component in the IDF, but it requires some additional changes and a CMakeLists file to tell the IDF how to compile.
## Rlottie patch file
### Rlottie patch file
Rlottie relies on a dynamic linking for an image loader lib. This needs to be disabled as the IDF doesn't play nice with dynamic linking.
A patch file is available in lvgl uner: /env_support/esp/rlottie/0001-changes-to-compile-with-esp-idf.patch
Apply the patch file to your rlottie submodule.
## CMakeLists for IDF
### CMakeLists for IDF
An example CMakeLists file has been provided at /env_support/esp/rlottie/CMakeLists.txt
Copy this CMakeLists file to 'your-project-directory'/components/rlottie/
@ -152,12 +152,12 @@ REQUIRES "lvgl" "rlottie"
From here, you should be able to use lv_rlottie objects in your ESP-IDF project as any other widget in LVGL ESP examples. Please remember that these animations can be highly resource constrained and this does not guarantee that every animation will work.
## Additional Rlottie considerations in ESP-IDF
### Additional Rlottie considerations in ESP-IDF
While unecessary, removing the rlottie/rlottie/example folder can remove many un-needed files for this embedded LVGL application
From here, you can use the relevant LVGL lv_rlottie functions to create lottie animations in LVGL on embedded hardware!
Please note, that while lottie animations are capable of running on many ESP chips, below is recommended for best performance.
Please note, that while lottie animations are capable of running on many ESP chips, below is recommended for best performance.
* ESP32-S3-WROOM-1-N16R8
* 16mb quad spi flash
@ -168,7 +168,7 @@ The Esp-box devkit meets this spec and https://github.com/espressif/esp-box is a
you'll need to enable LV_USE_RLOTTIE through idf.py menuconfig under LVGL component settings.
## Additional changes to make use of SPIRAM
### Additional changes to make use of SPIRAM
lv_alloc/realloc do not make use of SPIRAM. Given the high memory usage of lottie animations, it is recommended to shift as much out of internal DRAM into SPIRAM as possible. In order to do so, SPIRAM will need to be enabled in the menuconfig options for your given espressif chip.