[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / image-loader / async-image-loader-devel.h
index 99ca154..9073da7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H
 
 /*
- * Copyright (c) 2019 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.
  * limitations under the License.
  */
 
-#include <dali/public-api/signals/dali-signal.h>
+// EXTERNAL HEADER
+#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/signals/dali-signal.h>
+
+// INTERNAL HEADER
 #include <dali-toolkit/public-api/image-loader/async-image-loader.h>
 
 namespace Dali
@@ -27,8 +31,7 @@ namespace Toolkit
 {
 namespace DevelAsyncImageLoader
 {
-
-typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalType;
+typedef Signal<void(uint32_t, std::vector<Devel::PixelBuffer>&)> PixelBufferLoadedSignalType;
 
 /**
  * @brief Whether to multiply alpha into color channels on load
@@ -36,10 +39,25 @@ typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalT
 enum class PreMultiplyOnLoad
 {
   OFF = 0, ///< Don't modify the image
-  ON           ///< Multiply alpha into color channels on load
+  ON       ///< Multiply alpha into color channels on load
 };
 
 /**
+ * @brief Starts an animated image loading task.
+ * @REMARK_INTERNET
+ * @REMARK_STORAGE
+ * @param[in] asyncImageLoader The ayncImageLoader
+ * @param[in] animatedImageLoading The AnimatedImageLoading to load animated image
+ * @param[in] frameIndex The frame index of a frame to be loaded frame
+ * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha or if the image need to be applied alpha mask.
+ * @return The loading task id
+ */
+DALI_TOOLKIT_API uint32_t LoadAnimatedImage(AsyncImageLoader                         asyncImageLoader,
+                                            Dali::AnimatedImageLoading               animatedImageLoading,
+                                            uint32_t                                 frameIndex,
+                                            DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
+
+/**
  * @brief Starts an image loading task.
  * @REMARK_INTERNET
  * @REMARK_STORAGE
@@ -52,13 +70,13 @@ enum class PreMultiplyOnLoad
  * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha or if the image need to be applied alpha mask.
  * @return The loading task id
  */
-DALI_TOOLKIT_API uint32_t Load( AsyncImageLoader asyncImageLoader,
-                                const std::string& url,
-                                ImageDimensions dimensions,
-                                FittingMode::Type fittingMode,
-                                SamplingMode::Type samplingMode,
-                                bool orientationCorrection,
-                                DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad );
+DALI_TOOLKIT_API uint32_t Load(AsyncImageLoader                         asyncImageLoader,
+                               const std::string&                       url,
+                               ImageDimensions                          dimensions,
+                               FittingMode::Type                        fittingMode,
+                               SamplingMode::Type                       samplingMode,
+                               bool                                     orientationCorrection,
+                               DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
 
 /**
  * @brief Starts an mask applying task.
@@ -72,21 +90,21 @@ DALI_TOOLKIT_API uint32_t Load( AsyncImageLoader asyncImageLoader,
  * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha.
  * @return The masking task id
  */
-DALI_TOOLKIT_API uint32_t ApplyMask( AsyncImageLoader asyncImageLoader,
-                                     Devel::PixelBuffer pixelBuffer,
-                                     Devel::PixelBuffer maskPixelBuffer,
-                                     float contentScale,
-                                     bool cropToMask,
-                                     DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad );
+DALI_TOOLKIT_API uint32_t ApplyMask(AsyncImageLoader                         asyncImageLoader,
+                                    Devel::PixelBuffer                       pixelBuffer,
+                                    Devel::PixelBuffer                       maskPixelBuffer,
+                                    float                                    contentScale,
+                                    bool                                     cropToMask,
+                                    DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
 
 /**
  * Connect to this signal if you want to load a PixelBuffer instead of a PixelData.
  * @note Connecting to this signal prevents the emission of the ImageLoadedSignal.
  */
-DALI_TOOLKIT_API PixelBufferLoadedSignalType&  PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader );
+DALI_TOOLKIT_API PixelBufferLoadedSignalType& PixelBufferLoadedSignal(AsyncImageLoader asyncImageLoader);
 
-}
-} // Toolkit
-} // Dali
+} // namespace DevelAsyncImageLoader
+} // namespace Toolkit
+} // namespace Dali
 
 #endif