X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=platform-abstractions%2Fportable%2Fimage-operations.h;h=b83cca12a03814173af828ee54926506c990b009;hb=6774f439cf1f339c40364110cb2eebd185bff000;hp=075b3455edcef70ee4a2d938cc3b078490f6a718;hpb=1b44e30f6c6910ba2b30ab7204d7d6f16f4a8100;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/platform-abstractions/portable/image-operations.h b/platform-abstractions/portable/image-operations.h index 075b345..b83cca1 100644 --- a/platform-abstractions/portable/image-operations.h +++ b/platform-abstractions/portable/image-operations.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 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,7 +23,15 @@ // INTERNAL INCLUDES #include -#include +#include +#include + +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif + namespace Dali { @@ -79,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 ); /**@}*/ /** @@ -317,7 +328,7 @@ void LinearSample3BPP( const unsigned char * __restrict__ inPixels, /** * @copydoc LinearSample * - * Specialised for four byte per pixel formats like RGBA888. + * Specialised for four byte per pixel formats like RGBA8888. * @note, If used on RGBA8888, the A component will be blended independently. */ void LinearSample4BPP( const unsigned char * __restrict__ inPixels, @@ -325,6 +336,78 @@ void LinearSample4BPP( const unsigned char * __restrict__ inPixels, unsigned char * __restrict__ outPixels, ImageDimensions desiredDimensions ); +/** + * @brief Resamples the input image with the Lanczos algorithm. + * + * @pre @p inPixels must not alias @p outPixels. The input image should be a totally + * separate buffer from the output buffer. + * + * @param[in] inPixels Pointer to the input image buffer. + * @param[in] inputDimensions The input dimensions of the image. + * @param[out] outPixels Pointer to the output image buffer. + * @param[in] desiredDimensions The output dimensions of the image. + */ +void LanczosSample4BPP( const unsigned char * __restrict__ inPixels, + ImageDimensions inputDimensions, + unsigned char * __restrict__ outPixels, + ImageDimensions desiredDimensions ); + +/** + * @brief Resamples the input image with the Lanczos algorithm. + * + * @pre @p inPixels must not alias @p outPixels. The input image should be a totally + * separate buffer from the output buffer. + * + * @param[in] inPixels Pointer to the input image buffer. + * @param[in] inputDimensions The input dimensions of the image. + * @param[out] outPixels Pointer to the output image buffer. + * @param[in] desiredDimensions The output dimensions of the image. + */ +void LanczosSample1BPP( const unsigned char * __restrict__ inPixels, + ImageDimensions inputDimensions, + unsigned char * __restrict__ outPixels, + ImageDimensions desiredDimensions ); + +/** + * @brief Resamples the input image with the Lanczos algorithm. + * + * @pre @p inPixels must not alias @p outPixels. The input image should be a totally + * separate buffer from the output buffer. + * + * @param[in] inPixels Pointer to the input image buffer. + * @param[in] inputDimensions The input dimensions of the image. + * @param[out] outPixels Pointer to the output image buffer. + * @param[in] desiredDimensions The output dimensions of the image. + */ +void Resample( const unsigned char * __restrict__ inPixels, + ImageDimensions inputDimensions, + unsigned char * __restrict__ outPixels, + ImageDimensions desiredDimensions, + Resampler::Filter filterType, + int numChannels, bool hasAlpha ); + + +/** + * @brief Rotates the input image with an implementation of the 'Rotate by Shear' algorithm. + * + * @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 ); + /**@}*/ /**