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 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>
15 #include <opencv2/gapi/gopaque.hpp> // GOpaque<T>
21 // The whole idea of this class is to represent an operation
22 // which is applied to arguments. This is part of public API,
23 // since it is what users should use to define kernel interfaces.
25 class GAPI_EXPORTS GCall final
30 explicit GCall(const GKernel &k);
33 template<typename... Ts>
34 GCall& pass(Ts&&... args)
36 setArgs({cv::GArg(std::move(args))...});
40 // A generic yield method - obtain a link to operator's particular GMat output
41 GMat yield (int output = 0);
42 GMatP yieldP (int output = 0);
43 GScalar yieldScalar(int output = 0);
45 template<class T> GArray<T> yieldArray(int output = 0)
47 return GArray<T>(yieldArray(output));
50 template<class T> GOpaque<T> yieldOpaque(int output = 0)
52 return GOpaque<T>(yieldOpaque(output));
57 const Priv& priv() const;
60 std::shared_ptr<Priv> m_priv;
62 void setArgs(std::vector<GArg> &&args);
64 // Public versions return a typed array or opaque, those are implementation details
65 detail::GArrayU yieldArray(int output = 0);
66 detail::GOpaqueU yieldOpaque(int output = 0);
71 #endif // OPENCV_GAPI_GCALL_HPP