Struct opencv::gapi::GCompiled

source ·
pub struct GCompiled { /* private fields */ }
Expand description

\addtogroup gapi_main_classes /

Represents a compiled computation (graph). Can only be used with image / data formats & resolutions it was compiled for, with some exceptions.

This class represents a product of graph compilation (calling cv::GComputation::compile()). Objects of this class actually do data processing, and graph execution is incapsulated into objects of this class. Execution model itself depends on kernels and backends which were using during the compilation, see [gapi_compile_args] for details.

In a general case, GCompiled objects can be applied to data only in that formats/resolutions they were compiled for (see [gapi_meta_args]). However, if the underlying backends allow, a compiled object can be reshaped to handle data (images) of different resolution, though formats and types must remain the same.

GCompiled is very similar to std::function<> in its semantics – running it looks like a function call in the user code.

At the moment, GCompiled objects are not reentrant – generally, the objects are stateful since graph execution itself is a stateful process and this state is now maintained in GCompiled’s own memory (not on the process stack).

At the same time, two different GCompiled objects produced from the single cv::GComputation are completely independent and can be used concurrently.

See also

GStreamingCompiled

Implementations§

source§

impl GCompiled

source

pub fn default() -> Result<GCompiled>

Constructs an empty object

Trait Implementations§

source§

impl Boxed for GCompiled

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Drop for GCompiled

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl GCompiledTrait for GCompiled

source§

fn as_raw_mut_GCompiled(&mut self) -> *mut c_void

source§

fn apply(&mut self, in_: Mat, out: &mut Mat) -> Result<()>

Execute an unary computation Read more
source§

fn apply_1(&mut self, in_: Mat, out: &mut Scalar) -> Result<()>

Execute an unary computation Read more
source§

fn apply_2(&mut self, in1: Mat, in2: Mat, out: &mut Mat) -> Result<()>

Execute a binary computation Read more
source§

fn apply_3(&mut self, in1: Mat, in2: Mat, out: &mut Scalar) -> Result<()>

Execute an binary computation Read more
source§

fn apply_4(&mut self, ins: &Vector<Mat>, outs: &Vector<Mat>) -> Result<()>

Execute a computation with arbitrary number of inputs/outputs. Read more
source§

fn prepare_for_new_stream(&mut self) -> Result<()>

Prepare inner kernels states for a new video-stream. Read more
source§

impl GCompiledTraitConst for GCompiled

source§

fn as_raw_GCompiled(&self) -> *const c_void

source§

fn to_bool(&self) -> Result<bool>

Check if compiled object is valid (non-empty) Read more
source§

fn can_reshape(&self) -> Result<bool>

Check if the underlying backends support reshape or not. Read more
source§

impl Send for GCompiled

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.