23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
29 bool unchanged =
false,
35 bool override =
false;
37 for (
int i=1; i<nrhs; i+=2) {
38 string key(rhs[i].toString());
40 flags = rhs[i+1].toInt();
43 else if (key ==
"Unchanged")
44 unchanged = rhs[i+1].toBool();
45 else if (key ==
"AnyDepth")
46 anydepth = rhs[i+1].toBool();
47 else if (key ==
"AnyColor")
48 anycolor = rhs[i+1].toBool();
49 else if (key ==
"Grayscale") {
50 color = !rhs[i+1].toBool();
53 else if (key ==
"Color") {
54 color = rhs[i+1].toBool();
57 else if (key ==
"IgnoreOrientation")
58 norotate = rhs[i+1].toBool();
59 else if (key ==
"FlipChannels")
60 flip = rhs[i+1].toBool();
63 "Unrecognized option %s", key.
c_str());
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
struct mxArray_tag mxArray
Forward declaration for mxArray.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
IMREAD_IGNORE_ORIENTATION
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...
Mat imdecode(InputArray buf, int flags)
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
Global constant definitions.
void flip(InputArray src, OutputArray dst, int flipCode)