Difference between revisions of "Function:Rotate"

From CUVI Wiki
(Created page with "__NOTOC__ Rotates an image about origin (0,0) or center ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus rotate(CuviImage* srcImage, ...")
 
Line 32: Line 32:
| angle
| angle
| Cuvi32f
| Cuvi32f
| Angle of rotation, has a range of [-360,360]
| Angle of rotation
|-
|-
| type  
| type  

Revision as of 13:52, 8 May 2012

Rotates an image about origin (0,0) or center

Function

CuviStatus rotate(CuviImage* srcImage, 
                  CuviImage* dstImage,
                  Cuvi32f angle,
                  CuviRotationType type = CUVI_ROTATE_CENTER,
                  CuviStream* stream = NULL);


Parameters

Name Type Description
srcImage CuviImage* Input image
dstImage CuviImage* Output image
angle Cuvi32f Angle of rotation
type CuviRotationType Supports:
CUVI_ROTATE_CENTER
CUVI_ROTATE_ORIGIN
stream CuviStream* GPU stream ID for execution


Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3

Sample

Error creating thumbnail: Unable to save thumbnail to destination
Input Image
Error creating thumbnail: Unable to save thumbnail to destination
Output Image


Example

CuviImage* gimg = new CuviImage(size,img->depth,img->nChannels);
CuviImage* gout = new CuviImage(size,img->depth,img->nChannels);

//Populating GPU input image
gimg->upload(img->imageData,img->widthStep);


//function call
cuvi::geometryTransforms::rotate(gimg, gout, 15.0f, CUVI_ROTATE_ORIGIN);