27 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=2);
34 bool leftToRight =
false;
35 for (
int i=3; i<nrhs; i+=2) {
36 string key(rhs[i].toString());
37 if (key ==
"Connectivity")
38 connectivity = rhs[i+1].toInt();
39 else if (key ==
"LeftToRight")
40 leftToRight = rhs[i+1].toBool();
43 "Unrecognized option %s", key.
c_str());
48 Point pt1(rhs[1].toPoint()), pt2(rhs[2].toPoint());
49 LineIterator it(img, pt1, pt2, connectivity, leftToRight);
52 for (
int i = 0; i < it.
count; ++i) {
56 plhs[0] =
MxArray(
Mat(pts,
false).reshape(1,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.
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.