Trait opencv::prelude::GpuMatTraitConst
source · pub trait GpuMatTraitConst {
Show 55 methods
// Required method
fn as_raw_GpuMat(&self) -> *const c_void;
// Provided methods
fn flags(&self) -> i32 { ... }
fn rows(&self) -> i32 { ... }
fn cols(&self) -> i32 { ... }
fn step(&self) -> size_t { ... }
fn data(&self) -> *const u8 { ... }
fn refcount(&self) -> *const i32 { ... }
fn datastart(&self) -> *const u8 { ... }
fn dataend(&self) -> *const u8 { ... }
fn download(&self, dst: &mut impl ToOutputArray) -> Result<()> { ... }
fn download_async(
&self,
dst: &mut impl ToOutputArray,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn try_clone(&self) -> Result<GpuMat> { ... }
fn copy_to(&self, dst: &mut impl ToOutputArray) -> Result<()> { ... }
fn copy_to_gpu_mat(&self, dst: &mut impl GpuMatTrait) -> Result<()> { ... }
fn copy_to_stream(
&self,
dst: &mut impl ToOutputArray,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn copy_to_gpu_mat_stream(
&self,
dst: &mut impl GpuMatTrait,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn copy_to_mask(
&self,
dst: &mut impl ToOutputArray,
mask: &impl ToInputArray
) -> Result<()> { ... }
fn copy_to_gpu_mat_mask(
&self,
dst: &mut impl GpuMatTrait,
mask: &mut impl GpuMatTrait
) -> Result<()> { ... }
fn copy_to_mask_stream(
&self,
dst: &mut impl ToOutputArray,
mask: &impl ToInputArray,
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<()> { ... }
fn convert_to(&self, dst: &mut impl ToOutputArray, rtype: i32) -> Result<()> { ... }
fn convert_to_1(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn convert_to_2(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn convert_to_3(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64
) -> Result<()> { ... }
fn convert_to_def(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: f64
) -> Result<()> { ... }
fn convert_to_4(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
alpha: f64,
beta: f64
) -> Result<()> { ... }
fn convert_to_def_1(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32
) -> Result<()> { ... }
fn convert_to_5(
&self,
dst: &mut impl ToOutputArray,
rtype: i32,
alpha: 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<()> { ... }
fn convert_to_7(
&self,
dst: &mut impl GpuMatTrait,
rtype: i32,
alpha: f64,
beta: f64,
stream: &mut impl StreamTrait
) -> Result<()> { ... }
fn assign_to(&self, m: &mut impl GpuMatTrait, typ: i32) -> Result<()> { ... }
fn assign_to_def(&self, m: &mut impl GpuMatTrait) -> Result<()> { ... }
fn ptr(&self, y: i32) -> Result<*const u8> { ... }
fn ptr_def(&self) -> Result<*const u8> { ... }
fn row(&self, y: i32) -> Result<BoxedRef<'_, GpuMat>> { ... }
fn col(&self, x: 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>> { ... }
fn col_bounds(
&self,
startcol: i32,
endcol: i32
) -> Result<BoxedRef<'_, GpuMat>> { ... }
fn col_range(&self, r: 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>> { ... }
fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, GpuMat>> { ... }
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, GpuMat>> { ... }
fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()> { ... }
fn is_continuous(&self) -> Result<bool> { ... }
fn elem_size(&self) -> Result<size_t> { ... }
fn elem_size1(&self) -> Result<size_t> { ... }
fn typ(&self) -> Result<i32> { ... }
fn depth(&self) -> Result<i32> { ... }
fn channels(&self) -> Result<i32> { ... }
fn step1(&self) -> Result<size_t> { ... }
fn size(&self) -> Result<Size> { ... }
fn empty(&self) -> Result<bool> { ... }
fn cuda_ptr(&self) -> Result<*mut c_void> { ... }
}
Expand description
Constant methods for core::GpuMat
Required Methods§
fn as_raw_GpuMat(&self) -> *const c_void
Provided Methods§
sourcefn flags(&self) -> i32
fn flags(&self) -> i32
! includes several bit-fields:
- the magic signature
- continuity flag
- depth
- number of channels
sourcefn refcount(&self) -> *const i32
fn refcount(&self) -> *const i32
pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL
fn dataend(&self) -> *const u8
sourcefn download(&self, dst: &mut impl ToOutputArray) -> Result<()>
fn download(&self, dst: &mut impl ToOutputArray) -> Result<()>
Performs data download from GpuMat (Blocking call)
This function copies data from device memory to host memory. As being a blocking call, it is guaranteed that the copy operation is finished when this function returns.
sourcefn 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<()>
Performs data download from GpuMat (Non-Blocking call)
This function copies data from device memory to host 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 copy_to(&self, dst: &mut impl ToOutputArray) -> Result<()>
fn copy_to(&self, dst: &mut impl ToOutputArray) -> Result<()>
copies the GpuMat content to device memory (Blocking call)
sourcefn copy_to_gpu_mat(&self, dst: &mut impl GpuMatTrait) -> Result<()>
fn copy_to_gpu_mat(&self, dst: &mut impl GpuMatTrait) -> Result<()>
bindings overload which copies the GpuMat content to device memory (Blocking call)
sourcefn 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<()>
copies the GpuMat content to device memory (Non-Blocking call)
sourcefn 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<()>
bindings overload which copies the GpuMat content to device memory (Non-Blocking call)
sourcefn 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<()>
copies those GpuMat elements to “m” that are marked with non-zero mask elements (Blocking call)
sourcefn 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<()>
bindings overload which copies those GpuMat elements to “m” that are marked with non-zero mask elements (Blocking call)
sourcefn 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<()>
copies those GpuMat elements to “m” that are marked with non-zero mask elements (Non-Blocking call)
sourcefn 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<()>
bindings overload which copies those GpuMat elements to “m” that are marked with non-zero mask elements (Non-Blocking call)
sourcefn convert_to(&self, dst: &mut impl ToOutputArray, rtype: i32) -> Result<()>
fn convert_to(&self, dst: &mut impl ToOutputArray, rtype: i32) -> Result<()>
converts GpuMat to another datatype (Blocking call)
sourcefn 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<()>
converts GpuMat to another datatype (Non-Blocking call)
sourcefn 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<()>
bindings overload which converts GpuMat to another datatype (Non-Blocking call)
sourcefn 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<()>
sourcefn 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<()>
converts GpuMat to another datatype with scaling (Blocking call)
§Note
This alternative version of GpuMatTraitConst::convert_to function uses the following default values for its arguments:
- beta: 0.0
sourcefn 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<()>
bindings overload which converts GpuMat to another datatype with scaling(Blocking call)
§C++ default parameters
- alpha: 1.0
- beta: 0.0
sourcefn 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<()>
bindings overload which converts GpuMat to another datatype with scaling(Blocking call)
§Note
This alternative version of GpuMatTraitConst::convert_to function uses the following default values for its arguments:
- alpha: 1.0
- beta: 0.0
sourcefn 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<()>
converts GpuMat to another datatype with scaling (Non-Blocking call)
sourcefn 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<()>
converts GpuMat to another datatype with scaling (Non-Blocking call)
sourcefn 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<()>
bindings overload which converts GpuMat to another datatype with scaling (Non-Blocking call)
sourcefn assign_to(&self, m: &mut impl GpuMatTrait, typ: i32) -> Result<()>
fn assign_to(&self, m: &mut impl GpuMatTrait, typ: i32) -> Result<()>
§C++ default parameters
- typ: -1
sourcefn assign_to_def(&self, m: &mut impl GpuMatTrait) -> Result<()>
fn assign_to_def(&self, m: &mut impl GpuMatTrait) -> Result<()>
§Note
This alternative version of GpuMatTraitConst::assign_to function uses the following default values for its arguments:
- typ: -1
sourcefn ptr_def(&self) -> Result<*const u8>
fn ptr_def(&self) -> Result<*const u8>
§Note
This alternative version of GpuMatTraitConst::ptr function uses the following default values for its arguments:
- y: 0
sourcefn row(&self, y: i32) -> Result<BoxedRef<'_, GpuMat>>
fn row(&self, y: i32) -> Result<BoxedRef<'_, GpuMat>>
returns a new GpuMat header for the specified row
sourcefn col(&self, x: i32) -> Result<BoxedRef<'_, GpuMat>>
fn col(&self, x: i32) -> Result<BoxedRef<'_, GpuMat>>
returns a new GpuMat header for the specified column
sourcefn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, GpuMat>>
fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, GpuMat>>
… for the specified row span
fn row_range(&self, r: impl RangeTrait) -> Result<BoxedRef<'_, GpuMat>>
sourcefn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, GpuMat>>
fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, GpuMat>>
… for the specified column span
fn col_range(&self, r: impl RangeTrait) -> Result<BoxedRef<'_, GpuMat>>
sourcefn 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>>
extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.)
fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, GpuMat>>
sourcefn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, GpuMat>>
fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, 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 reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, GpuMat>>
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, 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 locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>
fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>
locates GpuMat header within a parent GpuMat
sourcefn is_continuous(&self) -> Result<bool>
fn is_continuous(&self) -> Result<bool>
returns true iff the GpuMat data is continuous (i.e. when there are no gaps between successive rows)
sourcefn elem_size1(&self) -> Result<size_t>
fn elem_size1(&self) -> Result<size_t>
returns the size of element channel in bytes
sourcefn size(&self) -> Result<Size>
fn size(&self) -> Result<Size>
returns GpuMat size : width == number of columns, height == number of rows