*
*/
+// INTERNAL INCLUDES
#include <dali/public-api/images/pixel.h>
#include <dali/public-api/images/pixel-data.h>
#include <dali/public-api/object/base-handle.h>
}
}
+
// Use namespace to separate from PixelBuffer typedef in buffer-image.h
namespace Devel
{
Pixel::Format GetPixelFormat() const;
/**
- * Apply the mask to this pixel data, and return a new pixel data
- * containing the masked image. If this PixelBuffer doesn't have an alpha channel,
- * then the resultant PixelBuffer will be converted to a format that
- * supports at least the width of the color channels and the alpha channel
- * from the mask.
+ * Apply the mask to this pixel data, and return a new pixel data containing
+ * the masked image. If this PixelBuffer doesn't have an alpha channel, then
+ * the resultant PixelBuffer will be converted to a format that supports at
+ * least the width of the color channels and the alpha channel from the mask.
+ *
+ * If cropToMask is set to true, then the contentScale is applied first to
+ * this buffer, and the target buffer is cropped to the size of the mask. If
+ * it's set to false, then the mask is scaled to match this buffer's size
+ * before the mask is applied.
+ *
* @param[in] mask The mask to apply.
+ * @param[in] contentScale The scaling factor to apply to the content
+ * @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 );
+
+ /**
+ * Apply a Gaussian blur to this pixel data with the given radius.
+ *
+ * @note A bigger radius will yield a blurrier image. Only works for pixel data in RGBA format.
+ *
+ * @param[in] blurRadius The radius for Gaussian blur. A value of 0 or negative value indicates no blur.
+ */
+ void ApplyGaussianBlur( const float blurRadius );
+
+ /**
+ * @brief Crops this buffer to the given crop rectangle.
+ *
+ * The crop rectangle will be clamped to the edges of the buffer if it is larger.
+ * @param[in] x The top left corner's X
+ * @param[in] y The top left corner's y
+ * @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 );
+
+ /**
+ * @brief Resizes the buffer to the given dimensions.
+ *
+ * Uses either Lanczos4 for downscaling or Mitchell for upscaling
+ * @param[in] width The new width
+ * @param[in] height The new height
+ */
+ void Resize( uint16_t width, uint16_t height );
+
+ /**
+ * Returns Exif metadata as a property map
+ *
+ * @param[out] metadata Property map object to write into
+ * @return True on success
*/
- void ApplyMask( PixelBuffer mask );
+ bool GetMetadata( Property::Map& metadata ) const;
public: