From c485aee4649042792a823d3a315f9ad6741c289c Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 18 Dec 2014 17:56:24 +0300 Subject: [PATCH] Included c-headers for better 2.4 compatibility --- modules/calib3d/include/opencv2/calib3d.hpp | 4 ++++ modules/core/include/opencv2/core/cvdef.h | 4 ++++ modules/core/include/opencv2/core/cvstd.hpp | 5 ++++- modules/core/include/opencv2/core/utility.hpp | 4 ++++ modules/highgui/include/opencv2/highgui.hpp | 5 +++++ modules/imgproc/include/opencv2/imgproc.hpp | 4 ++++ modules/objdetect/include/opencv2/objdetect.hpp | 4 ++++ modules/photo/include/opencv2/photo.hpp | 4 ++++ modules/video/include/opencv2/video.hpp | 4 ++++ 9 files changed, 37 insertions(+), 1 deletion(-) diff --git a/modules/calib3d/include/opencv2/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d.hpp index 396b666ee1..7b6a4db7cb 100644 --- a/modules/calib3d/include/opencv2/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d.hpp @@ -1854,4 +1854,8 @@ namespace fisheye } // cv +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/calib3d/calib3d_c.h" +#endif + #endif diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 482d97240b..06894d7a5d 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -73,6 +73,10 @@ # define CV_ENABLE_UNROLLED 1 #endif +#ifdef __OPENCV_BUILD +# define DISABLE_OPENCV_24_COMPATIBILITY +#endif + #if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS # define CV_EXPORTS __declspec(dllexport) #elif defined __GNUC__ && __GNUC__ >= 4 diff --git a/modules/core/include/opencv2/core/cvstd.hpp b/modules/core/include/opencv2/core/cvstd.hpp index 800357bd21..0da8faf3d1 100644 --- a/modules/core/include/opencv2/core/cvstd.hpp +++ b/modules/core/include/opencv2/core/cvstd.hpp @@ -303,7 +303,10 @@ struct Ptr @note It is often easier to use makePtr instead. */ template - explicit Ptr(Y* p); +#ifdef DISABLE_OPENCV_24_COMPATIBILITY + explicit +#endif + Ptr(Y* p); /** @overload @param d Deleter to use for the owned pointer. diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp index 73bbb31637..43dc8053a4 100644 --- a/modules/core/include/opencv2/core/utility.hpp +++ b/modules/core/include/opencv2/core/utility.hpp @@ -746,4 +746,8 @@ template<> inline std::string CommandLineParser::get(const String& } //namespace cv +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/core/core_c.h" +#endif + #endif //__OPENCV_CORE_UTILITY_H__ diff --git a/modules/highgui/include/opencv2/highgui.hpp b/modules/highgui/include/opencv2/highgui.hpp index 1c06bf0787..679c0a702c 100644 --- a/modules/highgui/include/opencv2/highgui.hpp +++ b/modules/highgui/include/opencv2/highgui.hpp @@ -677,4 +677,9 @@ CV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change, //! @} highgui } // cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/highgui/highgui_c.h" +#endif + #endif diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 1d02506e92..e67922eec0 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -4217,4 +4217,8 @@ Point LineIterator::pos() const } // cv +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/imgproc/imgproc_c.h" +#endif + #endif diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index a35d206b98..d8b06fa612 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -458,4 +458,8 @@ public: #include "opencv2/objdetect/detection_based_tracker.hpp" +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/objdetect/objdetect_c.h" +#endif + #endif diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp index 0cc0cf619a..2d1087e893 100644 --- a/modules/photo/include/opencv2/photo.hpp +++ b/modules/photo/include/opencv2/photo.hpp @@ -802,4 +802,8 @@ CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 6 } // cv +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/photo/photo_c.h" +#endif + #endif diff --git a/modules/video/include/opencv2/video.hpp b/modules/video/include/opencv2/video.hpp index 6d20a26cce..a5938154ae 100644 --- a/modules/video/include/opencv2/video.hpp +++ b/modules/video/include/opencv2/video.hpp @@ -56,4 +56,8 @@ #include "opencv2/video/tracking.hpp" #include "opencv2/video/background_segm.hpp" +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/video/tracking_c.h" +#endif + #endif //__OPENCV_VIDEO_HPP__