23 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
30 float green_mul = 1.0f;
31 float blue_mul = 1.0f;
33 for (
int i=2; i<nrhs; i+=2) {
34 string key(rhs[i].toString());
36 red_mul = rhs[i+1].toFloat();
38 green_mul = rhs[i+1].toFloat();
40 blue_mul = rhs[i+1].toFloat();
41 else if (key ==
"FlipChannels")
42 flip = rhs[i+1].toBool();
45 "Unrecognized option %s", key.
c_str());
54 if (src.channels() == 3)
56 if (mask.channels() == 3)
59 colorChange(src, mask, dst, red_mul, green_mul, blue_mul);
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
struct mxArray_tag mxArray
Forward declaration for mxArray.
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)
void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul=1.0f, float green_mul=1.0f, float blue_mul=1.0f)