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

Function fillPoly

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

Source from the content-addressed store, hash-verified

1939
1940
1941void 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
1972void polylines( Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed,

Callers 2

fillPolyMethod · 0.85
cvFillPolyFunction · 0.85

Calls 8

scalarToRawDataFunction · 0.85
CollectPolyEdgesFunction · 0.85
FillEdgeCollectionFunction · 0.85
dataMethod · 0.80
depthMethod · 0.45
typeMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected