@ -96,7 +96,7 @@ template<typename _KeyTp, typename _ValueTp> struct sorted_vector
} ;
template < typename _ValueTp > inline const _ValueTp * findstr ( const sorted_vector < std : : s tring, _ValueTp > & vec ,
template < typename _ValueTp > inline const _ValueTp * findstr ( const sorted_vector < cv : : S tring, _ValueTp > & vec ,
const char * key )
{
if ( ! key )
@ -130,7 +130,7 @@ Param::Param()
Param : : Param ( int _type , bool _readonly , int _offset ,
Algorithm : : Getter _getter , Algorithm : : Setter _setter ,
const std : : s tring& _help )
const cv : : S tring& _help )
{
type = _type ;
readonly = _readonly ;
@ -142,23 +142,23 @@ Param::Param(int _type, bool _readonly, int _offset,
struct CV_EXPORTS AlgorithmInfoData
{
sorted_vector < std : : s tring, Param > params ;
std : : s tring _name ;
sorted_vector < cv : : S tring, Param > params ;
cv : : S tring _name ;
} ;
static sorted_vector < std : : s tring, Algorithm : : Constructor > & alglist ( )
static sorted_vector < cv : : S tring, Algorithm : : Constructor > & alglist ( )
{
static sorted_vector < std : : s tring, Algorithm : : Constructor > alglist_var ;
static sorted_vector < cv : : S tring, Algorithm : : Constructor > alglist_var ;
return alglist_var ;
}
void Algorithm : : getList ( std : : vector < std : : s tring> & algorithms )
void Algorithm : : getList ( std : : vector < cv : : S tring> & algorithms )
{
alglist ( ) . get_keys ( algorithms ) ;
}
Ptr < Algorithm > Algorithm : : _create ( const std : : s tring& name )
Ptr < Algorithm > Algorithm : : _create ( const cv : : S tring& name )
{
Algorithm : : Constructor c = 0 ;
if ( ! alglist ( ) . find ( name , c ) )
@ -174,42 +174,42 @@ Algorithm::~Algorithm()
{
}
std : : s tring Algorithm : : name ( ) const
cv : : S tring Algorithm : : name ( ) const
{
return info ( ) - > name ( ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , int value )
void Algorithm : : set ( const cv : : S tring& parameter , int value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < int > : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , double value )
void Algorithm : : set ( const cv : : S tring& parameter , double value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < double > : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , bool value )
void Algorithm : : set ( const cv : : S tring& parameter , bool value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < bool > : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , const std : : s tring& value )
void Algorithm : : set ( const cv : : S tring& parameter , const cv : : S tring& value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < std : : s tring> : : type , & value ) ;
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < cv : : S tring> : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , const Mat & value )
void Algorithm : : set ( const cv : : S tring& parameter , const Mat & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < Mat > : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , const std : : vector < Mat > & value )
void Algorithm : : set ( const cv : : S tring& parameter , const std : : vector < Mat > & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < std : : vector < Mat > > : : type , & value ) ;
}
void Algorithm : : set ( const std : : s tring& parameter , const Ptr < Algorithm > & value )
void Algorithm : : set ( const cv : : S tring& parameter , const Ptr < Algorithm > & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < Algorithm > : : type , & value ) ;
}
@ -229,9 +229,9 @@ void Algorithm::set(const char* parameter, bool value)
info ( ) - > set ( this , parameter , ParamType < bool > : : type , & value ) ;
}
void Algorithm : : set ( const char * parameter , const std : : s tring& value )
void Algorithm : : set ( const char * parameter , const cv : : S tring& value )
{
info ( ) - > set ( this , parameter , ParamType < std : : s tring> : : type , & value ) ;
info ( ) - > set ( this , parameter , ParamType < cv : : S tring> : : type , & value ) ;
}
void Algorithm : : set ( const char * parameter , const Mat & value )
@ -250,37 +250,37 @@ void Algorithm::set(const char* parameter, const Ptr<Algorithm>& value)
}
void Algorithm : : setInt ( const std : : s tring& parameter , int value )
void Algorithm : : setInt ( const cv : : S tring& parameter , int value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < int > : : type , & value ) ;
}
void Algorithm : : setDouble ( const std : : s tring& parameter , double value )
void Algorithm : : setDouble ( const cv : : S tring& parameter , double value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < double > : : type , & value ) ;
}
void Algorithm : : setBool ( const std : : s tring& parameter , bool value )
void Algorithm : : setBool ( const cv : : S tring& parameter , bool value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < bool > : : type , & value ) ;
}
void Algorithm : : setString ( const std : : s tring& parameter , const std : : s tring& value )
void Algorithm : : setString ( const cv : : S tring& parameter , const cv : : S tring& value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < std : : s tring> : : type , & value ) ;
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < cv : : S tring> : : type , & value ) ;
}
void Algorithm : : setMat ( const std : : s tring& parameter , const Mat & value )
void Algorithm : : setMat ( const cv : : S tring& parameter , const Mat & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < Mat > : : type , & value ) ;
}
void Algorithm : : setMatVector ( const std : : s tring& parameter , const std : : vector < Mat > & value )
void Algorithm : : setMatVector ( const cv : : S tring& parameter , const std : : vector < Mat > & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < std : : vector < Mat > > : : type , & value ) ;
}
void Algorithm : : setAlgorithm ( const std : : s tring& parameter , const Ptr < Algorithm > & value )
void Algorithm : : setAlgorithm ( const cv : : S tring& parameter , const Ptr < Algorithm > & value )
{
info ( ) - > set ( this , parameter . c_str ( ) , ParamType < Algorithm > : : type , & value ) ;
}
@ -300,9 +300,9 @@ void Algorithm::setBool(const char* parameter, bool value)
info ( ) - > set ( this , parameter , ParamType < bool > : : type , & value ) ;
}
void Algorithm : : setString ( const char * parameter , const std : : s tring& value )
void Algorithm : : setString ( const char * parameter , const cv : : S tring& value )
{
info ( ) - > set ( this , parameter , ParamType < std : : s tring> : : type , & value ) ;
info ( ) - > set ( this , parameter , ParamType < cv : : S tring> : : type , & value ) ;
}
void Algorithm : : setMat ( const char * parameter , const Mat & value )
@ -322,47 +322,47 @@ void Algorithm::setAlgorithm(const char* parameter, const Ptr<Algorithm>& value)
int Algorithm : : getInt ( const std : : s tring& parameter ) const
int Algorithm : : getInt ( const cv : : S tring& parameter ) const
{
return get < int > ( parameter ) ;
}
double Algorithm : : getDouble ( const std : : s tring& parameter ) const
double Algorithm : : getDouble ( const cv : : S tring& parameter ) const
{
return get < double > ( parameter ) ;
}
bool Algorithm : : getBool ( const std : : s tring& parameter ) const
bool Algorithm : : getBool ( const cv : : S tring& parameter ) const
{
return get < bool > ( parameter ) ;
}
std : : s tring Algorithm : : getString ( const std : : s tring& parameter ) const
cv : : S tring Algorithm : : getString ( const cv : : S tring& parameter ) const
{
return get < std : : s tring> ( parameter ) ;
return get < cv : : S tring> ( parameter ) ;
}
Mat Algorithm : : getMat ( const std : : s tring& parameter ) const
Mat Algorithm : : getMat ( const cv : : S tring& parameter ) const
{
return get < Mat > ( parameter ) ;
}
std : : vector < Mat > Algorithm : : getMatVector ( const std : : s tring& parameter ) const
std : : vector < Mat > Algorithm : : getMatVector ( const cv : : S tring& parameter ) const
{
return get < std : : vector < Mat > > ( parameter ) ;
}
Ptr < Algorithm > Algorithm : : getAlgorithm ( const std : : s tring& parameter ) const
Ptr < Algorithm > Algorithm : : getAlgorithm ( const cv : : S tring& parameter ) const
{
return get < Algorithm > ( parameter ) ;
}
std : : s tring Algorithm : : paramHelp ( const std : : s tring& parameter ) const
cv : : S tring Algorithm : : paramHelp ( const cv : : S tring& parameter ) const
{
return info ( ) - > paramHelp ( parameter . c_str ( ) ) ;
}
int Algorithm : : paramType ( const std : : s tring& parameter ) const
int Algorithm : : paramType ( const cv : : S tring& parameter ) const
{
return info ( ) - > paramType ( parameter . c_str ( ) ) ;
}
@ -372,7 +372,7 @@ int Algorithm::paramType(const char* parameter) const
return info ( ) - > paramType ( parameter ) ;
}
void Algorithm : : getParams ( std : : vector < std : : s tring> & names ) const
void Algorithm : : getParams ( std : : vector < cv : : S tring> & names ) const
{
info ( ) - > getParams ( names ) ;
}
@ -388,7 +388,7 @@ void Algorithm::read(const FileNode& fn)
}
AlgorithmInfo : : AlgorithmInfo ( const std : : s tring& _name , Algorithm : : Constructor create )
AlgorithmInfo : : AlgorithmInfo ( const cv : : S tring& _name , Algorithm : : Constructor create )
{
data = new AlgorithmInfoData ;
data - > _name = _name ;
@ -408,7 +408,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
for ( i = 0 ; i < nparams ; i + + )
{
const Param & p = data - > params . vec [ i ] . second ;
const std : : s tring& pname = data - > params . vec [ i ] . first ;
const cv : : S tring& pname = data - > params . vec [ i ] . first ;
if ( p . type = = Param : : INT )
cv : : write ( fs , pname , algo - > get < int > ( pname ) ) ;
else if ( p . type = = Param : : BOOLEAN )
@ -416,7 +416,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
else if ( p . type = = Param : : REAL )
cv : : write ( fs , pname , algo - > get < double > ( pname ) ) ;
else if ( p . type = = Param : : STRING )
cv : : write ( fs , pname , algo - > get < std : : s tring> ( pname ) ) ;
cv : : write ( fs , pname , algo - > get < cv : : S tring> ( pname ) ) ;
else if ( p . type = = Param : : MAT )
cv : : write ( fs , pname , algo - > get < Mat > ( pname ) ) ;
else if ( p . type = = Param : : MAT_VECTOR )
@ -437,7 +437,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
cv : : write ( fs , pname , algo - > getInt ( pname ) ) ;
else
{
std : : s tring msg = format ( " unknown/unsupported type of '%s' parameter == %d " , pname . c_str ( ) , p . type ) ;
cv : : S tring msg = format ( " unknown/unsupported type of '%s' parameter == %d " , pname . c_str ( ) , p . type ) ;
CV_Error ( CV_StsUnsupportedFormat , msg . c_str ( ) ) ;
}
}
@ -451,7 +451,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
for ( i = 0 ; i < nparams ; i + + )
{
const Param & p = data - > params . vec [ i ] . second ;
const std : : s tring& pname = data - > params . vec [ i ] . first ;
const cv : : S tring& pname = data - > params . vec [ i ] . first ;
const FileNode n = fn [ pname ] ;
if ( n . empty ( ) )
continue ;
@ -472,7 +472,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else if ( p . type = = Param : : STRING )
{
std : : s tring val = ( std : : s tring) n ;
cv : : S tring val = ( cv : : S tring) n ;
info - > set ( algo , pname . c_str ( ) , p . type , & val , true ) ;
}
else if ( p . type = = Param : : MAT )
@ -489,7 +489,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else if ( p . type = = Param : : ALGORITHM )
{
Ptr < Algorithm > nestedAlgo = Algorithm : : _create ( ( std : : s tring) n [ " name " ] ) ;
Ptr < Algorithm > nestedAlgo = Algorithm : : _create ( ( cv : : S tring) n [ " name " ] ) ;
CV_Assert ( ! nestedAlgo . empty ( ) ) ;
nestedAlgo - > read ( n ) ;
info - > set ( algo , pname . c_str ( ) , p . type , & nestedAlgo , true ) ;
@ -516,13 +516,13 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else
{
std : : s tring msg = format ( " unknown/unsupported type of '%s' parameter == %d " , pname . c_str ( ) , p . type ) ;
cv : : S tring msg = format ( " unknown/unsupported type of '%s' parameter == %d " , pname . c_str ( ) , p . type ) ;
CV_Error ( CV_StsUnsupportedFormat , msg . c_str ( ) ) ;
}
}
}
std : : s tring AlgorithmInfo : : name ( ) const
cv : : S tring AlgorithmInfo : : name ( ) const
{
return data - > _name ;
}
@ -532,7 +532,7 @@ union GetSetParam
int ( Algorithm : : * get_int ) ( ) const ;
bool ( Algorithm : : * get_bool ) ( ) const ;
double ( Algorithm : : * get_double ) ( ) const ;
std : : s tring ( Algorithm : : * get_string ) ( ) const ;
cv : : S tring ( Algorithm : : * get_string ) ( ) const ;
Mat ( Algorithm : : * get_mat ) ( ) const ;
std : : vector < Mat > ( Algorithm : : * get_mat_vector ) ( ) const ;
Ptr < Algorithm > ( Algorithm : : * get_algo ) ( ) const ;
@ -544,7 +544,7 @@ union GetSetParam
void ( Algorithm : : * set_int ) ( int ) ;
void ( Algorithm : : * set_bool ) ( bool ) ;
void ( Algorithm : : * set_double ) ( double ) ;
void ( Algorithm : : * set_string ) ( const std : : s tring& ) ;
void ( Algorithm : : * set_string ) ( const cv : : S tring& ) ;
void ( Algorithm : : * set_mat ) ( const Mat & ) ;
void ( Algorithm : : * set_mat_vector ) ( const std : : vector < Mat > & ) ;
void ( Algorithm : : * set_algo ) ( const Ptr < Algorithm > & ) ;
@ -554,9 +554,9 @@ union GetSetParam
void ( Algorithm : : * set_uchar ) ( uchar ) ;
} ;
static std : : s tring getNameOfType ( int argType ) ;
static cv : : S tring getNameOfType ( int argType ) ;
static std : : s tring getNameOfType ( int argType )
static cv : : S tring getNameOfType ( int argType )
{
switch ( argType )
{
@ -576,37 +576,37 @@ static std::string getNameOfType(int argType)
return " " ;
}
static std : : s tring getErrorMessageForWrongArgumentInSetter ( std : : string algoName , std : : s tring paramName , int paramType , int argType )
static cv : : S tring getErrorMessageForWrongArgumentInSetter ( cv : : String algoName , cv : : S tring paramName , int paramType , int argType )
{
std : : string message = std : : s tring( " Argument error: the setter " )
cv : : String message = cv : : S tring( " Argument error: the setter " )
+ " method was called for the parameter ' " + paramName + " ' of the algorithm ' " + algoName
+ " ', the parameter has " + getNameOfType ( paramType ) + " type, " ;
if ( paramType = = Param : : INT | | paramType = = Param : : BOOLEAN | | paramType = = Param : : REAL
| | paramType = = Param : : FLOAT | | paramType = = Param : : UNSIGNED_INT | | paramType = = Param : : UINT64 | | paramType = = Param : : UCHAR )
{
message + = " so it should be set by integer, unsigned integer, uint64, unsigned char, boolean, float or double value, " ;
message = message + " so it should be set by integer, unsigned integer, uint64, unsigned char, boolean, float or double value, " ;
}
message + = " but the setter was called with " + getNameOfType ( argType ) + " value " ;
message = message + " but the setter was called with " + getNameOfType ( argType ) + " value " ;
return message ;
}
static std : : s tring getErrorMessageForWrongArgumentInGetter ( std : : string algoName , std : : s tring paramName , int paramType , int argType )
static cv : : S tring getErrorMessageForWrongArgumentInGetter ( cv : : String algoName , cv : : S tring paramName , int paramType , int argType )
{
std : : string message = std : : s tring( " Argument error: the getter " )
cv : : String message = cv : : S tring( " Argument error: the getter " )
+ " method was called for the parameter ' " + paramName + " ' of the algorithm ' " + algoName
+ " ', the parameter has " + getNameOfType ( paramType ) + " type, " ;
if ( paramType = = Param : : BOOLEAN )
{
message + = " so it should be get as integer, unsigned integer, uint64, boolean, unsigned char, float or double value, " ;
message = message + " so it should be get as integer, unsigned integer, uint64, boolean, unsigned char, float or double value, " ;
}
else if ( paramType = = Param : : INT | | paramType = = Param : : UNSIGNED_INT | | paramType = = Param : : UINT64 | | paramType = = Param : : UCHAR )
{
message + = " so it should be get as integer, unsigned integer, uint64, unsigned char, float or double value, " ;
message = message + " so it should be get as integer, unsigned integer, uint64, unsigned char, float or double value, " ;
}
message + = " but the getter was called to get a " + getNameOfType ( argType ) + " value " ;
message = message + " but the getter was called to get a " + getNameOfType ( argType ) + " value " ;
return message ;
}
@ -630,7 +630,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
if ( ! ( p - > type = = Param : : INT | | p - > type = = Param : : REAL | | p - > type = = Param : : BOOLEAN
| | p - > type = = Param : : UNSIGNED_INT | | p - > type = = Param : : UINT64 | | p - > type = = Param : : FLOAT | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -790,21 +790,21 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if ( p - > type ! = Param : : STRING )
{
std : : s tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
const std : : s tring& val = * ( const std : : s tring* ) value ;
const cv : : S tring& val = * ( const cv : : S tring* ) value ;
if ( p - > setter )
( algo - > * f . set_string ) ( val ) ;
else
* ( std : : s tring* ) ( ( uchar * ) algo + p - > offset ) = val ;
* ( cv : : S tring* ) ( ( uchar * ) algo + p - > offset ) = val ;
}
else if ( argType = = Param : : MAT )
{
if ( p - > type ! = Param : : MAT )
{
std : : s tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -818,7 +818,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if ( p - > type ! = Param : : MAT_VECTOR )
{
std : : s tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -832,7 +832,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if ( p - > type ! = Param : : ALGORITHM )
{
std : : s tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInSetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -862,7 +862,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : INT | | argType = = Param : : REAL | | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64 | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
int val = p - > getter ? ( algo - > * f . get_int ) ( ) : * ( int * ) ( ( uchar * ) algo + p - > offset ) ;
@ -887,7 +887,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : INT | | argType = = Param : : BOOLEAN | | argType = = Param : : REAL | | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64 | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
bool val = p - > getter ? ( algo - > * f . get_bool ) ( ) : * ( bool * ) ( ( uchar * ) algo + p - > offset ) ;
@ -913,7 +913,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : REAL | | argType = = Param : : FLOAT ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
double val = p - > getter ? ( algo - > * f . get_double ) ( ) : * ( double * ) ( ( uchar * ) algo + p - > offset ) ;
@ -929,7 +929,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : REAL | | argType = = Param : : FLOAT ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
float val = p - > getter ? ( algo - > * f . get_float ) ( ) : * ( float * ) ( ( uchar * ) algo + p - > offset ) ;
@ -945,7 +945,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : INT | | argType = = Param : : REAL | | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64 | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
unsigned int val = p - > getter ? ( algo - > * f . get_uint ) ( ) : * ( unsigned int * ) ( ( uchar * ) algo + p - > offset ) ;
@ -969,7 +969,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : INT | | argType = = Param : : REAL | | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64 | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
uint64 val = p - > getter ? ( algo - > * f . get_uint64 ) ( ) : * ( uint64 * ) ( ( uchar * ) algo + p - > offset ) ;
@ -993,7 +993,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( ! ( argType = = Param : : INT | | argType = = Param : : REAL | | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64 | | argType = = Param : : UCHAR ) )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
uchar val = p - > getter ? ( algo - > * f . get_uchar ) ( ) : * ( uchar * ) ( ( uchar * ) algo + p - > offset ) ;
@ -1021,18 +1021,18 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( p - > type ! = Param : : STRING )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
* ( std : : s tring* ) value = p - > getter ? ( algo - > * f . get_string ) ( ) :
* ( std : : s tring* ) ( ( uchar * ) algo + p - > offset ) ;
* ( cv : : S tring* ) value = p - > getter ? ( algo - > * f . get_string ) ( ) :
* ( cv : : S tring* ) ( ( uchar * ) algo + p - > offset ) ;
}
else if ( argType = = Param : : MAT )
{
if ( p - > type ! = Param : : MAT )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -1043,7 +1043,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( p - > type ! = Param : : MAT_VECTOR )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -1054,7 +1054,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if ( p - > type ! = Param : : ALGORITHM )
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
@ -1063,7 +1063,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
}
else
{
std : : s tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
cv : : S tring message = getErrorMessageForWrongArgumentInGetter ( algo - > name ( ) , parameter , p - > type , argType ) ;
CV_Error ( CV_StsBadArg , message ) ;
}
}
@ -1078,7 +1078,7 @@ int AlgorithmInfo::paramType(const char* parameter) const
}
std : : s tring AlgorithmInfo : : paramHelp ( const char * parameter ) const
cv : : S tring AlgorithmInfo : : paramHelp ( const char * parameter ) const
{
const Param * p = findstr ( data - > params , parameter ) ;
if ( ! p )
@ -1087,7 +1087,7 @@ std::string AlgorithmInfo::paramHelp(const char* parameter) const
}
void AlgorithmInfo : : getParams ( std : : vector < std : : s tring> & names ) const
void AlgorithmInfo : : getParams ( std : : vector < cv : : S tring> & names ) const
{
data - > params . get_keys ( names ) ;
}
@ -1096,7 +1096,7 @@ void AlgorithmInfo::getParams(std::vector<std::string>& names) const
void AlgorithmInfo : : addParam_ ( Algorithm & algo , const char * parameter , int argType ,
void * value , bool readOnly ,
Algorithm : : Getter getter , Algorithm : : Setter setter ,
const std : : s tring& help )
const cv : : S tring& help )
{
CV_Assert ( argType = = Param : : INT | | argType = = Param : : BOOLEAN | |
argType = = Param : : REAL | | argType = = Param : : STRING | |
@ -1104,7 +1104,7 @@ void AlgorithmInfo::addParam_(Algorithm& algo, const char* parameter, int argTyp
argType = = Param : : ALGORITHM
| | argType = = Param : : FLOAT | | argType = = Param : : UNSIGNED_INT | | argType = = Param : : UINT64
| | argType = = Param : : UCHAR ) ;
data - > params . add ( std : : s tring( parameter ) , Param ( argType , readOnly ,
data - > params . add ( cv : : S tring( parameter ) , Param ( argType , readOnly ,
( int ) ( ( size_t ) value - ( size_t ) ( void * ) & algo ) ,
getter , setter , help ) ) ;
}
@ -1114,7 +1114,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
int & value , bool readOnly ,
int ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( int ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < int > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1124,7 +1124,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
bool & value , bool readOnly ,
int ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( int ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < bool > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1134,19 +1134,19 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
double & value , bool readOnly ,
double ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( double ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < double > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
}
void AlgorithmInfo : : addParam ( Algorithm & algo , const char * parameter ,
std : : s tring& value , bool readOnly ,
std : : s tring ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( const std : : s tring& ) ,
const std : : s tring& help )
cv : : S tring& value , bool readOnly ,
cv : : S tring ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( const cv : : S tring& ) ,
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < std : : s tring> : : type , & value , readOnly ,
addParam_ ( algo , parameter , ParamType < cv : : S tring> : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
}
@ -1154,7 +1154,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Mat & value , bool readOnly ,
Mat ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( const Mat & ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < Mat > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1164,7 +1164,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
std : : vector < Mat > & value , bool readOnly ,
std : : vector < Mat > ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( const std : : vector < Mat > & ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < std : : vector < Mat > > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1174,7 +1174,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr < Algorithm > & value , bool readOnly ,
Ptr < Algorithm > ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( const Ptr < Algorithm > & ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < Algorithm > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1184,7 +1184,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
float & value , bool readOnly ,
float ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( float ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < float > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1194,7 +1194,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
unsigned int & value , bool readOnly ,
unsigned int ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( unsigned int ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < unsigned int > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1204,7 +1204,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
uint64 & value , bool readOnly ,
uint64 ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( uint64 ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < uint64 > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;
@ -1214,7 +1214,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
uchar & value , bool readOnly ,
uchar ( Algorithm : : * getter ) ( ) ,
void ( Algorithm : : * setter ) ( uchar ) ,
const std : : s tring& help )
const cv : : S tring& help )
{
addParam_ ( algo , parameter , ParamType < uchar > : : type , & value , readOnly ,
( Algorithm : : Getter ) getter , ( Algorithm : : Setter ) setter , help ) ;