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
8 #ifndef OPENCV_GAPI_GCALL_HPP
9 #define OPENCV_GAPI_GCALL_HPP
11 #include "opencv2/gapi/garg.hpp" // GArg
12 #include "opencv2/gapi/gmat.hpp" // GMat
13 #include "opencv2/gapi/gscalar.hpp" // GScalar
14 #include "opencv2/gapi/garray.hpp" // GArray<T>
20 // The whole idea of this class is to represent an operation
21 // which is applied to arguments. This is part of public API,
22 // since it is what users should use to define kernel interfaces.
24 class GAPI_EXPORTS GCall final
29 explicit GCall(const GKernel &k);
32 template<typename... Ts>
33 GCall& pass(Ts&&... args)
35 setArgs({cv::GArg(std::move(args))...});
39 // A generic yield method - obtain a link to operator's particular GMat output
40 GMat yield (int output = 0);
41 GScalar yieldScalar(int output = 0);
43 template<class T> GArray<T> yieldArray(int output = 0)
45 return GArray<T>(yieldArray(output));
50 const Priv& priv() const;
53 std::shared_ptr<Priv> m_priv;
55 void setArgs(std::vector<GArg> &&args);
57 // Public version returns a typed array, this one is implementation detail
58 detail::GArrayU yieldArray(int output = 0);
63 #endif // OPENCV_GAPI_GCALL_HPP