[4.0] Restore Uploaded signal for BufferImage and ResourceImage
[platform/core/uifw/dali-core.git] / dali / internal / event / images / pixel-data-impl.h
index cf2b299..8967c96 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_PIXEL_DATA_H__
-#define __DALI_INTERNAL_PIXEL_DATA_H__
+#ifndef DALI_INTERNAL_PIXEL_DATA_H
+#define DALI_INTERNAL_PIXEL_DATA_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -19,8 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/images/pixel-data.h>
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/devel-api/images/pixel-data-devel.h>
 
 namespace Dali
 {
@@ -39,12 +40,14 @@ public:
    * @brief Create a PixelData object.
    *
    * @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.
    */
   static PixelDataPtr New( unsigned char* buffer,
+                           unsigned int bufferSize,
                            unsigned int width,
                            unsigned int height,
                            Pixel::Format pixelFormat,
@@ -54,12 +57,14 @@ public:
    * @brief Constructor.
    *
    * @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.
    */
   PixelData( unsigned char* buffer,
+             unsigned int bufferSize,
              unsigned int width,
              unsigned int height,
              Pixel::Format pixelFormat,
@@ -100,6 +105,18 @@ public:
    */
   unsigned char* GetBuffer() const;
 
+  /**
+   * Get the size of the buffer in bytes
+   * @return The size of the buffer
+   */
+  unsigned int GetBufferSize() const;
+
+  /**
+   * Return the buffer pointer and reset the internal buffer to zero.
+   * @return The buffer pointer and associated data.
+   */
+  DevelPixelData::PixelDataBuffer ReleaseBuffer();
+
 private:
 
   /*
@@ -114,9 +131,10 @@ private:
 
 private:
 
-  unsigned char* mBuffer;           ///< The raw pixel data.
-  unsigned int   mWidth;            ///< Buffer width in pixels.
-  unsigned int   mHeight;           ///< Buffer height in pixels.
+  unsigned char* mBuffer;           ///< The raw pixel data
+  unsigned int   mBufferSize;       ///< Buffer sized in bytes
+  unsigned int   mWidth;            ///< Buffer width in pixels
+  unsigned int   mHeight;           ///< Buffer height in pixels
   Pixel::Format  mPixelFormat;      ///< Pixel format
   Dali::PixelData::ReleaseFunction mReleaseFunction;  ///< Function for releasing memory
 };