fix build break by 0f5edac6d1595e0fecd8d48bb7d2e5353fe9121f
[platform/core/uifw/lottie-player.git] / inc / lottieanimation_capi.h
1 #ifndef _LOTTIE_ANIMATION_CAPI_H_
2 #define _LOTTIE_ANIMATION_CAPI_H_
3
4 #include <stddef.h>
5 #include <stdint.h>
6 #include <stdbool.h>
7 #include <lottiecommon.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 typedef struct Lottie_Animation_S Lottie_Animation;
14
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);
22
23
24 /*
25  * Request to update the content of the frame $frame_number in to Animation object.
26  * frame_number, the content of the animation in that frame number
27  * width  , width of the viewbox
28  * height , height of the viewbox
29  *
30  * PS : user must call lottie_animation_get_node_count and  lottie_animation_get_node
31  * to get the renderlist.
32  */
33 LOT_EXPORT size_t lottie_animation_prepare_frame(Lottie_Animation *animation,
34                                                  size_t frameNo,
35                                                  size_t w, size_t h);
36 LOT_EXPORT size_t lottie_animation_get_node_count(const Lottie_Animation *animation);
37 LOT_EXPORT const LOTNode* lottie_animation_get_node(Lottie_Animation *animation, size_t idx);
38
39 /*
40  * Request to render the content of the frame $frame_number to buffer $buffer asynchronously.
41  * frame_number, the frame number needs to be rendered.
42  * buffer , surface buffer use for rendering
43  * width  , width of the surface
44  * height , height of the surface
45  * bytes_per_line, stride of the surface in bytes.
46  *
47  * PS : user must call lottie_animation_render_flush to make sure render is finished.
48  */
49 LOT_EXPORT void
50 lottie_animation_render_async(Lottie_Animation *animation,
51                               size_t frame_number,
52                               uint32_t *buffer,
53                               size_t width,
54                               size_t height,
55                               size_t bytes_per_line);
56
57
58 /*
59  * Request to finish the current asyn renderer job for this animation object.
60  * if render is finished then this call returns immidiately
61  * if not it waits till render job finish and then return.
62  * user must use lottie_animation_render_async and lottie_animation_render_flush
63  * together to get the benefit of async rendering.
64  */
65 LOT_EXPORT void
66 lottie_animation_render_flush(Lottie_Animation *animation);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif //_LOTTIE_ANIMATION_CAPI_H_
73