#define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
public:
using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
+ using VectorProperty = Dali::VectorAnimationRenderer::VectorProperty;
/**
* @brief Constructor
}
/**
- * @brief Second-phase constructor.
- *
- * @param[in] url The url of the animation file
+ * @brief Finalizes the renderer. It will be called in the main thread.
*/
- virtual bool Initialize(const std::string& url) = 0;
+ virtual void Finalize() = 0;
/**
- * @brief Finalizes the renderer. It will be called in the main thread.
+ * @brief Loads the animation file.
+ *
+ * @param[in] url The url of the vector animation file
+ * @return True if loading success, false otherwise.
*/
- virtual void Finalize() = 0;
+ virtual bool Load(const std::string& url) = 0;
/**
* @brief Sets the renderer used to display the result image.
virtual bool Render(uint32_t frameNumber) = 0;
/**
+ * @brief Notify the Renderer that rendering is stopped.
+ */
+ virtual void RenderStopped() = 0;
+
+ /**
* @brief Gets the total number of frames of the file.
*
* @return The total number of frames
virtual bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const = 0;
/**
- * @brief Ignores a rendered frame which is not shown yet.
+ * @brief Invalidates the rendered buffer.
+ * @note The upload completed signal will be emitted again.
*/
- virtual void IgnoreRenderedFrame() = 0;
+ virtual void InvalidateBuffer() = 0;
+
+ /**
+ * @brief Sets property value for the specified keyPath. This keyPath can resolve to multiple contents.
+ * In that case, the callback's value will apply to all of them.
+ *
+ * @param[in] keyPath The key path used to target a specific content or a set of contents that will be updated.
+ * @param[in] property The property to set.
+ * @param[in] callback The callback what gets called every time the animation is rendered.
+ * @param[in] id The Id to specify the callback. It should be unique and will be passed when the callback is called.
+ *
+ * @note A callback of the following type may be used:
+ * id The id to specify the callback.
+ * property The property that represent what you are trying to change.
+ * frameNumber The current frame number.
+ * It returns a Property::Value to set according to the property type.
+ *
+ * @code
+ * Property::Value MyFunction(int32_t id, VectorProperty property, uint32_t frameNumber);
+ * @endcode
+ *
+ * The keypath should conatin object names separated by (.) and can handle globe(**) or wildchar(*).
+ * Ownership of the callback is passed onto this class.
+ */
+ virtual void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id) = 0;
+
+ virtual void KeepRasterizedBuffer() = 0;
/**
* @brief Connect to this signal to be notified when the texture upload is completed.