pub struct GMat { /* private fields */ }
Expand description
GMat class represents image or tensor data in the graph.
GMat doesn’t store any data itself, instead it describes a functional relationship between operations consuming and producing GMat objects.
GMat is a virtual counterpart of Mat and UMat, but it doesn’t mean G-API use Mat or UMat objects internally to represent GMat objects – the internal data representation may be backend-specific or optimized out at all.
§See also
Mat, GMatDesc
Implementations§
Source§impl GMat
impl GMat
Sourcepub fn default() -> Result<GMat>
pub fn default() -> Result<GMat>
Constructs an empty GMat
Normally, empty G-API data objects denote a starting point of the graph. When an empty GMat is assigned to a result of some operation, it obtains a functional link to this operation (and is not empty anymore).
Sourcepub fn new(m: impl MatTrait) -> Result<GMat>
pub fn new(m: impl MatTrait) -> Result<GMat>
Constructs a value-initialized GMat
GMat may be associated with a buffer at graph construction time. It is useful when some operation has a Mat input which doesn’t change during the program execution, and is set only once. In this case, there’s no need to declare such GMat as graph input.
§Parameters
- m: a cv::Mat buffer to associate with this GMat object.
Trait Implementations§
Source§impl Boxed for GMat
impl Boxed for GMat
Source§unsafe fn from_raw(ptr: <GMat as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <GMat as OpenCVFromExtern>::ExternReceive) -> Self
Source§fn into_raw(self) -> <GMat as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <GMat as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(&self) -> <GMat as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <GMat as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(&mut self) -> <GMat as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <GMat as OpenCVTypeExternContainer>::ExternSendMut
Source§impl GMatTraitConst for GMat
impl GMatTraitConst for GMat
fn as_raw_GMat(&self) -> *const c_void
impl Send for GMat
Auto Trait Implementations§
impl Freeze for GMat
impl RefUnwindSafe for GMat
impl !Sync for GMat
impl Unpin for GMat
impl UnwindSafe for GMat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more