Dali 3D User Interface Engine
Functions
Pixel buffer-level scaling algorithms.

Functions

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 int &outWidth, unsigned int &outHeight)
 Destructive in-place downscaling by a power of 2 factor. More...
 
void Dali::Internal::Platform::DownscaleInPlacePow2RGBA8888 (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::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 int &outWidth, unsigned int &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...
 
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...
 
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::PointSample3BPP (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::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...
 
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...
 

Detailed Description

Function Documentation

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.

Destructive in-place downscaling by a power of 2 factor.

A box filter with a 2x2 kernel is repeatedly applied as long as the result of the next downscaling step would not be smaller than the desired dimensions.

Parameters
[in,out]pixelsThe buffer both to read from and write the result to.
[in]pixelFormatThe format of the image pointed at by pixels.
[in]inputWidthThe width of the input image.
[in]inputHeightThe height of the input image.
[in]desiredWidthThe width the client is requesting.
[in]desiredHeightThe height the client is requesting.
[out]outWidthThe resulting width after downscaling.
[out]outHeightThe resulting height after downscaling.

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

References Dali::Pixel::A8, Dali::SamplingMode::BOX, Dali::SamplingMode::BOX_THEN_LINEAR, Dali::SamplingMode::BOX_THEN_NEAREST, DALI_ASSERT_DEBUG, DALI_LOG_INFO, Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::DimensionTestForScalingMode(), Dali::Internal::Platform::DownscaleInPlacePow2ComponentPair(), Dali::Internal::Platform::DownscaleInPlacePow2RGB565(), Dali::Internal::Platform::DownscaleInPlacePow2RGB888(), Dali::Internal::Platform::DownscaleInPlacePow2RGBA8888(), Dali::Internal::Platform::DownscaleInPlacePow2SingleBytePerPixel(), Dali::Pixel::L8, Dali::Pixel::LA88, Dali::Pixel::RGB565, Dali::Pixel::RGB888, and Dali::Pixel::RGBA8888.

Referenced by Dali::Internal::Platform::DownscaleBitmap().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Platform::DownscaleInPlacePow2ComponentPair ( unsigned char *  pixels,
unsigned int  inputWidth,
unsigned int  inputHeight,
unsigned int  desiredWidth,
unsigned int  desiredHeight,
BoxDimensionTest  dimensionTest,
unsigned int &  outWidth,
unsigned int &  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 
)
void Dali::Internal::Platform::DownscaleInPlacePow2RGB888 ( unsigned char *  pixels,
unsigned int  inputWidth,
unsigned int  inputHeight,
unsigned int  desiredWidth,
unsigned int  desiredHeight,
BoxDimensionTest  dimensionTest,
unsigned int &  outWidth,
unsigned int &  outHeight 
)

Destructive in-place downscaling by a power of 2 factor.

A box filter with a 2x2 kernel is repeatedly applied as long as the result of the next downscaling step would not be smaller than the desired dimensions.

Parameters
[in,out]pixelsThe buffer both to read from and write the result to.
[in]inputWidthThe width of the input image.
[in]inputHeightThe height of the input image.
[in]desiredWidthThe width the client is requesting.
[in]desiredHeightThe height the client is requesting.
[out]outWidthThe resulting width after downscaling.
[out]outHeightThe resulting height after downscaling.
void Dali::Internal::Platform::DownscaleInPlacePow2RGBA8888 ( unsigned char *  pixels,
unsigned int  inputWidth,
unsigned int  inputHeight,
unsigned int  desiredWidth,
unsigned int  desiredHeight,
BoxDimensionTest  dimensionTest,
unsigned int &  outWidth,
unsigned int &  outHeight 
)

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 
)
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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

References Dali::Pixel::A8, DALI_ASSERT_DEBUG, DALI_LOG_INFO, Dali::Pixel::L8, Dali::Pixel::LA88, Dali::Internal::Platform::LinearSample1BPP(), Dali::Internal::Platform::LinearSample2BPP(), Dali::Internal::Platform::LinearSample3BPP(), Dali::Internal::Platform::LinearSample4BPP(), Dali::Internal::Platform::LinearSampleRGB565(), Dali::Pixel::RGB565, Dali::Pixel::RGB888, and Dali::Pixel::RGBA8888.

Referenced by Dali::Internal::Platform::DownscaleBitmap().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

Referenced by Dali::Internal::Platform::LinearSample().

Here is the caller graph for this function:

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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

Referenced by Dali::Internal::Platform::LinearSample().

Here is the caller graph for this function:

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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

Referenced by Dali::Internal::Platform::LinearSample().

Here is the caller graph for this function:

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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

Referenced by Dali::Internal::Platform::LinearSample().

Here is the caller graph for this function:

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.

Each output pixel is formed of a weighted sum of a 2x2 block of four input pixels

Precondition
inPixels must not alias outPixels. The input image should be a totally separate buffer from the input one.

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

Referenced by Dali::Internal::Platform::LinearSample().

Here is the caller graph for this function:

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.

Uses point sampling, equivalent to GL_NEAREST texture filter mode, for the fastest results, at the expense of aliasing (noisy images) when downscaling.

Note
inPixels is allowed to alias outPixels if this is a downscaling, but not for upscaling.

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

References Dali::Pixel::A8, DALI_ASSERT_DEBUG, DALI_LOG_INFO, Dali::Pixel::L8, Dali::Pixel::LA88, Dali::Internal::Platform::PointSample1BPP(), Dali::Internal::Platform::PointSample2BPP(), Dali::Internal::Platform::PointSample3BPP(), Dali::Internal::Platform::PointSample4BPP(), Dali::Pixel::RGB565, Dali::Pixel::RGB888, and Dali::Pixel::RGBA8888.

Referenced by Dali::Internal::Platform::DownscaleBitmap().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Uses point sampling, equivalent to GL_NEAREST texture filter mode, for the fastest results, at the expense of aliasing (noisy images) when downscaling.

Note
inPixels is allowed to alias outPixels if this is a downscaling, but not for upscaling.

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

Referenced by Dali::Internal::Platform::PointSample().

Here is the caller graph for this function:

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.

Uses point sampling, equivalent to GL_NEAREST texture filter mode, for the fastest results, at the expense of aliasing (noisy images) when downscaling.

Note
inPixels is allowed to alias outPixels if this is a downscaling, but not for upscaling.

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

Referenced by Dali::Internal::Platform::PointSample().

Here is the caller graph for this function:

void Dali::Internal::Platform::PointSample3BPP ( 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.

Uses point sampling, equivalent to GL_NEAREST texture filter mode, for the fastest results, at the expense of aliasing (noisy images) when downscaling.

Note
inPixels is allowed to alias outPixels if this is a downscaling, but not for upscaling.
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.

Uses point sampling, equivalent to GL_NEAREST texture filter mode, for the fastest results, at the expense of aliasing (noisy images) when downscaling.

Note
inPixels is allowed to alias outPixels if this is a downscaling, but not for upscaling.

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

Referenced by Dali::Internal::Platform::PointSample(), UtcDaliImageOperationsPointSampleCheckerboardRGBA888(), UtcDaliImageOperationsPointSampleRGBA888InBounds(), UtcDaliImageOperationsPointSampleRGBA888PixelsCorrectColor(), UtcDaliImageOperationsPointSampleRGBA888ScaleToSinglePixel(), and UtcDaliImageOperationsPointSampleRGBA888ScaleToZeroDims().

Here is the caller graph for this function:

Dali Docs Home
Read more about Dali