X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fimages%2Fpixel-data.h;h=0fb96db6a75e7b851b16d3375a43073f0c9dbff3;hb=adae31cf70bdeed19789edc694d4baaf2fc67f21;hp=b75a4e5453b0fab775ce9cf1836af81eb2788544;hpb=de2ca7c4b8120766f23113ac6695c12066657006;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/images/pixel-data.h b/dali/public-api/images/pixel-data.h index b75a4e5..0fb96db 100644 --- a/dali/public-api/images/pixel-data.h +++ b/dali/public-api/images/pixel-data.h @@ -2,7 +2,7 @@ #define DALI_PIXEL_DATA_H /* - * Copyright (c) 2016 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. @@ -18,11 +18,19 @@ * */ +// EXTERNAL INCLUDES +#include // uint8_t, uint32_t + +// INTERNAL INCLUDES #include #include namespace Dali { +/** + * @addtogroup dali_core_images + * @{ + */ namespace Internal { @@ -36,41 +44,60 @@ class PixelData; * * @SINCE_1_1.43 */ -class DALI_IMPORT_API PixelData : public BaseHandle +class DALI_CORE_API PixelData : public BaseHandle { public: - /** - * @brief Function to release the pixel buffer + * @brief Enumeration for Function to release the pixel buffer. * @SINCE_1_1.43 */ enum ReleaseFunction { - FREE, ///< Use free function to release the pixel buffer @SINCE_1_1.43 - DELETE_ARRAY, ///< Use delete[] operator to release the pixel buffer @SINCE_1_1.43 + FREE, ///< Use free function to release the pixel buffer @SINCE_1_1.43 + DELETE_ARRAY, ///< Use delete[] operator to release the pixel buffer @SINCE_1_1.43 }; /** - * @brief Create a PixelData object. + * @brief Creates a PixelData object. * * @SINCE_1_1.43 - * @param[in] buffer The raw pixel data. - * @param[in] bufferSize The size of the buffer in bytes - * @param[in] width Buffer width in pixels - * @param[in] height Buffer height in pixels - * @param[in] pixelFormat The pixel format - * @param[in] releaseFunction The function used to release the memory. + * @param[in] buffer The raw pixel data + * @param[in] bufferSize The size of the buffer in bytes + * @param[in] width Buffer width in pixels + * @param[in] height Buffer height in pixels + * @param[in] pixelFormat The pixel format + * @param[in] releaseFunction The function used to release the memory * @return A handle to the PixelData */ - static PixelData New( unsigned char* buffer, - unsigned int bufferSize, - unsigned int width, - unsigned int height, - Pixel::Format pixelFormat, - ReleaseFunction releaseFunction); + static PixelData New(uint8_t* buffer, + uint32_t bufferSize, + uint32_t width, + uint32_t height, + Pixel::Format pixelFormat, + ReleaseFunction releaseFunction); /** - * @brief Create an empty handle. + * @brief Creates a PixelData object. + * + * @SINCE_2_1.10 + * @param[in] buffer The raw pixel data + * @param[in] bufferSize The size of the buffer in bytes + * @param[in] width Buffer width in pixels + * @param[in] height Buffer height in pixels + * @param[in] stride Buffer stride in pixels, 0 means the buffer is tightly packed + * @param[in] pixelFormat The pixel format + * @param[in] releaseFunction The function used to release the memory + * @return A handle to the PixelData + */ + static PixelData New(uint8_t* buffer, + uint32_t bufferSize, + uint32_t width, + uint32_t height, + uint32_t stride, + Pixel::Format pixelFormat, + ReleaseFunction releaseFunction); + /** + * @brief Creates an empty handle. * Use PixelData::New() to create an initialized object. * * @SINCE_1_1.43 @@ -78,7 +105,7 @@ public: PixelData(); /** - * Destructor + * @brief Destructor. * * @SINCE_1_1.43 */ @@ -102,41 +129,72 @@ public: PixelData& operator=(const PixelData& rhs); /** - * Get the width of the buffer in pixels. + * @brief Move constructor. + * + * @SINCE_1_9.22 + * @param[in] rhs A reference to the moved handle + */ + PixelData(PixelData&& rhs) noexcept; + + /** + * @brief Move assignment operator. + * + * @SINCE_1_9.22 + * @param[in] rhs A reference to the moved handle + * @return A reference to this handle + */ + PixelData& operator=(PixelData&& rhs) noexcept; + + /** + * @brief Gets the width of the buffer in pixels. * * @SINCE_1_1.43 * @return The width of the buffer in pixels */ - unsigned int GetWidth() const; + uint32_t GetWidth() const; /** - * Get the height of the buffer in pixels + * @brief Gets the height of the buffer in pixels. * * @SINCE_1_1.43 * @return The height of the buffer in pixels */ - unsigned int GetHeight() const; + uint32_t GetHeight() const; /** - * Get the pixel format + * @brief Gets the pixel format. * * @SINCE_1_1.43 * @return The pixel format */ Pixel::Format GetPixelFormat() const; -public: + /** + * @brief Gets the stride of the buffer in pixels. + * + * @SINCE_2_1.10 + * @return The stride of the buffer in pixels. 0 means the buffer is tightly packed. + */ + uint32_t GetStride() const; /** - * @brief The constructor + * Class method to get the total currently allocated size of pixel buffers + */ + static uint32_t GetTotalAllocatedSize(); + +public: + /** + * @brief The constructor. * @note Not intended for application developers. * @SINCE_1_1.43 * @param[in] pointer A pointer to a newly allocated PixelData */ - explicit DALI_INTERNAL PixelData( Internal::PixelData* pointer ); + explicit DALI_INTERNAL PixelData(Internal::PixelData* pointer); }; - -} //namespace Dali +/** + * @} + */ +} // namespace Dali #endif // DALI_PIXEL_DATA_H