From 811fa7f8726dd9e9f013ae9a277a6e0533a7697b Mon Sep 17 00:00:00 2001 From: Maxim Pashchenkov Date: Wed, 6 May 2020 15:36:56 +0300 Subject: [PATCH] Problem with substitution --- modules/gapi/include/opencv2/gapi/gmat.hpp | 2 +- modules/gapi/include/opencv2/gapi/opencv_includes.hpp | 2 +- modules/gapi/include/opencv2/gapi/own/cvdefs.hpp | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/gapi/include/opencv2/gapi/gmat.hpp b/modules/gapi/include/opencv2/gapi/gmat.hpp index 91f6332a1060..438a663170df 100644 --- a/modules/gapi/include/opencv2/gapi/gmat.hpp +++ b/modules/gapi/include/opencv2/gapi/gmat.hpp @@ -209,7 +209,7 @@ static inline GMatDesc empty_gmat_desc() { return GMatDesc{-1,-1,{-1,-1}}; } GAPI_EXPORTS GMatDesc descr_of(const cv::UMat &mat); #endif // !defined(GAPI_STANDALONE) -GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat); +GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat); //another way: previous declaration /** @} */ // FIXME: WHY??? WHY it is under different namespace? diff --git a/modules/gapi/include/opencv2/gapi/opencv_includes.hpp b/modules/gapi/include/opencv2/gapi/opencv_includes.hpp index 5acf28023d07..767346659f67 100644 --- a/modules/gapi/include/opencv2/gapi/opencv_includes.hpp +++ b/modules/gapi/include/opencv2/gapi/opencv_includes.hpp @@ -9,7 +9,7 @@ #ifndef OPENCV_GAPI_OPENCV_INCLUDES_HPP #define OPENCV_GAPI_OPENCV_INCLUDES_HPP -#if !defined(GAPI_STANDALONE) +#if !defined(GAPI_STANDALONE) // # include # include # include diff --git a/modules/gapi/include/opencv2/gapi/own/cvdefs.hpp b/modules/gapi/include/opencv2/gapi/own/cvdefs.hpp index 008cdd6f7af0..ecf67282275d 100644 --- a/modules/gapi/include/opencv2/gapi/own/cvdefs.hpp +++ b/modules/gapi/include/opencv2/gapi/own/cvdefs.hpp @@ -11,13 +11,12 @@ #if defined(GAPI_STANDALONE) #include // cv::gapi::own::Rect/Size/Point #include // cv::gapi::own::Scalar - +#include // call opencv_includes.hpp, that call cvdefs.hpp, that call gmat.hpp, ... // Simulate OpenCV definitions taken from various // OpenCV interface headers if G-API is built in a // standalone mode. // interface.h: - typedef unsigned char uchar; typedef char schar; @@ -139,15 +138,23 @@ enum InterpolationFlags{ INTER_LINEAR_EXACT = 5, INTER_MAX = 7, }; + +// struct GMatDesc; // another way - without include gmat.hpp + // replacement of cv's structures: namespace gapi { namespace own { class Mat; +// GMatDesc descr_of(const Mat &mat); // another way: error-> conflicts with a previous declaration in gmat.hpp }} // namespace gapi::own + +using gapi::own::descr_of; // with include gmat.hpp it has not been declared + using Rect = gapi::own::Rect; using Size = gapi::own::Size; using Point = gapi::own::Point; using Scalar = gapi::own::Scalar; using Mat = gapi::own::Mat; + } // namespace cv static inline int cvFloor( double value )