[dali_1.4.42] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visuals / image-visual-properties-devel.h
index ce15c21..1c54511 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -45,83 +45,147 @@ enum Type
   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,
 
   /**
-   * @brief The border of the image
-   * @details Name "border", type Property::RECTANGLE or Property::VECTOR4
-   *          The border of the image in the order: left, right, bottom, top.
+   * @brief Overlays the auxiliary image on top of an NPatch image.
    *
-   * @note Optional.
-   * @note For N-Patch images only.
+   * The resulting visual image will be at least as large as the
+   * smallest possible n-patch or the auxiliary image, whichever is
+   * larger.
+   *
+   * @details Name "auxiliaryImage", Type Property::STRING, URL of the image.
+   * @note Default true
    */
-  BORDER = WRAP_MODE_V + 1,
+  AUXILIARY_IMAGE = ORIENTATION_CORRECTION + 1,
 
   /**
-   * @brief Whether to use the texture atlas
-   * @details Name "atlasing", type Property::BOOLEAN, true to enable texture atlas
-   *
-   * @note Optional. By default atlasing is off.
+   * @brief An alpha value for mixing between the masked main NPatch image and the auxiliary image
+   * @details Name "auxiliaryImageAlpha", Type Property::FLOAT, between 0 and 1
+   * @note Default 0
    */
-
-  ATLASING = WRAP_MODE_V + 2,
+  AUXILIARY_IMAGE_ALPHA = ORIENTATION_CORRECTION + 2,
 
   /**
-   * @brief URL of a masking image
-   * @details Name "alphaMaskUrl", type Property::STRING, URL of image to apply as
-   * a mask after image loading. If set after the main URL has finished loading, this
-   * may necessitate a re-load of the main image. The alpha mask image will be scaled
-   * on load to match the size of the main image, then applied to the pixel data
-   * before uploading to GL.
-   * @note Optional.
+   * @brief The number of times the AnimatedImageVisual or AnimatedVectorImageVisual will be looped.
+   * @details Name "loopCount", type Property::INTEGER.
+   * @note For Animated images only. Default -1. if < 0, loop unlimited. else, loop loopCount times.
    */
+  LOOP_COUNT = ORIENTATION_CORRECTION + 3,
 
-  ALPHA_MASK_URL = WRAP_MODE_V + 3,
+  /**
+   * @brief The playing range the AnimatedVectorImageVisual will use.
+   *
+   * Animation will play between the values specified. The array can only have two values, and more will be ignored.
+   * Both values should be between 0 and the total frame number, otherwise they will be ignored.
+   * If the range provided is not in proper order ( minimum, maximum ), it will be reordered.
+   *
+   * @details Name "playRange", Type Property::ARRAY of Property::INTEGER
+   * @note Default 0 and the total frame number.
+   */
+  PLAY_RANGE = ORIENTATION_CORRECTION + 4,
 
   /**
-   * @brief Defines the batch size for pre-loading images in the AnimatedImageVisual
-   * @details Name "batchSize", type Property::INTEGER, number of images to pre-load
-   * before starting to play. Default value: 1
+   * @brief The playing state the AnimatedVectorImageVisual will use.
+   * @details Name "playState", Type PlayState::Type (Property::INTEGER)
+   * @note This property is read-only.
    */
-  BATCH_SIZE = WRAP_MODE_V + 4,
+  PLAY_STATE = ORIENTATION_CORRECTION + 5,
 
   /**
-   * @brief Defines the cache size for loading images in the AnimatedImageVisual
-   * @details Name "cacheSize", type Property::INTEGER, number of images to keep
-   * cached ahead during playback. Default value: 1
-   *
-   * @note, cacheSize should be >= batchSize.
-   * If it isn't, then the cache will automatically be changed to batchSize.
-   * @note, because of the defaults, it is expected that the application developer
-   * tune the batch and cache sizes to their particular use case.
+   * @brief The current frame number the 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.
    */
-  CACHE_SIZE = WRAP_MODE_V + 5,
+  CURRENT_FRAME_NUMBER = ORIENTATION_CORRECTION + 6,
 
   /**
-   * @brief The number of milliseconds between each frame in the AnimatedImageVisual
-   * @details Name "frameDelay", type Property::INTEGER, The number of milliseconds between each frame. Note, this is only used with the URLS property above.
+   * @brief The total frame number the AnimatedVectorImageVisual will use.
+   * @details Name "totalFrameNumber", Type Property::INTEGER.
+   * @note This property is read-only.
    */
-  FRAME_DELAY = WRAP_MODE_V + 6,
+  TOTAL_FRAME_NUMBER = ORIENTATION_CORRECTION + 7,
 
   /**
-   * @brief The scale factor to apply to the content image before masking
-   * @details Name "maskContentScale", type Property::FLOAT, The scale factor
-   * to apply to the content before masking. Note, scaled images are cropped to
-   * the same size as the alpha mask.
+   * @brief  The stop behavior the AnimatedVectorImageVisual will use.
+   * @details Name "stopBehavior", Type StopBehavior::Type (Property::INTEGER)
+   * @note Default value is StopBehavior::CURRENT_FRAME.
    */
-  MASK_CONTENT_SCALE = WRAP_MODE_V + 7,
+  STOP_BEHAVIOR = ORIENTATION_CORRECTION + 8,
 
   /**
-   * @brief Whether to crop image to mask or scale mask to fit image
-   * @details Name "cropToMask", type Property::BOOLEAN, True if the image should
-   * be cropped to match the mask size, or false if the image should remain the same size.
-   * Note, if this is false, then the mask is scaled to fit the image before being applied.
+   * @brief  The looping mode the AnimatedVectorImageVisual will use.
+   * @details Name "loopingMode", Type LoopingMode::Type (Property::INTEGER)
+   * @note Default value is LoopingMode::RESTART.
    */
-  CROP_TO_MASK = WRAP_MODE_V + 8,
+  LOOPING_MODE = ORIENTATION_CORRECTION + 9,
 
+  /**
+   * @brief The content information the AnimatedVectorImageVisual will use.
+   * @details Name "contentInfo", 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
 };
 
 } //namespace Property
 
+/**
+ * @brief Enumeration for what state the animation is in.
+ */
+namespace PlayState
+{
+
+enum Type
+{
+  STOPPED,   ///< Animation has stopped
+  PLAYING,   ///< The animation is playing
+  PAUSED     ///< The animation is paused
+};
+
+} // namespace PlayState
+
+/**
+ * @brief Enumeration for what to do when the animation is stopped.
+ */
+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.
+};
+
+} // namespace StopBehavoir
+
+/**
+ * @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.
+};
+
+} // namespace LoopingMode
+
 } // namespace DevelImageVisual
 
 } // namespace Toolkit