ResizeCenter

THIS FUNCTION IS DEPRECATED. Changes an image size and shifts the destination image relative to the given point.

Syntax

Case 1: Operation on pixel-order data

IppStatus ippiResizeCenter_<mod>(const Ipp<datatype>* pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, double xFactor, double yFactor, double xCenter, double yCenter, 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 ippiResizeCenter_<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, double xCenter, double yCenter, int interpolation);

Supported values for mod:

8u_P3R

16u_P3R

32f_P3R

IppStatus ippiResizeCenter_<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, double xCenter, double yCenter, int interpolation);

Supported values for mod:

8u_P4R

16u_P4R

32f_P4R

Parameters

pSrc

Pointer to the source image origin. An array of 3 or 4 pointers to different color planes 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 3 or 4 pointers to destination ROI in different color 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.

xCenter, yCenter

Coordinates of the preset center.

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 ippiResizeCenter 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. Unlike ippiResize, this function also shifts the destination image in such a way that a given point with coordinate xCenter, yCenter - preset center - remains stationary after resizing, which creates an effect of changing the image size relative to that point. The preset center is always positioned in the center of the destination image ROI with coordinates dstROI.width/2; dstROI.height/2 (see Figure “Resizing Image with the Function ippiResizeCenter”). Note that the preset center may be specified in an arbitrary point including points outside the source image..

Resizing Image with the Function ippiResizeCenter

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.

The code Example “Resizing and Shifting an Image ” shows how to use the ippiResizeCenter function.

Resizing and Shifting an Image 

IppStatus resizeCenter( void ) {
   Ipp8u x[8*8], y[8*8];
   IppiSize sz = {8,8}, roi = {8,8};
   IppiRect rect = {0,0,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 ippiResizeCenter_8u_C1R( x, sz, 8, rect, y, 8, sz,
      2.9, 2.0, 4, 4, IPPI_INTER_NN );
}
 

The image has the following contents after applying the ippiResizeCenter function:

 02 02 02 02 02 02 02 02
 02 02 02 02 02 02 02 02
 02 02 03 03 03 03 03 03
 02 02 03 03 03 03 03 03
 02 02 03 03 03 04 04 04
 02 02 03 03 03 04 04 04
 02 02 03 03 03 04 04 04
 02 02 03 03 03 04 04 04
 

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.

ippStsWrongIntersectROI

Indicates a warning 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.