| 1939 | |
| 1940 | |
| 1941 | void fillPoly( Mat& img, const Point** pts, const int* npts, int ncontours, |
| 1942 | const Scalar& color, int line_type, |
| 1943 | int shift, Point offset ) |
| 1944 | { |
| 1945 | if( line_type == CV_AA && img.depth() != CV_8U ) |
| 1946 | line_type = 8; |
| 1947 | |
| 1948 | CV_Assert( pts && npts && ncontours >= 0 && 0 <= shift && shift <= XY_SHIFT ); |
| 1949 | |
| 1950 | double buf[4]; |
| 1951 | scalarToRawData(color, buf, img.type(), 0); |
| 1952 | |
| 1953 | vector<PolyEdge> edges; |
| 1954 | |
| 1955 | int i, total = 0; |
| 1956 | for( i = 0; i < ncontours; i++ ) |
| 1957 | total += npts[i]; |
| 1958 | |
| 1959 | edges.reserve( total + 1 ); |
| 1960 | for( i = 0; i < ncontours; i++ ) |
| 1961 | { |
| 1962 | vector<Point2l> _pts; |
| 1963 | for( int n = 0; n < npts[i]; n++ ) |
| 1964 | _pts.push_back(Point2l(pts[i][n].x, pts[i][n].y)); |
| 1965 | CollectPolyEdges( img, _pts.data(), npts[i], edges, buf, line_type, shift, offset ); |
| 1966 | } |
| 1967 | |
| 1968 | FillEdgeCollection(img, edges, buf); |
| 1969 | } |
| 1970 | |
| 1971 | |
| 1972 | void polylines( Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, |
no test coverage detected