Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ResizeCubic

Changes an image size using interpolation with two-parameter cubic filters.

Syntax

IppStatus ippiResizeCubic_<mod>(const Ipp<datatype>* pSrc, Ipp32s srcStep, Ipp<datatype>* pDst, Ipp32s dstStep, IppiPoint dstOffset, IppiSize dstSize, IppiBorderType border, const Ipp<datatype>* pBorderValue, const IppiResizeSpec_32f* pSpec, Ipp8u* pBuffer);

Supported values for mod:

8u_C1R

16u_C1R

16s_C1R

32f_C1R

8u_C3R

16u_C3R

16s_C3R

32f_C3R

8u_C4R

16u_C4R

16s_C4R

32f_C4R

Platform-aware functions

IppStatus ippiResizeCubic_<mod>_L(const Ipp<datatype>* pSrc, IppSizeL srcStep, Ipp<datatype>* pDst, IppSizeL dstStep, IppiPointL dstOffset, IppiSizeL dstSize, IppiBorderType border, const Ipp<datatype>* pBorderValue, const IppiResizeSpec* pSpec, Ipp8u* pBuffer);

Supported values for mod:

8u_C1R

16u_C1R

16s_C1R

32f_C1R

8u_C3R

16u_C3R

16s_C3R

32f_C3R

8u_C4R

16u_C4R

16s_C4R

32f_C4R

Threading layer (TL) functions

IppStatus ippiResizeCubic_<mod>_LT(const Ipp<datatype>* pSrc, IppSizeL srcStep, Ipp<datatype>* pDst, IppSizeL dstStep, IppiBorderType border, const Ipp<datatype>* pBorderValue, const IppiResizeSpec_LT* pSpec, Ipp8u* pBuffer);

Supported values for mod:

8u_C1R

16u_C1R

16s_C1R

32f_C1R

8u_C3R

16u_C3R

16s_C3R

32f_C3R

8u_C4R

16u_C4R

16s_C4R

32f_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 startings 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.

ippBorderInMem

Border is obtained from the source image pixels in memory.

ippBorderMirror

Border is obtained from the source image boundary pixels. Value can be specified via ippiResizeCubic* and ippiResizeCubic*_LT.

ippBorderMirrorR

Border is obtained from the source image boundary pixels. The anchor cell value is replicated to the border pixels. Value can be specified via ippiResizeCubic* and ippiResizeCubic*_LT.

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 spec structure for the resize filter.

pBuffer

Pointer to the work buffer.

Description

This function changes an image size using interpolation with two-parameter cubic filters. The image size can be either reduced or increased in each direction, depending on the destination image size.

This function operates with ROI. It resizes the source image ROI origin to the destination image ROI origin. You need to 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 ippiResizeGetSrcRoi function with the corresponding mod value. To obtain the source image ROI origin offset, call the ippiResizeGetSrcOffset function with the corresponding mod value. 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 function ippiResizeCubic uses in calculation the weighted values of these outer pixels. To obtain the size of the out of the source image origin, call the ippiResizeGetBorderSize function for the corresponding flavor.

If the border type is equal to ippBorderRepl, the source image edge pixels are replicated out of the image origin. If the border type is equal to ippBorderInMem, the outer pixels are obtained from the out of the source image origin space. For the mixed border types, the combined approach is applied.

Before using the ippiResizeLinear function, you need to initialize the specification structure using the ippiResizeCubicInit function and compute the size of the external buffer pBuffer using the ippiResizeGetBufferSize function for the corresponding flavor.

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 pointer to the spec structure is invalid.

ippStsNotSupportedModeErr

Indicates an error when the requested mode is not supported.

ippStsSizeErr

Indicates an error when width or height of the source or 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.

See Also