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

ResizeNearest

Changes an image size using the nearest neighbor interpolation method.

Syntax

IppStatus ippiResizeNearest_<mod>(const Ipp<datatype>* pSrc, Ipp32s srcStep, Ipp<datatype>* pDst, Ipp32s dstStep, IppiPoint dstOffset, IppiSize dstSize, 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 ippiResizeNearest_<mod>_L(const Ipp<datatype>* pSrc, IppSizeL srcStep, Ipp<datatype>* pDst, IppSizeL dstStep, IppiPointL dstOffset, IppiSizeL dstSize, 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 ippiResizeNearest_<mod>_LT(const Ipp<datatype>* pSrc, IppSizeL srcStep, Ipp<datatype>* pDst, IppSizeL dstStep, 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 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.

pSpec

Pointer to the specification structure for the resize filter.

pBuffer

Pointer to the work buffer.

Description

This function changes an image size using the nearest neighbor interpolation method. 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.

Function flavors operating on images of 64-bit sizes (with the L suffix) can process only whole images.

The interpolation algorithm applied uses only pixels of the source image origin that are inside of the image boundaries.

Before using the ippiResizeNearest function, you need to initialize the resize specification structure using the ippiResizeNearestInit 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.

ippStsContextMatchErr

Indicates an error when pointer to the spec structure is invalid.

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