[dali_2.3.5] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / vector-animation-renderer.h
index 37cb214..cec206f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/rendering/renderer.h>
 
@@ -51,7 +52,7 @@ public:
     FILL_COLOR,         ///< Fill color of the object, Type Property::VECTOR3
     FILL_OPACITY,       ///< Fill opacity of the object, Type Property::FLOAT
     STROKE_COLOR,       ///< Stroke color of the object, Type Property::VECTOR3
-    STROKE_OPACTY,      ///< Stroke opacity of the object, Type Property::FLOAT
+    STROKE_OPACITY,     ///< Stroke opacity of the object, Type Property::FLOAT
     STROKE_WIDTH,       ///< Stroke width of the object, Type Property::FLOAT
     TRANSFORM_ANCHOR,   ///< Transform anchor of the Layer and Group object, Type Property::VECTOR2
     TRANSFORM_POSITION, ///< Transform position of the Layer and Group object, Type Property::VECTOR2
@@ -110,6 +111,14 @@ public:
   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
@@ -133,6 +142,11 @@ public:
   bool Render(uint32_t frameNumber);
 
   /**
+   * @brief Notify the Renderer that rendering is stopped.
+   */
+  void RenderStopped();
+
+  /**
    * @brief Gets the total number of frames of the file
    *
    * @return The total number of frames
@@ -177,6 +191,13 @@ public:
   bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
 
   /**
+   * @brief Gets the all composition marker informations.
+   *
+   * @param[out] map The marker information
+   */
+  void GetMarkerInfo(Property::Map& map) const;
+
+  /**
    * @brief Invalidates the rendered buffer.
    * @note The upload completed signal will be emitted again.
    */
@@ -206,6 +227,15 @@ public:
    */
   void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id);
 
+  /**
+   * @brief Keep the rasterized buffer to use the frame cache.
+   *
+   * By default, only as much as needed is kept in the rasterized buffer and not kept after use.
+   * tis API is efficient in terms of memory, but has the disadvantage of having to load the necessary buffer each time.
+   * therefore, if there are cases in which you want to improve the performance even if the app sacrifices a lot of memory, this API is useful.
+   */
+  void KeepRasterizedBuffer();
+
 public: // Signals
   /**
    * @brief Connect to this signal to be notified when the texture upload is completed.