ResizeCCRotate

Creates a low-resolution preview image for high-resolution video or still capture applications.

Syntax

IppStatus ippiResizeCCRotate_8u_C2R(const Ipp8u* pSrc, int srcStep, IppiSize srcRoi, Ipp16u * pDst, int dstStep, int zoomFactor, int interpolation, int colorConversion, int rotation);

Parameters

pSrc

Pointer to the source image. Input byte order is Cb Y Cr Y.

srcStep

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

srcRoi

ROI of the source image, in pixels. The ROI of the destination image is calculated by user.

pDst

Pointer to the destination image. As an output parameter, indicates a pointer to the start of the buffer containing the resized and rotated image with completed color conversion.

dstStep

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

zoomFactor

Parameter, indicating downscale factor; takes values 2, 4 or 8 for 2:1, 4:1, and 8:1 downscale respectively.

interpolation

Type of interpolation to perform resampling of the input image. The following types are currently supported: IPPI_INTER_NN - nearest neighbor interpolation, IPPI_INTER_LINEAR - linear interpolation.

colorConversion

Color conversion control parameter, must be set to one of the following pre-defined values: IPPVC_CbYCr422ToBGR565 and IPPVC_CbYCr422ToBGR555. See the corresponding enumerator in the introduction to the General Functions

rotation

Rotation control parameter. Possible values:

IPPVC_ROTATE_DISABLE

no rotation

IPPVC_ROTATE_90CCW

rotating by 90o counterclockwise

IPPVC_ROTATE_90CW

rotating by 90o clockwise

IPPVC_ROTATE_180

rotating by 180o

See the corresponding enumerator in the introduction to the General Functions.

Description

The function ippiResizeCCRotate_8u_C2R is declared in the ippvc.h file. This function synthesizes a low-resolution preview image for high-resolution video or still capture applications. The function combines scale reduction 2:1, 4:1 or 8:1, color space conversion, and rotation of an image.

Example “Call of ippiResizeCCRotate_8u_C2R shows how to call ippiResizeCCRotate_8u_C2R.

Call of ippiResizeCCRotate_8u_C2R  

#define ROTATE IPPVC_ROTATE_90CW
#define ZOOMOUT  8

  {
    Ipp8u*  pSrcIm;
    Ipp16u* pDstIm;
    int    stepSrc;
    int    stepDst;
    IppiSize srcRoi = {64,64};
    IppiSize dstRoi;
    /* you should calculate dstROI for memory allocation only.*/
    /* dstROI is a function of parameters zoomFactor and rotation.*/
    switch (ROTATE){
      case IPPVC_ROTATE_DISABLE:
      case IPPVC_ROTATE_180:
        dstRoi.width = srcRoi.width /ZOOMOUT;
        dstRoi.height = srcRoi.height/ZOOMOUT;
		   break;
		case IPPVC_ROTATE_90CCW:
		case IPPVC_ROTATE_90CW:
        dstRoi.width = srcRoi.height/ZOOMOUT;
        dstRoi.height = srcRoi.width /ZOOMOUT;
		   break;
    }
    pSrcIm = ippiMalloc_8u_C2 (srcRoi.width, srcRoi.height, &stepSrc);
    pDstIm = ippiMalloc_16u_C1(dstRoi.width, dstRoi.height, &stepDst);
    ippiResizeCCRotate_8u_C2R (pSrcIm, stepSrc, srcRoi, pDstIm, stepDst,
 ZOOMOUT, IPPI_INTER_NN, IPPVC_CbYCr422ToBGR555, ROTATE);
    ippiFree(pDstIm);
    ippiFree(pSrcIm);
  }

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

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

ippStsSizeErr

Indicates an error condition if srcRoi.width or srcRoi.height is less than zoomFactor.

ippStsInterpolationErr

Indicates an invalid value of interpolation control parameter.

ippStsResizeFactorErr

Indicates an invalid value of zoomFactor control parameter.

ippStsBadArgErr

Indicates an invalid value of rotation control parameter.

ippStsDoubleSize

Indicates the condition when the values srcRoi.width and srcRoi.height are not multiples of 2. The function reduces their original values to the nearest multiples of 2 and continues operation.

Note iconNote

If srcRoi.width and srcRoi.height are not multiples of 2, the function reduces the values to the nearest multiples of 2. For example, if the size value is 7, the function approximates this value to 6.


Submit feedback on this help topic

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