pub struct GpuMat { /* private fields */ }
Expand description
Base storage class for GPU memory with reference counting.
Its interface matches the Mat interface with the following limitations:
- no arbitrary dimensions support (only 2D)
- no functions that return references to their data (because references on GPU are not valid for CPU)
- no expression templates technique support
Beware that the latter limitation may lead to overloaded matrix operators that cause memory allocations. The GpuMat class is convertible to cuda::PtrStepSz and cuda::PtrStep so it can be passed directly to the kernel.
Note: In contrast with Mat, in most cases GpuMat::isContinuous() == false . This means that rows are aligned to a size depending on the hardware. Single-row GpuMat is always a continuous matrix.
Note: You are not recommended to leave static or global GpuMat variables allocated, that is, to rely on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory release function returns error if the CUDA context has been destroyed before.
Some member functions are described as a “Blocking Call” while some are described as a “Non-Blocking Call”. Blocking functions are synchronous to host. It is guaranteed that the GPU operation is finished when the function returns. However, non-blocking functions are asynchronous to host. Those functions may return even if the GPU operation is not finished.
Compared to their blocking counterpart, non-blocking functions accept Stream as an additional argument. If a non-default stream is passed, the GPU operation may overlap with operations in other streams.
§See also
Mat
Implementations§
source§impl GpuMat
impl GpuMat
sourcepub fn default_allocator() -> Result<AbstractRefMut<'static, GpuMat_Allocator>>
pub fn default_allocator() -> Result<AbstractRefMut<'static, GpuMat_Allocator>>
default allocator
pub unsafe fn set_default_allocator( allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<()>
sourcepub unsafe fn new(allocator: &mut impl GpuMat_AllocatorTrait) -> Result<GpuMat>
pub unsafe fn new(allocator: &mut impl GpuMat_AllocatorTrait) -> Result<GpuMat>
sourcepub fn new_def() -> Result<GpuMat>
pub fn new_def() -> Result<GpuMat>
default constructor
§Note
This alternative version of [new] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
sourcepub unsafe fn new_rows_cols(
rows: i32,
cols: i32,
typ: i32,
allocator: &mut impl GpuMat_AllocatorTrait,
) -> Result<GpuMat>
pub unsafe fn new_rows_cols( rows: i32, cols: i32, typ: i32, allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<GpuMat>
constructs GpuMat of the specified size and type
§C++ default parameters
- allocator: GpuMat::defaultAllocator()
sourcepub fn new_rows_cols_def(rows: i32, cols: i32, typ: i32) -> Result<GpuMat>
pub fn new_rows_cols_def(rows: i32, cols: i32, typ: i32) -> Result<GpuMat>
constructs GpuMat of the specified size and type
§Note
This alternative version of [new_rows_cols] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
sourcepub unsafe fn new_size(
size: Size,
typ: i32,
allocator: &mut impl GpuMat_AllocatorTrait,
) -> Result<GpuMat>
pub unsafe fn new_size( size: Size, typ: i32, allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<GpuMat>
§C++ default parameters
- allocator: GpuMat::defaultAllocator()
sourcepub fn new_size_def(size: Size, typ: i32) -> Result<GpuMat>
pub fn new_size_def(size: Size, typ: i32) -> Result<GpuMat>
§Note
This alternative version of [new_size] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
sourcepub unsafe fn new_rows_cols_with_default(
rows: i32,
cols: i32,
typ: i32,
s: Scalar,
allocator: &mut impl GpuMat_AllocatorTrait,
) -> Result<GpuMat>
pub unsafe fn new_rows_cols_with_default( rows: i32, cols: i32, typ: i32, s: Scalar, allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<GpuMat>
constructs GpuMat and fills it with the specified value _s
§C++ default parameters
- allocator: GpuMat::defaultAllocator()
sourcepub fn new_rows_cols_with_default_def(
rows: i32,
cols: i32,
typ: i32,
s: Scalar,
) -> Result<GpuMat>
pub fn new_rows_cols_with_default_def( rows: i32, cols: i32, typ: i32, s: Scalar, ) -> Result<GpuMat>
constructs GpuMat and fills it with the specified value _s
§Note
This alternative version of [new_rows_cols_with_default] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
sourcepub unsafe fn new_size_with_default(
size: Size,
typ: i32,
s: Scalar,
allocator: &mut impl GpuMat_AllocatorTrait,
) -> Result<GpuMat>
pub unsafe fn new_size_with_default( size: Size, typ: i32, s: Scalar, allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<GpuMat>
§C++ default parameters
- allocator: GpuMat::defaultAllocator()
sourcepub fn new_size_with_default_def(
size: Size,
typ: i32,
s: Scalar,
) -> Result<GpuMat>
pub fn new_size_with_default_def( size: Size, typ: i32, s: Scalar, ) -> Result<GpuMat>
§Note
This alternative version of [new_size_with_default] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
sourcepub fn copy(m: &impl GpuMatTraitConst) -> Result<GpuMat>
pub fn copy(m: &impl GpuMatTraitConst) -> Result<GpuMat>
copy constructor
sourcepub unsafe fn new_rows_cols_with_data(
rows: i32,
cols: i32,
typ: i32,
data: *mut c_void,
step: size_t,
) -> Result<GpuMat>
pub unsafe fn new_rows_cols_with_data( rows: i32, cols: i32, typ: i32, data: *mut c_void, step: size_t, ) -> Result<GpuMat>
constructor for GpuMat headers pointing to user-allocated data
§C++ default parameters
- step: Mat::AUTO_STEP
sourcepub unsafe fn new_rows_cols_with_data_def(
rows: i32,
cols: i32,
typ: i32,
data: *mut c_void,
) -> Result<GpuMat>
pub unsafe fn new_rows_cols_with_data_def( rows: i32, cols: i32, typ: i32, data: *mut c_void, ) -> Result<GpuMat>
constructor for GpuMat headers pointing to user-allocated data
§Note
This alternative version of [new_rows_cols_with_data] function uses the following default values for its arguments:
- step: Mat::AUTO_STEP
sourcepub unsafe fn new_size_with_data(
size: Size,
typ: i32,
data: *mut c_void,
step: size_t,
) -> Result<GpuMat>
pub unsafe fn new_size_with_data( size: Size, typ: i32, data: *mut c_void, step: size_t, ) -> Result<GpuMat>
§C++ default parameters
- step: Mat::AUTO_STEP
sourcepub unsafe fn new_size_with_data_def(
size: Size,
typ: i32,
data: *mut c_void,
) -> Result<GpuMat>
pub unsafe fn new_size_with_data_def( size: Size, typ: i32, data: *mut c_void, ) -> Result<GpuMat>
§Note
This alternative version of [new_size_with_data] function uses the following default values for its arguments:
- step: Mat::AUTO_STEP
sourcepub fn rowscols(
m: &impl GpuMatTraitConst,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRef<'_, GpuMat>>
pub fn rowscols( m: &impl GpuMatTraitConst, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRef<'_, GpuMat>>
creates a GpuMat header for a part of the bigger matrix
sourcepub fn rowscols_mut(
m: &mut impl GpuMatTrait,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRefMut<'_, GpuMat>>
pub fn rowscols_mut( m: &mut impl GpuMatTrait, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRefMut<'_, GpuMat>>
creates a GpuMat header for a part of the bigger matrix
pub fn roi(m: &impl GpuMatTraitConst, roi: Rect) -> Result<BoxedRef<'_, GpuMat>>
pub fn roi_mut( m: &mut impl GpuMatTrait, roi: Rect, ) -> Result<BoxedRefMut<'_, GpuMat>>
sourcepub unsafe fn from_hostmem(
arr: &impl ToInputArray,
allocator: &mut impl GpuMat_AllocatorTrait,
) -> Result<GpuMat>
pub unsafe fn from_hostmem( arr: &impl ToInputArray, allocator: &mut impl GpuMat_AllocatorTrait, ) -> Result<GpuMat>
builds GpuMat from host memory (Blocking call)
§C++ default parameters
- allocator: GpuMat::defaultAllocator()
sourcepub fn from_hostmem_def(arr: &impl ToInputArray) -> Result<GpuMat>
pub fn from_hostmem_def(arr: &impl ToInputArray) -> Result<GpuMat>
builds GpuMat from host memory (Blocking call)
§Note
This alternative version of [from_hostmem] function uses the following default values for its arguments:
- allocator: GpuMat::defaultAllocator()
Trait Implementations§
source§impl Boxed for GpuMat
impl Boxed for GpuMat
source§unsafe fn from_raw(ptr: <GpuMat as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <GpuMat as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(&mut self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <GpuMat as OpenCVTypeExternContainer>::ExternSendMut
source§impl GpuMatTrait for GpuMat
impl GpuMatTrait for GpuMat
fn as_raw_mut_GpuMat(&mut self) -> *mut c_void
source§fn set_step(&mut self, val: size_t)
fn set_step(&mut self, val: size_t)
source§fn refcount_mut(&mut self) -> *mut i32
fn refcount_mut(&mut self) -> *mut i32
source§unsafe fn set_refcount(&mut self, val: *const i32)
unsafe fn set_refcount(&mut self, val: *const i32)
source§fn datastart_mut(&mut self) -> *mut u8
fn datastart_mut(&mut self) -> *mut u8
source§unsafe fn set_datastart(&mut self, val: *const u8)
unsafe fn set_datastart(&mut self, val: *const u8)
source§fn allocator(&mut self) -> AbstractRefMut<'_, GpuMat_Allocator>
fn allocator(&mut self) -> AbstractRefMut<'_, GpuMat_Allocator>
source§unsafe fn set_allocator(&mut self, val: &impl GpuMat_AllocatorTraitConst)
unsafe fn set_allocator(&mut self, val: &impl GpuMat_AllocatorTraitConst)
source§fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
fn create_1(&mut self, size: Size, typ: i32) -> Result<()>
source§fn release(&mut self) -> Result<()>
fn release(&mut self) -> Result<()>
source§fn upload(&mut self, arr: &impl ToInputArray) -> Result<()>
fn upload(&mut self, arr: &impl ToInputArray) -> Result<()>
source§fn upload_async(
&mut self,
arr: &impl ToInputArray,
stream: &mut impl StreamTrait,
) -> Result<()>
fn upload_async( &mut self, arr: &impl ToInputArray, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn set_to(&mut self, s: Scalar) -> Result<GpuMat>
fn set_to(&mut self, s: Scalar) -> Result<GpuMat>
source§fn set_to_1(
&mut self,
s: Scalar,
stream: &mut impl StreamTrait,
) -> Result<GpuMat>
fn set_to_1( &mut self, s: Scalar, stream: &mut impl StreamTrait, ) -> Result<GpuMat>
source§fn set_to_2(&mut self, s: Scalar, mask: &impl ToInputArray) -> Result<GpuMat>
fn set_to_2(&mut self, s: Scalar, mask: &impl ToInputArray) -> Result<GpuMat>
source§fn set_to_3(
&mut self,
s: Scalar,
mask: &impl ToInputArray,
stream: &mut impl StreamTrait,
) -> Result<GpuMat>
fn set_to_3( &mut self, s: Scalar, mask: &impl ToInputArray, stream: &mut impl StreamTrait, ) -> Result<GpuMat>
source§fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn row_bounds_mut(
&mut self,
startrow: i32,
endrow: i32,
) -> Result<BoxedRefMut<'_, GpuMat>>
fn row_bounds_mut( &mut self, startrow: i32, endrow: i32, ) -> Result<BoxedRefMut<'_, GpuMat>>
fn row_range_mut( &mut self, r: impl RangeTrait, ) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn col_bounds_mut(
&mut self,
startcol: i32,
endcol: i32,
) -> Result<BoxedRefMut<'_, GpuMat>>
fn col_bounds_mut( &mut self, startcol: i32, endcol: i32, ) -> Result<BoxedRefMut<'_, GpuMat>>
fn col_range_mut( &mut self, r: impl RangeTrait, ) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn rowscols_mut(
&mut self,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRefMut<'_, GpuMat>>
fn rowscols_mut( &mut self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRefMut<'_, GpuMat>>
fn roi_mut(&mut self, roi: Rect) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, GpuMat>>
source§fn adjust_roi(
&mut self,
dtop: i32,
dbottom: i32,
dleft: i32,
dright: i32,
) -> Result<GpuMat>
fn adjust_roi( &mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32, ) -> Result<GpuMat>
source§fn update_continuity_flag(&mut self) -> Result<()>
fn update_continuity_flag(&mut self) -> Result<()>
source§impl GpuMatTraitConst for GpuMat
impl GpuMatTraitConst for GpuMat
fn as_raw_GpuMat(&self) -> *const c_void
source§fn refcount(&self) -> *const i32
fn refcount(&self) -> *const i32
fn dataend(&self) -> *const u8
source§fn download(&self, dst: &mut impl ToOutputArray) -> Result<()>
fn download(&self, dst: &mut impl ToOutputArray) -> Result<()>
source§fn download_async(
&self,
dst: &mut impl ToOutputArray,
stream: &mut impl StreamTrait,
) -> Result<()>
fn download_async( &self, dst: &mut impl ToOutputArray, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn try_clone(&self) -> Result<GpuMat>
fn try_clone(&self) -> Result<GpuMat>
source§fn copy_to(&self, dst: &mut impl ToOutputArray) -> Result<()>
fn copy_to(&self, dst: &mut impl ToOutputArray) -> Result<()>
source§fn copy_to_gpu_mat(&self, dst: &mut impl GpuMatTrait) -> Result<()>
fn copy_to_gpu_mat(&self, dst: &mut impl GpuMatTrait) -> Result<()>
source§fn copy_to_stream(
&self,
dst: &mut impl ToOutputArray,
stream: &mut impl StreamTrait,
) -> Result<()>
fn copy_to_stream( &self, dst: &mut impl ToOutputArray, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn copy_to_gpu_mat_stream(
&self,
dst: &mut impl GpuMatTrait,
stream: &mut impl StreamTrait,
) -> Result<()>
fn copy_to_gpu_mat_stream( &self, dst: &mut impl GpuMatTrait, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn copy_to_mask(
&self,
dst: &mut impl ToOutputArray,
mask: &impl ToInputArray,
) -> Result<()>
fn copy_to_mask( &self, dst: &mut impl ToOutputArray, mask: &impl ToInputArray, ) -> Result<()>
source§fn copy_to_gpu_mat_mask(
&self,
dst: &mut impl GpuMatTrait,
mask: &mut impl GpuMatTrait,
) -> Result<()>
fn copy_to_gpu_mat_mask( &self, dst: &mut impl GpuMatTrait, mask: &mut impl GpuMatTrait, ) -> Result<()>
source§fn copy_to_mask_stream(
&self,
dst: &mut impl ToOutputArray,
mask: &impl ToInputArray,
stream: &mut impl StreamTrait,
) -> Result<()>
fn copy_to_mask_stream( &self, dst: &mut impl ToOutputArray, mask: &impl ToInputArray, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn copy_to_gpu_mat_mask_stream(
&self,
dst: &mut impl GpuMatTrait,
mask: &mut impl GpuMatTrait,
stream: &mut impl StreamTrait,
) -> Result<()>
fn copy_to_gpu_mat_mask_stream( &self, dst: &mut impl GpuMatTrait, mask: &mut impl GpuMatTrait, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn convert_to(&self, dst: &mut impl ToOutputArray, rtype: i32) -> Result<()>
fn convert_to(&self, dst: &mut impl ToOutputArray, rtype: i32) -> Result<()>
source§fn convert_to_1(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
stream: &mut impl StreamTrait,
) -> Result<()>
fn convert_to_1( &self, dst: &mut impl ToOutputArray, rtype: i32, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn convert_to_2(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
stream: &mut impl StreamTrait,
) -> Result<()>
fn convert_to_2( &self, dst: &mut impl GpuMatTrait, rtype: i32, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn convert_to_3(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()>
fn convert_to_3( &self, dst: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64, ) -> Result<()>
source§fn convert_to_def(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
) -> Result<()>
fn convert_to_def( &self, dst: &mut impl ToOutputArray, rtype: i32, alpha: f64, ) -> Result<()>
source§fn convert_to_4(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()>
fn convert_to_4( &self, dst: &mut impl GpuMatTrait, rtype: i32, alpha: f64, beta: f64, ) -> Result<()>
source§fn convert_to_def_1(&self, dst: &mut impl GpuMatTrait, rtype: i32) -> Result<()>
fn convert_to_def_1(&self, dst: &mut impl GpuMatTrait, rtype: i32) -> Result<()>
source§fn convert_to_5(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
stream: &mut impl StreamTrait,
) -> Result<()>
fn convert_to_5( &self, dst: &mut impl ToOutputArray, rtype: i32, alpha: f64, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn convert_to_6(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64,
stream: &mut impl StreamTrait,
) -> Result<()>
fn convert_to_6( &self, dst: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn convert_to_7(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
alpha: f64,
beta: f64,
stream: &mut impl StreamTrait,
) -> Result<()>
fn convert_to_7( &self, dst: &mut impl GpuMatTrait, rtype: i32, alpha: f64, beta: f64, stream: &mut impl StreamTrait, ) -> Result<()>
source§fn assign_to(&self, m: &mut impl GpuMatTrait, typ: i32) -> Result<()>
fn assign_to(&self, m: &mut impl GpuMatTrait, typ: i32) -> Result<()>
source§fn assign_to_def(&self, m: &mut impl GpuMatTrait) -> Result<()>
fn assign_to_def(&self, m: &mut impl GpuMatTrait) -> Result<()>
source§fn row(&self, y: i32) -> Result<BoxedRef<'_, GpuMat>>
fn row(&self, y: i32) -> Result<BoxedRef<'_, GpuMat>>
source§fn col(&self, x: i32) -> Result<BoxedRef<'_, GpuMat>>
fn col(&self, x: i32) -> Result<BoxedRef<'_, GpuMat>>
source§fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, GpuMat>>
fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, GpuMat>>
fn row_range(&self, r: impl RangeTrait) -> Result<BoxedRef<'_, GpuMat>>
source§fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, GpuMat>>
fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, GpuMat>>
fn col_range(&self, r: impl RangeTrait) -> Result<BoxedRef<'_, GpuMat>>
source§fn rowscols(
&self,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRef<'_, GpuMat>>
fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRef<'_, GpuMat>>
fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, GpuMat>>
source§fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, GpuMat>>
fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, GpuMat>>
source§fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, GpuMat>>
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, GpuMat>>
source§fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>
fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>
source§fn is_continuous(&self) -> Result<bool>
fn is_continuous(&self) -> Result<bool>
source§fn elem_size1(&self) -> Result<size_t>
fn elem_size1(&self) -> Result<size_t>
source§fn size(&self) -> Result<Size>
fn size(&self) -> Result<Size>
fn cuda_ptr(&self) -> Result<*mut c_void>
source§impl ToInputArray for &GpuMat
impl ToInputArray for &GpuMat
fn input_array(&self) -> Result<BoxedRef<'_, _InputArray>>
source§impl ToInputArray for GpuMat
impl ToInputArray for GpuMat
fn input_array(&self) -> Result<BoxedRef<'_, _InputArray>>
source§impl ToInputOutputArray for &mut GpuMat
impl ToInputOutputArray for &mut GpuMat
fn input_output_array(&mut self) -> Result<BoxedRefMut<'_, _InputOutputArray>>
source§impl ToInputOutputArray for GpuMat
impl ToInputOutputArray for GpuMat
fn input_output_array(&mut self) -> Result<BoxedRefMut<'_, _InputOutputArray>>
source§impl ToOutputArray for &mut GpuMat
impl ToOutputArray for &mut GpuMat
fn output_array(&mut self) -> Result<BoxedRefMut<'_, _OutputArray>>
source§impl ToOutputArray for GpuMat
impl ToOutputArray for GpuMat
fn output_array(&mut self) -> Result<BoxedRefMut<'_, _OutputArray>>
impl Send for GpuMat
Auto Trait Implementations§
impl Freeze for GpuMat
impl RefUnwindSafe for GpuMat
impl !Sync for GpuMat
impl Unpin for GpuMat
impl UnwindSafe for GpuMat
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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