github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcomputation_async.hpp (about) 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. 4 // 5 // Copyright (C) 2019 Intel Corporation 6 7 #ifndef OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP 8 #define OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP 9 10 11 #include <future> //for std::future 12 #include <exception> //for std::exception_ptr 13 #include <functional> //for std::function 14 #include <opencv2/gapi/garg.hpp> //for GRunArgs, GRunArgsP 15 #include <opencv2/gapi/gcommon.hpp> //for GCompileArgs 16 #include <opencv2/gapi/own/exports.hpp> 17 18 19 namespace cv { 20 //fwd declaration 21 class GComputation; 22 namespace gapi { 23 namespace wip { 24 class GAsyncContext; 25 /** In contrast to async() functions, these do call GComputation::apply() member function of the GComputation passed in. 26 27 @param gcomp Computation (graph) to run asynchronously 28 @param callback Callback to be called when execution of gcomp is done 29 @param ins Input parameters for gcomp 30 @param outs Output parameters for gcomp 31 @param args Compile arguments to pass to GComputation::apply() 32 @see async 33 */ 34 GAPI_EXPORTS void async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {}); 35 /** @overload 36 @param gcomp Computation (graph) to run asynchronously 37 @param callback Callback to be called when execution of gcomp is done 38 @param ins Input parameters for gcomp 39 @param outs Output parameters for gcomp 40 @param args Compile arguments to pass to GComputation::apply() 41 @param ctx Context this request belongs to 42 @see async_apply async GAsyncContext 43 */ 44 GAPI_EXPORTS void async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext& ctx); 45 /** @overload 46 @param gcomp Computation (graph) to run asynchronously 47 @param ins Input parameters for gcomp 48 @param outs Output parameters for gcomp 49 @param args Compile arguments to pass to GComputation::apply() 50 @return std::future<void> object to wait for completion of async operation 51 @see async_apply async 52 */ 53 GAPI_EXPORTS std::future<void> async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {}); 54 /** @overload 55 @param gcomp Computation (graph) to run asynchronously 56 @param ins Input parameters for gcomp 57 @param outs Output parameters for gcomp 58 @param args Compile arguments to pass to GComputation::apply() 59 @param ctx Context this request belongs to 60 @return std::future<void> object to wait for completion of async operation 61 @see async_apply async GAsyncContext 62 */ 63 GAPI_EXPORTS std::future<void> async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext& ctx); 64 } // namespace wip 65 } // namespace gapi 66 } // namespace cv 67 68 69 #endif //OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP