Changes an image size using the chosen interpolation method with antialiasing.

Syntax

IppStatus ippiResizeAntialiasing_<data_type>_<chan>(const Ipp<data_type>* pSrc, Ipp32s srcStep, Ipp<data_type>* pDst, Ipp32s dstStep, IppiPoint dstOffset, IppiSize dstSize, IppiBorderType border, const Ipp<data_type>* pBorderValue, const IppiResizeSpec_32f* pSpec, Ipp8u* pBuffer);

Supported values for data_type:

8u

16u

16s

32f

Supported values for chan:

C1R

C3R

C4R

Platform-aware functions

IppStatus ippiResizeAntialiasing_<data_type>_<chan>_L(const Ipp<data_type>* pSrc, IppSizeL srcStep, Ipp<data_type>* pDst, IppSizeL dstStep, IppiPointL dstOffset, IppiSizeL dstSize, IppiBorderType border, const Ipp<data_type>* pBorderValue, const IppiResizeSpec* pSpec, Ipp8u* pBuffer);

Supported values for data_type:

8u

16u

16s

32f

Supported values for chan:

C1R

C3R

C4R

Threading layer (TL) functions

IppStatus ippiResizeAntialiasing_<data_type>_<chan>_LT(const Ipp<data_type>* pSrc, IppSizeL srcStep, Ipp<data_type>* pDst, IppSizeL dstStep, IppiBorderType border, const Ipp<data_type>* pBorderValue, const IppiResizeSpec_LT* pSpec, Ipp8u* pBuffer);

Supported values for data_type:

8u

16u

16s

32f

Supported values for chan:

C1R

C3R

C4R

Include Files

ippi.h

Flavors with the _LT suffix: ippi_tl.h

Flavors with the _L suffix: ippi_l.h

Domain Dependencies

Flavors declared in ippi.h:

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Flavors declared in ippi_tl.h:

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib, ippcore_tl.lib, ippi_tl.lib

Parameters

pSrc

Pointer to the source image.

srcStep

Distance, in bytes, between the starting points of consecutive lines in the source image buffer.

pDst

Pointer to the destination image.

dstStep

Distance, in bytes, between the starting points of consecutive lines in the destination image buffer.

dstOffset

Offset of the tiled destination image with respect to the destination image origin.

dstSize

Size of the destination image, in pixels.

border

Type of border. Possible values are:

ippBorderRepl

Border is replicated from the edge pixels.

ippBorderConst

Border pixels are set to constants.

ippBorderInMem

Border is obtained from the source image pixels in memory.

Mixed borders are also supported. They can be obtained by the bitwise operation OR between the ippBorderRepl type and the ippBorderInMemTop, ippBorderInMemBottom, ippBorderInMemLeft, ippBorderInMemRight types.

pBorderValue

Pointer to the constant value to assign to pixels of the constant border. This parameter is applicable only to the ippBorderConst border type.

pSpec

Pointer to the specification structure for the resize filter.

pBuffer

Pointer to the external buffer.

Description

The ippiResizeAntialiasing function changes the size of an image using the chosen interpolation method with antialiasing. The interpolation method to be applied is defined by the function that you use for the resize filter initialization. Use this function to reduce the image size with minimization of moire artifacts. For more information about the implemented algorithm, refer to [SCHU92].

If you use ippiResizeAntialiasing to increase the image size, the function applies the same algorithm as one of the following resize functions, depending on the interpolation type chosen at the initialization stage: ippiResizeLinear, ippiResizeCubic, or ippiResizeLanczos.

This function operates with ROI. It resizes the source image ROI origin to the destination image ROI origin. Define the destination image ROI origin by the following parameters: the offset of the tiled destination image with respect to the destination image origin and the destination image size. The source image ROI origin is defined automatically. To obtain the source image ROI, use the corresponding flavor of the ippiResizeGetSrcRoi function. To obtain the source image ROI origin offset, call the corresponding flavor of the ippiResizeGetSrcOffset function. Parameters pSrc and pDst must point to the processed source and destination image ROI origins, respectively.

The interpolation algorithm applied uses edge pixels of the source image that are out of the image origin. The ippiResizeAntialiasing function uses the weighted values of these outer pixels. To obtain the size of the out of the source image origin, call the corresponding flavor of the ippiResizeGetBorderSize function.

Before using the ippiResizeAntialiasing function, you need to initialize the IppiResizeSpec_32f structure using one of the following functions, depending on the interpolation method to be applied: ippiResizeAntialiasingLinearInit, ippiResizeAntialiasingCubicInit, or ippiResizeAntialiasingLanczosInit, and compute the size of the external buffer pBuffer using the corresponding flavor of the ippiResizeGetBufferSize function.

For more information about the supported border types, see User-defined Border Types.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when one of the specified pointers is NULL.

ippStsNoOperation

Indicates a warning when width or height of the destination image is equal to zero.

ippStsBorderErr

Indicates an error when the border value is illegal.

ippStsContextMatchErr

Indicates an error when a pointer to the specification structure is invalid.

ippStsNotSupportedModeErr

Indicates an error when the requested mode is not supported.

ippStsSizeErr

Indicates an error when width or height of the destination image is negative.

ippStsStepErr

Indicates an error when the step value is not data type multiple.

ippStsOutOfRangeErr

Indicates an error when the destination image offset point is outside the destination image origin.

ippStsSizeWrn

Indicates a warning when the destination image size is more than the destination image origin size.

Example

ResizeAntialiasing.c

The figure below demonstrates the results of reducing a 1751x1044 image by five times with antialiasing (a) and without (b).

See Also

Для получения подробной информации о возможностях оптимизации компилятора обратитесь к нашему Уведомлению об оптимизации.