Dali 3D User Interface Engine
Classes | Namespaces | Typedefs | Functions | Variables
image-operations.cpp File Reference
#include "image-operations.h"
#include <cstring>
#include <stddef.h>
#include <cmath>
#include <dali/integration-api/debug.h>
#include <dali/public-api/math/vector2.h>
Include dependency graph for image-operations.cpp:

Go to the source code of this file.

Classes

struct  Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel4Bytes
 4 byte pixel structure. More...
 
struct  Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel3Bytes
 RGB888 pixel structure. More...
 
struct  Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel2Bytes
 a Pixel composed of two independent byte components. More...
 

Namespaces

namespace  Dali
 The top level DALi namespace.
 
namespace  Dali::Internal
 
namespace  Dali::Internal::Platform
 
namespace  Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}
 

Typedefs

typedef unsigned char Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::PixelBuffer
 
typedef uint16_t Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::PixelRGB565
 RGB565 pixel typedefed from a short. More...
 

Functions

const uint8_t Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BORDER_FILL_VALUE (0x00)
 
const unsigned int Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::MAXIMUM_TARGET_BITMAP_SIZE ((1u<< 16)-1)
 
struct
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel4Bytes 
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::__attribute__ ((packed, aligned(4)))
 
struct
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel3Bytes 
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::__attribute__ ((packed, aligned(1)))
 
struct
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::Pixel2Bytes 
Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::__attribute__ ((packed, aligned(2)))
 
unsigned int Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::EvenDown (const unsigned int a)
 
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::ValidateScalingParameters (const unsigned int inputWidth, const unsigned int inputHeight, const unsigned int desiredWidth, const unsigned int desiredHeight)
 Log bad parameters. More...
 
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::DebugAssertScanlineParameters (const uint8_t *const pixels, const unsigned int width)
 Do debug assertions common to all scanline halving functions. More...
 
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::DebugAssertDualScanlineParameters (const uint8_t *const scanline1, const uint8_t *const scanline2, uint8_t *const outputScanline, const size_t widthInComponents)
 Assertions on params to functions averaging pairs of scanlines. More...
 
BoxDimensionTest Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::DimensionTestForScalingMode (FittingMode::Type fittingMode)
 Converts a scaling mode to the definition of which dimensions matter when box filtering as a part of that mode. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::FitForShrinkToFit (ImageDimensions target, ImageDimensions source)
 Work out the dimensions for a uniform scaling of the input to map it into the target while effecting ShinkToFit scaling mode. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::FitForScaleToFill (ImageDimensions target, ImageDimensions source)
 Work out the dimensions for a uniform scaling of the input to map it into the target while effecting SCALE_TO_FILL scaling mode. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::FitForFitWidth (ImageDimensions target, ImageDimensions source)
 Work out the dimensions for a uniform scaling of the input to map it into the target while effecting FIT_WIDTH scaling mode. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::FitForFitHeight (ImageDimensions target, ImageDimensions source)
 Work out the dimensions for a uniform scaling of the input to map it into the target while effecting FIT_HEIGHT scaling mode. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::FitToScalingMode (ImageDimensions requestedSize, ImageDimensions sourceSize, FittingMode::Type fittingMode)
 Generate the rectangle to use as the target of a pixel sampling pass (e.g., nearest or linear). More...
 
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::CalculateBordersFromFittingMode (ImageDimensions sourceSize, FittingMode::Type fittingMode, ImageDimensions &requestedSize, int &scanlinesToCrop, int &columnsToCrop)
 Calculate the number of lines on the X and Y axis that need to be either added or removed with repect to the specified fitting mode. More...
 
BitmapPtr Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::MakeEmptyBitmap (Pixel::Format pixelFormat, unsigned int width, unsigned int height)
 Construct a bitmap with format and dimensions requested. More...
 
BitmapPtr Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::MakeBitmap (const uint8_t *const pixels, Pixel::Format pixelFormat, unsigned int width, unsigned int height)
 Construct a bitmap object from a copy of the pixel array passed in. More...
 
ImageDimensions Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::CalculateDesiredDimensions (unsigned int bitmapWidth, unsigned int bitmapHeight, unsigned int requestedWidth, unsigned int requestedHeight)
 Work out the desired width and height, accounting for zeros. More...
 
ImageDimensions Dali::Internal::Platform::CalculateDesiredDimensions (ImageDimensions rawDimensions, ImageDimensions requestedDimensions)
 Work out the true desired width and height, accounting for special rules for zeros in either or both input requested dimensions. More...
 
Integration::BitmapPtr Dali::Internal::Platform::CropAndPadForFittingMode (Integration::BitmapPtr bitmap, ImageDimensions desiredDimensions, FittingMode::Type fittingMode)
 Apply cropping and padding for specified fitting mode. More...
 
void Dali::Internal::Platform::AddBorders (PixelBuffer *targetPixels, const unsigned int bytesPerPixel, const ImageDimensions targetDimensions, const ImageDimensions padDimensions)
 Adds horizontal or vertical borders to the source image. More...
 
BitmapPtr Dali::Internal::Platform::ApplyAttributesToBitmap (Integration::BitmapPtr bitmap, ImageDimensions dimensions, FittingMode::Type fittingMode=FittingMode::DEFAULT, SamplingMode::Type samplingMode=SamplingMode::DEFAULT)
 Apply requested attributes to bitmap. More...
 
Integration::BitmapPtr Dali::Internal::Platform::DownscaleBitmap (Integration::Bitmap &bitmap, ImageDimensions desired, FittingMode::Type fittingMode, SamplingMode::Type samplingMode)
 Apply downscaling to a bitmap according to requested attributes. More...
 
bool Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::ContinueScaling (BoxDimensionTest test, unsigned int scaledWidth, unsigned int scaledHeight, unsigned int desiredWidth, unsigned int desiredHeight)
 Returns whether to keep box filtering based on whether downscaled dimensions will overshoot the desired ones aty the next step. More...
 
template<int BYTES_PER_PIXEL, void(*)(unsigned char *const pixels, const unsigned int width) HalveScanlineInPlace, void(*)(const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width) AverageScanlines>
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::DownscaleInPlacePow2Generic (unsigned char *const pixels, const unsigned int inputWidth, const unsigned int inputHeight, const unsigned int desiredWidth, const unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned &outWidth, unsigned &outHeight)
 A shared implementation of the overall iterative box filter downscaling algorithm. More...
 
void Dali::Internal::Platform::HalveScanlineInPlaceRGB888 (unsigned char *pixels, unsigned int width)
 Average adjacent pairs of pixels, overwriting the input array. More...
 
void Dali::Internal::Platform::HalveScanlineInPlaceRGBA8888 (unsigned char *pixels, unsigned int width)
 Average adjacent pairs of pixels, overwriting the input array. More...
 
void Dali::Internal::Platform::HalveScanlineInPlaceRGB565 (unsigned char *pixels, unsigned int width)
 Average adjacent pairs of pixels, overwriting the input array. More...
 
void Dali::Internal::Platform::HalveScanlineInPlace2Bytes (unsigned char *pixels, unsigned int width)
 Average adjacent pairs of pixels, overwriting the input array. More...
 
void Dali::Internal::Platform::HalveScanlineInPlace1Byte (unsigned char *pixels, unsigned int width)
 Average adjacent pairs of pixels, overwriting the input array. More...
 
void Dali::Internal::Platform::AverageScanlines1 (const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width)
 : Optimise for ARM using a 4 bytes at a time loop wrapped around the single ARMV6 instruction: UHADD8 R4, R0, R5. More...
 
void Dali::Internal::Platform::AverageScanlines2 (const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width)
 
void Dali::Internal::Platform::AverageScanlines3 (const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width)
 
void Dali::Internal::Platform::AverageScanlinesRGBA8888 (const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width)
 
void Dali::Internal::Platform::AverageScanlinesRGB565 (const unsigned char *const scanline1, const unsigned char *const __restrict__ scanline2, unsigned char *const outputScanline, const unsigned int width)
 
void Dali::Internal::Platform::DownscaleInPlacePow2 (unsigned char *const pixels, Pixel::Format pixelFormat, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, unsigned &outWidth, unsigned &outHeight)
 Dispatch to pixel format appropriate box filter downscaling functions. More...
 
void Dali::Internal::Platform::DownscaleInPlacePow2RGB888 (unsigned char *pixels, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned &outWidth, unsigned &outHeight)
 
void Dali::Internal::Platform::DownscaleInPlacePow2RGBA8888 (unsigned char *pixels, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned &outWidth, unsigned &outHeight)
 
void Dali::Internal::Platform::DownscaleInPlacePow2RGB565 (unsigned char *pixels, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned int &outWidth, unsigned int &outHeight)
  More...
 
void Dali::Internal::Platform::DownscaleInPlacePow2ComponentPair (unsigned char *pixels, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned &outWidth, unsigned &outHeight)
  More...
 
void Dali::Internal::Platform::DownscaleInPlacePow2SingleBytePerPixel (unsigned char *pixels, unsigned int inputWidth, unsigned int inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, BoxDimensionTest dimensionTest, unsigned int &outWidth, unsigned int &outHeight)
  More...
 
template<typename PIXEL >
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::PointSampleAddressablePixels (const uint8_t *inPixels, unsigned int inputWidth, unsigned int inputHeight, uint8_t *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 Point sample an image to a new resolution (like GL_NEAREST). More...
 
void Dali::Internal::Platform::PointSample4BPP (const unsigned char *inPixels, unsigned int inputWidth, unsigned int inputHeight, unsigned char *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 Rescales an input image into the exact output dimensions passed-in. More...
 
void Dali::Internal::Platform::PointSample2BPP (const unsigned char *inPixels, unsigned int inputWidth, unsigned int inputHeight, unsigned char *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 Rescales an input image into the exact output dimensions passed-in. More...
 
void Dali::Internal::Platform::PointSample1BPP (const unsigned char *inPixels, unsigned int inputWidth, unsigned int inputHeight, unsigned char *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 Rescales an input image into the exact output dimensions passed-in. More...
 
void Dali::Internal::Platform::PointSample3BPP (const uint8_t *inPixels, unsigned int inputWidth, unsigned int inputHeight, uint8_t *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 
void Dali::Internal::Platform::PointSample (const unsigned char *inPixels, unsigned int inputWidth, unsigned int inputHeight, Pixel::Format pixelFormat, unsigned char *outPixels, unsigned int desiredWidth, unsigned int desiredHeight)
 Rescales an input image into the exact output dimensions passed-in. More...
 
uint8_t Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BilinearFilter1BPPByte (uint8_t tl, uint8_t tr, uint8_t bl, uint8_t br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical)
 Blend 4 pixels together using horizontal and vertical weights. More...
 
Pixel2Bytes Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BilinearFilter2Bytes (Pixel2Bytes tl, Pixel2Bytes tr, Pixel2Bytes bl, Pixel2Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical)
  More...
 
Pixel3Bytes Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BilinearFilterRGB888 (Pixel3Bytes tl, Pixel3Bytes tr, Pixel3Bytes bl, Pixel3Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical)
  More...
 
PixelRGB565 Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BilinearFilterRGB565 (PixelRGB565 tl, PixelRGB565 tr, PixelRGB565 bl, PixelRGB565 br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical)
  More...
 
Pixel4Bytes Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::BilinearFilter4Bytes (Pixel4Bytes tl, Pixel4Bytes tr, Pixel4Bytes bl, Pixel4Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical)
  More...
 
template<typename PIXEL , PIXEL(*)(PIXEL tl, PIXEL tr, PIXEL bl, PIXEL br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical) BilinearFilter, bool DEBUG_ASSERT_ALIGNMENT>
void Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::LinearSampleGeneric (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Generic version of bilinear sampling image resize function. More...
 
void Dali::Internal::Platform::LinearSample1BPP (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Resample input image to output image using a bilinear filter. More...
 
void Dali::Internal::Platform::LinearSample2BPP (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Resample input image to output image using a bilinear filter. More...
 
void Dali::Internal::Platform::LinearSampleRGB565 (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Resample input image to output image using a bilinear filter. More...
 
void Dali::Internal::Platform::LinearSample3BPP (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Resample input image to output image using a bilinear filter. More...
 
void Dali::Internal::Platform::LinearSample4BPP (const unsigned char *__restrict__ inPixels, ImageDimensions inputDimensions, unsigned char *__restrict__ outPixels, ImageDimensions desiredDimensions)
 Resample input image to output image using a bilinear filter. More...
 
void Dali::Internal::Platform::LinearSample (const unsigned char *__restrict__ inPixels, ImageDimensions inDimensions, Pixel::Format pixelFormat, unsigned char *__restrict__ outPixels, ImageDimensions outDimensions)
 Resample input image to output image using a bilinear filter. More...
 

Variables

uint8_t r
 
uint8_t g
 
uint8_t b
 
uint8_t a
 
uint8_t l
 

Variable Documentation

uint8_t a

Definition at line 63 of file image-operations.cpp.

Referenced by Dali::Toolkit::Internal::ObjLoader::CalculateTangentArray(), Dali::UtcCoverageIntrusivePtr< T >::Check(), Dali::Internal::Atlas::ClearBackground(), Dali::Scripting::anonymous_namespace{scripting.cpp}::CompareEnums(), DefaultFunctionCoverage< T >::DefaultFunctionCoverage(), Dali::Toolkit::Internal::DeterminePropertyFromNode(), Dali::Quaternion::Exp(), Dali::Internal::History::Get(), Dali::Internal::Interpolate(), Dali::TizenPlatform::LoadBitmapFromIco(), Dali::Quaternion::Log(), anonymous_namespace{utc-Dali-ImageOperations.cpp}::PixelRGBA8888(), Dali::Internal::Actor::RayActorTest(), Dali::Internal::Actor::RaySphereTest(), anonymous_namespace{automation.cpp}::SetProperties(), Dali::ShortestDistanceInDomain(), Dali::Toolkit::Internal::ScrollView::SnapWithVelocity(), UtcDaliActorSetDrawMode(), UtcDaliActorSetDrawModeOverlayRender(), UtcDaliAngleAxisAssign(), UtcDaliAngleAxisCopy(), UtcDaliAngleAxisEqual(), UtcDaliAngleAxisNew01(), UtcDaliAngleAxisNew02(), UtcDaliAngleAxisNew03(), UtcDaliBloomViewUninitialized(), UtcDaliDegreeOperatorEquals(), UtcDaliDegreeOperatorNotEquals(), UtcDaliGaussianBlurViewUninitialized(), UtcDaliJsonParserMethod05(), UtcDaliMatrixAssign02P(), UtcDaliMatrixAssignP(), UtcDaliModelViewUninitialized(), UtcDaliPropertyValueConstructorsMatrixP(), UtcDaliRadianCastOperatorEquals(), UtcDaliRadianCastOperatorLessThan(), UtcDaliRadianCastOperatorNotEquals(), UtcDaliRandomRangeMethod(), UtcDaliShadowViewUninitialized(), UtcDaliToolkitScrollViewActorAutoSnap(), UtcDaliToolkitScrollViewBind(), UtcDaliToolkitScrollViewConstraints(), UtcDaliToolkitScrollViewConstraintsMove(), UtcDaliToolkitScrollViewConstraintsWrap(), UtcDaliTypeRegistryActionViaBaseHandle(), and anonymous_namespace{scroll-view-impl.cpp}::VectorInDomain().

uint8_t b
uint8_t g
uint8_t l
uint8_t r
Dali Docs Home
Read more about Dali