CanvasRenderer: Add Set/GetViewBox() API
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / vector-image-renderer-plugin.h
1 #ifndef DALI_VECTOR_IMAGE_RENDERER_PLUGIN_H
2 #define DALI_VECTOR_IMAGE_RENDERER_PLUGIN_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
23
24 namespace Dali
25 {
26 /**
27  * VectorImageRendererPlugin is an abstract interface, used by dali-adaptor to render a vector image(SVG).
28  * A concrete implementation must be created for each platform and provided as a dynamic library which
29  * will be loaded at run time by the adaptor.
30  */
31 class VectorImageRendererPlugin
32 {
33 public:
34   /**
35    * @brief Constructor
36    */
37   VectorImageRendererPlugin()
38   {
39   }
40
41   /**
42    * @brief Destructor
43    */
44   virtual ~VectorImageRendererPlugin()
45   {
46   }
47
48   /**
49    * @brief Load vector image data directly.
50    *
51    * @param[in] data The memory data of vector image
52    * @return True if the load success, false otherwise.
53    */
54   virtual bool Load(const Vector<uint8_t>& data) = 0;
55
56   /**
57    * @brief Rasterizes the content to the target buffer synchronously.
58    *
59    * @param[in] buffer The target buffer
60    * @return True if the rendering succeeds, false otherwise.
61    */
62   virtual bool Rasterize(Dali::Devel::PixelBuffer& buffer) = 0;
63
64   /**
65    * @brief Gets the default size of the file.
66    *
67    * @param[out] width The default width of the file
68    * @param[out] height The default height of the file
69    */
70   virtual void GetDefaultSize(uint32_t& width, uint32_t& height) const = 0;
71
72   /**
73    * @brief Function pointer called in adaptor to create a plugin instance.
74    */
75   using CreateVectorImageRendererFunction = VectorImageRendererPlugin* (*)();
76 };
77
78 } // namespace Dali
79
80 #endif // DALI_VECTOR_IMAGE_RENDERER_PLUGIN_H