23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
29 bool unchanged =
false,
37 bool override =
false;
39 for (
int i=1; i<nrhs; i+=2) {
40 string key(rhs[i].toString());
42 flags = rhs[i+1].toInt();
45 else if (key ==
"Unchanged")
46 unchanged = rhs[i+1].toBool();
47 else if (key ==
"AnyDepth")
48 anydepth = rhs[i+1].toBool();
49 else if (key ==
"AnyColor")
50 anycolor = rhs[i+1].toBool();
51 else if (key ==
"Grayscale") {
52 color = !rhs[i+1].toBool();
55 else if (key ==
"Color") {
56 color = rhs[i+1].toBool();
59 else if (key ==
"GDAL")
60 gdal = rhs[i+1].toBool();
61 else if (key ==
"ReduceScale") {
62 scale_denom = rhs[i+1].toInt();
63 CV_Assert(scale_denom==1 || scale_denom==2 ||
64 scale_denom==4 || scale_denom==8);
66 else if (key ==
"IgnoreOrientation")
67 norotate = rhs[i+1].toBool();
68 else if (key ==
"FlipChannels")
69 flip = rhs[i+1].toBool();
72 "Unrecognized option %s", key.
c_str());
95 if (scale_denom > 1) {
98 else if (scale_denom == 4)
100 else if (scale_denom == 8)
110 string filename(rhs[0].toString());
112 if (img.
data == NULL)
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
Mat imread(const String &filename, int flags=IMREAD_COLOR)
struct mxArray_tag mxArray
Forward declaration for mxArray.
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...
IMREAD_REDUCED_GRAYSCALE_4
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
Global constant definitions.
IMREAD_REDUCED_GRAYSCALE_2
void flip(InputArray src, OutputArray dst, int flipCode)
IMREAD_REDUCED_GRAYSCALE_8
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.