1 #ifndef _LOTTIE_ANIMATION_CAPI_H_
2 #define _LOTTIE_ANIMATION_CAPI_H_
7 #include <lottiecommon.h>
13 typedef struct Lottie_Animation_S Lottie_Animation;
15 LOT_EXPORT Lottie_Animation *lottie_animation_from_file(const char *file);
16 LOT_EXPORT Lottie_Animation *lottie_animation_from_data(const char *data, const char *key);
17 LOT_EXPORT void lottie_animation_destroy(Lottie_Animation *animation);
18 LOT_EXPORT void lottie_animation_get_size(const Lottie_Animation *animation, size_t *w, size_t *h);
19 LOT_EXPORT double lottie_animation_get_duration(const Lottie_Animation *animation);
20 LOT_EXPORT size_t lottie_animation_get_totalframe(const Lottie_Animation *animation);
21 LOT_EXPORT double lottie_animation_get_framerate(const Lottie_Animation *animation);
24 * Get the render tree which contains the snapshot of the animation object at frame $frame_number
25 * frame_number, the content of the animation in that frame number
26 * width , width of the viewbox
27 * height , height of the viewbox
29 * PS : user has to traverse the tree for rendering. @see LOTLayerNode and @see LOTNode
31 LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation *animation,
36 * Request to render the content of the frame $frame_number to buffer $buffer asynchronously.
37 * frame_number, the frame number needs to be rendered.
38 * buffer , surface buffer use for rendering
39 * width , width of the surface
40 * height , height of the surface
41 * bytes_per_line, stride of the surface in bytes.
43 * PS : user must call lottie_animation_render_flush to make sure render is finished.
46 lottie_animation_render_async(Lottie_Animation *animation,
51 size_t bytes_per_line);
55 * Request to finish the current asyn renderer job for this animation object.
56 * if render is finished then this call returns immidiately
57 * if not it waits till render job finish and then return.
58 * user must use lottie_animation_render_async and lottie_animation_render_flush
59 * together to get the benefit of async rendering.
62 lottie_animation_render_flush(Lottie_Animation *animation);
68 #endif //_LOTTIE_ANIMATION_CAPI_H_