2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/vector-animation/common/vector-animation-renderer-impl.h>
22 #include <dali/public-api/object/type-registry.h>
32 namespace // unnamed namespace
35 Dali::BaseHandle Create()
37 return Dali::BaseHandle();
40 Dali::TypeRegistration type(typeid(Dali::VectorAnimationRenderer), typeid(Dali::BaseHandle), Create);
42 } // unnamed namespace
44 VectorAnimationRendererPtr VectorAnimationRenderer::New()
46 VectorAnimationRendererPtr renderer = new VectorAnimationRenderer();
50 VectorAnimationRenderer::VectorAnimationRenderer()
51 : mPlugin(std::string())
55 VectorAnimationRenderer::~VectorAnimationRenderer()
59 void VectorAnimationRenderer::Finalize()
64 bool VectorAnimationRenderer::Load(const std::string& url)
66 return mPlugin.Load(url);
69 bool VectorAnimationRenderer::Load(const Vector<uint8_t>& data)
71 return mPlugin.Load(data);
74 void VectorAnimationRenderer::SetRenderer(Dali::Renderer renderer)
76 mPlugin.SetRenderer(renderer);
79 void VectorAnimationRenderer::SetSize(uint32_t width, uint32_t height)
81 mPlugin.SetSize(width, height);
84 bool VectorAnimationRenderer::Render(uint32_t frameNumber)
86 return mPlugin.Render(frameNumber);
89 void VectorAnimationRenderer::RenderStopped()
91 mPlugin.RenderStopped();
94 uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
96 return mPlugin.GetTotalFrameNumber();
99 float VectorAnimationRenderer::GetFrameRate() const
101 return mPlugin.GetFrameRate();
104 void VectorAnimationRenderer::GetDefaultSize(uint32_t& width, uint32_t& height) const
106 mPlugin.GetDefaultSize(width, height);
109 void VectorAnimationRenderer::GetLayerInfo(Property::Map& map) const
111 mPlugin.GetLayerInfo(map);
114 bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const
116 return mPlugin.GetMarkerInfo(marker, startFrame, endFrame);
119 void VectorAnimationRenderer::GetMarkerInfo(Property::Map& map) const
121 mPlugin.GetMarkerInfo(map);
124 void VectorAnimationRenderer::InvalidateBuffer()
126 mPlugin.InvalidateBuffer();
129 void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id)
131 mPlugin.AddPropertyValueCallback(keyPath, property, callback, id);
134 void VectorAnimationRenderer::KeepRasterizedBuffer()
136 mPlugin.KeepRasterizedBuffer();
139 Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
141 return mPlugin.UploadCompletedSignal();
144 } // namespace Adaptor
146 } // namespace Internal