34 for (; first != last; first += 2) {
35 string key(first->toString());
36 const MxArray& val = *(first + 1);
38 samples = val.
toInt();
39 else if (key ==
"Lambda")
40 lambda = val.toFloat();
41 else if (key ==
"Random")
42 random = val.toBool();
45 "Unrecognized option %s", key.c_str());
65 int id = rhs[0].toInt();
66 string method(rhs[1].toString());
69 if (method ==
"new") {
82 if (method ==
"delete") {
87 else if (method ==
"clear") {
91 else if (method ==
"load") {
92 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs==0);
94 bool loadFromString =
false;
95 for (
int i=3; i<nrhs; i+=2) {
96 string key(rhs[i].toString());
98 objname = rhs[i+1].toString();
99 else if (key ==
"FromString")
100 loadFromString = rhs[i+1].toBool();
103 "Unrecognized option %s", key.
c_str());
112 FileStorage fs(rhs[2].toString(), FileStorage::READ +
113 (loadFromString ? FileStorage::MEMORY : 0));
122 else if (method ==
"save") {
124 obj->
save(rhs[2].toString());
126 else if (method ==
"empty") {
130 else if (method ==
"getDefaultName") {
134 else if (method ==
"process") {
147 else if (method ==
"get") {
149 string prop(rhs[2].toString());
150 if (prop ==
"Samples")
152 else if (prop ==
"Lambda")
154 else if (prop ==
"Random")
158 "Unrecognized property %s", prop.
c_str());
160 else if (method ==
"set") {
162 string prop(rhs[2].toString());
163 if (prop ==
"Samples")
165 else if (prop ==
"Lambda")
167 else if (prop ==
"Random")
171 "Unrecognized property %s", prop.
c_str());
175 "Unrecognized operation %s", method.
c_str());
int toInt() const
Convert MxArray to int.
virtual float getLambda() const=0
int last_id
Last object id to allocate.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
Ptr< CalibrateDebevec > create_CalibrateDebevec(vector< MxArray >::const_iterator first, vector< MxArray >::const_iterator last)
Create an instance of CalibrateDebevec using options in arguments.
virtual void setSamples(int samples)=0
virtual bool isOpened() const
struct mxArray_tag mxArray
Forward declaration for mxArray.
virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times)=0
virtual void read(const FileNode &fn)
Ptr< CalibrateDebevec > createCalibrateDebevec(int samples=70, float lambda=10.0f, bool random=false)
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...
map< int, Ptr< CalibrateDebevec > > obj_
Object container.
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
virtual bool getRandom() const=0
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
FileNode getFirstTopLevelNode() const
virtual String getDefaultName() const
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
virtual int getSamples() const=0
virtual void setRandom(bool random)=0
virtual void save(const String &filename) const
virtual bool empty() const
virtual void setLambda(float lambda)=0