[4.0] PixelBuffer::Rotate() amendments.
[platform/core/uifw/dali-adaptor.git] / adaptors / common / pixel-buffer-impl.h
index 2b57823..e8eb98e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_PIXEL_BUFFER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
 #include <dali/public-api/images/image-operations.h> // For ImageDimensions
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/property-map.h>
+
+// EXTERNAL INCLUDES
+#include <memory>
 
 namespace Dali
 {
@@ -181,6 +185,38 @@ public:
    */
   void MultiplyColorByAlpha();
 
+  /**
+   * @brief Sets image metadata
+   *
+   * @param map Property map containing Exif fields
+   */
+  void SetMetadata( const Property::Map& map );
+
+  /**
+   * @brief Returns image metadata as a property map
+   * @param[out] outMetadata Property map to copy the data into
+   * @return True on success
+   */
+  bool GetMetadata(Property::Map& outMetadata) const;
+
+  /**
+   * @brief Sets metadata property map for the pixel buffer
+   * @note The function takes over the ownership of the property map
+   * @param[in] metadata Property map to copy the data into
+   */
+  void SetMetadata(std::unique_ptr<Property::Map> metadata);
+
+  /**
+   * Allocates fixed amount of memory for the pixel data. Used by compressed formats.
+   * @param[in] size Size of memory to be allocated
+   */
+  void AllocateFixedSize( uint32_t size );
+
+  /**
+   * @copydoc Devel::PixelBuffer::Rotate()
+   */
+  bool Rotate( Degree angle );
+
 private:
   /*
    * Undefined copy constructor.
@@ -234,14 +270,14 @@ private:
    */
   static PixelBufferPtr NewResize( const PixelBuffer& inBuffer, ImageDimensions outDimensions );
 
-
 private:
 
-  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
+  std::unique_ptr<Property::Map>  mMetadata;         ///< Metadata fields
+  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
 };
 
 } // namespace Adaptor