Resize

THIS FUNCTION IS DEPRECATED. Changes an image size.

Syntax

Case 1: Operation on pixel-order data

IppStatus ippiResize_<mod>(const Ipp<datatype>* pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, double xFactor, double yFactor, int interpolation);

Supported values for mod:

8u_C1R

16u_C1R

32f_C1R

8u_C3R

16u_C3R

32f_C3R

8u_C4R

16u_C4R

32f_C4R

8u_AC4R

16u_AC4R

32f_AC4R

Case 2: Operation on planar-order data

IppStatus ippiResize_<mod>(const Ipp<datatype>* const pSrc[3], IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* const pDst[3], int dstStep, IppiSize dstRoiSize, double xFactor, double yFactor, int interpolation);

Supported values for mod:

8u_P3R

16u_P3R

32f_P3R

IppStatus ippiResize_<mod>(const Ipp<datatype>* const pSrc[4], IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* const pDst[4], int dstStep, IppiSize dstRoiSize, double xFactor, double yFactor, int interpolation);

Supported values for mod:

8u_P4R

16u_P4R

32f_P4R

Parameters

pSrc

Pointer to the source image origin. An array of separate pointers to each plane in case of data in planar format.

srcSize

Size in pixels of the source image.

srcStep

Distance in bytes between starts of consecutive lines in the source image buffer.

srcRoi

Region of interest in the source image (of the IppiRect type).

pDst

Pointer to the destination image ROI. An array of pointers to separate ROI in each planes for planar image.

dstStep

Distance in bytes between starts of consecutive lines in the destination image buffer.

dstRoiSize

Size of the destination ROI in pixels.

xFactor, yFactor

Factors by which the x and y dimensions of the source ROI are changed. The factor value greater than 1 corresponds to increasing the image size in that dimension.

interpolation

Specifies the interpolation mode. Use one of the following values:

IPPI_INTER_NN

nearest neighbor interpolation

IPPI_INTER_LINEAR

linear interpolation

IPPI_INTER_CUBIC

cubic interpolation

IPPI_INTER_SUPER

supersampling interpolation, cannot be applied for image enlarging

IPPI_INTER_LANCZOS

interpolation with Lanczos window.

Description

Caution iconCaution

THIS FUNCTION IS DEPRECATED. Please use the function ippiResizeSqrPixel instead.

The function ippiResize is declared in the ippi.h file. It operates with ROI (see ROI Processing in Geometric Transforms).

This function resizes the source image ROI by xFactor in the x direction and yFactor in the y direction. The image size can be either reduced or increased in each direction, depending on the values of xFactor, yFactor. The result is resampled using the interpolation mode specified by the interpolation parameter, and written to the destination image ROI. Supersampling interpolation can be applied if both xFactor and yFactor are less than or equal to 1. Figure “Sample Image Changed by the ippiResize Function” shows the result of applying the ippiResize function to the sample image of size 256 by 256 pixels. The destination image is of 300 by 100 pixels size.

Sample Image Changed by the ippiResize Function

The following code Example “Resizing an Image” shows how to use the ippiResize function:

Resizing an Image

IppStatus resize( void ) {
   Ipp8u x[8*8], y[8*8];
   IppiSize srcsz={8,8}, dstroi={6,6};
   IppiRect srcroi={1,1,6,6};
   IppiSize roi = {8,8};
 int i;
   for( i=0; i<8; ++i ) {
      ippiSet_8u_C1R( (Ipp8u)i, x+8*i+i, 8, roi );
      --roi.width;
      --roi.height;    }
   return ippiResize_8u_C1R( x, srcsz, 8, srcroi, y, 8, dstroi, 2.9, 2, IPPI_INTER_NN );
}
The image has the following contents after resizing:
  01 01 01 01 01 01 CC CC
  01 01 01 01 01 01 CC CC
  01 01 02 02 02 02 CC CC
  01 01 02 02 02 02 CC CC
  01 01 02 02 02 03 CC CC
  01 01 02 02 02 03 CC CC
  CC CC CC CC CC CC CC CC
  CC CC CC CC CC CC CC CC
 

This function is used in the H.264 encoder included into Intel ® IPP Samples downloadable from http://www.intel.com/cd/software/products/asmo-na/eng/perflib/ipp/index.htm.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if pSrc or pDst pointer is NULL.

ippStsSizeErr

Indicates an error condition if srcSize or dstRoiSize has a field with zero or negative value.

ippStsWrongIntersectROIErr

Indicates an error condition if srcRoi has no intersection with the source image.

ippStsResizeNoOperationErr

Indicates an error condition if one of the destination image dimensions is less than 1 pixel.

ippStsResizeFactorErr

Indicates an error condition if xFactor or yFactor is less than or equal to zero.

ippStsInterpolationErr

Indicates an error condition if interpolation has an illegal value.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.