Function:Rectangle

From CUVI Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Draws a rectangle of specified color on the image.

Function

CuviStatus rectangle(CuviImage& image,
	             const CuviRect& rect,
                     const CuviScalar& color,
                     const CuviStream& stream = CuviStream());

Parameters

Name Type Description
image CuviImage& Input Image
rect const CuviRect& Region of the image on which to draw the rectangle
color const CuviScalar& Color of the rectangle
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3


Example

//Read an image from the disk
CuviImage image = cuvi::io::loadImage(path);

//Draw a 100 x 100 rectangle on the image starting from pixel (10,10)
CuviRect rect(10,10,100,100);

//Set the color of the rectangle
CuviScalar redColor(0,0,255);

//Draw the rectangle on the image
cuvi::dataExchange::rectangle(image,rect,color);