X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fpixel-buffer.h;h=18b5a5f1e6ac40cc094c13b5b97a84ccc814ceef;hb=f32f04052accfe880a9141d554091d4cfe922d47;hp=449bc02c964fad2aef73dc2c34b192598b349148;hpb=e0a7e95ba0d0d294630d3fe9908d04da2044f063;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/pixel-buffer.h b/dali/devel-api/adaptor-framework/pixel-buffer.h old mode 100755 new mode 100644 index 449bc02..18b5a5f --- a/dali/devel-api/adaptor-framework/pixel-buffer.h +++ b/dali/devel-api/adaptor-framework/pixel-buffer.h @@ -2,7 +2,7 @@ #define DALI_PIXEL_BUFFER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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,8 @@ */ // INTERNAL INCLUDES -#include #include +#include #include // INTERNAL INCLUDES @@ -28,20 +28,17 @@ namespace Dali { - namespace Internal { namespace Adaptor { class PixelBuffer; } -} - +} // namespace Internal // Use namespace to separate from PixelBuffer typedef in buffer-image.h namespace Devel { - /** * @brief The PixelBuffer object holds a pixel buffer. * @@ -61,13 +58,12 @@ namespace Devel class DALI_ADAPTOR_API PixelBuffer : public BaseHandle { public: - /** * Create a PixelBuffer with it's own data buffer. */ - static PixelBuffer New( unsigned int width, - unsigned int height, - Dali::Pixel::Format pixelFormat ); + static PixelBuffer New(unsigned int width, + unsigned int height, + Dali::Pixel::Format pixelFormat); /** * @brief Creates an empty handle. @@ -112,7 +108,7 @@ public: * @param[in,out] pixelBuffer * @return a new PixelData which takes ownership of the PixelBuffer's buffer. */ - static PixelData Convert( PixelBuffer& pixelBuffer ); + static PixelData Convert(PixelBuffer& pixelBuffer); /** * Copy the data from this object into a new PixelData object, which could be @@ -184,7 +180,7 @@ public: * @param[in] cropToMask Whether to crop the output to the mask size (true) * or scale the mask to the content size (false) */ - void ApplyMask( PixelBuffer mask, float contentScale=1.0f, bool cropToMask=false ); + void ApplyMask(PixelBuffer mask, float contentScale = 1.0f, bool cropToMask = false); /** * Apply a Gaussian blur to this pixel data with the given radius. @@ -193,7 +189,7 @@ public: * * @param[in] blurRadius The radius for Gaussian blur. A value of 0 or negative value indicates no blur. */ - void ApplyGaussianBlur( const float blurRadius ); + void ApplyGaussianBlur(const float blurRadius); /** * @brief Crops this buffer to the given crop rectangle. @@ -204,7 +200,7 @@ public: * @param[in] width The crop width * @param[in] height The crop height */ - void Crop( uint16_t x, uint16_t y, uint16_t width, uint16_t height ); + void Crop(uint16_t x, uint16_t y, uint16_t width, uint16_t height); /** * @brief Resizes the buffer to the given dimensions. @@ -213,7 +209,7 @@ public: * @param[in] width The new width * @param[in] height The new height */ - void Resize( uint16_t width, uint16_t height ); + void Resize(uint16_t width, uint16_t height); /** * @brief Returns Exif metadata as a property map @@ -221,7 +217,7 @@ public: * @param[out] metadata Property map object to write into * @return True on success */ - bool GetMetadata( Property::Map& metadata ) const; + bool GetMetadata(Property::Map& metadata) const; /** * @brief Multiplies the image's color values by the alpha value. This provides better @@ -240,17 +236,22 @@ public: * * @return @e false if the rotation fails (invalid pixel format or memory issues). */ - bool Rotate( Degree angle ); + bool Rotate(Degree angle); -public: + /** + * @brief Returns pixel-buffer is premultiplied or not. + * @return true if alpha is pre-multiplied. + */ + bool IsAlphaPreMultiplied() const; +public: /** * @brief The constructor. * @note Not intended for application developers. * @SINCE_1_2.46 * @param[in] pointer A pointer to a newly allocated PixelBuffer */ - explicit DALI_INTERNAL PixelBuffer( Internal::Adaptor::PixelBuffer* pointer ); + explicit DALI_INTERNAL PixelBuffer(Internal::Adaptor::PixelBuffer* pointer); }; } // namespace Devel