lottie: Fixed SVACE warning for uninitialized class member variable.
[platform/core/uifw/lottie-player.git] / inc / lottiecommon.h
1 #ifndef _LOTTIE_COMMON_H_
2 #define _LOTTIE_COMMON_H_
3
4 #ifdef _WIN32
5 #ifdef LOT_BUILD
6 #ifdef DLL_EXPORT
7 #define LOT_EXPORT __declspec(dllexport)
8 #else
9 #define LOT_EXPORT
10 #endif
11 #else
12 #define LOT_EXPORT __declspec(dllimport)
13 #endif
14 #else
15 #ifdef __GNUC__
16 #if __GNUC__ >= 4
17 #define LOT_EXPORT __attribute__((visibility("default")))
18 #else
19 #define LOT_EXPORT
20 #endif
21 #else
22 #define LOT_EXPORT
23 #endif
24 #endif
25
26
27 /**
28  * @defgroup Lottie_Animation Lottie_Animation
29  *
30  * Lottie Animation is a modern style vector based animation design. Its animation
31  * resource(within json format) could be generated by Adobe After Effect using
32  * bodymovin plugin. You can find a good examples in Lottie Community which
33  * shares many free resources(see: www.lottiefiles.com).
34  *
35  * This Lottie_Animation is a common engine to manipulate, control Lottie
36  * Animation from the Lottie resource - json file. It provides a scene-graph
37  * node tree per frames by user demand as well as rasterized frame images.
38  *
39  */
40
41 /**
42  * @ingroup Lottie_Animation
43  */
44
45
46 /**
47  * @brief Enumeration for Lottie Player error code.
48  */
49 typedef enum
50 {
51    //TODO: Coding convention??
52     LOT_ANIMATION_ERROR_NONE = 0,
53     LOT_ANIMATION_ERROR_NOT_PERMITTED,
54     LOT_ANIMATION_ERROR_OUT_OF_MEMORY,
55     LOT_ANIMATION_ERROR_INVALID_PARAMETER,
56     LOT_ANIMATION_ERROR_RESULT_OUT_OF_RANGE,
57     LOT_ANIMATION_ERROR_ALREADY_IN_PROGRESS,
58     LOT_ANIMATION_ERROR_UNKNOWN
59 } LOTErrorType;
60
61 typedef enum
62 {
63     BrushSolid = 0,
64     BrushGradient
65 } LOTBrushType;
66
67 typedef enum
68 {
69     FillEvenOdd = 0,
70     FillWinding
71 } LOTFillRule;
72
73 typedef enum
74 {
75     JoinMiter = 0,
76     JoinBevel,
77     JoinRound
78 } LOTJoinStyle;
79
80 typedef enum
81 {
82     CapFlat = 0,
83     CapSquare,
84     CapRound
85 } LOTCapStyle;
86
87 typedef enum
88 {
89     GradientLinear = 0,
90     GradientRadial
91 } LOTGradientType;
92
93 typedef struct LOTGradientStop
94 {
95     float         pos;
96     unsigned char r, g, b, a;
97 } LOTGradientStop;
98
99 typedef enum
100 {
101     MaskModeAdd = 0,
102     MaskModeSubstract,
103     MaskModeIntersect,
104     MaskModeDifference
105 } LOTMaskMode;
106
107 typedef struct LOTMask {
108     struct {
109         const float *ptPtr;
110         int          ptCount;
111         const char*  elmPtr;
112         int          elmCount;
113     } mPath;
114     LOTMaskMode mMode;
115 }LOTMask;
116
117 typedef enum
118 {
119     MatteNone = 0,
120     MatteAlpha,
121     MatteAlphaInv,
122     MatteLuma,
123     MatteLumaInv
124 } LOTMatteType;
125
126 typedef struct LOTNode {
127
128 #define ChangeFlagNone 0x0000
129 #define ChangeFlagPath 0x0001
130 #define ChangeFlagPaint 0x0010
131 #define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
132
133     struct {
134         const float *ptPtr;
135         int          ptCount;
136         const char*  elmPtr;
137         int          elmCount;
138     } mPath;
139
140     struct {
141         unsigned char r, g, b, a;
142     } mColor;
143
144     struct {
145         unsigned char  enable;
146         int       width;
147         LOTCapStyle  cap;
148         LOTJoinStyle join;
149         int       meterLimit;
150         float*    dashArray;
151         int       dashArraySize;
152     } mStroke;
153
154     struct {
155         LOTGradientType type;
156         LOTGradientStop *stopPtr;
157         unsigned int stopCount;
158         struct {
159             float x, y;
160         } start, end, center, focal;
161         float cradius;
162         float fradius;
163     } mGradient;
164
165     int       mFlag;
166     LOTBrushType mBrushType;
167     LOTFillRule  mFillRule;
168 } LOTNode;
169
170
171
172 typedef struct LOTLayerNode {
173
174     struct {
175         LOTMask        *ptr;
176         unsigned int    size;
177     } mMaskList;
178
179     struct {
180         struct LOTLayerNode   **ptr;
181         unsigned int          size;
182     } mLayerList;
183
184     struct {
185         LOTNode       **ptr;
186         unsigned int   size;
187     } mNodeList;
188
189     LOTMatteType mMatte;
190     int          mVisible;
191
192 } LOTLayerNode;
193
194 /**
195  * @}
196  */
197
198 #endif  // _LOTTIE_COMMON_H_