| OpenCV 4.3.0 Open Source Computer Vision

Namespaces | Classes | Functions
cv::gapi::wip Namespace Reference

## Namespaces
| draw

## Classes
struct | Data
| This aggregate type represents all types which G-API can handle (via variant). More...
class | GAsyncCanceled
class | GAsyncContext
| A class to group async requests to cancel them in a single shot. More...
class | GCaptureSource
| OpenCV's VideoCapture-based streaming source. More...
class | IStreamSource
| Abstract streaming pipeline source. More...

## Functions
void | async (GCompiled &gcmpld, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs)
void | async (GCompiled &gcmpld, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext &ctx)
std::future< void > | async (GCompiled &gcmpld, GRunArgs &&ins, GRunArgsP &&outs)
std::future< void > | async (GCompiled &gcmpld, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext &ctx)
void | async_apply (GComputation &gcomp, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args={})
void | async_apply (GComputation &gcomp, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext &ctx)
std::future< void > | async_apply (GComputation &gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args={})
std::future< void > | async_apply (GComputation &gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext &ctx)
template<class T , class... Args>
IStreamSource::Ptr | make_src (Args &&... args)

## Function Documentation

## ◆ async() [1/4]

void cv::gapi::wip::async | ( | GCompiled & | gcmpld,
|  | std::function< void(std::exception_ptr)> && | callback,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs
| ) |  |

These functions asynchronously (i.e. probably on a separate thread of execution) call GCompiled::operator() member function of their first argument with copies of rest of arguments (except callback) passed in. The difference between the function is the way to get the completion notification (via callback or a waiting on std::future object) If exception is occurred during execution of apply it is transferred to the callback (via function parameter) or passed to future (and will be thrown on call to std::future::get)

N.B. : Input arguments are copied on call to async function (actually on call to cv::gin) and thus do not have to outlive the actual completion of asynchronous activity. While output arguments are "captured" by reference(pointer) and therefore must outlive the asynchronous activity (i.e. live at least until callback is called or future is unblocked)

Parameters

  gcmpld | Compiled computation (graph) to start asynchronously
  callback | Callback to be called when execution of gcmpld is done
  ins | Input parameters for gcmpld
  outs | Output parameters for gcmpld

## ◆ async() [2/4]

void cv::gapi::wip::async | ( | GCompiled & | gcmpld,
|  | std::function< void(std::exception_ptr)> && | callback,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GAsyncContext & | ctx
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  gcmpld | Compiled computation (graph) to run asynchronously
  callback | Callback to be called when execution of gcmpld is done
  ins | Input parameters for gcmpld
  outs | Output parameters for gcmpld
  ctx | Context this request belongs to

See also
  async GAsyncContext

## ◆ async() [3/4]

std::future<void> cv::gapi::wip::async | ( | GCompiled & | gcmpld,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  gcmpld | Compiled computation (graph) to run asynchronously
  ins | Input parameters for gcmpld
  outs | Output parameters for gcmpld

Returns
  std::future<void> object to wait for completion of async operation

See also
  async

## ◆ async() [4/4]

std::future<void> cv::gapi::wip::async | ( | GCompiled & | gcmpld,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GAsyncContext & | ctx
| ) |  |

Parameters

  gcmpld | Compiled computation (graph) to run asynchronously
  ins | Input parameters for gcmpld
  outs | Output parameters for gcmpld
  ctx | Context this request belongs to

Returns
  std::future<void> object to wait for completion of async operation

See also
  async GAsyncContext

## ◆ async_apply() [1/4]

void cv::gapi::wip::async_apply | ( | GComputation & | gcomp,
|  | std::function< void(std::exception_ptr)> && | callback,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GCompileArgs && | args = `{}`
| ) |  |

In contrast to async() functions, these do call GComputation::apply() member function of the GComputation passed in.

Parameters

  gcomp | Computation (graph) to run asynchronously
  callback | Callback to be called when execution of gcomp is done
  ins | Input parameters for gcomp
  outs | Output parameters for gcomp
  args | Compile arguments to pass to GComputation::apply()

See also
  async

## ◆ async_apply() [2/4]

void cv::gapi::wip::async_apply | ( | GComputation & | gcomp,
|  | std::function< void(std::exception_ptr)> && | callback,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GCompileArgs && | args,
|  | GAsyncContext & | ctx
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  gcomp | Computation (graph) to run asynchronously
  callback | Callback to be called when execution of gcomp is done
  ins | Input parameters for gcomp
  outs | Output parameters for gcomp
  args | Compile arguments to pass to GComputation::apply()
  ctx | Context this request belongs to

See also
  async_apply async GAsyncContext

## ◆ async_apply() [3/4]

std::future<void> cv::gapi::wip::async_apply | ( | GComputation & | gcomp,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GCompileArgs && | args = `{}`
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  gcomp | Computation (graph) to run asynchronously
  ins | Input parameters for gcomp
  outs | Output parameters for gcomp
  args | Compile arguments to pass to GComputation::apply()

Returns
  std::future<void> object to wait for completion of async operation

See also
  async_apply async

## ◆ async_apply() [4/4]

std::future<void> cv::gapi::wip::async_apply | ( | GComputation & | gcomp,
|  | GRunArgs && | ins,
|  | GRunArgsP && | outs,
|  | GCompileArgs && | args,
|  | GAsyncContext & | ctx
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  gcomp | Computation (graph) to run asynchronously
  ins | Input parameters for gcomp
  outs | Output parameters for gcomp
  args | Compile arguments to pass to GComputation::apply()
  ctx | Context this request belongs to

Returns
  std::future<void> object to wait for completion of async operation

See also
  async_apply async GAsyncContext

## ◆ make_src()

template<class T , class... Args>

IStreamSource::Ptr cv::gapi::wip::make_src | ( | Args &&... | args | ) |
| inline