From 2a2a1dc5b4a42cd05c76662f8fa1f866d82ffa89 Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Fri, 19 May 2017 16:51:08 +0300 Subject: [PATCH] Get rid of OPENCV_NOSTL definition --- modules/core/include/opencv2/core/cvstd.hpp | 33 +------------------ .../core/include/opencv2/core/cvstd.inl.hpp | 8 ++--- modules/core/include/opencv2/core/mat.hpp | 10 ------ .../core/include/opencv2/core/persistence.hpp | 2 -- modules/core/include/opencv2/core/utility.hpp | 2 -- modules/photo/src/denoise_tvl1.cpp | 15 +-------- 6 files changed, 4 insertions(+), 66 deletions(-) diff --git a/modules/core/include/opencv2/core/cvstd.hpp b/modules/core/include/opencv2/core/cvstd.hpp index 83d5cdb5e3..ddb53e5325 100644 --- a/modules/core/include/opencv2/core/cvstd.hpp +++ b/modules/core/include/opencv2/core/cvstd.hpp @@ -53,12 +53,9 @@ #include #include -#ifndef OPENCV_NOSTL -# include -#endif +#include // import useful primitives from stl -#ifndef OPENCV_NOSTL_TRANSITIONAL # include # include # include //for abs(int) @@ -81,21 +78,6 @@ namespace cv using std::log; } -#else -namespace cv -{ - template static inline T min(T a, T b) { return a < b ? a : b; } - template static inline T max(T a, T b) { return a > b ? a : b; } - template static inline T abs(T a) { return a < 0 ? -a : a; } - template static inline void swap(T& a, T& b) { T tmp = a; a = b; b = tmp; } - - template<> inline uchar abs(uchar a) { return a; } - template<> inline ushort abs(ushort a) { return a; } - template<> inline unsigned abs(unsigned a) { return a; } - template<> inline uint64 abs(uint64 a) { return a; } -} -#endif - namespace cv { //! @addtogroup core_utils @@ -555,7 +537,6 @@ public: String toLowerCase() const; -#ifndef OPENCV_NOSTL String(const std::string& str); String(const std::string& str, size_t pos, size_t len = npos); String& operator=(const std::string& str); @@ -564,7 +545,6 @@ public: friend String operator+ (const String& lhs, const std::string& rhs); friend String operator+ (const std::string& lhs, const String& rhs); -#endif private: char* cstr_; @@ -1049,21 +1029,10 @@ static inline bool operator>= (const String& lhs, const char* rhs) { return lh } // cv -#ifndef OPENCV_NOSTL_TRANSITIONAL namespace std { static inline void swap(cv::String& a, cv::String& b) { a.swap(b); } } -#else -namespace cv -{ - template<> inline - void swap(cv::String& a, cv::String& b) - { - a.swap(b); - } -} -#endif #include "opencv2/core/ptr.inl.hpp" diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index c8c7ba998e..dd9ba31c71 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -44,10 +44,8 @@ #ifndef OPENCV_CORE_CVSTDINL_HPP #define OPENCV_CORE_CVSTDINL_HPP -#ifndef OPENCV_NOSTL -# include -# include -#endif +#include +#include //! @cond IGNORED @@ -58,7 +56,6 @@ namespace cv { -#ifndef OPENCV_NOSTL template class DataType< std::complex<_Tp> > { @@ -280,7 +277,6 @@ static inline std::ostream& operator << (std::ostream& out, const MatSize& msize return out; } -#endif // OPENCV_NOSTL } // cv #ifdef _MSC_VER diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 92d34c174e..afdbec558c 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -2967,9 +2967,7 @@ public: typedef const uchar** pointer; typedef uchar* reference; -#ifndef OPENCV_NOSTL typedef std::random_access_iterator_tag iterator_category; -#endif //! default constructor MatConstIterator(); @@ -3034,9 +3032,7 @@ public: typedef const _Tp* pointer; typedef const _Tp& reference; -#ifndef OPENCV_NOSTL typedef std::random_access_iterator_tag iterator_category; -#endif //! default constructor MatConstIterator_(); @@ -3087,9 +3083,7 @@ public: typedef _Tp* pointer; typedef _Tp& reference; -#ifndef OPENCV_NOSTL typedef std::random_access_iterator_tag iterator_category; -#endif //! the default constructor MatIterator_(); @@ -3223,9 +3217,7 @@ template class SparseMatConstIterator_ : public SparseMatConstIter { public: -#ifndef OPENCV_NOSTL typedef std::forward_iterator_tag iterator_category; -#endif //! the default constructor SparseMatConstIterator_(); @@ -3259,9 +3251,7 @@ template class SparseMatIterator_ : public SparseMatConstIterator_ { public: -#ifndef OPENCV_NOSTL typedef std::forward_iterator_tag iterator_category; -#endif //! the default constructor SparseMatIterator_(); diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 90da60d821..a5ae22f122 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -570,9 +570,7 @@ public: operator double() const; //! returns the node content as text string operator String() const; -#ifndef OPENCV_NOSTL operator std::string() const; -#endif //! returns pointer to the underlying file node CvFileNode* operator *(); diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index cdff24dc26..a7a3eb9d4a 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -1022,7 +1022,6 @@ template inline AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const { return ptr; } -#ifndef OPENCV_NOSTL template<> inline std::string CommandLineParser::get(int index, bool space_delete) const { return get(index, space_delete); @@ -1031,7 +1030,6 @@ template<> inline std::string CommandLineParser::get(const String& { return get(name, space_delete); } -#endif // OPENCV_NOSTL //! @endcond diff --git a/modules/photo/src/denoise_tvl1.cpp b/modules/photo/src/denoise_tvl1.cpp index 03bd747900..df756c4c85 100644 --- a/modules/photo/src/denoise_tvl1.cpp +++ b/modules/photo/src/denoise_tvl1.cpp @@ -56,21 +56,8 @@ namespace cv{ double _scale; }; -#ifndef OPENCV_NOSTL using std::transform; -#else - template - static OutputIterator transform (InputIterator first1, InputIterator last1, InputIterator2 first2, - OutputIterator result, BinaryOperator binary_op) - { - while (first1 != last1) - { - *result = binary_op(*first1, *first2); - ++result; ++first1; ++first2; - } - return result; - } -#endif + void denoise_TVL1(const std::vector& observations,Mat& result, double lambda, int niters){ CV_Assert(observations.size()>0 && niters>0 && lambda>0);