diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index b1cb9c9744..9414b66f09 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -251,7 +251,7 @@ PREDEFINED = __cplusplus=1 \ CV_DEFAULT(x)=" = x" \ CV_NEON=1 \ CV_SSE2=1 \ - FLANN_DEPRECATED= + CV_DEPRECATED= EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES TAGFILES = diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 810ec56ed3..9e2b1ed7fd 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -369,6 +369,16 @@ Cv64suf; # define CV_EXPORTS #endif +#ifndef CV_DEPRECATED +# if defined(__GNUC__) +# define CV_DEPRECATED __attribute__ ((deprecated)) +# elif defined(_MSC_VER) +# define CV_DEPRECATED __declspec(deprecated) +# else +# define CV_DEPRECATED +# endif +#endif + #ifndef CV_EXTERN_C # ifdef __cplusplus # define CV_EXTERN_C extern "C" diff --git a/modules/flann/include/opencv2/flann.hpp b/modules/flann/include/opencv2/flann.hpp index 19a98f19e5..22c6ffcf19 100644 --- a/modules/flann/include/opencv2/flann.hpp +++ b/modules/flann/include/opencv2/flann.hpp @@ -59,7 +59,7 @@ can be found in @cite Muja2009 . namespace cvflann { CV_EXPORTS flann_distance_t flann_distance_type(); - FLANN_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); + CV_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); } @@ -230,7 +230,7 @@ public: ::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); } - FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } + CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } private: ::cvflann::Index* nnIndex; @@ -344,7 +344,7 @@ public: typedef typename L2::ElementType ElementType; typedef typename L2::ResultType DistanceType; - FLANN_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) + CV_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) { printf("[WARNING] The cv::flann::Index_ class is deperecated, use cv::flann::GenericIndex instead\n"); @@ -368,13 +368,13 @@ public: if (nnIndex_L1) nnIndex_L1->buildIndex(); if (nnIndex_L2) nnIndex_L2->buildIndex(); } - FLANN_DEPRECATED ~Index_() + CV_DEPRECATED ~Index_() { if (nnIndex_L1) delete nnIndex_L1; if (nnIndex_L2) delete nnIndex_L2; } - FLANN_DEPRECATED void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) + CV_DEPRECATED void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) { ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); @@ -383,7 +383,7 @@ public: if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); } - FLANN_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) + CV_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) { CV_Assert(queries.type() == CvType::type()); CV_Assert(queries.isContinuous()); @@ -401,7 +401,7 @@ public: if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); } - FLANN_DEPRECATED int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) + CV_DEPRECATED int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) { ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); @@ -411,7 +411,7 @@ public: if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); } - FLANN_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) + CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) { CV_Assert(query.type() == CvType::type()); CV_Assert(query.isContinuous()); @@ -429,32 +429,32 @@ public: if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); } - FLANN_DEPRECATED void save(String filename) + CV_DEPRECATED void save(String filename) { if (nnIndex_L1) nnIndex_L1->save(filename); if (nnIndex_L2) nnIndex_L2->save(filename); } - FLANN_DEPRECATED int veclen() const + CV_DEPRECATED int veclen() const { if (nnIndex_L1) return nnIndex_L1->veclen(); if (nnIndex_L2) return nnIndex_L2->veclen(); } - FLANN_DEPRECATED int size() const + CV_DEPRECATED int size() const { if (nnIndex_L1) return nnIndex_L1->size(); if (nnIndex_L2) return nnIndex_L2->size(); } - FLANN_DEPRECATED ::cvflann::IndexParams getParameters() + CV_DEPRECATED ::cvflann::IndexParams getParameters() { if (nnIndex_L1) return nnIndex_L1->getParameters(); if (nnIndex_L2) return nnIndex_L2->getParameters(); } - FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() + CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); @@ -505,7 +505,7 @@ int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::K /** @deprecated */ template -FLANN_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) +CV_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) { printf("[WARNING] cv::flann::hierarchicalClustering is deprecated, use " "cv::flann::hierarchicalClustering instead\n"); diff --git a/modules/flann/include/opencv2/flann/defines.h b/modules/flann/include/opencv2/flann/defines.h index f0264f74e3..cab6ea9c0a 100644 --- a/modules/flann/include/opencv2/flann/defines.h +++ b/modules/flann/include/opencv2/flann/defines.h @@ -50,19 +50,6 @@ #endif -#ifdef FLANN_DEPRECATED -#undef FLANN_DEPRECATED -#endif -#ifdef __GNUC__ -#define FLANN_DEPRECATED __attribute__ ((deprecated)) -#elif defined(_MSC_VER) -#define FLANN_DEPRECATED __declspec(deprecated) -#else -#pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler") -#define FLANN_DEPRECATED -#endif - - #undef FLANN_PLATFORM_32_BIT #undef FLANN_PLATFORM_64_BIT #if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 diff --git a/modules/flann/include/opencv2/flann/flann_base.hpp b/modules/flann/include/opencv2/flann/flann_base.hpp index 98c33cf6c0..98901afec1 100644 --- a/modules/flann/include/opencv2/flann/flann_base.hpp +++ b/modules/flann/include/opencv2/flann/flann_base.hpp @@ -241,7 +241,7 @@ public: /** * \brief Returns actual index */ - FLANN_DEPRECATED NNIndex* getIndex() + CV_DEPRECATED NNIndex* getIndex() { return nnIndex_; } @@ -250,7 +250,7 @@ public: * \brief Returns index parameters. * \deprecated use getParameters() instead. */ - FLANN_DEPRECATED const IndexParams* getIndexParameters() + CV_DEPRECATED const IndexParams* getIndexParameters() { return &index_params_; } diff --git a/modules/flann/include/opencv2/flann/matrix.h b/modules/flann/include/opencv2/flann/matrix.h index 51b6c6352c..f6092d134e 100644 --- a/modules/flann/include/opencv2/flann/matrix.h +++ b/modules/flann/include/opencv2/flann/matrix.h @@ -66,7 +66,7 @@ public: /** * Convenience function for deallocating the storage data. */ - FLANN_DEPRECATED void free() + CV_DEPRECATED void free() { fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " "and it does not do any memory deallocation any more. You are"