#include <dali/public-api/images/pixel-data.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/images/pixel-devel.h>
+#include <dali/public-api/images/pixel.h>
namespace Dali
{
{
/**
- * @brief Creates a PixelData object.
+ * Struct to keep the buffer pointer and the allocation method.
*
- * @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
+ * @note Need to find a better solution - one library should not
+ * be freeing data from a different source with potentially
+ * different allocators.
*/
-DALI_IMPORT_API PixelData New( unsigned char* buffer,
- unsigned int bufferSize,
- unsigned int width,
- unsigned int height,
- DevelPixel::Format pixelFormat,
- PixelData::ReleaseFunction releaseFunction );
+struct PixelDataBuffer
+{
+ unsigned char* buffer;
+ unsigned int bufferSize;
+ PixelData::ReleaseFunction releaseFunction;
+
+ PixelDataBuffer( unsigned char* buffer,
+ unsigned int bufferSize,
+ PixelData::ReleaseFunction releaseFunction )
+ : buffer(buffer),
+ bufferSize(bufferSize),
+ releaseFunction(releaseFunction)
+ {
+ }
+};
+
+/**
+ * Get the buffer from a pixel data object, zero it in the pixel data object
+ * and release the handle.
+ * @param[in,out] pixelData The pixel data object to take the buffer from
+ * @return the buffer and the data release mechanism
+ */
+PixelDataBuffer ReleasePixelDataBuffer( PixelData& pixelData );
} // namespace DevelPixelData