#define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual bool Load(const std::string& url) = 0;
/**
+ * @brief Loads the animation file by buffer.
+ *
+ * @param[in] data The raw buffer of the vector animation file
+ * @return True if loading success, false otherwise.
+ */
+ virtual bool Load(const Dali::Vector<uint8_t>& data) = 0;
+
+ /**
* @brief Sets the renderer used to display the result image.
*
* @param[in] renderer The renderer used to display the result image
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(*this).Load(url);
}
+bool VectorAnimationRenderer::Load(const Dali::Vector<uint8_t>& data)
+{
+ return GetImplementation(*this).Load(data);
+}
+
void VectorAnimationRenderer::SetRenderer(Renderer renderer)
{
GetImplementation(*this).SetRenderer(renderer);
#define DALI_VECTOR_ANIMATION_RENDERER_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
bool Load(const std::string& url);
/**
+ * @brief Loads the animation file by buffer.
+ *
+ * @param[in] data The raw buffer of the vector animation file
+ * @return True if loading success, false otherwise.
+ */
+ bool Load(const Dali::Vector<uint8_t>& data);
+
+ /**
* @brief Sets the renderer used to display the result image.
*
* @param[in] renderer The renderer used to display the result image
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return mPlugin.Load(url);
}
+bool VectorAnimationRenderer::Load(const Vector<uint8_t>& data)
+{
+ return mPlugin.Load(data);
+}
+
void VectorAnimationRenderer::SetRenderer(Dali::Renderer renderer)
{
mPlugin.SetRenderer(renderer);
#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool Load(const std::string& url);
/**
+ * @copydoc Dali::VectorAnimationRenderer::Load()
+ */
+ bool Load(const Vector<uint8_t>& data);
+
+ /**
* @copydoc Dali::VectorAnimationRenderer::SetRenderer()
*/
void SetRenderer(Dali::Renderer renderer);
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return false;
}
+bool VectorAnimationRendererPluginProxy::Load(const Vector<uint8_t>& data)
+{
+ if(mPlugin)
+ {
+ return mPlugin->Load(data);
+ }
+ return false;
+}
+
void VectorAnimationRendererPluginProxy::SetRenderer(Dali::Renderer renderer)
{
if(mPlugin)
#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool Load(const std::string& url);
/**
+ * @copydoc Dali::VectorAnimationRendererPlugin::Load()
+ */
+ bool Load(const Vector<uint8_t>& data);
+
+ /**
* @copydoc Dali::VectorAnimationRendererPlugin::SetRenderer()
*/
void SetRenderer(Dali::Renderer renderer);