Add front buffer rendering APIs in Dali::Window
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / pixel-buffer.h
index 18b5a5f..40f3eae 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PIXEL_BUFFER_H
 
 /*
- * Copyright (c) 2020 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.
@@ -61,8 +61,8 @@ public:
   /**
    * Create a PixelBuffer with it's own data buffer.
    */
-  static PixelBuffer New(unsigned int        width,
-                         unsigned int        height,
+  static PixelBuffer New(uint32_t            width,
+                         uint32_t            height,
                          Dali::Pixel::Format pixelFormat);
 
   /**
@@ -98,6 +98,23 @@ public:
   PixelBuffer& operator=(const PixelBuffer& rhs);
 
   /**
+   * @brief This move constructor is required for (smart) pointer semantics.
+   *
+   * @SINCE_2_1.45
+   * @param[in] handle A reference to the moved handle
+   */
+  PixelBuffer(PixelBuffer&& handle);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @SINCE_2_1.45
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this object
+   */
+  PixelBuffer& operator=(PixelBuffer&& rhs);
+
+  /**
    * Convert to a pixel data and release the pixelBuffer's object.
    * This handle is left empty.
    *
@@ -127,7 +144,7 @@ public:
    * @SINCE_1_2.46
    * @return The pixel buffer, or NULL.
    */
-  unsigned char* GetBuffer();
+  uint8_t* GetBuffer();
 
   /**
    * @brief Gets the pixel buffer. This is a pointer to the internal
@@ -138,7 +155,7 @@ public:
    *
    * @return The pixel buffer, or NULL.
    */
-  const unsigned char* const GetBuffer() const;
+  const uint8_t* GetBuffer() const;
 
   /**
    * @brief Gets the width of the buffer in pixels.
@@ -146,7 +163,7 @@ public:
    * @SINCE_1_2.46
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Gets the height of the buffer in pixels.
@@ -154,7 +171,15 @@ public:
    * @SINCE_1_2.46
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
+
+  /**
+   * @brief Gets the stride of the buffer in pixels.
+   *
+   * @SINCE_2_1.17
+   * @return The stride of the buffer in pixels. 0 means the buffer is tightly packed.
+   */
+  uint32_t GetStride() const;
 
   /**
    * @brief Gets the pixel format.
@@ -244,6 +269,13 @@ public:
    */
   bool IsAlphaPreMultiplied() const;
 
+  /**
+   * @brief Get the brightness of the pixel buffer.
+   * @note The range is 255 to 0. The closer to 255, the brighter. 0 is not bright.
+   * @return brightness of the pixel buffer.
+   */
+  uint32_t GetBrightness() const;
+
 public:
   /**
    * @brief The constructor.