| 1735 | } |
| 1736 | |
| 1737 | void 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 | |
| 1766 | void rectangle( Mat& img, Rect rec, |
no test coverage detected