#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.
/**
* 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);
/**
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.
*
* @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
*
* @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.
* @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.
* @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.
*/
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.