Comments (8)
Hi @hermet,
It works, thank you for the quick help! 🎉
tvg_canvas_draw(tvg_canvas);
tvg_canvas_sync(tvg_canvas);
were the missing pieces. LVGL will have out of the box Lottie support with ThorVG soon.
I'm planning to demonstrate it on Embedded World on the booth of NXP, ST, Espressif, and Renesas.
If you will also visit Embedded World it would be amazing to meet personally.
from thorvg.
I works like a charm with v0.12.x
. Thank you for the support!
I'll report back with a video when all work together 🙂
from thorvg.
@kisvegabor Hello, good news.
Could you please double-check the return value?
Tvg_Result result = tvg_picture_load_data(paint, approve_lottie, sizeof(approve_lottie), "lottie", true);
Just in case, thorvg expects a define value to successfully build the lottie feature.
#define THORVG_TVG_LOADER_SUPPORT 1
from thorvg.
@kisvegabor Please double check this src: I confirmed the given lottie asset(approve_lottie) works my side.
//setup lvgl canvas
static uint32_t buffer[WIDTH * HEIGHT]; //canvas target buffer
lv_obj_t * lv_canvas = lv_canvas_create(lv_screen_active());
lv_canvas_set_buffer(lv_canvas, buffer, WIDTH, HEIGHT, LV_COLOR_FORMAT_ARGB8888);
lv_canvas_fill_bg(lv_canvas, lv_color_hex3(0x32f), 0xff);
//setup tvg canvas
Tvg_Canvas* tvg_canvas = tvg_swcanvas_create();
tvg_swcanvas_set_target(tvg_canvas, buffer, WIDTH, WIDTH, HEIGHT, TVG_COLORSPACE_ARGB8888);
//setup lottie animation
Tvg_Animation * anim = tvg_animation_new();
Tvg_Paint * paint = tvg_animation_get_picture(anim);
tvg_picture_load_data(paint, approve_lottie, sizeof(approve_lottie), "lottie", true);
tvg_picture_set_size(paint, 100, 100);
float d = 0;
tvg_animation_get_duration(anim, &d); /*d = 1.0*/
uint32_t f = 0;
tvg_animation_get_total_frame(anim, &f); /*f=60*/
tvg_animation_set_frame(anim, 40);
//push the lottie picture
tvg_canvas_push(tvg_canvas, paint);
//draw it & complete it.
tvg_canvas_draw(tvg_canvas);
tvg_canvas_sync(tvg_canvas);
from thorvg.
Do you also see the extra dot in the top right corner?Could it be an issue with the source?
I'm using this code based on the previous initialization.
uint32_t i = 0;
while(1) {
tvg_animation_set_frame(anim, i % f);
tvg_canvas_update(tvg_canvas);
tvg_canvas_draw(tvg_canvas);
tvg_canvas_sync(tvg_canvas);
lv_obj_invalidate(lv_canvas);
lv_timer_handler();
usleep(100 * 1000);
i++;
}
from thorvg.
Hi You need this patch #2024 (there may be more PR related to this)
I recommend to upgrade the version.
from thorvg.
@kisvegabor This patch will fix it: #1932
I strongly recommend you to upgrade thorvg with v0.12.x.
Lottie features has been significantly enhanced since the v0.11.x
from thorvg.
were the missing pieces. LVGL will have out of the box Lottie support with ThorVG soon.
I'm planning to demonstrate it on Embedded World on the booth of NXP, ST, Espressif, and Renesas.
If you will also visit Embedded World it would be amazing to meet personally.
By the way, congratulations! I hope people will be able to see the Lottie animation on such small devices!
from thorvg.
Related Issues (20)
- Metal backend support?
- Adding a web build test CI HOT 2
- Lottie: Animation Segment(Marker) Support
- Lottie/slot: multiple properties in single slot not working
- broken lottie trimpath (individual)
- Feature Request: Clear canvas without deleting paints HOT 2
- Storing the address of local variable HOT 2
- CAPI: update colorspace interfaces
- Lottie: Support feasibility of accessing a specific Lottie node by identifier
- Lost compose effect when call canvas::draw second time
- lottie compatibility issue HOT 2
- Embedded compilers doesn't like `_A`, `_B`, and `_C` function names.
- ThorVG 0.13 Release HOT 1
- Memory leak lottie2gif fails to converte file
- Random crashes/leaks, when trying to convert invalid lottie files to gifs HOT 3
- feture request: generate documentation with meson
- Stack overflow and crash when using svg2png HOT 2
- thorvg msys2 package support HOT 6
- Crash when using a clippath with an empty path shape HOT 3
- Handling of very large size stroke-width HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thorvg.