From 0ee47502d9dcc326201d660b7d00085b43dc8ee1 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 15 Sep 2013 07:05:30 +0400 Subject: [PATCH] remove CV_EXPORT from templates --- modules/core/include/opencv2/core/core.hpp | 66 +++++++++---------- .../core/include/opencv2/core/operations.hpp | 42 ++++++------ .../include/opencv2/features2d/features2d.hpp | 2 +- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index bc1a68fb77..9996c242ad 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -78,11 +78,11 @@ using std::vector; using std::string; using std::ptrdiff_t; -template class CV_EXPORTS Size_; -template class CV_EXPORTS Point_; -template class CV_EXPORTS Rect_; -template class CV_EXPORTS Vec; -template class CV_EXPORTS Matx; +template class Size_; +template class Point_; +template class Rect_; +template class Vec; +template class Matx; typedef std::string String; @@ -112,10 +112,10 @@ class CV_EXPORTS MatOp_Base; class CV_EXPORTS MatArg; class CV_EXPORTS MatConstIterator; -template class CV_EXPORTS Mat_; -template class CV_EXPORTS MatIterator_; -template class CV_EXPORTS MatConstIterator_; -template class CV_EXPORTS MatCommaInitializer_; +template class Mat_; +template class MatIterator_; +template class MatConstIterator_; +template class MatCommaInitializer_; #if !defined(ANDROID) || (defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_WCHAR_T) typedef std::basic_string WString; @@ -363,7 +363,7 @@ CV_EXPORTS_W bool useOptimized(); /*! The STL-compilant memory Allocator based on cv::fastMalloc() and cv::fastFree() */ -template class CV_EXPORTS Allocator +template class Allocator { public: typedef _Tp value_type; @@ -405,7 +405,7 @@ public: The class is specialized for each fundamental numerical data type supported by OpenCV. It provides DataDepth::value constant. */ -template class CV_EXPORTS DataDepth {}; +template class DataDepth {}; template<> class DataDepth { public: enum { value = CV_8U, fmt=(int)'u' }; }; template<> class DataDepth { public: enum { value = CV_8U, fmt=(int)'u' }; }; @@ -446,7 +446,7 @@ struct CV_EXPORTS Matx_MulOp {}; struct CV_EXPORTS Matx_MatMulOp {}; struct CV_EXPORTS Matx_TOp {}; -template class CV_EXPORTS Matx +template class Matx { public: typedef _Tp value_type; @@ -595,7 +595,7 @@ typedef Matx Matx66d; In addition to the universal notation like Vec, you can use shorter aliases for the most popular specialized variants of Vec, e.g. Vec3f ~ Vec. */ -template class CV_EXPORTS Vec : public Matx<_Tp, cn, 1> +template class Vec : public Matx<_Tp, cn, 1> { public: typedef _Tp value_type; @@ -691,7 +691,7 @@ typedef Vec Vec6d; more convenient access to the real and imaginary parts using through the simple field access, as opposite to std::complex::real() and std::complex::imag(). */ -template class CV_EXPORTS Complex +template class Complex { public: @@ -727,7 +727,7 @@ typedef Complex Complexd; as a template parameter. There are a few shorter aliases available for user convenience. See cv::Point, cv::Point2i, cv::Point2f and cv::Point2d. */ -template class CV_EXPORTS Point_ +template class Point_ { public: typedef _Tp value_type; @@ -770,7 +770,7 @@ public: \see cv::Point3i, cv::Point3f and cv::Point3d */ -template class CV_EXPORTS Point3_ +template class Point3_ { public: typedef _Tp value_type; @@ -809,7 +809,7 @@ public: The class represents the size of a 2D rectangle, image size, matrix size etc. Normally, cv::Size ~ cv::Size_ is used. */ -template class CV_EXPORTS Size_ +template class Size_ { public: typedef _Tp value_type; @@ -844,7 +844,7 @@ public: The class represents a 2D rectangle with coordinates of the specified data type. Normally, cv::Rect ~ cv::Rect_ is used. */ -template class CV_EXPORTS Rect_ +template class Rect_ { public: typedef _Tp value_type; @@ -933,7 +933,7 @@ public: This is partially specialized cv::Vec class with the number of elements = 4, i.e. a short vector of four elements. Normally, cv::Scalar ~ cv::Scalar_ is used. */ -template class CV_EXPORTS Scalar_ : public Vec<_Tp, 4> +template class Scalar_ : public Vec<_Tp, 4> { public: //! various constructors @@ -1260,7 +1260,7 @@ public: \note{Another good property of the class is that the operations on the reference counter are atomic, i.e. it is safe to use the class in multi-threaded applications} */ -template class CV_EXPORTS Ptr +template class Ptr { public: //! empty constructor @@ -2748,7 +2748,7 @@ CV_EXPORTS_W Size getTextSize(const string& text, int fontFace, img(i,j)[2] ^= (uchar)(i ^ j); // img(y,x)[c] accesses c-th channel of the pixel (x,y) \endcode */ -template class CV_EXPORTS Mat_ : public Mat +template class Mat_ : public Mat { public: typedef _Tp value_type; @@ -2980,7 +2980,7 @@ public: */ template -class CV_EXPORTS MatConstIterator_ : public MatConstIterator +class MatConstIterator_ : public MatConstIterator { public: typedef _Tp value_type; @@ -3031,7 +3031,7 @@ public: */ template -class CV_EXPORTS MatIterator_ : public MatConstIterator_<_Tp> +class MatIterator_ : public MatConstIterator_<_Tp> { public: typedef _Tp* pointer; @@ -3072,7 +3072,7 @@ public: MatIterator_ operator ++(int); }; -template class CV_EXPORTS MatOp_Iter_; +template class MatOp_Iter_; /*! Comma-separated Matrix Initializer @@ -3087,7 +3087,7 @@ template class CV_EXPORTS MatOp_Iter_; Mat R = (Mat_(2,2) << a, -b, b, a); \endcode */ -template class CV_EXPORTS MatCommaInitializer_ +template class MatCommaInitializer_ { public: //! the constructor, created by "matrix << firstValue" operator, where matrix is cv::Mat @@ -3102,7 +3102,7 @@ protected: }; -template class CV_EXPORTS MatxCommaInitializer +template class MatxCommaInitializer { public: MatxCommaInitializer(Matx<_Tp, m, n>* _mtx); @@ -3113,7 +3113,7 @@ public: int idx; }; -template class CV_EXPORTS VecCommaInitializer : public MatxCommaInitializer<_Tp, m, 1> +template class VecCommaInitializer : public MatxCommaInitializer<_Tp, m, 1> { public: VecCommaInitializer(Vec<_Tp, m>* _vec); @@ -3148,7 +3148,7 @@ public: } \endcode */ -template class CV_EXPORTS AutoBuffer +template class AutoBuffer { public: typedef _Tp value_type; @@ -3719,7 +3719,7 @@ public: m_.ref(2) += m_(3); // equivalent to m.ref(2) += m.value(3); \endcode */ -template class CV_EXPORTS SparseMat_ : public SparseMat +template class SparseMat_ : public SparseMat { public: typedef SparseMatIterator_<_Tp> iterator; @@ -3793,7 +3793,7 @@ public: This is the derived from SparseMatConstIterator class that introduces more convenient operator *() for accessing the current element. */ -template class CV_EXPORTS SparseMatConstIterator_ : public SparseMatConstIterator +template class SparseMatConstIterator_ : public SparseMatConstIterator { public: typedef std::forward_iterator_tag iterator_category; @@ -3823,7 +3823,7 @@ public: This is the derived from cv::SparseMatConstIterator_ class that introduces more convenient operator *() for accessing the current element. */ -template class CV_EXPORTS SparseMatIterator_ : public SparseMatConstIterator_<_Tp> +template class SparseMatIterator_ : public SparseMatConstIterator_<_Tp> { public: typedef std::forward_iterator_tag iterator_category; @@ -4255,7 +4255,7 @@ typedef Ptr MemStorage; i.e. no constructors or destructors are called for the sequence elements. */ -template class CV_EXPORTS Seq +template class Seq { public: typedef SeqIterator<_Tp> iterator; @@ -4338,7 +4338,7 @@ public: /*! STL-style Sequence Iterator inherited from the CvSeqReader structure */ -template class CV_EXPORTS SeqIterator : public CvSeqReader +template class SeqIterator : public CvSeqReader { public: //! the default constructor diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index e100f754eb..9569d1abc0 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -711,7 +711,7 @@ CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n); -template struct CV_EXPORTS Matx_DetOp +template struct Matx_DetOp { double operator ()(const Matx<_Tp, m, m>& a) const { @@ -726,7 +726,7 @@ template struct CV_EXPORTS Matx_DetOp }; -template struct CV_EXPORTS Matx_DetOp<_Tp, 1> +template struct Matx_DetOp<_Tp, 1> { double operator ()(const Matx<_Tp, 1, 1>& a) const { @@ -735,7 +735,7 @@ template struct CV_EXPORTS Matx_DetOp<_Tp, 1> }; -template struct CV_EXPORTS Matx_DetOp<_Tp, 2> +template struct Matx_DetOp<_Tp, 2> { double operator ()(const Matx<_Tp, 2, 2>& a) const { @@ -744,7 +744,7 @@ template struct CV_EXPORTS Matx_DetOp<_Tp, 2> }; -template struct CV_EXPORTS Matx_DetOp<_Tp, 3> +template struct Matx_DetOp<_Tp, 3> { double operator ()(const Matx<_Tp, 3, 3>& a) const { @@ -778,7 +778,7 @@ Matx<_Tp, n, m> Matx<_Tp, m, n>::t() const } -template struct CV_EXPORTS Matx_FastInvOp +template struct Matx_FastInvOp { bool operator()(const Matx<_Tp, m, m>& a, Matx<_Tp, m, m>& b, int method) const { @@ -796,7 +796,7 @@ template struct CV_EXPORTS Matx_FastInvOp }; -template struct CV_EXPORTS Matx_FastInvOp<_Tp, 2> +template struct Matx_FastInvOp<_Tp, 2> { bool operator()(const Matx<_Tp, 2, 2>& a, Matx<_Tp, 2, 2>& b, int) const { @@ -813,7 +813,7 @@ template struct CV_EXPORTS Matx_FastInvOp<_Tp, 2> }; -template struct CV_EXPORTS Matx_FastInvOp<_Tp, 3> +template struct Matx_FastInvOp<_Tp, 3> { bool operator()(const Matx<_Tp, 3, 3>& a, Matx<_Tp, 3, 3>& b, int) const { @@ -853,7 +853,7 @@ Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method) const } -template struct CV_EXPORTS Matx_FastSolveOp +template struct Matx_FastSolveOp { bool operator()(const Matx<_Tp, m, m>& a, const Matx<_Tp, m, n>& b, Matx<_Tp, m, n>& x, int method) const @@ -868,7 +868,7 @@ template struct CV_EXPORTS Matx_FastSolveOp }; -template struct CV_EXPORTS Matx_FastSolveOp<_Tp, 2, 1> +template struct Matx_FastSolveOp<_Tp, 2, 1> { bool operator()(const Matx<_Tp, 2, 2>& a, const Matx<_Tp, 2, 1>& b, Matx<_Tp, 2, 1>& x, int) const @@ -884,7 +884,7 @@ template struct CV_EXPORTS Matx_FastSolveOp<_Tp, 2, 1> }; -template struct CV_EXPORTS Matx_FastSolveOp<_Tp, 3, 1> +template struct Matx_FastSolveOp<_Tp, 3, 1> { bool operator()(const Matx<_Tp, 3, 3>& a, const Matx<_Tp, 3, 1>& b, Matx<_Tp, 3, 1>& x, int) const @@ -2265,7 +2265,7 @@ inline Range::operator CvSlice() const // 1) it can be created on top of user-allocated data w/o copying it // 2) vector b = a means copying the header, // not the underlying data (use clone() to make a deep copy) -template class CV_EXPORTS Vector +template class Vector { public: typedef _Tp value_type; @@ -2274,7 +2274,7 @@ public: typedef _Tp& reference; typedef const _Tp& const_reference; - struct CV_EXPORTS Hdr + struct Hdr { Hdr() : data(0), datastart(0), refcount(0), size(0), capacity(0) {}; _Tp* data; @@ -2858,7 +2858,7 @@ inline void write(FileStorage& fs, const string& name, const Range& r ) write(fs, r.end); } -template class CV_EXPORTS VecWriterProxy +template class VecWriterProxy { public: VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} @@ -2871,7 +2871,7 @@ public: FileStorage* fs; }; -template class CV_EXPORTS VecWriterProxy<_Tp,1> +template class VecWriterProxy<_Tp,1> { public: VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} @@ -3086,7 +3086,7 @@ inline void FileNode::readRaw( const string& fmt, uchar* vec, size_t len ) const begin().readRaw( fmt, vec, len ); } -template class CV_EXPORTS VecReaderProxy +template class VecReaderProxy { public: VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} @@ -3100,7 +3100,7 @@ public: FileNodeIterator* it; }; -template class CV_EXPORTS VecReaderProxy<_Tp,1> +template class VecReaderProxy<_Tp,1> { public: VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} @@ -3414,19 +3414,19 @@ template void sort( vector<_Tp>& vec, _LT LT=_LT() ) } } -template class CV_EXPORTS LessThan +template class LessThan { public: bool operator()(const _Tp& a, const _Tp& b) const { return a < b; } }; -template class CV_EXPORTS GreaterEq +template class GreaterEq { public: bool operator()(const _Tp& a, const _Tp& b) const { return a >= b; } }; -template class CV_EXPORTS LessThanIdx +template class LessThanIdx { public: LessThanIdx( const _Tp* _arr ) : arr(_arr) {} @@ -3434,7 +3434,7 @@ public: const _Tp* arr; }; -template class CV_EXPORTS GreaterEqIdx +template class GreaterEqIdx { public: GreaterEqIdx( const _Tp* _arr ) : arr(_arr) {} @@ -3763,7 +3763,7 @@ template inline bool operator != (const SeqIterator<_Tp>& a, } -template struct CV_EXPORTS RTTIImpl +template struct RTTIImpl { public: static int isInstance(const void* ptr) diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index d4649baab9..d598ed6d78 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -1017,7 +1017,7 @@ struct CV_EXPORTS Hamming typedef Hamming HammingLUT; -template struct CV_EXPORTS HammingMultilevel +template struct HammingMultilevel { enum { normType = NORM_HAMMING + (cellsize>1) }; typedef unsigned char ValueType;