| 1970 | |
| 1971 | |
| 1972 | void polylines( Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, |
| 1973 | const Scalar& color, int thickness, int line_type, int shift ) |
| 1974 | { |
| 1975 | if( line_type == CV_AA && img.depth() != CV_8U ) |
| 1976 | line_type = 8; |
| 1977 | |
| 1978 | CV_Assert( pts && npts && ncontours >= 0 && |
| 1979 | 0 <= thickness && thickness <= 255 && |
| 1980 | 0 <= shift && shift <= XY_SHIFT ); |
| 1981 | |
| 1982 | double buf[4]; |
| 1983 | scalarToRawData( color, buf, img.type(), 0 ); |
| 1984 | |
| 1985 | for( int i = 0; i < ncontours; i++ ) |
| 1986 | { |
| 1987 | vector<Point2l> _pts; |
| 1988 | for( int n = 0; n < npts[i]; n++ ) |
| 1989 | _pts.push_back(Point2l(pts[i][n].x, pts[i][n].y)); |
| 1990 | PolyLine( img, _pts.data(), npts[i], isClosed, buf, thickness, line_type, shift ); |
| 1991 | } |
| 1992 | } |
| 1993 | |
| 1994 | |
| 1995 | enum { FONT_SIZE_SHIFT=8, FONT_ITALIC_ALPHA=(1 << 8), |