23 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
33 for (
int i=2; i<nrhs; i+=2) {
34 string key(rhs[i].toString());
36 color = (rhs[i+1].isChar()) ?
37 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
38 else if (key ==
"LineType")
39 lineType = (rhs[i+1].isChar()) ?
40 LineType[rhs[i+1].toString()] : rhs[i+1].toInt();
41 else if (key ==
"Shift")
42 shift = rhs[i+1].toInt();
43 else if (key ==
"Offset")
44 offset = rhs[i+1].toPoint();
47 "Unrecognized option %s", key.
c_str());
53 fillPoly(img, pts, color, lineType, shift, offset);
struct mxArray_tag mxArray
Forward declaration for mxArray.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
const ConstMap< std::string, int > LineType
Line type for drawing.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
void fillPoly(Mat &img, const Point **pts, const int *npts, int ncontours, const Scalar &color, int lineType=LINE_8, int shift=0, Point offset=Point())
Global constant definitions.
const ConstMap< std::string, cv::Scalar > ColorType
Translates MATLAB color names (see ColorSpec) into OpenCV scalars.