summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsubhransu mohanty <sub.mohanty@samsung.com>2018-07-11 14:10:07 +0900
committersubhransu mohanty <sub.mohanty@samsung.com>2018-07-11 14:10:07 +0900
commitd22af26b252a88fb0f3173d55f5cce7f564712e4 (patch)
tree0e4705ef87a5b654a373a00fd5f9dd82870896d1
parent8299967b00096d7c7985592687304183aaf85a37 (diff)
lottie: renamed include to inc folder
-rw-r--r--inc/lottieplayer.h149
-rw-r--r--inc/meson.build (renamed from include/meson.build)0
-rw-r--r--include/lottieplayer.h149
-rw-r--r--meson.build4
4 files changed, 151 insertions, 151 deletions
diff --git a/inc/lottieplayer.h b/inc/lottieplayer.h
new file mode 100644
index 0000000..dfda152
--- /dev/null
+++ b/inc/lottieplayer.h
@@ -0,0 +1,149 @@
1#ifndef LOTPLAYER_H
2#define LOTPLAYER_H
3
4#include <vector>
5#include <future>
6
7#ifdef _WIN32
8# ifdef LOT_BUILD
9# ifdef DLL_EXPORT
10# define LOT_EXPORT __declspec(dllexport)
11# else
12# define LOT_EXPORT
13# endif
14# else
15# define LOT_EXPORT __declspec(dllimport)
16# endif
17#else
18# ifdef __GNUC__
19# if __GNUC__ >= 4
20# define LOT_EXPORT __attribute__ ((visibility("default")))
21# else
22# define LOT_EXPORT
23# endif
24# else
25# define LOT_EXPORT
26# endif
27#endif
28
29class LOTPlayerPrivate;
30class LOTNode;
31
32struct LOT_EXPORT LOTBuffer
33{
34 uint32_t *buffer;
35 int width;
36 int height;
37 int bytesPerLine;
38 bool clear;
39};
40
41class LOT_EXPORT LOTPlayer
42{
43public:
44 ~LOTPlayer();
45 LOTPlayer();
46
47 LOTPlayer(const char *filePath);
48
49 bool setFilePath(const char *filePath);
50
51 void setSize(int width, int height);
52 void size(int &width, int &height) const;
53
54 int frameRate() const;
55
56 void setFrameRate(int frameRate);
57
58 float playTime() const;
59
60 void seek(float pos);
61
62 const std::vector<LOTNode *>& renderList() const;
63
64 std::future<bool> render(float pos, const LOTBuffer &buffer);
65 bool renderSync(float pos, const LOTBuffer &buffer);
66
67public:
68 LOTPlayerPrivate *d;
69};
70
71#define ChangeFlagNone 0x0000
72#define ChangeFlagPath 0x0001
73#define ChangeFlagPaint 0x0010
74#define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
75
76class LOT_EXPORT LOTNode
77{
78public:
79 struct PathData {
80 const float *ptPtr;
81 int ptCount;
82 const char *elmPtr;
83 int elmCount;
84 };
85 struct Color {
86 unsigned short r, g, b, a;
87 };
88
89 enum BrushType {
90 BrushSolid,
91 BrushGradient
92 };
93 enum FillRule {
94 EvenOdd,
95 Winding
96 };
97
98 enum JoinStyle {
99 MiterJoin,
100 BevelJoin,
101 RoundJoin
102 };
103
104 enum CapStyle {
105 FlatCap,
106 SquareCap,
107 RoundCap
108 };
109
110 struct Stroke {
111 bool enable;
112 int width;
113 CapStyle cap;
114 JoinStyle join;
115 int meterLimit;
116 float *dashArray;
117 int dashArraySize;
118 };
119
120 struct Gradient {
121 enum Type {
122 Linear = 1,
123 Radial = 2
124 };
125 Gradient::Type type;
126 struct {
127 float x, y;
128 } start, end;
129 struct {
130 float x, y;
131 } center, focal;
132 float cradius;
133 float fradius;
134 };
135
136 ~LOTNode();
137 LOTNode();
138
139public:
140 int mFlag;
141 LOTNode::BrushType mType;
142 FillRule mFillRule;
143 PathData mPath;
144 Color mColor;
145 Stroke mStroke;
146 Gradient mGradient;
147};
148
149#endif // LOTPLAYER_H
diff --git a/include/meson.build b/inc/meson.build
index 0b4bb41..0b4bb41 100644
--- a/include/meson.build
+++ b/inc/meson.build
diff --git a/include/lottieplayer.h b/include/lottieplayer.h
deleted file mode 100644
index d25f62c..0000000
--- a/include/lottieplayer.h
+++ /dev/null
@@ -1,149 +0,0 @@
1#ifndef LOTPLAYER_H
2#define LOTPLAYER_H
3
4#include <vector>
5#include <future>
6
7#ifdef _WIN32
8# ifdef LOT_BUILD
9# ifdef DLL_EXPORT
10# define LOT_EXPORT __declspec(dllexport)
11# else
12# define LOT_EXPORT
13# endif
14# else
15# define LOT_EXPORT __declspec(dllimport)
16# endif
17#else
18# ifdef __GNUC__
19# if __GNUC__ >= 4
20# define LOT_EXPORT __attribute__ ((visibility("default")))
21# else
22# define LOT_EXPORT
23# endif
24# else
25# define LOT_EXPORT
26# endif
27#endif
28
29class LOTPlayerPrivate;
30class LOTNode;
31
32struct LOT_EXPORT LOTBuffer
33{
34 uint32_t *buffer;
35 int width;
36 int height;
37 int bytesPerLine;
38 bool clear;
39};
40
41class LOT_EXPORT LOTPlayer
42{
43public:
44 ~LOTPlayer();
45 LOTPlayer();
46
47 LOTPlayer(const char *filePath);
48
49 bool setFilePath(const char *filePath);
50
51 void setSize(int width, int height);
52 void size(int &width, int &height) const;
53
54 int frameRate() const;
55
56 void setFrameRate(int frameRate);
57
58 float playTime() const;
59
60 void seek(float pos);
61
62 const std::vector<LOTNode *>& renderList()const;
63
64 std::future<bool> render(float pos, const LOTBuffer &buffer);
65 bool renderSync(float pos, const LOTBuffer &buffer);
66
67public:
68 LOTPlayerPrivate *d;
69};
70
71#define ChangeFlagNone 0x0000
72#define ChangeFlagPath 0x0001
73#define ChangeFlagPaint 0x0010
74#define ChangeFlagAll (ChangeFlagPath & ChangeFlagPaint)
75
76class LOT_EXPORT LOTNode
77{
78public:
79 struct PathData {
80 const float *ptPtr;
81 int ptCount;
82 const char *elmPtr;
83 int elmCount;
84 };
85 struct Color {
86 unsigned short r, g, b, a;
87 };
88
89 enum BrushType {
90 BrushSolid,
91 BrushGradient
92 };
93 enum FillRule {
94 EvenOdd,
95 Winding
96 };
97
98 enum JoinStyle {
99 MiterJoin,
100 BevelJoin,
101 RoundJoin
102 };
103
104 enum CapStyle {
105 FlatCap,
106 SquareCap,
107 RoundCap
108 };
109
110 struct Stroke {
111 bool enable;
112 int width;
113 CapStyle cap;
114 JoinStyle join;
115 int meterLimit;
116 float *dashArray;
117 int dashArraySize;
118 };
119
120 struct Gradient{
121 enum Type {
122 Linear = 1,
123 Radial = 2
124 };
125 Gradient::Type type;
126 struct {
127 float x, y;
128 } start, end;
129 struct {
130 float x, y;
131 } center, focal;
132 float cradius;
133 float fradius;
134 };
135
136 ~LOTNode();
137 LOTNode();
138
139public:
140 int mFlag;
141 LOTNode::BrushType mType;
142 FillRule mFillRule;
143 PathData mPath;
144 Color mColor;
145 Stroke mStroke;
146 Gradient mGradient;
147};
148
149#endif // LOTPLAYER_H
diff --git a/meson.build b/meson.build
index 8e119ea..755209e 100644
--- a/meson.build
+++ b/meson.build
@@ -11,9 +11,9 @@ endif
11 11
12add_global_arguments(compiler_flags, language: 'cpp') 12add_global_arguments(compiler_flags, language: 'cpp')
13 13
14inc = include_directories('include') 14inc = include_directories('inc')
15 15
16subdir('include') 16subdir('inc')
17subdir('src') 17subdir('src')
18 18
19subdir('example') 19subdir('example')