remove redundant apis.
[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  * 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
28  *
29  * PS : user has to traverse the tree for rendering. @see LOTLayerNode and @see LOTNode
30  */
31 LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation *animation,
32                                                              size_t frameNo,
33                                                              size_t w, size_t h);
34
35 /*
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.
42  *
43  * PS : user must call lottie_animation_render_flush to make sure render is finished.
44  */
45 LOT_EXPORT void
46 lottie_animation_render_async(Lottie_Animation *animation,
47                               size_t frame_number,
48                               uint32_t *buffer,
49                               size_t width,
50                               size_t height,
51                               size_t bytes_per_line);
52
53
54 /*
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.
60  */
61 LOT_EXPORT void
62 lottie_animation_render_flush(Lottie_Animation *animation);
63
64 #ifdef __cplusplus
65 }
66 #endif
67
68 #endif //_LOTTIE_ANIMATION_CAPI_H_
69