[Adaptation Layer] Added rive-tizen adaptation layer class.
[platform/core/uifw/rive-tizen.git] / submodule / skia / recorder / include / extractor.hpp
1 #ifndef EXTRACTOR_HPP
2 #define EXTRACTOR_HPP
3
4 #include "SkData.h"
5 #include "SkImage.h"
6 #include "SkPixmap.h"
7 #include "SkStream.h"
8 #include "SkSurface.h"
9 #include "animation/animation.hpp"
10 #include "animation/linear_animation.hpp"
11 #include "animation/linear_animation_instance.hpp"
12 #include "artboard.hpp"
13 #include "core/binary_reader.hpp"
14 #include "file.hpp"
15 #include "math/aabb.hpp"
16 #include "skia_renderer.hpp"
17 #include "util.hpp"
18 #include "util.hxx"
19
20 class RiveFrameExtractor
21 {
22
23 public:
24         RiveFrameExtractor(const char* path,
25                            const char* artboard_name,
26                            const char* animation_name,
27                            const char* watermark_name,
28                            int width = 0,
29                            int height = 0,
30                            int small_extent_target = 0,
31                            int max_width = 0,
32                            int max_height = 0,
33                            int min_duration = 0,
34                            int max_duration = 0,
35                            float fps = 0);
36         ~RiveFrameExtractor();
37
38         int width();
39         int height();
40         int totalFrames();
41         float fps();
42         void advanceFrame();
43         const void* getPixelAddresses();
44         sk_sp<SkData> getSkData();
45
46 private:
47         int _width, _height, _min_duration, _max_duration;
48         rive::File* riveFile;
49         float ifps, _fps;
50         sk_sp<SkImage> getWaterMark(const char* watermark_name);
51         rive::File* getRiveFile(const char* path);
52         rive::Artboard* getArtboard(const char* artboard_name);
53         rive::LinearAnimation* getAnimation(const char* artboard_name);
54         rive::Artboard* artboard;
55         rive::LinearAnimation* animation;
56         rive::LinearAnimationInstance* animation_instance;
57         sk_sp<SkImage> watermarkImage;
58         SkCanvas* rasterCanvas;
59         sk_sp<SkSurface> rasterSurface;
60         sk_sp<SkImage> getSnapshot();
61         void initializeDimensions(int width,
62                                   int height,
63                                   int small_extent_target,
64                                   int max_width,
65                                   int max_height);
66 };
67
68 #endif