MCPcopy Create free account
hub / github.com/creatale/node-dv / rectangle

Function rectangle

deps/opencv/modules/core/src/drawing.cpp:1737–1763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1735}
1736
1737void rectangle( Mat& img, Point pt1, Point pt2,
1738 const Scalar& color, int thickness,
1739 int lineType, int shift )
1740{
1741 if( lineType == CV_AA && img.depth() != CV_8U )
1742 lineType = 8;
1743
1744 CV_Assert( thickness <= 255 );
1745 CV_Assert( 0 <= shift && shift <= XY_SHIFT );
1746
1747 double buf[4];
1748 scalarToRawData(color, buf, img.type(), 0);
1749
1750 Point2l pt[4];
1751
1752 pt[0] = pt1;
1753 pt[1].x = pt2.x;
1754 pt[1].y = pt1.y;
1755 pt[2] = pt2;
1756 pt[3].x = pt1.x;
1757 pt[3].y = pt2.y;
1758
1759 if( thickness >= 0 )
1760 PolyLine( img, pt, 4, true, buf, thickness, lineType, shift );
1761 else
1762 FillConvexPoly( img, pt, 4, buf, lineType, shift );
1763}
1764
1765
1766void rectangle( Mat& img, Rect rec,

Callers 3

cvRectangleFunction · 0.85
cvRectangleRFunction · 0.85
setPaddingToZeroMethod · 0.85

Calls 9

scalarToRawDataFunction · 0.85
PolyLineFunction · 0.85
FillConvexPolyFunction · 0.85
tlMethod · 0.80
brMethod · 0.80
PointClass · 0.50
depthMethod · 0.45
typeMethod · 0.45
areaMethod · 0.45

Tested by

no test coverage detected