Trait opencv::prelude::GpuMatTrait
source · pub trait GpuMatTrait: GpuMatTraitConst {
Show 38 methods
// Required method
fn as_raw_mut_GpuMat(&mut self) -> *mut c_void;
// Provided methods
fn set_flags(&mut self, val: i32) { ... }
fn set_rows(&mut self, val: i32) { ... }
fn set_cols(&mut self, val: i32) { ... }
fn set_step(&mut self, val: size_t) { ... }
fn data_mut(&mut self) -> *mut u8 { ... }
unsafe fn set_data(&mut self, val: *const u8) { ... }
fn refcount_mut(&mut self) -> *mut i32 { ... }
unsafe fn set_refcount(&mut self, val: *const i32) { ... }
fn datastart_mut(&mut self) -> *mut u8 { ... }
unsafe fn set_datastart(&mut self, val: *const u8) { ... }
fn allocator(&mut self) -> AbstractRefMut<'_, GpuMat_Allocator> { ... }
unsafe fn set_allocator(&mut self, val: &impl GpuMat_AllocatorTraitConst) { ... }
fn set(&mut self, m: &impl GpuMatTraitConst) -> Result<()> { ... }
fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()> { ... }
fn create_1(&mut self, size: Size, typ: i32) -> Result<()> { ... }
fn release(&mut self) -> Result<()> { ... }
fn swap(&mut self, mat: &mut impl GpuMatTrait) -> Result<()> { ... }
fn upload(&mut self, arr: &impl ToInputArray) -> Result<()> { ... }
fn upload_async(
&mut self,
arr: &impl ToInputArray,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn set_to(&mut self, s: Scalar) -> Result<GpuMat> { ... }
fn set_to_1(
&mut self,
s: Scalar,
stream: &mut impl StreamTrait
) -> Result<GpuMat> { ... }
fn set_to_2(
&mut self,
s: Scalar,
mask: &impl ToInputArray
) -> Result<GpuMat> { ... }
fn set_to_3(
&mut self,
s: Scalar,
mask: &impl ToInputArray,
stream: &mut impl StreamTrait
) -> Result<GpuMat> { ... }
fn ptr_mut(&mut self, y: i32) -> Result<*mut u8> { ... }
fn ptr_mut_def(&mut self) -> Result<*mut u8> { ... }
fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, GpuMat>> { ... }
fn col_mut(&mut self, x: 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>> { ... }
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>> { ... }
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>> { ... }
fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, GpuMat>> { ... }
fn reshape_mut(
&mut self,
cn: i32,
rows: i32
) -> Result<BoxedRefMut<'_, GpuMat>> { ... }
fn adjust_roi(
&mut self,
dtop: i32,
dbottom: i32,
dleft: i32,
dright: i32
) -> Result<GpuMat> { ... }
fn update_continuity_flag(&mut self) -> Result<()> { ... }
}
Expand description
Mutable methods for core::GpuMat
Required Methods§
fn as_raw_mut_GpuMat(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_flags(&mut self, val: i32)
fn set_flags(&mut self, val: i32)
! includes several bit-fields:
- the magic signature
- continuity flag
- depth
- number of channels
sourcefn set_step(&mut self, val: size_t)
fn set_step(&mut self, val: size_t)
a distance between successive rows in bytes; includes the gap if any
sourcefn refcount_mut(&mut self) -> *mut i32
fn refcount_mut(&mut self) -> *mut i32
pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL
sourceunsafe fn set_refcount(&mut self, val: *const i32)
unsafe fn set_refcount(&mut self, val: *const i32)
pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL
sourcefn datastart_mut(&mut self) -> *mut u8
fn datastart_mut(&mut self) -> *mut u8
helper fields used in locateROI and adjustROI
sourceunsafe fn set_datastart(&mut self, val: *const u8)
unsafe fn set_datastart(&mut self, val: *const u8)
helper fields used in locateROI and adjustROI
sourcefn allocator(&mut self) -> AbstractRefMut<'_, GpuMat_Allocator>
fn allocator(&mut self) -> AbstractRefMut<'_, GpuMat_Allocator>
allocator
sourceunsafe fn set_allocator(&mut self, val: &impl GpuMat_AllocatorTraitConst)
unsafe fn set_allocator(&mut self, val: &impl GpuMat_AllocatorTraitConst)
allocator
sourcefn set(&mut self, m: &impl GpuMatTraitConst) -> Result<()>
fn set(&mut self, m: &impl GpuMatTraitConst) -> Result<()>
assignment operators
sourcefn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
allocates new GpuMat data unless the GpuMat already has specified size and type
fn create_1(&mut self, size: Size, typ: i32) -> Result<()>
sourcefn release(&mut self) -> Result<()>
fn release(&mut self) -> Result<()>
decreases reference counter, deallocate the data when reference counter reaches 0
sourcefn swap(&mut self, mat: &mut impl GpuMatTrait) -> Result<()>
fn swap(&mut self, mat: &mut impl GpuMatTrait) -> Result<()>
swaps with other smart pointer
sourcefn upload(&mut self, arr: &impl ToInputArray) -> Result<()>
fn upload(&mut self, arr: &impl ToInputArray) -> Result<()>
Performs data upload to GpuMat (Blocking call)
This function copies data from host memory to device memory. As being a blocking call, it is guaranteed that the copy operation is finished when this function returns.
sourcefn 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<()>
Performs data upload to GpuMat (Non-Blocking call)
This function copies data from host memory to device memory. As being a non-blocking call, this function may return even if the copy operation is not finished.
The copy operation may be overlapped with operations in other non-default streams if \p stream is not the default stream and \p dst is HostMem allocated with HostMem::PAGE_LOCKED option.
sourcefn set_to(&mut self, s: Scalar) -> Result<GpuMat>
fn set_to(&mut self, s: Scalar) -> Result<GpuMat>
sets some of the GpuMat elements to s (Blocking call)
sourcefn 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>
sets some of the GpuMat elements to s (Non-Blocking call)
sourcefn 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>
sets some of the GpuMat elements to s, according to the mask (Blocking call)
sourcefn 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>
sets some of the GpuMat elements to s, according to the mask (Non-Blocking call)
sourcefn ptr_mut_def(&mut self) -> Result<*mut u8>
fn ptr_mut_def(&mut self) -> Result<*mut u8>
returns pointer to y-th row
§Note
This alternative version of GpuMatTrait::ptr_mut function uses the following default values for its arguments:
- y: 0
sourcefn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, GpuMat>>
returns a new GpuMat header for the specified row
sourcefn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, GpuMat>>
returns a new GpuMat header for the specified column
sourcefn 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>>
… for the specified row span
fn row_range_mut( &mut self, r: impl RangeTrait ) -> Result<BoxedRefMut<'_, GpuMat>>
sourcefn 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>>
… for the specified column span
fn col_range_mut( &mut self, r: impl RangeTrait ) -> Result<BoxedRefMut<'_, GpuMat>>
sourcefn 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>>
extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.)
fn roi_mut(&mut self, roi: Rect) -> Result<BoxedRefMut<'_, GpuMat>>
sourcefn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, GpuMat>>
creates alternative GpuMat header for the same data, with different number of channels and/or different number of rows
§Note
This alternative version of GpuMatTraitConst::reshape function uses the following default values for its arguments:
- rows: 0
sourcefn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, GpuMat>>
fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, GpuMat>>
creates alternative GpuMat header for the same data, with different number of channels and/or different number of rows
§C++ default parameters
- rows: 0
sourcefn 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>
moves/resizes the current GpuMat ROI inside the parent GpuMat
sourcefn update_continuity_flag(&mut self) -> Result<()>
fn update_continuity_flag(&mut self) -> Result<()>
internal use method: updates the continuity flag