36 int id = rhs[0].toInt();
37 string method(rhs[1].toString());
40 if (method ==
"new") {
41 nargchk((nrhs==3||nrhs==4) && nlhs<=1);
62 if (method ==
"delete") {
67 else if (method ==
"clear") {
71 else if (method ==
"load") {
72 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs==0);
74 bool loadFromString =
false;
75 for (
int i=3; i<nrhs; i+=2) {
76 string key(rhs[i].toString());
78 objname = rhs[i+1].toString();
79 else if (key ==
"FromString")
80 loadFromString = rhs[i+1].toBool();
83 "Unrecognized option %s", key.
c_str());
92 FileStorage fs(rhs[2].toString(), FileStorage::READ +
93 (loadFromString ? FileStorage::MEMORY : 0));
102 else if (method ==
"save") {
104 obj->
save(rhs[2].toString());
106 else if (method ==
"empty") {
110 else if (method ==
"getDefaultName") {
114 else if (method ==
"render") {
115 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
117 for (
int i=2; i<nrhs; i+=2) {
118 string key(rhs[i].toString());
119 if (key ==
"FlipChannels")
120 flip = rhs[i+1].toBool();
123 "Unrecognized option %s", key.
c_str());
134 else if (method ==
"set") {
136 string prop(rhs[2].toString());
138 obj->
setMinX(rhs[3].toDouble());
139 else if (prop ==
"MinY")
140 obj->
setMinY(rhs[3].toDouble());
141 else if (prop ==
"MaxX")
142 obj->
setMaxX(rhs[3].toDouble());
143 else if (prop ==
"MaxY")
144 obj->
setMaxY(rhs[3].toDouble());
145 else if (prop ==
"PlotLineWidth")
147 else if (prop ==
"NeedPlotLine")
149 else if (prop ==
"PlotLineColor")
151 ColorType[rhs[3].toString()] : rhs[3].toScalar());
152 else if (prop ==
"PlotBackgroundColor")
154 ColorType[rhs[3].toString()] : rhs[3].toScalar());
155 else if (prop ==
"PlotAxisColor")
157 ColorType[rhs[3].toString()] : rhs[3].toScalar());
158 else if (prop ==
"PlotGridColor")
160 ColorType[rhs[3].toString()] : rhs[3].toScalar());
161 else if (prop ==
"PlotTextColor")
163 ColorType[rhs[3].toString()] : rhs[3].toScalar());
164 else if (prop ==
"PlotSize") {
165 Size sz(rhs[3].toSize());
168 else if (prop ==
"ShowGrid")
170 else if (prop ==
"ShowText")
172 else if (prop ==
"GridLinesNumber")
174 else if (prop ==
"InvertOrientation")
176 else if (prop ==
"PointIdxToPrint")
180 "Unrecognized property %s", prop.
c_str());
184 "Unrecognized operation %s", method.
c_str());
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
int last_id
Last object id to allocate.
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
virtual void setGridLinesNumber(int gridLinesNumber)=0
virtual void setNeedPlotLine(bool _needPlotLine)=0
virtual void setMinY(double _plotMinY)=0
virtual bool isOpened() const
struct mxArray_tag mxArray
Forward declaration for mxArray.
virtual void setShowText(bool needShowText)=0
virtual void setPlotTextColor(Scalar _plotTextColor)=0
virtual void setInvertOrientation(bool _invertOrientation)=0
virtual void setPlotLineColor(Scalar _plotLineColor)=0
virtual void read(const FileNode &fn)
virtual void setPlotAxisColor(Scalar _plotAxisColor)=0
virtual void setMaxX(double _plotMaxX)=0
virtual void setPlotGridColor(Scalar _plotGridColor)=0
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...
virtual void setPlotSize(int _plotSizeWidth, int _plotSizeHeight)=0
virtual void setPointIdxToPrint(int pointIdx)=0
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
FileNode getFirstTopLevelNode() const
virtual void setMinX(double _plotMinX)=0
virtual void setShowGrid(bool needShowGrid)=0
virtual String getDefaultName() const
Global constant definitions.
virtual void setMaxY(double _plotMaxY)=0
virtual void setPlotBackgroundColor(Scalar _plotBackgroundColor)=0
void flip(InputArray src, OutputArray dst, int flipCode)
virtual void save(const String &filename) const
virtual bool empty() const
virtual void render(OutputArray _plotResult)=0
map< int, Ptr< Plot2d > > obj_
Object container.
const ConstMap< std::string, cv::Scalar > ColorType
Translates MATLAB color names (see ColorSpec) into OpenCV scalars.
void create(int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
virtual void setPlotLineWidth(int _plotLineWidth)=0