X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fpixel-buffer-impl.h;h=b8ad251c1553beabc3aa1f4971af2299465790d5;hb=refs%2Fchanges%2F11%2F189011%2F3;hp=1882909f96a92b452c99ea6ce22b8f40f7bdbd40;hpb=29700e5d950c37672475098e30b946aadcdfb86b;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/pixel-buffer-impl.h b/adaptors/common/pixel-buffer-impl.h index 1882909..b8ad251 100644 --- a/adaptors/common/pixel-buffer-impl.h +++ b/adaptors/common/pixel-buffer-impl.h @@ -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. @@ -23,6 +23,10 @@ #include // For ImageDimensions #include #include +#include + +// EXTERNAL INCLUDES +#include namespace Dali { @@ -175,6 +179,44 @@ public: */ void Resize( ImageDimensions outDimensions ); + /** + * Multiplies the image's color values by the alpha value. This provides better + * blending capability. + */ + 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 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() + */ + void Rotate( Degree angle ); + private: /* * Undefined copy constructor. @@ -228,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 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