[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visuals / image-visual-properties-devel.h
index 5419799..90e868e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace DevelImageVisual
 {
-
 namespace Property
 {
-
 enum Type
 {
-  URL                 = Dali::Toolkit::ImageVisual::Property::URL,
-  FITTING_MODE        = Dali::Toolkit::ImageVisual::Property::FITTING_MODE,
-  SAMPLING_MODE       = Dali::Toolkit::ImageVisual::Property::SAMPLING_MODE,
-  DESIRED_WIDTH       = Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH,
-  DESIRED_HEIGHT      = Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT,
-  SYNCHRONOUS_LOADING = Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING,
-  BORDER_ONLY         = Dali::Toolkit::ImageVisual::Property::BORDER_ONLY,
-  PIXEL_AREA          = Dali::Toolkit::ImageVisual::Property::PIXEL_AREA,
-  WRAP_MODE_U         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_U,
-  WRAP_MODE_V         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_V,
-  BORDER              = Dali::Toolkit::ImageVisual::Property::BORDER,
-  ATLASING            = Dali::Toolkit::ImageVisual::Property::ATLASING,
-  ALPHA_MASK_URL      = Dali::Toolkit::ImageVisual::Property::ALPHA_MASK_URL,
-  BATCH_SIZE          = Dali::Toolkit::ImageVisual::Property::BATCH_SIZE,
-  CACHE_SIZE          = Dali::Toolkit::ImageVisual::Property::CACHE_SIZE,
-  FRAME_DELAY         = Dali::Toolkit::ImageVisual::Property::FRAME_DELAY,
-  MASK_CONTENT_SCALE  = Dali::Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE,
-  CROP_TO_MASK        = Dali::Toolkit::ImageVisual::Property::CROP_TO_MASK,
-  LOAD_POLICY         = Dali::Toolkit::ImageVisual::Property::LOAD_POLICY,
-  RELEASE_POLICY      = Dali::Toolkit::ImageVisual::Property::RELEASE_POLICY,
+  URL                    = Dali::Toolkit::ImageVisual::Property::URL,
+  FITTING_MODE           = Dali::Toolkit::ImageVisual::Property::FITTING_MODE,
+  SAMPLING_MODE          = Dali::Toolkit::ImageVisual::Property::SAMPLING_MODE,
+  DESIRED_WIDTH          = Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH,
+  DESIRED_HEIGHT         = Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT,
+  SYNCHRONOUS_LOADING    = Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING,
+  BORDER_ONLY            = Dali::Toolkit::ImageVisual::Property::BORDER_ONLY,
+  PIXEL_AREA             = Dali::Toolkit::ImageVisual::Property::PIXEL_AREA,
+  WRAP_MODE_U            = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_U,
+  WRAP_MODE_V            = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_V,
+  BORDER                 = Dali::Toolkit::ImageVisual::Property::BORDER,
+  ATLASING               = Dali::Toolkit::ImageVisual::Property::ATLASING,
+  ALPHA_MASK_URL         = Dali::Toolkit::ImageVisual::Property::ALPHA_MASK_URL,
+  BATCH_SIZE             = Dali::Toolkit::ImageVisual::Property::BATCH_SIZE,
+  CACHE_SIZE             = Dali::Toolkit::ImageVisual::Property::CACHE_SIZE,
+  FRAME_DELAY            = Dali::Toolkit::ImageVisual::Property::FRAME_DELAY,
+  MASK_CONTENT_SCALE     = Dali::Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE,
+  CROP_TO_MASK           = Dali::Toolkit::ImageVisual::Property::CROP_TO_MASK,
+  LOAD_POLICY            = Dali::Toolkit::ImageVisual::Property::LOAD_POLICY,
+  RELEASE_POLICY         = Dali::Toolkit::ImageVisual::Property::RELEASE_POLICY,
   ORIENTATION_CORRECTION = Dali::Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION,
 
   /**
@@ -95,7 +91,7 @@ enum Type
    * Animation will play between the start frame and the end frame of the marker if one marker is specified.
    * Or animation will play between the start frame of the first marker and the end frame of the second marker if two markers are specified.
    *
-   * @details Name "playRange", Type Property::ARRAY of Property::INTEGER or Property::ARRAY of Property::STRING.
+   * @details Name "playRange", Type Property::ARRAY of Property::INTEGER or Property::ARRAY of Property::STRING or Property::STRING (one marker).
    * @note Default 0 and the total frame number.
    */
   PLAY_RANGE = ORIENTATION_CORRECTION + 4,
@@ -108,21 +104,21 @@ enum Type
   PLAY_STATE = ORIENTATION_CORRECTION + 5,
 
   /**
-   * @brief The current frame number the AnimatedVectorImageVisual will use.
+   * @brief The current frame number the AnimatedImageVisual and AnimatedVectorImageVisual will use.
    * @details Name "currentFrameNumber", Type Property::INTEGER, between [0, the maximum frame number] or between the play range if specified
    * @note This property is read-only.
    */
   CURRENT_FRAME_NUMBER = ORIENTATION_CORRECTION + 6,
 
   /**
-   * @brief The total frame number the AnimatedVectorImageVisual will use.
+   * @brief The total frame number the AnimatedImageVisual and AnimatedVectorImageVisual will use.
    * @details Name "totalFrameNumber", Type Property::INTEGER.
    * @note This property is read-only.
    */
   TOTAL_FRAME_NUMBER = ORIENTATION_CORRECTION + 7,
 
   /**
-   * @brief  The stop behavior the AnimatedVectorImageVisual will use.
+   * @brief  The stop behavior the AnimatedImageVisual and AnimatedVectorImageVisual will use.
    * @details Name "stopBehavior", Type StopBehavior::Type (Property::INTEGER)
    * @note Default value is StopBehavior::CURRENT_FRAME.
    */
@@ -137,12 +133,84 @@ enum Type
 
   /**
    * @brief The content information the AnimatedVectorImageVisual will use.
-   * @details Name "contentInfo", Type Property::MAP.
+   * @details Type Property::MAP.
    * The map contains the layer name as a key and Property::Array as a value.
    * And the array contains 2 integer values which are the frame numbers, the start frame number and the end frame number of the layer.
    * @note This property is read-only.
    */
-  CONTENT_INFO = ORIENTATION_CORRECTION + 10
+  CONTENT_INFO = ORIENTATION_CORRECTION + 10,
+
+  /**
+   * @brief Whether to redraw the image when the visual is scaled down.
+   * @details Name "redrawInScalingDown", type Property::BOOLEAN.
+   * @note It is used in the AnimatedVectorImageVisual. The default is true.
+   */
+  REDRAW_IN_SCALING_DOWN = ORIENTATION_CORRECTION + 11,
+
+  /**
+   * @brief Whether to apply mask in loading time or rendering time.
+   * @details Name "maskingType", type PlayState::Type (Property::INTEGER).
+   * In general, MASKING_ON_LOADING is the default behavior.
+   * However, if the visual uses an external texture, only MASKING_ON_RENDERING is possible.
+   * So we change its value to MASKING_ON_RENDERING even if the visual sets the MASKING_TYPE as MASKING_ON_LOADING when it uses external texture.
+   * @note It is used in the ImageVisual and AnimatedImageVisual. The default is MASKING_ON_LOADING.
+   */
+  MASKING_TYPE = ORIENTATION_CORRECTION + 12,
+
+  /**
+   * @brief If true, uploads texture before ResourceReady signal is emitted. Otherwise uploads after texture load is completed.
+   * @details Name "fastTrackUploading", type Property::BOOLEAN
+   * If true, the upload happens without event-thread dependency, but the following need to be considered:
+   *  - Texture size is not valid until upload is fully complete.
+   *  - Texture cannot be cached (a new image is uploaded every time).
+   *  - Seamless visual change is not supported.
+   *  - The following, if set are also not supported and will be ignored:
+   *    - Alpha masking
+   *    - Synchronous loading
+   *    - Reload action
+   *    - Atlas loading
+   *    - Custom shader
+   * @note Used by the ImageVisual. The default is false.
+   */
+  FAST_TRACK_UPLOADING = ORIENTATION_CORRECTION + 13,
+
+  /**
+   * @brief Whether to enable broken image in image visual.
+   * Some of visual don't need to show broken image(ex. placeholder)
+   * Disable broken image for these visuals.
+   * default is true.
+   */
+  ENABLE_BROKEN_IMAGE = ORIENTATION_CORRECTION + 14,
+
+  /**
+   * @brief The marker information the AnimatedVectorImageVisual will use.
+   * @details Type Property::MAP.
+   * The map contains the marker name as a key and Property::Array as a value.
+   * And the array contains 2 integer values which are the frame numbers, the start frame number and the end frame number of the marker.
+   * @note This property is read-only.
+   */
+  MARKER_INFO = ORIENTATION_CORRECTION + 15,
+
+  /**
+   * @brief Whether to AnimatedVectorImageVisual fixed cache or not.
+   * @details Name "enableFrameCache", type Property::BOOLEAN.
+   * If this property is true, AnimatedVectorImageVisual enable frame cache for loading and keeps loaded frame
+   * until the visual is removed. It reduces CPU cost when the animated image will be looping.
+   * But it can spend a lot of memory if the resource has high resolution image or many frame count.
+   * @note It is used in the AnimatedVectorImageVisual. The default is false
+   */
+  ENABLE_FRAME_CACHE = ORIENTATION_CORRECTION + 16,
+
+  /**
+   * @brief Whether notify AnimatedVectorImageVisual to render thread after every rasterization or not.
+   * @details Name "notifyAfterRasterization", type Property::BOOLEAN.
+   * If this property is true, AnimatedVectorImageVisual send notify to render thread after every rasterization.
+   * If false, AnimatedVectorImageVisual set Renderer's Behaviour as Continouly (mean, always update the render thread.)
+   *
+   * This flag is useful if given resource has low fps, so we don't need to render every frame.
+   * @note It is used in the AnimatedVectorImageVisual. The default is false.
+   */
+  NOTIFY_AFTER_RASTERIZATION = ORIENTATION_CORRECTION + 17
 };
 
 } //namespace Property
@@ -152,12 +220,11 @@ enum Type
  */
 namespace PlayState
 {
-
 enum Type
 {
-  STOPPED,   ///< Animation has stopped
-  PLAYING,   ///< The animation is playing
-  PAUSED     ///< The animation is paused
+  STOPPED, ///< Animation has stopped
+  PLAYING, ///< The animation is playing
+  PAUSED   ///< The animation is paused
 };
 
 } // namespace PlayState
@@ -167,30 +234,41 @@ enum Type
  */
 namespace StopBehavior
 {
-
 enum Type
 {
-  CURRENT_FRAME,  ///< When the animation is stopped, the current frame is shown.
-  FIRST_FRAME,    ///< When the animation is stopped, the first frame is shown.
-  LAST_FRAME      ///< When the animation is stopped, the last frame is shown.
+  CURRENT_FRAME, ///< When the animation is stopped, the current frame is shown.
+  FIRST_FRAME,   ///< When the animation is stopped, the first frame is shown.
+  LAST_FRAME     ///< When the animation is stopped, the last frame is shown.
 };
 
-} // namespace StopBehavoir
+} // namespace StopBehavior
 
 /**
  * @brief Enumeration for what looping mode is in.
  */
 namespace LoopingMode
 {
-
 enum Type
 {
-  RESTART,      ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
-  AUTO_REVERSE  ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
+  RESTART,     ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
+  AUTO_REVERSE ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
 };
 
 } // namespace LoopingMode
 
+/**
+ * @brief Enumeration for what masking type is in.
+ */
+namespace MaskingType
+{
+enum Type
+{
+  MASKING_ON_RENDERING, ///< Alpha masking is applied for each rendering time. (On GPU)
+  MASKING_ON_LOADING    ///< Alpha masking is applied when the image is loading. (On CPU)
+};
+
+}
+
 } // namespace DevelImageVisual
 
 } // namespace Toolkit