1 #ifndef DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H
2 #define DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/devel-api/adaptor-framework/vector-image-renderer-plugin.h>
23 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
35 * Proxy class to dynamically load, use and unload vector image renderer plugin.
37 class VectorImageRendererPluginProxy
44 VectorImageRendererPluginProxy( std::string sharedObjectName );
49 ~VectorImageRendererPluginProxy();
52 * @brief Query whether the plugin is valid or not.
53 * @return True if valid, false otherwise
58 * @copydoc Dali::VectorImageRendererPlugin::Load()
60 bool Load(const Vector<uint8_t>& data);
63 * @copydoc Dali::VectorImageRendererPlugin::Rasterize()
65 bool Rasterize(Dali::Devel::PixelBuffer& buffer, float scale);
68 * @copydoc Dali::VectorImageRendererPlugin::GetDefaultSize()
70 void GetDefaultSize(uint32_t& width, uint32_t& height) const;
72 // Not copyable or movable
73 VectorImageRendererPluginProxy( const VectorImageRendererPluginProxy& ) = delete; ///< Deleted copy constructor
74 VectorImageRendererPluginProxy( VectorImageRendererPluginProxy&& ) = delete; ///< Deleted move constructor
75 VectorImageRendererPluginProxy& operator=( const VectorImageRendererPluginProxy& ) = delete; ///< Deleted copy assignment operator
76 VectorImageRendererPluginProxy& operator=( VectorImageRendererPluginProxy&& ) = delete; ///< Deleted move assignment operator
81 * Dynamically loads the plugin.
83 void InitializePlugin();
87 using CreateVectorImageRendererFunction = Dali::VectorImageRendererPlugin* (*)();
89 std::string mSharedObjectName; ///< Shared object name
90 void* mLibHandle; ///< Handle for the loaded library
91 Dali::VectorImageRendererPlugin* mPlugin; ///< Plugin handle
93 CreateVectorImageRendererFunction mCreateVectorImageRendererPtr; ///< Function pointer called in adaptor to create a plugin instance
97 } // namespace Adaptor
99 } // namespace Internal
103 #endif // DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H