[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / image-loader / image-url.h
index 819198b..7e5b700 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_IMAGE_URL_H
 
 /*
- * Copyright (c) 2021 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.
@@ -20,6 +20,7 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <dali/public-api/rendering/texture.h>
+#include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
@@ -39,6 +40,7 @@ class ImageUrl;
  * Application can get url from ImageUrl.
  * When application does not use this anymore, the destructor of the ImageUrl is called.
  * At this time, the buffer is deleted from the texture manager.
+ * @note Visual also have reference of the buffer. In this case, buffer will be deleted after visual is deleted.
  */
 class DALI_TOOLKIT_API ImageUrl : public BaseHandle
 {
@@ -58,9 +60,18 @@ public:
    * @brief Create an initialized ImageUrl.
    *
    * @param[in] texture The texture url is got from external buffer.
+   * @param[in] preMultiplied Whether this external texture preMultiplied or not. Default as false.
    * @return A handle to a newly allocated Dali resource.
    */
-  static ImageUrl New(Texture& texture);
+  static ImageUrl New(Texture& texture, bool preMultiplied = false);
+
+  /**
+   * @brief Create an initialized ImageUrl.
+   *
+   * @param[in] encodedImageBuffer The encoded image buffer url is got from external buffer.
+   * @return A handle to a newly allocated Dali resource.
+   */
+  static ImageUrl New(const EncodedImageBuffer& encodedImageBuffer);
 
   /**
    * @brief Downcast an Object handle to ImageUrl handle.
@@ -89,14 +100,14 @@ public:
    * @brief Move constructor.
    * @param[in] rhs A reference to the moved handle
    */
-  ImageUrl(ImageUrl&& rhs);
+  ImageUrl(ImageUrl&& rhs) noexcept;
 
   /**
    * @brief Move assignment operator.
    * @param[in] rhs A reference to the moved handle
    * @return A reference to this handle
    */
-  ImageUrl& operator=(ImageUrl&& rhs);
+  ImageUrl& operator=(ImageUrl&& rhs) noexcept;
 
   /**
    * Get the url