1 #ifndef DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
2 #define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
5 * Copyright (c) 2019 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/public-api/rendering/renderer.h>
26 #include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
32 * VectorAnimationRendererPlugin is an abstract interface, used by dali-adaptor to render a vector animation.
33 * A concrete implementation must be created for each platform and provided as a dynamic library which
34 * will be loaded at run time by the adaptor.
36 class VectorAnimationRendererPlugin
40 using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
45 VectorAnimationRendererPlugin() {}
50 virtual ~VectorAnimationRendererPlugin() {}
53 * @brief Second-phase constructor.
55 * @param[in] url The url of the animation file
57 virtual bool Initialize( const std::string& url ) = 0;
60 * @brief Sets the renderer used to display the result image.
62 * @param[in] renderer The renderer used to display the result image
64 virtual void SetRenderer( Renderer renderer ) = 0;
67 * @brief Sets the target image size.
69 * @param[in] width The target image width
70 * @param[in] height The target image height
72 virtual void SetSize( uint32_t width, uint32_t height ) = 0;
75 * @brief Renders the content to the target buffer synchronously.
77 * @param[in] frameNumber The frame number to be rendered
78 * @return True if the rendering success, false otherwise.
80 virtual bool Render( uint32_t frameNumber ) = 0;
83 * @brief Gets the total number of frames of the file.
85 * @return The total number of frames
87 virtual uint32_t GetTotalFrameNumber() const = 0;
90 * @brief Gets the frame rate of the file.
92 * @return The frame rate of the file
94 virtual float GetFrameRate() const = 0;
97 * @brief Gets the default size of the file,.
99 * @return The default size of the file
101 virtual void GetDefaultSize( uint32_t& width, uint32_t& height ) const = 0;
104 * @brief Connect to this signal to be notified when the texture upload is completed.
106 * @return The signal to connect to.
108 virtual UploadCompletedSignalType& UploadCompletedSignal() = 0;
111 * @brief Function pointer called in adaptor to create a plugin instance.
113 using CreateVectorAnimationRendererFunction = VectorAnimationRendererPlugin* (*)();
118 #endif // DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H