1 #ifndef DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
2 #define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
5 * Copyright (c) 2018 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>
29 * VectorAnimationRendererPlugin is an abstract interface, used by dali-adaptor to render a vector animation.
30 * A concrete implementation must be created for each platform and provided as a dynamic library which
31 * will be loaded at run time by the adaptor.
33 class VectorAnimationRendererPlugin
40 VectorAnimationRendererPlugin() {}
45 virtual ~VectorAnimationRendererPlugin() {}
48 * @brief Creates a renderer to render an vector animation file.
50 * @param[in] url The url of an animation file
51 * @param[in] renderer The renderer used to render the image
52 * @param[in] width The target image width
53 * @param[in] height The target image height
54 * @return True if the renderer is successfully created, false otherwise
56 virtual bool CreateRenderer( const std::string& url, Renderer renderer, uint32_t width, uint32_t height ) = 0;
59 * @brief Starts the rendering.
61 * @return True if the renderer is successfully started, false otherwise
63 virtual bool StartRender() = 0;
66 * @brief Stops the rendering.
68 virtual void StopRender() = 0;
71 * @brief Renders the content to the target buffer synchronously.
73 * @param[in] frameNumber The frame number to be rendered
75 virtual void Render( uint32_t frameNumber ) = 0;
78 * @brief Gets the total number of frames of the file
80 * @return The total number of frames
82 virtual uint32_t GetTotalFrameNumber() = 0;
85 * @brief Function pointer called in adaptor to create a plugin instance.
87 using CreateVectorAnimationRendererFunction = VectorAnimationRendererPlugin* (*)();
92 #endif // DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H