Remove all using directives for STL namespace and members

Made all STL usages explicit to be able automatically find all usages of
particular class or function.
This commit is contained in:
Andrey Kamaev
2013-02-24 20:14:01 +04:00
parent f783f34e0b
commit 2a6fb2867e
310 changed files with 5744 additions and 5964 deletions

View File

@@ -74,18 +74,12 @@ namespace cv {
#undef max
#undef Complex
using std::vector;
using std::string;
using std::ptrdiff_t;
template<typename _Tp> class CV_EXPORTS Size_;
template<typename _Tp> class CV_EXPORTS Point_;
template<typename _Tp> class CV_EXPORTS Rect_;
template<typename _Tp, int cn> class CV_EXPORTS Vec;
template<typename _Tp, int m, int n> class CV_EXPORTS Matx;
typedef std::string String;
class Mat;
class SparseMat;
typedef Mat MatND;
@@ -111,8 +105,8 @@ template<typename _Tp> class CV_EXPORTS MatCommaInitializer_;
template<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class CV_EXPORTS AutoBuffer;
CV_EXPORTS string format( const char* fmt, ... );
CV_EXPORTS string tempfile( const char* suffix CV_DEFAULT(0));
CV_EXPORTS std::string format( const char* fmt, ... );
CV_EXPORTS std::string tempfile( const char* suffix CV_DEFAULT(0));
// matrix decomposition types
enum { DECOMP_LU=0, DECOMP_SVD=1, DECOMP_EIG=2, DECOMP_CHOLESKY=3, DECOMP_QR=4, DECOMP_NORMAL=16 };
@@ -138,7 +132,7 @@ public:
Full constructor. Normally the constuctor is not called explicitly.
Instead, the macros CV_Error(), CV_Error_() and CV_Assert() are used.
*/
Exception(int _code, const string& _err, const string& _func, const string& _file, int _line);
Exception(int _code, const std::string& _err, const std::string& _func, const std::string& _file, int _line);
virtual ~Exception() throw();
/*!
@@ -147,12 +141,12 @@ public:
virtual const char *what() const throw();
void formatMessage();
string msg; ///< the formatted error message
std::string msg; ///< the formatted error message
int code; ///< error code @see CVStatus
string err; ///< error description
string func; ///< function name. Available only when the compiler supports __func__ macro
string file; ///< source file name where the error has occured
std::string err; ///< error description
std::string func; ///< function name. Available only when the compiler supports __func__ macro
std::string file; ///< source file name where the error has occured
int line; ///< line number in the source file where the error has occured
};
@@ -216,7 +210,7 @@ CV_EXPORTS void setNumThreads(int nthreads);
CV_EXPORTS int getNumThreads();
CV_EXPORTS int getThreadNum();
CV_EXPORTS_W const string& getBuildInformation();
CV_EXPORTS_W const std::string& getBuildInformation();
//! Returns the number of ticks.
@@ -1317,10 +1311,10 @@ public:
_InputArray(const Mat& m);
_InputArray(const MatExpr& expr);
template<typename _Tp> _InputArray(const _Tp* vec, int n);
template<typename _Tp> _InputArray(const vector<_Tp>& vec);
template<typename _Tp> _InputArray(const vector<vector<_Tp> >& vec);
_InputArray(const vector<Mat>& vec);
template<typename _Tp> _InputArray(const vector<Mat_<_Tp> >& vec);
template<typename _Tp> _InputArray(const std::vector<_Tp>& vec);
template<typename _Tp> _InputArray(const std::vector<std::vector<_Tp> >& vec);
_InputArray(const std::vector<Mat>& vec);
template<typename _Tp> _InputArray(const std::vector<Mat_<_Tp> >& vec);
template<typename _Tp> _InputArray(const Mat_<_Tp>& m);
template<typename _Tp, int m, int n> _InputArray(const Matx<_Tp, m, n>& matx);
_InputArray(const Scalar& s);
@@ -1330,7 +1324,7 @@ public:
_InputArray(const gpu::GpuMat& d_mat);
virtual Mat getMat(int i=-1) const;
virtual void getMatVector(vector<Mat>& mv) const;
virtual void getMatVector(std::vector<Mat>& mv) const;
virtual GlBuffer getGlBuffer() const;
virtual GlTexture2D getGlTexture2D() const;
virtual gpu::GpuMat getGpuMat() const;
@@ -1375,10 +1369,10 @@ public:
_OutputArray();
_OutputArray(Mat& m);
template<typename _Tp> _OutputArray(vector<_Tp>& vec);
template<typename _Tp> _OutputArray(vector<vector<_Tp> >& vec);
_OutputArray(vector<Mat>& vec);
template<typename _Tp> _OutputArray(vector<Mat_<_Tp> >& vec);
template<typename _Tp> _OutputArray(std::vector<_Tp>& vec);
template<typename _Tp> _OutputArray(std::vector<std::vector<_Tp> >& vec);
_OutputArray(std::vector<Mat>& vec);
template<typename _Tp> _OutputArray(std::vector<Mat_<_Tp> >& vec);
template<typename _Tp> _OutputArray(Mat_<_Tp>& m);
template<typename _Tp, int m, int n> _OutputArray(Matx<_Tp, m, n>& matx);
template<typename _Tp> _OutputArray(_Tp* vec, int n);
@@ -1387,10 +1381,10 @@ public:
_OutputArray(GlTexture2D& tex);
_OutputArray(const Mat& m);
template<typename _Tp> _OutputArray(const vector<_Tp>& vec);
template<typename _Tp> _OutputArray(const vector<vector<_Tp> >& vec);
_OutputArray(const vector<Mat>& vec);
template<typename _Tp> _OutputArray(const vector<Mat_<_Tp> >& vec);
template<typename _Tp> _OutputArray(const std::vector<_Tp>& vec);
template<typename _Tp> _OutputArray(const std::vector<std::vector<_Tp> >& vec);
_OutputArray(const std::vector<Mat>& vec);
template<typename _Tp> _OutputArray(const std::vector<Mat_<_Tp> >& vec);
template<typename _Tp> _OutputArray(const Mat_<_Tp>& m);
template<typename _Tp, int m, int n> _OutputArray(const Matx<_Tp, m, n>& matx);
template<typename _Tp> _OutputArray(const _Tp* vec, int n);
@@ -1690,7 +1684,7 @@ public:
//! converts old-style IplImage to the new matrix; the data is not copied by default
Mat(const IplImage* img, bool copyData=false);
//! builds matrix from std::vector with or without copying the data
template<typename _Tp> explicit Mat(const vector<_Tp>& vec, bool copyData=false);
template<typename _Tp> explicit Mat(const std::vector<_Tp>& vec, bool copyData=false);
//! builds matrix from cv::Vec; the data is copied by default
template<typename _Tp, int n> explicit Mat(const Vec<_Tp, n>& vec, bool copyData=true);
//! builds matrix from cv::Matx; the data is copied by default
@@ -1821,7 +1815,7 @@ public:
//! converts header to IplImage; no data is copied
operator IplImage() const;
template<typename _Tp> operator vector<_Tp>() const;
template<typename _Tp> operator std::vector<_Tp>() const;
template<typename _Tp, int n> operator Vec<_Tp, n>() const;
template<typename _Tp, int m, int n> operator Matx<_Tp, m, n>() const;
@@ -2155,10 +2149,10 @@ CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);
//! copies selected channels from the input arrays to the selected channels of the output arrays
CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
const int* fromTo, size_t npairs);
CV_EXPORTS void mixChannels(const vector<Mat>& src, vector<Mat>& dst,
CV_EXPORTS void mixChannels(const std::vector<Mat>& src, std::vector<Mat>& dst,
const int* fromTo, size_t npairs);
CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputArrayOfArrays dst,
const vector<int>& fromTo);
const std::vector<int>& fromTo);
//! extracts a single channel from src (coi is 0-based index)
CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);
@@ -2620,7 +2614,7 @@ public:
//! converts elliptic arc to a polygonal curve
CV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle,
int arcStart, int arcEnd, int delta,
CV_OUT vector<Point>& pts );
CV_OUT std::vector<Point>& pts );
enum
{
@@ -2636,13 +2630,13 @@ enum
};
//! renders text string in the image
CV_EXPORTS_W void putText( Mat& img, const string& text, Point org,
CV_EXPORTS_W void putText( Mat& img, const std::string& text, Point org,
int fontFace, double fontScale, Scalar color,
int thickness=1, int lineType=8,
bool bottomLeftOrigin=false );
//! returns bounding box of the text string
CV_EXPORTS_W Size getTextSize(const string& text, int fontFace,
CV_EXPORTS_W Size getTextSize(const std::string& text, int fontFace,
double fontScale, int thickness,
CV_OUT int* baseLine);
@@ -2732,7 +2726,7 @@ public:
//! from a matrix expression
explicit Mat_(const MatExpr& e);
//! makes a matrix out of Vec, std::vector, Point_ or Point3_. The matrix will have a single column
explicit Mat_(const vector<_Tp>& vec, bool copyData=false);
explicit Mat_(const std::vector<_Tp>& vec, bool copyData=false);
template<int n> explicit Mat_(const Vec<typename DataType<_Tp>::channel_type, n>& vec, bool copyData=true);
template<int m, int n> explicit Mat_(const Matx<typename DataType<_Tp>::channel_type, m, n>& mtx, bool copyData=true);
explicit Mat_(const Point_<typename DataType<_Tp>::channel_type>& pt, bool copyData=true);
@@ -2825,7 +2819,7 @@ public:
const _Tp& operator ()(Point pt) const;
//! conversion to vector.
operator vector<_Tp>() const;
operator std::vector<_Tp>() const;
//! conversion to Vec
template<int n> operator Vec<typename DataType<_Tp>::channel_type, n>() const;
//! conversion to Matx
@@ -3339,8 +3333,8 @@ public:
size_t nodeSize;
size_t nodeCount;
size_t freeList;
vector<uchar> pool;
vector<size_t> hashtab;
std::vector<uchar> pool;
std::vector<size_t> hashtab;
int size[CV_MAX_DIM];
};
@@ -3878,9 +3872,9 @@ public:
//! returns the search space dimensionality
CV_WRAP int dims() const;
vector<Node> nodes; //!< all the tree nodes
std::vector<Node> nodes; //!< all the tree nodes
CV_PROP Mat points; //!< all the points. It can be a reordered copy of the input vector set or the original vector set.
CV_PROP vector<int> labels; //!< the parallel array of labels.
CV_PROP std::vector<int> labels; //!< the parallel array of labels.
CV_PROP int maxDepth; //!< maximum depth of the search tree. Do not modify it
CV_PROP_RW int normType; //!< type of the distance (cv::NORM_L1 or cv::NORM_L2) used for search. Initially set to cv::NORM_L2, but you can modify it
};
@@ -3954,7 +3948,7 @@ class CV_EXPORTS FileNode;
FileStorage fs("test.yml", FileStorage::READ);
int test_int = (int)fs["test_int"];
double test_real = (double)fs["test_real"];
string test_string = (string)fs["test_string"];
std::string test_string = (std::string)fs["test_string"];
Mat M;
fs["test_mat"] >> M;
@@ -3965,7 +3959,7 @@ class CV_EXPORTS FileNode;
int tl1 = (int)tl[1];
double tl2 = (double)tl[2];
int tl3 = (int)tl[3];
string tl4 = (string)tl[4];
std::string tl4 = (std::string)tl[4];
CV_Assert(tl[5].type() == FileNode::MAP && tl[5].size() == 3);
int month = (int)tl[5]["month"];
@@ -4011,27 +4005,27 @@ public:
//! the default constructor
CV_WRAP FileStorage();
//! the full constructor that opens file storage for reading or writing
CV_WRAP FileStorage(const string& source, int flags, const string& encoding=string());
CV_WRAP FileStorage(const std::string& source, int flags, const std::string& encoding=std::string());
//! the constructor that takes pointer to the C FileStorage structure
FileStorage(CvFileStorage* fs);
//! the destructor. calls release()
virtual ~FileStorage();
//! opens file storage for reading or writing. The previous storage is closed with release()
CV_WRAP virtual bool open(const string& filename, int flags, const string& encoding=string());
CV_WRAP virtual bool open(const std::string& filename, int flags, const std::string& encoding=std::string());
//! returns true if the object is associated with currently opened file.
CV_WRAP virtual bool isOpened() const;
//! closes the file and releases all the memory buffers
CV_WRAP virtual void release();
//! closes the file, releases all the memory buffers and returns the text string
CV_WRAP virtual string releaseAndGetString();
CV_WRAP virtual std::string releaseAndGetString();
//! returns the first element of the top-level mapping
CV_WRAP FileNode getFirstTopLevelNode() const;
//! returns the top-level mapping. YAML supports multiple streams
CV_WRAP FileNode root(int streamidx=0) const;
//! returns the specified element of the top-level mapping
FileNode operator[](const string& nodename) const;
FileNode operator[](const std::string& nodename) const;
//! returns the specified element of the top-level mapping
CV_WRAP FileNode operator[](const char* nodename) const;
@@ -4040,16 +4034,16 @@ public:
//! returns pointer to the underlying C FileStorage structure
const CvFileStorage* operator *() const { return fs; }
//! writes one or more numbers of the specified format to the currently written structure
void writeRaw( const string& fmt, const uchar* vec, size_t len );
void writeRaw( const std::string& fmt, const uchar* vec, size_t len );
//! writes the registered C structure (CvMat, CvMatND, CvSeq). See cvWrite()
void writeObj( const string& name, const void* obj );
void writeObj( const std::string& name, const void* obj );
//! returns the normalized object name for the specified file name
static string getDefaultObjectName(const string& filename);
static std::string getDefaultObjectName(const std::string& filename);
Ptr<CvFileStorage> fs; //!< the underlying C FileStorage structure
string elname; //!< the currently written element
vector<char> structs; //!< the stack of written structures
std::string elname; //!< the currently written element
std::vector<char> structs; //!< the stack of written structures
int state; //!< the writer state
};
@@ -4093,7 +4087,7 @@ public:
//! the copy constructor
FileNode(const FileNode& node);
//! returns element of a mapping node
FileNode operator[](const string& nodename) const;
FileNode operator[](const std::string& nodename) const;
//! returns element of a mapping node
CV_WRAP FileNode operator[](const char* nodename) const;
//! returns element of a sequence node
@@ -4118,7 +4112,7 @@ public:
//! returns true if the node has a name
CV_WRAP bool isNamed() const;
//! returns the node name or an empty string if the node is nameless
CV_WRAP string name() const;
CV_WRAP std::string name() const;
//! returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.
CV_WRAP size_t size() const;
//! returns the node content as an integer. If the node stores floating-point number, it is rounded.
@@ -4128,7 +4122,7 @@ public:
//! returns the node content as double
operator double() const;
//! returns the node content as text string
operator string() const;
operator std::string() const;
//! returns pointer to the underlying file node
CvFileNode* operator *();
@@ -4141,7 +4135,7 @@ public:
FileNodeIterator end() const;
//! reads node elements to the buffer with the specified format
void readRaw( const string& fmt, uchar* vec, size_t len ) const;
void readRaw( const std::string& fmt, uchar* vec, size_t len ) const;
//! reads the registered object and returns pointer to it
void* readObj() const;
@@ -4184,7 +4178,7 @@ public:
FileNodeIterator& operator -= (int ofs);
//! reads the next maxCount elements (or less, if the sequence/mapping last element occurs earlier) to the buffer with the specified format
FileNodeIterator& readRaw( const string& fmt, uchar* vec,
FileNodeIterator& readRaw( const std::string& fmt, uchar* vec,
size_t maxCount=(size_t)INT_MAX );
const CvFileStorage* fs;
@@ -4281,9 +4275,9 @@ public:
void pop_back(_Tp* elems, size_t count);
//! copies the whole sequence or the sequence slice to the specified vector
void copyTo(vector<_Tp>& vec, const Range& range=Range::all()) const;
void copyTo(std::vector<_Tp>& vec, const Range& range=Range::all()) const;
//! returns the vector containing all the sequence elements
operator vector<_Tp>() const;
operator std::vector<_Tp>() const;
CvSeq* seq;
};
@@ -4340,59 +4334,59 @@ class CV_EXPORTS_W Algorithm
public:
Algorithm();
virtual ~Algorithm();
string name() const;
std::string name() const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const string& name) const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const std::string& name) const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const char* name) const;
CV_WRAP int getInt(const string& name) const;
CV_WRAP double getDouble(const string& name) const;
CV_WRAP bool getBool(const string& name) const;
CV_WRAP string getString(const string& name) const;
CV_WRAP Mat getMat(const string& name) const;
CV_WRAP vector<Mat> getMatVector(const string& name) const;
CV_WRAP Ptr<Algorithm> getAlgorithm(const string& name) const;
CV_WRAP int getInt(const std::string& name) const;
CV_WRAP double getDouble(const std::string& name) const;
CV_WRAP bool getBool(const std::string& name) const;
CV_WRAP std::string getString(const std::string& name) const;
CV_WRAP Mat getMat(const std::string& name) const;
CV_WRAP std::vector<Mat> getMatVector(const std::string& name) const;
CV_WRAP Ptr<Algorithm> getAlgorithm(const std::string& name) const;
void set(const string& name, int value);
void set(const string& name, double value);
void set(const string& name, bool value);
void set(const string& name, const string& value);
void set(const string& name, const Mat& value);
void set(const string& name, const vector<Mat>& value);
void set(const string& name, const Ptr<Algorithm>& value);
template<typename _Tp> void set(const string& name, const Ptr<_Tp>& value);
void set(const std::string& name, int value);
void set(const std::string& name, double value);
void set(const std::string& name, bool value);
void set(const std::string& name, const std::string& value);
void set(const std::string& name, const Mat& value);
void set(const std::string& name, const std::vector<Mat>& value);
void set(const std::string& name, const Ptr<Algorithm>& value);
template<typename _Tp> void set(const std::string& name, const Ptr<_Tp>& value);
CV_WRAP void setInt(const string& name, int value);
CV_WRAP void setDouble(const string& name, double value);
CV_WRAP void setBool(const string& name, bool value);
CV_WRAP void setString(const string& name, const string& value);
CV_WRAP void setMat(const string& name, const Mat& value);
CV_WRAP void setMatVector(const string& name, const vector<Mat>& value);
CV_WRAP void setAlgorithm(const string& name, const Ptr<Algorithm>& value);
template<typename _Tp> void setAlgorithm(const string& name, const Ptr<_Tp>& value);
CV_WRAP void setInt(const std::string& name, int value);
CV_WRAP void setDouble(const std::string& name, double value);
CV_WRAP void setBool(const std::string& name, bool value);
CV_WRAP void setString(const std::string& name, const std::string& value);
CV_WRAP void setMat(const std::string& name, const Mat& value);
CV_WRAP void setMatVector(const std::string& name, const std::vector<Mat>& value);
CV_WRAP void setAlgorithm(const std::string& name, const Ptr<Algorithm>& value);
template<typename _Tp> void setAlgorithm(const std::string& name, const Ptr<_Tp>& value);
void set(const char* name, int value);
void set(const char* name, double value);
void set(const char* name, bool value);
void set(const char* name, const string& value);
void set(const char* name, const std::string& value);
void set(const char* name, const Mat& value);
void set(const char* name, const vector<Mat>& value);
void set(const char* name, const std::vector<Mat>& value);
void set(const char* name, const Ptr<Algorithm>& value);
template<typename _Tp> void set(const char* name, const Ptr<_Tp>& value);
void setInt(const char* name, int value);
void setDouble(const char* name, double value);
void setBool(const char* name, bool value);
void setString(const char* name, const string& value);
void setString(const char* name, const std::string& value);
void setMat(const char* name, const Mat& value);
void setMatVector(const char* name, const vector<Mat>& value);
void setMatVector(const char* name, const std::vector<Mat>& value);
void setAlgorithm(const char* name, const Ptr<Algorithm>& value);
template<typename _Tp> void setAlgorithm(const char* name, const Ptr<_Tp>& value);
CV_WRAP string paramHelp(const string& name) const;
CV_WRAP std::string paramHelp(const std::string& name) const;
int paramType(const char* name) const;
CV_WRAP int paramType(const string& name) const;
CV_WRAP void getParams(CV_OUT vector<string>& names) const;
CV_WRAP int paramType(const std::string& name) const;
CV_WRAP void getParams(CV_OUT std::vector<std::string>& names) const;
virtual void write(FileStorage& fs) const;
@@ -4402,9 +4396,9 @@ public:
typedef int (Algorithm::*Getter)() const;
typedef void (Algorithm::*Setter)(int);
CV_WRAP static void getList(CV_OUT vector<string>& algorithms);
CV_WRAP static Ptr<Algorithm> _create(const string& name);
template<typename _Tp> static Ptr<_Tp> create(const string& name);
CV_WRAP static void getList(CV_OUT std::vector<std::string>& algorithms);
CV_WRAP static Ptr<Algorithm> _create(const std::string& name);
template<typename _Tp> static Ptr<_Tp> create(const std::string& name);
virtual AlgorithmInfo* info() const /* TODO: make it = 0;*/ { return 0; }
};
@@ -4414,66 +4408,66 @@ class CV_EXPORTS AlgorithmInfo
{
public:
friend class Algorithm;
AlgorithmInfo(const string& name, Algorithm::Constructor create);
AlgorithmInfo(const std::string& name, Algorithm::Constructor create);
~AlgorithmInfo();
void get(const Algorithm* algo, const char* name, int argType, void* value) const;
void addParam_(Algorithm& algo, const char* name, int argType,
void* value, bool readOnly,
Algorithm::Getter getter, Algorithm::Setter setter,
const string& help=string());
string paramHelp(const char* name) const;
const std::string& help=std::string());
std::string paramHelp(const char* name) const;
int paramType(const char* name) const;
void getParams(vector<string>& names) const;
void getParams(std::vector<std::string>& names) const;
void write(const Algorithm* algo, FileStorage& fs) const;
void read(Algorithm* algo, const FileNode& fn) const;
string name() const;
std::string name() const;
void addParam(Algorithm& algo, const char* name,
int& value, bool readOnly=false,
int (Algorithm::*getter)()=0,
void (Algorithm::*setter)(int)=0,
const string& help=string());
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
bool& value, bool readOnly=false,
int (Algorithm::*getter)()=0,
void (Algorithm::*setter)(int)=0,
const string& help=string());
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
double& value, bool readOnly=false,
double (Algorithm::*getter)()=0,
void (Algorithm::*setter)(double)=0,
const string& help=string());
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
string& value, bool readOnly=false,
string (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const string&)=0,
const string& help=string());
std::string& value, bool readOnly=false,
std::string (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const std::string&)=0,
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
Mat& value, bool readOnly=false,
Mat (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Mat&)=0,
const string& help=string());
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
vector<Mat>& value, bool readOnly=false,
vector<Mat> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const vector<Mat>&)=0,
const string& help=string());
std::vector<Mat>& value, bool readOnly=false,
std::vector<Mat> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const std::vector<Mat>&)=0,
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
Ptr<Algorithm>& value, bool readOnly=false,
Ptr<Algorithm> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
const string& help=string());
const std::string& help=std::string());
template<typename _Tp, typename _Base> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<_Tp>&)=0,
const string& help=string());
const std::string& help=std::string());
template<typename _Tp> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<_Tp>&)=0,
const string& help=string());
const std::string& help=std::string());
protected:
AlgorithmInfoData* data;
void set(Algorithm* algo, const char* name, int argType,
@@ -4489,13 +4483,13 @@ struct CV_EXPORTS Param
Param(int _type, bool _readonly, int _offset,
Algorithm::Getter _getter=0,
Algorithm::Setter _setter=0,
const string& _help=string());
const std::string& _help=std::string());
int type;
int offset;
bool readonly;
Algorithm::Getter getter;
Algorithm::Setter setter;
string help;
std::string help;
};
template<> struct ParamType<bool>
@@ -4522,10 +4516,10 @@ template<> struct ParamType<double>
enum { type = Param::REAL };
};
template<> struct ParamType<string>
template<> struct ParamType<std::string>
{
typedef const string& const_param_type;
typedef string member_type;
typedef const std::string& const_param_type;
typedef std::string member_type;
enum { type = Param::STRING };
};
@@ -4538,10 +4532,10 @@ template<> struct ParamType<Mat>
enum { type = Param::MAT };
};
template<> struct ParamType<vector<Mat> >
template<> struct ParamType<std::vector<Mat> >
{
typedef const vector<Mat>& const_param_type;
typedef vector<Mat> member_type;
typedef const std::vector<Mat>& const_param_type;
typedef std::vector<Mat> member_type;
enum { type = Param::MAT_VECTOR };
};
@@ -4584,14 +4578,14 @@ template<> struct ParamType<uint64>
class CV_EXPORTS CommandLineParser
{
public:
CommandLineParser(int argc, const char* const argv[], const string& keys);
CommandLineParser(int argc, const char* const argv[], const std::string& keys);
CommandLineParser(const CommandLineParser& parser);
CommandLineParser& operator = (const CommandLineParser& parser);
string getPathToApplication() const;
std::string getPathToApplication() const;
template <typename T>
T get(const string& name, bool space_delete = true) const
T get(const std::string& name, bool space_delete = true) const
{
T val = T();
getByName(name, space_delete, ParamType<T>::type, (void*)&val);
@@ -4606,17 +4600,17 @@ public:
return val;
}
bool has(const string& name) const;
bool has(const std::string& name) const;
bool check() const;
void about(const string& message);
void about(const std::string& message);
void printMessage() const;
void printErrors() const;
protected:
void getByName(const string& name, bool space_delete, int type, void* dst) const;
void getByName(const std::string& name, bool space_delete, int type, void* dst) const;
void getByIndex(int index, bool space_delete, int type, void* dst) const;
struct Impl;

View File

@@ -171,7 +171,7 @@ inline Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
}
template<typename _Tp> inline Mat::Mat(const vector<_Tp>& vec, bool copyData)
template<typename _Tp> inline Mat::Mat(const std::vector<_Tp>& vec, bool copyData)
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG),
dims(2), rows((int)vec.size()), cols(1), data(0), refcount(0),
datastart(0), dataend(0), allocator(0), size(&rows)
@@ -648,9 +648,9 @@ template<typename _Tp> inline MatIterator_<_Tp> Mat::end()
return it;
}
template<typename _Tp> inline Mat::operator vector<_Tp>() const
template<typename _Tp> inline Mat::operator std::vector<_Tp>() const
{
vector<_Tp> v;
std::vector<_Tp> v;
copyTo(v);
return v;
}
@@ -873,7 +873,7 @@ template<typename _Tp> inline Mat_<_Tp>::Mat_(const Point3_<typename DataType<_T
template<typename _Tp> inline Mat_<_Tp>::Mat_(const MatCommaInitializer_<_Tp>& commaInitializer)
: Mat(commaInitializer) {}
template<typename _Tp> inline Mat_<_Tp>::Mat_(const vector<_Tp>& vec, bool copyData)
template<typename _Tp> inline Mat_<_Tp>::Mat_(const std::vector<_Tp>& vec, bool copyData)
: Mat(vec, copyData) {}
template<typename _Tp> inline Mat_<_Tp>& Mat_<_Tp>::operator = (const Mat& m)
@@ -1059,9 +1059,9 @@ template<typename _Tp> inline const _Tp& Mat_<_Tp>::operator ()(int i0, int i1,
}
template<typename _Tp> inline Mat_<_Tp>::operator vector<_Tp>() const
template<typename _Tp> inline Mat_<_Tp>::operator std::vector<_Tp>() const
{
vector<_Tp> v;
std::vector<_Tp> v;
copyTo(v);
return v;
}
@@ -1116,13 +1116,13 @@ process( const Mat_<T1>& m1, const Mat_<T2>& m2, Mat_<T3>& m3, Op op )
/////////////////////////////// Input/Output Arrays /////////////////////////////////
template<typename _Tp> inline _InputArray::_InputArray(const vector<_Tp>& vec)
template<typename _Tp> inline _InputArray::_InputArray(const std::vector<_Tp>& vec)
: flags(FIXED_TYPE + STD_VECTOR + DataType<_Tp>::type), obj((void*)&vec) {}
template<typename _Tp> inline _InputArray::_InputArray(const vector<vector<_Tp> >& vec)
template<typename _Tp> inline _InputArray::_InputArray(const std::vector<std::vector<_Tp> >& vec)
: flags(FIXED_TYPE + STD_VECTOR_VECTOR + DataType<_Tp>::type), obj((void*)&vec) {}
template<typename _Tp> inline _InputArray::_InputArray(const vector<Mat_<_Tp> >& vec)
template<typename _Tp> inline _InputArray::_InputArray(const std::vector<Mat_<_Tp> >& vec)
: flags(FIXED_TYPE + STD_VECTOR_MAT + DataType<_Tp>::type), obj((void*)&vec) {}
template<typename _Tp, int m, int n> inline _InputArray::_InputArray(const Matx<_Tp, m, n>& mtx)
@@ -1137,11 +1137,11 @@ inline _InputArray::_InputArray(const Scalar& s)
template<typename _Tp> inline _InputArray::_InputArray(const Mat_<_Tp>& m)
: flags(FIXED_TYPE + MAT + DataType<_Tp>::type), obj((void*)&m) {}
template<typename _Tp> inline _OutputArray::_OutputArray(vector<_Tp>& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(std::vector<_Tp>& vec)
: _InputArray(vec) {}
template<typename _Tp> inline _OutputArray::_OutputArray(vector<vector<_Tp> >& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(std::vector<std::vector<_Tp> >& vec)
: _InputArray(vec) {}
template<typename _Tp> inline _OutputArray::_OutputArray(vector<Mat_<_Tp> >& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(std::vector<Mat_<_Tp> >& vec)
: _InputArray(vec) {}
template<typename _Tp> inline _OutputArray::_OutputArray(Mat_<_Tp>& m)
: _InputArray(m) {}
@@ -1150,11 +1150,11 @@ template<typename _Tp, int m, int n> inline _OutputArray::_OutputArray(Matx<_Tp,
template<typename _Tp> inline _OutputArray::_OutputArray(_Tp* vec, int n)
: _InputArray(vec, n) {}
template<typename _Tp> inline _OutputArray::_OutputArray(const vector<_Tp>& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(const std::vector<_Tp>& vec)
: _InputArray(vec) {flags |= FIXED_SIZE;}
template<typename _Tp> inline _OutputArray::_OutputArray(const vector<vector<_Tp> >& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(const std::vector<std::vector<_Tp> >& vec)
: _InputArray(vec) {flags |= FIXED_SIZE;}
template<typename _Tp> inline _OutputArray::_OutputArray(const vector<Mat_<_Tp> >& vec)
template<typename _Tp> inline _OutputArray::_OutputArray(const std::vector<Mat_<_Tp> >& vec)
: _InputArray(vec) {flags |= FIXED_SIZE;}
template<typename _Tp> inline _OutputArray::_OutputArray(const Mat_<_Tp>& m)
@@ -1667,8 +1667,8 @@ operator ^= (const Mat_<_Tp>& a, const Scalar& s)
/////////////////////////////// Miscellaneous operations //////////////////////////////
template<typename _Tp> void split(const Mat& src, vector<Mat_<_Tp> >& mv)
{ split(src, (vector<Mat>&)mv ); }
template<typename _Tp> void split(const Mat& src, std::vector<Mat_<_Tp> >& mv)
{ split(src, (std::vector<Mat>&)mv ); }
//////////////////////////////////////////////////////////////

View File

@@ -101,16 +101,6 @@
namespace cv
{
using std::cos;
using std::sin;
using std::max;
using std::min;
using std::exp;
using std::log;
using std::pow;
using std::sqrt;
/////////////// saturate_cast (used in image & signal processing) ///////////////////
template<typename _Tp> static inline _Tp saturate_cast(uchar v) { return _Tp(v); }
@@ -2769,18 +2759,18 @@ template<> CV_EXPORTS void Ptr<CvFileStorage>::delete_obj();
//////////////////////////////////////// XML & YAML I/O ////////////////////////////////////
CV_EXPORTS_W void write( FileStorage& fs, const string& name, int value );
CV_EXPORTS_W void write( FileStorage& fs, const string& name, float value );
CV_EXPORTS_W void write( FileStorage& fs, const string& name, double value );
CV_EXPORTS_W void write( FileStorage& fs, const string& name, const string& value );
CV_EXPORTS_W void write( FileStorage& fs, const std::string& name, int value );
CV_EXPORTS_W void write( FileStorage& fs, const std::string& name, float value );
CV_EXPORTS_W void write( FileStorage& fs, const std::string& name, double value );
CV_EXPORTS_W void write( FileStorage& fs, const std::string& name, const std::string& value );
template<typename _Tp> inline void write(FileStorage& fs, const _Tp& value)
{ write(fs, string(), value); }
{ write(fs, std::string(), value); }
CV_EXPORTS void writeScalar( FileStorage& fs, int value );
CV_EXPORTS void writeScalar( FileStorage& fs, float value );
CV_EXPORTS void writeScalar( FileStorage& fs, double value );
CV_EXPORTS void writeScalar( FileStorage& fs, const string& value );
CV_EXPORTS void writeScalar( FileStorage& fs, const std::string& value );
template<> inline void write( FileStorage& fs, const int& value )
{
@@ -2797,7 +2787,7 @@ template<> inline void write( FileStorage& fs, const double& value )
writeScalar(fs, value);
}
template<> inline void write( FileStorage& fs, const string& value )
template<> inline void write( FileStorage& fs, const std::string& value )
{
writeScalar(fs, value);
}
@@ -2858,20 +2848,20 @@ inline void write(FileStorage& fs, const Range& r )
class CV_EXPORTS WriteStructContext
{
public:
WriteStructContext(FileStorage& _fs, const string& name,
int flags, const string& typeName=string());
WriteStructContext(FileStorage& _fs, const std::string& name,
int flags, const std::string& typeName=std::string());
~WriteStructContext();
FileStorage* fs;
};
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Point_<_Tp>& pt )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Point_<_Tp>& pt )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, pt.x);
write(fs, pt.y);
}
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Point3_<_Tp>& pt )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Point3_<_Tp>& pt )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, pt.x);
@@ -2879,21 +2869,21 @@ template<typename _Tp> inline void write(FileStorage& fs, const string& name, co
write(fs, pt.z);
}
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Size_<_Tp>& sz )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Size_<_Tp>& sz )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, sz.width);
write(fs, sz.height);
}
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Complex<_Tp>& c )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Complex<_Tp>& c )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, c.re);
write(fs, c.im);
}
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Rect_<_Tp>& r )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Rect_<_Tp>& r )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, r.x);
@@ -2902,14 +2892,14 @@ template<typename _Tp> inline void write(FileStorage& fs, const string& name, co
write(fs, r.height);
}
template<typename _Tp, int cn> inline void write(FileStorage& fs, const string& name, const Vec<_Tp, cn>& v )
template<typename _Tp, int cn> inline void write(FileStorage& fs, const std::string& name, const Vec<_Tp, cn>& v )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
for(int i = 0; i < cn; i++)
write(fs, v.val[i]);
}
template<typename _Tp> inline void write(FileStorage& fs, const string& name, const Scalar_<_Tp>& s )
template<typename _Tp> inline void write(FileStorage& fs, const std::string& name, const Scalar_<_Tp>& s )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, s.val[0]);
@@ -2918,7 +2908,7 @@ template<typename _Tp> inline void write(FileStorage& fs, const string& name, co
write(fs, s.val[3]);
}
inline void write(FileStorage& fs, const string& name, const Range& r )
inline void write(FileStorage& fs, const std::string& name, const Range& r )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+CV_NODE_FLOW);
write(fs, r.start);
@@ -2929,7 +2919,7 @@ template<typename _Tp, int numflag> class CV_EXPORTS VecWriterProxy
{
public:
VecWriterProxy( FileStorage* _fs ) : fs(_fs) {}
void operator()(const vector<_Tp>& vec) const
void operator()(const std::vector<_Tp>& vec) const
{
size_t i, count = vec.size();
for( i = 0; i < count; i++ )
@@ -2942,30 +2932,30 @@ template<typename _Tp> class CV_EXPORTS VecWriterProxy<_Tp,1>
{
public:
VecWriterProxy( FileStorage* _fs ) : fs(_fs) {}
void operator()(const vector<_Tp>& vec) const
void operator()(const std::vector<_Tp>& vec) const
{
int _fmt = DataType<_Tp>::fmt;
char fmt[] = { (char)((_fmt>>8)+'1'), (char)_fmt, '\0' };
fs->writeRaw( string(fmt), !vec.empty() ? (uchar*)&vec[0] : 0, vec.size()*sizeof(_Tp) );
fs->writeRaw( std::string(fmt), !vec.empty() ? (uchar*)&vec[0] : 0, vec.size()*sizeof(_Tp) );
}
FileStorage* fs;
};
template<typename _Tp> static inline void write( FileStorage& fs, const vector<_Tp>& vec )
template<typename _Tp> static inline void write( FileStorage& fs, const std::vector<_Tp>& vec )
{
VecWriterProxy<_Tp, DataType<_Tp>::fmt != 0> w(&fs);
w(vec);
}
template<typename _Tp> static inline void write( FileStorage& fs, const string& name,
const vector<_Tp>& vec )
template<typename _Tp> static inline void write( FileStorage& fs, const std::string& name,
const std::vector<_Tp>& vec )
{
WriteStructContext ws(fs, name, CV_NODE_SEQ+(DataType<_Tp>::fmt != 0 ? CV_NODE_FLOW : 0));
write(fs, vec);
}
CV_EXPORTS_W void write( FileStorage& fs, const string& name, const Mat& value );
CV_EXPORTS void write( FileStorage& fs, const string& name, const SparseMat& value );
CV_EXPORTS_W void write( FileStorage& fs, const std::string& name, const Mat& value );
CV_EXPORTS void write( FileStorage& fs, const std::string& name, const SparseMat& value );
template<typename _Tp> static inline FileStorage& operator << (FileStorage& fs, const _Tp& value)
{
@@ -2979,10 +2969,10 @@ template<typename _Tp> static inline FileStorage& operator << (FileStorage& fs,
return fs;
}
CV_EXPORTS FileStorage& operator << (FileStorage& fs, const string& str);
CV_EXPORTS FileStorage& operator << (FileStorage& fs, const std::string& str);
static inline FileStorage& operator << (FileStorage& fs, const char* str)
{ return (fs << string(str)); }
{ return (fs << std::string(str)); }
inline FileNode::FileNode() : fs(0), node(0) {}
inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node)
@@ -3060,9 +3050,9 @@ static inline void read(const FileNode& node, double& value, double default_valu
CV_NODE_IS_REAL(node.node->tag) ? node.node->data.f : 1e300;
}
static inline void read(const FileNode& node, string& value, const string& default_value)
static inline void read(const FileNode& node, std::string& value, const std::string& default_value)
{
value = !node.node ? default_value : CV_NODE_IS_STRING(node.node->tag) ? string(node.node->data.str.ptr) : string("");
value = !node.node ? default_value : CV_NODE_IS_STRING(node.node->tag) ? std::string(node.node->data.str.ptr) : std::string("");
}
CV_EXPORTS_W void read(const FileNode& node, Mat& mat, const Mat& default_mat=Mat() );
@@ -3086,14 +3076,14 @@ inline FileNode::operator double() const
read(*this, value, 0.);
return value;
}
inline FileNode::operator string() const
inline FileNode::operator std::string() const
{
string value;
std::string value;
read(*this, value, value);
return value;
}
inline void FileNode::readRaw( const string& fmt, uchar* vec, size_t len ) const
inline void FileNode::readRaw( const std::string& fmt, uchar* vec, size_t len ) const
{
begin().readRaw( fmt, vec, len );
}
@@ -3102,7 +3092,7 @@ template<typename _Tp, int numflag> class CV_EXPORTS VecReaderProxy
{
public:
VecReaderProxy( FileNodeIterator* _it ) : it(_it) {}
void operator()(vector<_Tp>& vec, size_t count) const
void operator()(std::vector<_Tp>& vec, size_t count) const
{
count = std::min(count, it->remaining);
vec.resize(count);
@@ -3116,7 +3106,7 @@ template<typename _Tp> class CV_EXPORTS VecReaderProxy<_Tp,1>
{
public:
VecReaderProxy( FileNodeIterator* _it ) : it(_it) {}
void operator()(vector<_Tp>& vec, size_t count) const
void operator()(std::vector<_Tp>& vec, size_t count) const
{
size_t remaining = it->remaining, cn = DataType<_Tp>::channels;
int _fmt = DataType<_Tp>::fmt;
@@ -3124,20 +3114,20 @@ public:
size_t remaining1 = remaining/cn;
count = count < remaining1 ? count : remaining1;
vec.resize(count);
it->readRaw( string(fmt), !vec.empty() ? (uchar*)&vec[0] : 0, count*sizeof(_Tp) );
it->readRaw( std::string(fmt), !vec.empty() ? (uchar*)&vec[0] : 0, count*sizeof(_Tp) );
}
FileNodeIterator* it;
};
template<typename _Tp> static inline void
read( FileNodeIterator& it, vector<_Tp>& vec, size_t maxCount=(size_t)INT_MAX )
read( FileNodeIterator& it, std::vector<_Tp>& vec, size_t maxCount=(size_t)INT_MAX )
{
VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it);
r(vec, maxCount);
}
template<typename _Tp> static inline void
read( const FileNode& node, vector<_Tp>& vec, const vector<_Tp>& default_value=vector<_Tp>() )
read( const FileNode& node, std::vector<_Tp>& vec, const std::vector<_Tp>& default_value=std::vector<_Tp>() )
{
if(!node.node)
vec = default_value;
@@ -3168,7 +3158,7 @@ template<typename _Tp> static inline FileNodeIterator& operator >> (FileNodeIter
{ read( *it, value, _Tp()); return ++it; }
template<typename _Tp> static inline
FileNodeIterator& operator >> (FileNodeIterator& it, vector<_Tp>& vec)
FileNodeIterator& operator >> (FileNodeIterator& it, std::vector<_Tp>& vec)
{
VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it);
r(vec, (size_t)INT_MAX);
@@ -3178,7 +3168,7 @@ FileNodeIterator& operator >> (FileNodeIterator& it, vector<_Tp>& vec)
template<typename _Tp> static inline void operator >> (const FileNode& n, _Tp& value)
{ read( n, value, _Tp()); }
template<typename _Tp> static inline void operator >> (const FileNode& n, vector<_Tp>& vec)
template<typename _Tp> static inline void operator >> (const FileNode& n, std::vector<_Tp>& vec)
{ FileNodeIterator it = n.begin(); it >> vec; }
static inline bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2)
@@ -3264,7 +3254,7 @@ template<typename _Tp> static inline _Tp gcd(_Tp a, _Tp b)
\****************************************************************************************/
template<typename _Tp, class _LT> void sort( vector<_Tp>& vec, _LT LT=_LT() )
template<typename _Tp, class _LT> void sort( std::vector<_Tp>& vec, _LT LT=_LT() )
{
int isort_thresh = 7;
int sp = 0;
@@ -3462,7 +3452,7 @@ public:
// The algorithm is described in "Introduction to Algorithms"
// by Cormen, Leiserson and Rivest, the chapter "Data structures for disjoint sets"
template<typename _Tp, class _EqPredicate> int
partition( const vector<_Tp>& _vec, vector<int>& labels,
partition( const std::vector<_Tp>& _vec, std::vector<int>& labels,
_EqPredicate predicate=_EqPredicate())
{
int i, j, N = (int)_vec.size();
@@ -3471,7 +3461,7 @@ partition( const vector<_Tp>& _vec, vector<int>& labels,
const int PARENT=0;
const int RANK=1;
vector<int> _nodes(N*2);
std::vector<int> _nodes(N*2);
int (*nodes)[2] = (int(*)[2])&_nodes[0];
// The first O(N) pass: create N single-vertex trees
@@ -3667,7 +3657,7 @@ template<typename _Tp> inline void Seq<_Tp>::remove(int idx)
template<typename _Tp> inline void Seq<_Tp>::remove(const Range& r)
{ seqRemoveSlice(seq, r); }
template<typename _Tp> inline void Seq<_Tp>::copyTo(vector<_Tp>& vec, const Range& range) const
template<typename _Tp> inline void Seq<_Tp>::copyTo(std::vector<_Tp>& vec, const Range& range) const
{
size_t len = !seq ? 0 : range == Range::all() ? seq->total : range.end - range.start;
vec.resize(len);
@@ -3675,9 +3665,9 @@ template<typename _Tp> inline void Seq<_Tp>::copyTo(vector<_Tp>& vec, const Rang
cvCvtSeqToArray(seq, &vec[0], range);
}
template<typename _Tp> inline Seq<_Tp>::operator vector<_Tp>() const
template<typename _Tp> inline Seq<_Tp>::operator std::vector<_Tp>() const
{
vector<_Tp> vec;
std::vector<_Tp> vec;
copyTo(vec);
return vec;
}
@@ -3815,7 +3805,7 @@ public:
{
FileStorage fs(_fs);
fs.fs.addref();
((const _ClsName*)ptr)->write(fs, string(name));
((const _ClsName*)ptr)->write(fs, std::string(name));
}
}
@@ -3843,28 +3833,28 @@ public:
struct CV_EXPORTS Formatted
{
Formatted(const Mat& m, const Formatter* fmt,
const vector<int>& params);
const std::vector<int>& params);
Formatted(const Mat& m, const Formatter* fmt,
const int* params=0);
Mat mtx;
const Formatter* fmt;
vector<int> params;
std::vector<int> params;
};
static inline Formatted format(const Mat& mtx, const char* fmt,
const vector<int>& params=vector<int>())
const std::vector<int>& params=std::vector<int>())
{
return Formatted(mtx, Formatter::get(fmt), params);
}
template<typename _Tp> static inline Formatted format(const vector<Point_<_Tp> >& vec,
const char* fmt, const vector<int>& params=vector<int>())
template<typename _Tp> static inline Formatted format(const std::vector<Point_<_Tp> >& vec,
const char* fmt, const std::vector<int>& params=std::vector<int>())
{
return Formatted(Mat(vec), Formatter::get(fmt), params);
}
template<typename _Tp> static inline Formatted format(const vector<Point3_<_Tp> >& vec,
const char* fmt, const vector<int>& params=vector<int>())
template<typename _Tp> static inline Formatted format(const std::vector<Point3_<_Tp> >& vec,
const char* fmt, const std::vector<int>& params=std::vector<int>())
{
return Formatted(Mat(vec), Formatter::get(fmt), params);
}
@@ -3897,7 +3887,7 @@ static inline std::ostream& operator << (std::ostream& out, const Formatted& fmt
template<typename _Tp> static inline std::ostream& operator << (std::ostream& out,
const vector<Point_<_Tp> >& vec)
const std::vector<Point_<_Tp> >& vec)
{
Formatter::get()->write(out, Mat(vec));
return out;
@@ -3905,7 +3895,7 @@ template<typename _Tp> static inline std::ostream& operator << (std::ostream& ou
template<typename _Tp> static inline std::ostream& operator << (std::ostream& out,
const vector<Point3_<_Tp> >& vec)
const std::vector<Point3_<_Tp> >& vec)
{
Formatter::get()->write(out, Mat(vec));
return out;
@@ -3977,7 +3967,7 @@ template<typename _Tp> inline std::ostream& operator<<(std::ostream& out, const
}
template<typename _Tp> inline Ptr<_Tp> Algorithm::create(const string& name)
template<typename _Tp> inline Ptr<_Tp> Algorithm::create(const std::string& name)
{
return _create(name).ptr<_Tp>();
}
@@ -3993,7 +3983,7 @@ inline void Algorithm::set(const char* _name, const Ptr<_Tp>& value)
}
template<typename _Tp>
inline void Algorithm::set(const string& _name, const Ptr<_Tp>& value)
inline void Algorithm::set(const std::string& _name, const Ptr<_Tp>& value)
{
this->set<_Tp>(_name.c_str(), value);
}
@@ -4009,12 +3999,12 @@ inline void Algorithm::setAlgorithm(const char* _name, const Ptr<_Tp>& value)
}
template<typename _Tp>
inline void Algorithm::setAlgorithm(const string& _name, const Ptr<_Tp>& value)
inline void Algorithm::setAlgorithm(const std::string& _name, const Ptr<_Tp>& value)
{
this->set<_Tp>(_name.c_str(), value);
}
template<typename _Tp> inline typename ParamType<_Tp>::member_type Algorithm::get(const string& _name) const
template<typename _Tp> inline typename ParamType<_Tp>::member_type Algorithm::get(const std::string& _name) const
{
typename ParamType<_Tp>::member_type value;
info()->get(this, _name.c_str(), ParamType<_Tp>::type, &value);
@@ -4030,7 +4020,7 @@ template<typename _Tp> inline typename ParamType<_Tp>::member_type Algorithm::ge
template<typename _Tp, typename _Base> inline void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr<_Tp>& value, bool readOnly, Ptr<_Tp> (Algorithm::*getter)(), void (Algorithm::*setter)(const Ptr<_Tp>&),
const string& help)
const std::string& help)
{
//TODO: static assert: _Tp inherits from _Base
addParam_(algo, parameter, ParamType<_Base>::type, &value, readOnly,
@@ -4039,7 +4029,7 @@ template<typename _Tp, typename _Base> inline void AlgorithmInfo::addParam(Algor
template<typename _Tp> inline void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr<_Tp>& value, bool readOnly, Ptr<_Tp> (Algorithm::*getter)(), void (Algorithm::*setter)(const Ptr<_Tp>&),
const string& help)
const std::string& help)
{
//TODO: static assert: _Tp inherits from Algorithm
addParam_(algo, parameter, ParamType<Algorithm>::type, &value, readOnly,