Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / src / api / gmat.cpp
index e8c5285..0477c91 100644 (file)
@@ -2,7 +2,7 @@
 // It is subject to the license terms in the LICENSE file found in the top-level directory
 // of this distribution and at http://opencv.org/license.html.
 //
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
 
 
 #include "precomp.hpp"
@@ -33,15 +33,39 @@ const cv::GOrigin& cv::GMat::priv() const
     return *m_priv;
 }
 
+namespace{
+    template <typename T> cv::GMetaArgs vec_descr_of(const std::vector<T> &vec)
+        {
+        cv::GMetaArgs vec_descr;
+        vec_descr.reserve(vec.size());
+        for(auto& mat : vec){
+            vec_descr.emplace_back(descr_of(mat));
+        }
+        return vec_descr;
+    }
+}
+
+
 #if !defined(GAPI_STANDALONE)
 cv::GMatDesc cv::descr_of(const cv::Mat &mat)
 {
     return GMatDesc{mat.depth(), mat.channels(), {mat.cols, mat.rows}};
 }
+
 cv::GMatDesc cv::descr_of(const cv::UMat &mat)
 {
     return GMatDesc{ mat.depth(), mat.channels(),{ mat.cols, mat.rows } };
 }
+
+cv::GMetaArgs cv::descr_of(const std::vector<cv::Mat> &vec)
+{
+    return vec_descr_of(vec);
+}
+
+cv::GMetaArgs cv::descr_of(const std::vector<cv::UMat> &vec)
+{
+    return vec_descr_of(vec);
+}
 #endif
 
 cv::GMatDesc cv::gapi::own::descr_of(const cv::gapi::own::Mat &mat)
@@ -49,6 +73,11 @@ cv::GMatDesc cv::gapi::own::descr_of(const cv::gapi::own::Mat &mat)
     return GMatDesc{mat.depth(), mat.channels(), {mat.cols, mat.rows}};
 }
 
+cv::GMetaArgs cv::gapi::own::descr_of(const std::vector<cv::gapi::own::Mat> &vec)
+{
+    return vec_descr_of(vec);
+}
+
 namespace cv {
 std::ostream& operator<<(std::ostream& os, const cv::GMatDesc &desc)
 {