G-API: "deownification" corrections

- moved "standalone" aliases of cv types to "opencv_includes.hpp" to
keep responsibility principle aplied
- introduced correct aliasing for "descr_of(Mat)" function for
standalone case
 - added missing include in `gapi/own/mat.hpp`
This commit is contained in:
Anton Potapov
2020-05-12 14:06:50 +03:00
parent 713577b257
commit 7386d8523b
6 changed files with 25 additions and 22 deletions
+9 -4
View File
@@ -209,15 +209,20 @@ 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);
/** @} */
// FIXME: WHY??? WHY it is under different namespace?
//Fwd declarations
namespace gapi { namespace own {
class Mat;
GAPI_EXPORTS GMatDesc descr_of(const Mat &mat);
}}//gapi::own
#if !defined(GAPI_STANDALONE)
GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat);
#else
using gapi::own::descr_of;
#endif
/** @} */
GAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const cv::GMatDesc &desc);
} // namespace cv
@@ -16,6 +16,17 @@
# include <opencv2/core/base.hpp>
#else // Without OpenCV
# include <opencv2/gapi/own/cvdefs.hpp>
# include <opencv2/gapi/own/types.hpp> // cv::gapi::own::Rect/Size/Point
# include <opencv2/gapi/own/scalar.hpp> // cv::gapi::own::Scalar
# include <opencv2/gapi/own/mat.hpp>
// replacement of cv's structures:
namespace cv {
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
#endif // !defined(GAPI_STANDALONE)
#endif // OPENCV_GAPI_OPENCV_INCLUDES_HPP
@@ -9,9 +9,6 @@
#define OPENCV_GAPI_CV_DEFS_HPP
#if defined(GAPI_STANDALONE)
#include <opencv2/gapi/own/types.hpp> // cv::gapi::own::Rect/Size/Point
#include <opencv2/gapi/own/scalar.hpp> // cv::gapi::own::Scalar
// Simulate OpenCV definitions taken from various
// OpenCV interface headers if G-API is built in a
// standalone mode.
@@ -139,15 +136,6 @@ enum InterpolationFlags{
INTER_LINEAR_EXACT = 5,
INTER_MAX = 7,
};
// replacement of cv's structures:
namespace gapi { namespace own {
class Mat;
}} // namespace gapi::own
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 )
@@ -17,6 +17,7 @@
#include <memory> //std::shared_ptr
#include <cstring> //std::memcpy
#include <numeric> //std::accumulate
#include <vector>
#include <opencv2/gapi/util/throw.hpp>
namespace cv { namespace gapi { namespace own {