Rotate

Rotates an image around the origin (0,0) and then shifts it.

Syntax

Case 1: Operation on pixel-order data

IppStatus ippiRotate_<mod>(const Ipp<datatype>* pSrc, IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* pDst, int dstStep, IppiRect dstRoi, double angle, double xShift, double yShift, int interpolation);

Supported values for mod:

8u_C1R

16u_C1R

32f_C1R

64f_C1R

8u_C3R

16u_C3R

32f_C3R

64f_C3R

8u_C4R

16u_C4R

32f_C4R

64f_C4R

8u_AC4R

16u_AC4R

32f_AC4R

64f_AC4R

Case 2: Operation on planar-order data

IppStatus ippiRotate_<mod>(const Ipp<datatype>* const pSrc[3], IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* const pDst[3], int dstStep, IppiRect dstRoi, double angle, double xShift, double yShift, int interpolation);

Supported values for mod:

8u_P3R

16u_P3R

32f_P3R

64f_P3R

IppStatus ippiRotate_<mod>(const Ipp<datatype>* const pSrc[4], IppiSize srcSize, int srcStep, IppiRect srcRoi, Ipp<datatype>* const pDst[4], int dstStep, IppiRect dstRoi, double angle, double xShift, double yShift, int interpolation);

Supported values for mod:

8u_P4R

16u_P4R

32f_P4R

64f_P4R

Parameters

pSrc

Pointer to the source image origin. An array of separate pointers to each plane for 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 origin. An array of separate pointers to each plane for data in planar format.

dstStep

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

dstRoi

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

angle

The angle of rotation in degrees. The source image is rotated counterclockwise around the origin (0,0).

xShift, yShift

The shifts along horizontal and vertical axes to perform after the rotation.

interpolation

Specifies the interpolation mode. Possible values are:

IPPI_INTER_NN - nearest neighbor interpolation

IPPI_INTER_LINEAR - linear interpolation

IPPI_INTER_CUBIC - cubic interpolation

IPPI_INTER_CUBIC2P_CATMULLROM - Catmull-Rom spline

the following flag is used additionally to the above modes:

IPPI_SMOOTH_EDGE - edge smoothing

Description

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

This function rotates the ROI of the source image by angle degrees (counterclockwise for positive angle values) around the origin (0,0) that is implied to be in the top left corner, and shifts it by xShift and yShift values along the x- and y- axes, respectively. The result is resampled using the interpolation mode specified by the interpolation parameter, and written to the destination image ROI.

If you need to rotate an image about an arbitrary center (xCenter, yCenter), use the function ippiGetRotateShift to compute the appropriate xShift, yShift values, and then call ippiRotate with these values as input parameters.

Alternatively, you can use the ippiRotateCenter function instead.

Figure “Rotation of an Image” shows the result of rotating the sample image by 10 degrees.

Rotation of an Image

The figures below illustrate how the SMOOTH_EDGE option affects the resulting destination image appearance. Both images are computed as a result of rotating the same source image by 9 degrees using the same interpolation method, with the SMOOTH_EDGE option turned off and on, respectively. The use of this option has an antialiasing effect seen on the right border of image b) in Figure “The Effect of Edge Smoothing in the Destination Image”.

The Effect of Edge Smoothing in the Destination Image

Example “Using Intel IPP Functions for Image Rotation” shows how to use the function ippiRotate_8u_C1R.

Return Values

ippStsNoErr

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

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if any image dimension has zero or negative value.

ippStsInterpolationErr

Indicates an error condition if interpolation has an illegal value.

ippStsRectErr

Indicates an error condition if width or height of the intersection of the srcRoi and source image is less than or equal to 1.

ippStsWrongIntersectROIErr

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

ippStsWrongIntersectQuad

Indicates a warning that no operation is performed if the transformed source ROI has no intersection with the destination ROI.

Submit feedback on this help topic

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