X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=platform-abstractions%2Fportable%2Fimage-operations.h;h=540b9e0a2ce65c386713954465c47929392701fb;hb=8d61b6699d9f2466af87a35a894fb626fd5bf455;hp=0c1e2533bad3bec23f48be8196425c20ce3526ec;hpb=31d54de242e65bb1438537aba8382cbba5f7429a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/platform-abstractions/portable/image-operations.h b/platform-abstractions/portable/image-operations.h index 0c1e253..540b9e0 100644 --- a/platform-abstractions/portable/image-operations.h +++ b/platform-abstractions/portable/image-operations.h @@ -1,5 +1,5 @@ /* - * 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. @@ -26,6 +26,13 @@ #include #include +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif + + namespace Dali { namespace Internal @@ -80,13 +87,16 @@ ImageDimensions CalculateDesiredDimensions( ImageDimensions rawDimensions, Image * bitmap passed-in, or the original bitmap passed in if the attributes * have no effect. */ -Integration::BitmapPtr ApplyAttributesToBitmap( Integration::BitmapPtr bitmap, ImageDimensions dimensions, FittingMode::Type fittingMode = FittingMode::DEFAULT, SamplingMode::Type samplingMode = SamplingMode::DEFAULT ); +Dali::Devel::PixelBuffer ApplyAttributesToBitmap( Dali::Devel::PixelBuffer bitmap, ImageDimensions dimensions, FittingMode::Type fittingMode = FittingMode::DEFAULT, SamplingMode::Type samplingMode = SamplingMode::DEFAULT ); /** * @brief Apply downscaling to a bitmap according to requested attributes. * @note The input bitmap pixel buffer may be modified and used as scratch working space for efficiency, so it must be discarded. **/ -Integration::BitmapPtr DownscaleBitmap( Integration::Bitmap& bitmap, ImageDimensions desired, FittingMode::Type fittingMode, SamplingMode::Type samplingMode ); +Dali::Devel::PixelBuffer DownscaleBitmap( Dali::Devel::PixelBuffer bitmap, + ImageDimensions desired, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode ); /**@}*/ /** @@ -377,6 +387,32 @@ void Resample( const unsigned char * __restrict__ inPixels, int numChannels, bool hasAlpha ); +/** + * @brief Rotates the input image with an implementation of the 'Rotate by Shear' algorithm. + * + * @pre @p pixelsIn must not alias @p pixelsOut. The input image should be a totally + * separate buffer from the output buffer. + * + * @note This function allocates memory in @p pixelsOut which has to be released by calling @e free() + * + * @param[in] pixelsIn The input buffer. + * @param[in] widthIn The width of the input buffer. + * @param[in] heightIn The height of the input buffer. + * @param[in] pixelSize The size of the pixel. + * @param[in] radians The rotation angle in radians. + * @param[out] pixelsOut The rotated output buffer. + * @param[out] widthOut The width of the output buffer. + * @param[out] heightOut The height of the output buffer. + */ +void RotateByShear( const uint8_t* const pixelsIn, + unsigned int widthIn, + unsigned int heightIn, + unsigned int pixelSize, + float radians, + uint8_t*& pixelsOut, + unsigned int& widthOut, + unsigned int& heightOut ); + /**@}*/ /**