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 <ade/util/assert.hpp>
11 #include "api/gapi_priv.hpp"
12 #include "api/gnode_priv.hpp"
14 cv::GOrigin::GOrigin(GShape s,
17 const cv::gimpl::HostCtor c)
18 : shape(s), node(n), port(p), ctor(c)
22 cv::GOrigin::GOrigin(GShape s, cv::gimpl::ConstVal v)
23 : shape(s), node(cv::GNode::Const()), value(v), port(INVALID_PORT)
27 bool cv::detail::GOriginCmp::operator() (const cv::GOrigin &lhs,
28 const cv::GOrigin &rhs) const
30 const GNode::Priv* lhs_p = &lhs.node.priv();
31 const GNode::Priv* rhs_p = &rhs.node.priv();
34 if (lhs.port == rhs.port)
36 // A data Origin is uniquely identified by {node/port} pair.
37 // The situation when there're two Origins with same {node/port}s
38 // but with different shapes (data formats) is illegal!
39 GAPI_Assert(lhs.shape == rhs.shape);
41 return lhs.port < rhs.port;
43 else return lhs_p < rhs_p;