Commit bb93e3ab authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added color canny; improved Algorithm class implementation

parent 716a5d04
......@@ -4288,12 +4288,31 @@ public:
void read(Algorithm* algo, const FileNode& fn) const;
string name() const;
template<typename _Tp> void addParam(const Algorithm* algo, const char* name,
const typename ParamType<_Tp>::member_type& value,
bool readOnly=false,
typename ParamType<_Tp>::member_type (Algorithm::*getter)()=0,
void (Algorithm::*setter)(typename ParamType<_Tp>::const_param_type)=0,
const string& help=string());
void addParam(const Algorithm* algo, const char* name,
const int& value, bool readOnly=false,
int (Algorithm::*getter)()=0,
void (Algorithm::*setter)(int)=0,
const string& help=string());
void addParam(const Algorithm* algo, const char* name,
const double& value, bool readOnly=false,
double (Algorithm::*getter)()=0,
void (Algorithm::*setter)(double)=0,
const string& help=string());
void addParam(const Algorithm* algo, const char* name,
const string& value, bool readOnly=false,
string (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const string&)=0,
const string& help=string());
void addParam(const Algorithm* algo, const char* name,
const Mat& value, bool readOnly=false,
Mat (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Mat&)=0,
const string& help=string());
void addParam(const Algorithm* algo, const char* name,
const Ptr<Algorithm>& value, bool readOnly=false,
Ptr<Algorithm> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
const string& help=string());
protected:
AlgorithmInfoData* data;
};
......
......@@ -3833,17 +3833,6 @@ template<typename _Tp> inline void Algorithm::set(const char* name,
info()->set(this, name, ParamType<_Tp>::type, &value);
}
template<typename _Tp> inline void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const typename ParamType<_Tp>::member_type& value,
bool readOnly,
typename ParamType<_Tp>::member_type (Algorithm::*getter)(),
void (Algorithm::*setter)(typename ParamType<_Tp>::const_param_type),
const string& help)
{
addParam_(algo, name, ParamType<_Tp>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
}
#endif // __cplusplus
......
......@@ -493,6 +493,57 @@ void AlgorithmInfo::addParam_(const Algorithm* algo, const char* name, int argTy
(int)((size_t)value - (size_t)(void*)algo),
getter, setter, help));
}
void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const int& value, bool readOnly,
int (Algorithm::*getter)(),
void (Algorithm::*setter)(int),
const string& help)
{
addParam_(algo, name, ParamType<int>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const double& value, bool readOnly,
double (Algorithm::*getter)(),
void (Algorithm::*setter)(double),
const string& help)
{
addParam_(algo, name, ParamType<double>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const string& value, bool readOnly,
string (Algorithm::*getter)(),
void (Algorithm::*setter)(const string&),
const string& help)
{
addParam_(algo, name, ParamType<string>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const Mat& value, bool readOnly,
Mat (Algorithm::*getter)(),
void (Algorithm::*setter)(const Mat&),
const string& help)
{
addParam_(algo, name, ParamType<Mat>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(const Algorithm* algo, const char* name,
const Ptr<Algorithm>& value, bool readOnly,
Ptr<Algorithm> (Algorithm::*getter)(),
void (Algorithm::*setter)(const Ptr<Algorithm>&),
const string& help)
{
addParam_(algo, name, ParamType<Algorithm>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment