virtual bool fixedType() const;
virtual bool needed() const;
virtual Mat& getMatRef(int i=-1) const;
- /*virtual*/ gpu::GpuMat& getGpuMatRef() const;
+ virtual gpu::GpuMat& getGpuMatRef() const;
virtual void create(Size sz, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
virtual void create(int rows, int cols, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
virtual void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS void split(const Mat& src, Mat* mvbegin);
-CV_EXPORTS void split(const Mat& m, vector<Mat>& mv );
+CV_EXPORTS void split(const Mat& src, vector<Mat>& mv );
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);
void (Algorithm::*setter)(int)=0,
const string& help=string());
void addParam(Algorithm& algo, const char* name,
- short& value, bool readOnly=false,
- int (Algorithm::*getter)()=0,
- void (Algorithm::*setter)(int)=0,
- const string& help=string());
- void addParam(Algorithm& algo, const char* name,
bool& value, bool readOnly=false,
int (Algorithm::*getter)()=0,
void (Algorithm::*setter)(int)=0,
struct CV_EXPORTS Param
{
- enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, SHORT=10 };
+ enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9 };
Param();
Param(int _type, bool _readonly, int _offset,
enum { type = Param::INT };
};
-template<> struct ParamType<short>
-{
- typedef int const_param_type;
- typedef int member_type;
-
- enum { type = Param::SHORT };
-};
-
template<> struct ParamType<double>
{
typedef double const_param_type;
class CV_EXPORTS CommandLineParser
{
public:
- CommandLineParser(int argc, const char* const argv[], const char* key_map);
- CommandLineParser(int argc, const char* const argv[], const string& key_map);
+ CommandLineParser(int argc, const char* const argv[], const char* keys);
+ CommandLineParser(int argc, const char* const argv[], const string& keys);
CommandLineParser(const CommandLineParser& parser);
CommandLineParser& operator = (const CommandLineParser& parser);
return val;
}
- bool has(const string& keys);
+ bool has(const string& name);
bool check() const;
void about(const string& message);
if( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL )
{
- CV_Assert( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN ||
- (p->type == Param::SHORT && argType == Param::INT) );
+ CV_Assert( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN );
if( p->type == Param::INT )
{
int val = argType == Param::INT ? *(const int*)value :
- argType == Param::BOOLEAN ? (int)*(const bool*)value :
- saturate_cast<int>(*(const double*)value);
+ argType == Param::BOOLEAN ? (int)*(const bool*)value :
+ saturate_cast<int>(*(const double*)value);
if( p->setter )
(algo->*f.set_int)(val);
else
*(int*)((uchar*)algo + p->offset) = val;
}
- else if( p->type == Param::SHORT )
- {
- int val = *(const int*)value;
- if( p->setter )
- (algo->*f.set_int)(val);
- else
- *(short*)((uchar*)algo + p->offset) = (short)val;
- }
else if( p->type == Param::BOOLEAN )
{
bool val = argType == Param::INT ? *(const int*)value != 0 :
else
*(double*)value = val;
}
- else if( p->type == Param::SHORT )
- {
- CV_Assert( argType == Param::INT );
- int val = p->getter ? (algo->*f.get_int)() : *(short*)((uchar*)algo + p->offset);
-
- *(int*)value = val;
- }
else if( p->type == Param::BOOLEAN )
{
CV_Assert( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL );
CV_Assert( argType == Param::INT || argType == Param::BOOLEAN ||
argType == Param::REAL || argType == Param::STRING ||
argType == Param::MAT || argType == Param::MAT_VECTOR ||
- argType == Param::ALGORITHM || argType == Param::SHORT );
+ argType == Param::ALGORITHM );
data->params.add(string(parameter), Param(argType, readOnly,
(int)((size_t)value - (size_t)(void*)&algo),
getter, setter, help));
}
void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
- short& value, bool readOnly,
- int (Algorithm::*getter)(),
- void (Algorithm::*setter)(int),
- const string& help)
-{
- addParam_(algo, parameter, ParamType<int>::type, &value, readOnly,
- (Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
-}
-
-void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
bool& value, bool readOnly,
int (Algorithm::*getter)(),
void (Algorithm::*setter)(int),