1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #18391 from dmatveev:dm/gframe_00_new_type

* G-API: Make GFrame a new (distinct) G-type, not an alias to GMat

- The underlying host type is still cv::Mat, a new cv::MediaFrame
  type is to be added as a separate PR

* Fix warnings and review comments

- Somewhow there was a switch() without a default: clause in Fluid
This commit is contained in:
Dmitry Matveev
2020-09-23 21:25:14 +03:00
committed by GitHub
parent 3fc1487cc9
commit e937d9b559
8 changed files with 110 additions and 17 deletions
+41
View File
@@ -0,0 +1,41 @@
// This file is part of OpenCV project.
// 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) 2020 Intel Corporation
#include "precomp.hpp"
#include <opencv2/gapi/gframe.hpp>
#include "api/gorigin.hpp"
// cv::GFrame public implementation //////////////////////////////////////////////
cv::GFrame::GFrame()
: m_priv(new GOrigin(GShape::GMAT, GNode::Param())) {
// N.B.: The shape here is still GMAT as currently cv::Mat is used
// as an underlying host type. Will be changed to GFRAME once
// GExecutor & GStreamingExecutor & selected backends will be extended
// to support cv::MediaFrame.
}
cv::GFrame::GFrame(const GNode &n, std::size_t out)
: m_priv(new GOrigin(GShape::GMAT, n, out)) {
// N.B.: GMAT is here for the same reason as above ^
}
cv::GOrigin& cv::GFrame::priv() {
return *m_priv;
}
const cv::GOrigin& cv::GFrame::priv() const {
return *m_priv;
}
namespace cv {
std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &) {
return os;
}
} // namespace cv
@@ -1249,6 +1249,7 @@ void cv::gimpl::GFluidExecutable::bindInArg(const cv::gimpl::RcDesc &rc, const G
case GShape::GSCALAR: m_res.slot<cv::Scalar>()[rc.id] = util::get<cv::Scalar>(arg); break;
case GShape::GARRAY: m_res.slot<cv::detail::VectorRef>()[rc.id] = util::get<cv::detail::VectorRef>(arg); break;
case GShape::GOPAQUE: m_res.slot<cv::detail::OpaqueRef>()[rc.id] = util::get<cv::detail::OpaqueRef>(arg); break;
default: util::throw_error(std::logic_error("Unsupported input GShape type"));
}
}