23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
29 bool unchanged =
false,
36 bool override =
false;
38 for (
int i=1; i<nrhs; i+=2) {
39 string key(rhs[i].toString());
41 flags = rhs[i+1].toInt();
44 else if (key ==
"Unchanged")
45 unchanged = rhs[i+1].toBool();
46 else if (key ==
"AnyDepth")
47 anydepth = rhs[i+1].toBool();
48 else if (key ==
"AnyColor")
49 anycolor = rhs[i+1].toBool();
50 else if (key ==
"Grayscale") {
51 color = !rhs[i+1].toBool();
54 else if (key ==
"Color") {
55 color = rhs[i+1].toBool();
58 else if (key ==
"GDAL")
59 gdal = rhs[i+1].toBool();
60 else if (key ==
"IgnoreOrientation")
61 norotate = rhs[i+1].toBool();
62 else if (key ==
"FlipChannels")
63 flip = rhs[i+1].toBool();
66 "Unrecognized option %s", key.
c_str());
94 string filename(rhs[0].toString());
100 if (it->data == NULL)
102 if (
flip && (it->channels() == 3 || it->channels() == 4)) {
104 cvtColor(*it, *it, (it->channels()==3 ?
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
bool imreadmulti(const String &filename, std::vector< Mat > &mats, int flags=IMREAD_ANYCOLOR)
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...
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)