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
# 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
#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.
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 )
#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 {
}
}
+#if !defined(GAPI_STANDALONE)
cv::GMatDesc cv::descr_of(const cv::Mat &mat)
{
-#if !defined(GAPI_STANDALONE)
const auto mat_dims = mat.size.dims();
if (mat_dims == 2)
dims[i] = mat.size[i];
}
return GMatDesc{mat.depth(), std::move(dims)};
-#else
- return (mat.dims.empty())
- ? GMatDesc{mat.depth(), mat.channels(), {mat.cols, mat.rows}}
- : GMatDesc{mat.depth(), mat.dims};
-#endif
}
+#endif
cv::GMatDesc cv::gapi::own::descr_of(const Mat &mat)
{
return *m_priv;
}
+//N.B. if we ever need more complicated logic for desc_of(cv::(gapi::own::)Scalar)
+//dispatching should be done in the same way as for cv::(gapi::own)::Mat
cv::GScalarDesc cv::descr_of(const cv::Scalar &)
{
return empty_scalar_desc();