1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018-2019 Intel Corporation
9 #include <opencv2/gapi/opencv_includes.hpp>
10 #include <opencv2/gapi/own/mat.hpp> //gapi::own::Mat
12 #include "opencv2/gapi/gmat.hpp"
13 #include "api/gapi_priv.hpp" // GOrigin
15 // cv::GMat public implementation //////////////////////////////////////////////
17 : m_priv(new GOrigin(GShape::GMAT, GNode::Param()))
21 cv::GMat::GMat(const GNode &n, std::size_t out)
22 : m_priv(new GOrigin(GShape::GMAT, n, out))
26 cv::GOrigin& cv::GMat::priv()
31 const cv::GOrigin& cv::GMat::priv() const
37 template <typename T> cv::GMetaArgs vec_descr_of(const std::vector<T> &vec)
39 cv::GMetaArgs vec_descr;
40 vec_descr.reserve(vec.size());
42 vec_descr.emplace_back(descr_of(mat));
49 #if !defined(GAPI_STANDALONE)
50 cv::GMatDesc cv::descr_of(const cv::Mat &mat)
52 return GMatDesc{mat.depth(), mat.channels(), {mat.cols, mat.rows}};
55 cv::GMatDesc cv::descr_of(const cv::UMat &mat)
57 return GMatDesc{ mat.depth(), mat.channels(),{ mat.cols, mat.rows } };
60 cv::GMetaArgs cv::descr_of(const std::vector<cv::Mat> &vec)
62 return vec_descr_of(vec);
65 cv::GMetaArgs cv::descr_of(const std::vector<cv::UMat> &vec)
67 return vec_descr_of(vec);
71 cv::GMatDesc cv::gapi::own::descr_of(const cv::gapi::own::Mat &mat)
73 return GMatDesc{mat.depth(), mat.channels(), {mat.cols, mat.rows}};
76 cv::GMetaArgs cv::gapi::own::descr_of(const std::vector<cv::gapi::own::Mat> &vec)
78 return vec_descr_of(vec);
82 std::ostream& operator<<(std::ostream& os, const cv::GMatDesc &desc)
86 #define TT(X) case CV_##X: os << #X; break;
97 << std::hex << desc.depth << std::dec
102 os << "C" << desc.chan << " ";
103 os << desc.size.width << "x" << desc.size.height;