1 #ifndef DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
2 #define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
5 * Copyright (c) 2022 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/object/base-object.h>
25 #include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
26 #include <dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h>
34 class VectorAnimationRenderer;
35 using VectorAnimationRendererPtr = IntrusivePtr<VectorAnimationRenderer>;
38 * Dali internal VectorAnimationRenderer.
40 class VectorAnimationRenderer : public BaseObject, public ConnectionTracker
44 * @brief Creates a VectorAnimationRenderer object.
46 * @param[in] url The url of the vector animation file
48 static VectorAnimationRendererPtr New();
51 * @copydoc Dali::VectorAnimationRenderer::Finalize()
56 * @copydoc Dali::VectorAnimationRenderer::Load()
58 bool Load(const std::string& url);
61 * @copydoc Dali::VectorAnimationRenderer::SetRenderer()
63 void SetRenderer(Dali::Renderer renderer);
66 * @copydoc Dali::VectorAnimationRenderer::SetSize()
68 void SetSize(uint32_t width, uint32_t height);
71 * @copydoc Dali::VectorAnimationRenderer::Render()
73 bool Render(uint32_t frameNumber);
76 * @copydoc Dali::VectorAnimationRenderer::RenderStopped()
81 * @copydoc Dali::VectorAnimationRenderer::GetTotalFrameNumber()
83 uint32_t GetTotalFrameNumber() const;
86 * @copydoc Dali::VectorAnimationRenderer::GetFrameRate()
88 float GetFrameRate() const;
91 * @copydoc Dali::VectorAnimationRenderer::GetDefaultSize()
93 void GetDefaultSize(uint32_t& width, uint32_t& height) const;
96 * @copydoc Dali::VectorAnimationRenderer::GetLayerInfo()
98 void GetLayerInfo(Property::Map& map) const;
101 * @copydoc Dali::VectorAnimationRenderer::GetMarkerInfo()
103 bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
106 * @copydoc Dali::VectorAnimationRenderer::InvalidateBuffer()
108 void InvalidateBuffer();
111 * @copydoc Dali::VectorAnimationRenderer::AddPropertyValueCallback()
113 void AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id);
115 void KeepRasterizedBuffer();
118 * @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal()
120 Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal();
126 VectorAnimationRenderer();
131 ~VectorAnimationRenderer();
134 VectorAnimationRenderer(const VectorAnimationRenderer&) = delete;
135 VectorAnimationRenderer& operator=(VectorAnimationRenderer&) = delete;
138 VectorAnimationRendererPluginProxy mPlugin;
141 } // namespace Adaptor
143 } // namespace Internal
145 inline static Internal::Adaptor::VectorAnimationRenderer& GetImplementation(Dali::VectorAnimationRenderer& renderer)
147 DALI_ASSERT_ALWAYS(renderer && "VectorAnimationRenderer handle is empty.");
149 BaseObject& handle = renderer.GetBaseObject();
151 return static_cast<Internal::Adaptor::VectorAnimationRenderer&>(handle);
154 inline static const Internal::Adaptor::VectorAnimationRenderer& GetImplementation(const Dali::VectorAnimationRenderer& renderer)
156 DALI_ASSERT_ALWAYS(renderer && "VectorAnimationRenderer handle is empty.");
158 const BaseObject& handle = renderer.GetBaseObject();
160 return static_cast<const Internal::Adaptor::VectorAnimationRenderer&>(handle);
165 #endif // DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H