pub trait UMatTraitConst {
Show 54 methods
// Required method
fn as_raw_UMat(&self) -> *const c_void;
// Provided methods
fn flags(&self) -> i32 { ... }
fn dims(&self) -> i32 { ... }
fn rows(&self) -> i32 { ... }
fn cols(&self) -> i32 { ... }
fn usage_flags(&self) -> UMatUsageFlags { ... }
fn offset(&self) -> size_t { ... }
fn mat_size(&self) -> MatSize<'_> { ... }
fn mat_step(&self) -> MatStep { ... }
fn get_mat(&self, flags: AccessFlag) -> Result<Mat> { ... }
fn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>> { ... }
fn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>> { ... }
fn row_bounds(
&self,
startrow: i32,
endrow: i32,
) -> Result<BoxedRef<'_, UMat>> { ... }
fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>> { ... }
fn col_bounds(
&self,
startcol: i32,
endcol: i32,
) -> Result<BoxedRef<'_, UMat>> { ... }
fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>> { ... }
fn diag(&self, d: i32) -> Result<BoxedRef<'_, UMat>> { ... }
fn diag_def(&self) -> Result<BoxedRef<'_, UMat>> { ... }
fn try_clone(&self) -> Result<UMat> { ... }
fn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()> { ... }
fn copy_to_masked(
&self,
m: &mut impl ToOutputArray,
mask: &impl ToInputArray,
) -> Result<()> { ... }
fn convert_to(
&self,
m: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()> { ... }
fn convert_to_def(
&self,
m: &mut impl ToOutputArray,
rtype: i32,
) -> Result<()> { ... }
fn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()> { ... }
fn assign_to_def(&self, m: &mut impl UMatTrait) -> Result<()> { ... }
fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, UMat>> { ... }
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, UMat>> { ... }
fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, UMat>> { ... }
fn t(&self) -> Result<UMat> { ... }
fn inv(&self, method: i32) -> Result<UMat> { ... }
fn inv_def(&self) -> Result<UMat> { ... }
fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<UMat> { ... }
fn mul_def(&self, m: &impl ToInputArray) -> Result<UMat> { ... }
fn dot(&self, m: &impl ToInputArray) -> Result<f64> { ... }
fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()> { ... }
fn rowscols(
&self,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRef<'_, UMat>> { ... }
fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, UMat>> { ... }
fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, UMat>> { ... }
fn is_continuous(&self) -> bool { ... }
fn is_submatrix(&self) -> bool { ... }
fn elem_size(&self) -> Result<size_t> { ... }
fn elem_size1(&self) -> size_t { ... }
fn typ(&self) -> i32 { ... }
fn depth(&self) -> i32 { ... }
fn channels(&self) -> i32 { ... }
fn step1(&self, i: i32) -> Result<size_t> { ... }
fn step1_def(&self) -> Result<size_t> { ... }
fn empty(&self) -> bool { ... }
fn total(&self) -> size_t { ... }
fn check_vector(
&self,
elem_channels: i32,
depth: i32,
require_continuous: bool,
) -> Result<i32> { ... }
fn check_vector_def(&self, elem_channels: i32) -> Result<i32> { ... }
fn handle(&self, access_flags: AccessFlag) -> Result<*mut c_void> { ... }
fn ndoffset(&self, ofs: &mut size_t) -> Result<()> { ... }
fn size(&self) -> Result<Size> { ... }
}
Expand description
Constant methods for core::UMat
Required Methods§
fn as_raw_UMat(&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 rows(&self) -> i32
fn rows(&self) -> i32
number of rows in the matrix; -1 when the matrix has more than 2 dimensions
Sourcefn cols(&self) -> i32
fn cols(&self) -> i32
number of columns in the matrix; -1 when the matrix has more than 2 dimensions
Sourcefn usage_flags(&self) -> UMatUsageFlags
fn usage_flags(&self) -> UMatUsageFlags
usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
Sourcefn mat_size(&self) -> MatSize<'_>
fn mat_size(&self) -> MatSize<'_>
dimensional size of the matrix; accessible in various formats
fn get_mat(&self, flags: AccessFlag) -> Result<Mat>
Sourcefn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>>
fn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>>
returns a new matrix header for the specified row
Sourcefn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>>
fn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>>
returns a new matrix header for the specified column
Sourcefn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, UMat>>
fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, UMat>>
… for the specified row span
fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>
Sourcefn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, UMat>>
fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, UMat>>
… for the specified column span
fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>
Sourcefn diag(&self, d: i32) -> Result<BoxedRef<'_, UMat>>
fn diag(&self, d: i32) -> Result<BoxedRef<'_, UMat>>
… for the specified diagonal (d=0 - the main diagonal,
0 - a diagonal from the upper half, <0 - a diagonal from the lower half)
§C++ default parameters
- d: 0
Sourcefn diag_def(&self) -> Result<BoxedRef<'_, UMat>>
fn diag_def(&self) -> Result<BoxedRef<'_, UMat>>
… for the specified diagonal (d=0 - the main diagonal,
0 - a diagonal from the upper half, <0 - a diagonal from the lower half)
§Note
This alternative version of UMatTraitConst::diag function uses the following default values for its arguments:
- d: 0
Sourcefn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()>
fn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()>
copies the matrix content to “m”.
Sourcefn copy_to_masked(
&self,
m: &mut impl ToOutputArray,
mask: &impl ToInputArray,
) -> Result<()>
fn copy_to_masked( &self, m: &mut impl ToOutputArray, mask: &impl ToInputArray, ) -> Result<()>
copies those matrix elements to “m” that are marked with non-zero mask elements.
Sourcefn convert_to(
&self,
m: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64,
) -> Result<()>
fn convert_to( &self, m: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64, ) -> Result<()>
converts matrix to another datatype with optional scaling. See cvConvertScale.
§C++ default parameters
- alpha: 1
- beta: 0
Sourcefn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>
fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>
converts matrix to another datatype with optional scaling. See cvConvertScale.
§Note
This alternative version of UMatTraitConst::convert_to function uses the following default values for its arguments:
- alpha: 1
- beta: 0
Sourcefn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()>
fn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()>
§C++ default parameters
- typ: -1
Sourcefn assign_to_def(&self, m: &mut impl UMatTrait) -> Result<()>
fn assign_to_def(&self, m: &mut impl UMatTrait) -> Result<()>
§Note
This alternative version of UMatTraitConst::assign_to function uses the following default values for its arguments:
- typ: -1
Sourcefn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, UMat>>
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, UMat>>
creates alternative matrix header for the same data, with different
§Note
This alternative version of UMatTraitConst::reshape function uses the following default values for its arguments:
- rows: 0
fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, UMat>>
Sourcefn inv_def(&self) -> Result<UMat>
fn inv_def(&self) -> Result<UMat>
matrix inversion by means of matrix expressions
§Note
This alternative version of UMatTraitConst::inv function uses the following default values for its arguments:
- method: DECOMP_LU
Sourcefn mul_def(&self, m: &impl ToInputArray) -> Result<UMat>
fn mul_def(&self, m: &impl ToInputArray) -> Result<UMat>
per-element matrix multiplication by means of matrix expressions
§Note
This alternative version of UMatTraitConst::mul function uses the following default values for its arguments:
- scale: 1
Sourcefn dot(&self, m: &impl ToInputArray) -> Result<f64>
fn dot(&self, m: &impl ToInputArray) -> Result<f64>
computes dot-product
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 matrix header within a parent matrix. See below
Sourcefn rowscols(
&self,
row_range: impl RangeTrait,
col_range: impl RangeTrait,
) -> Result<BoxedRef<'_, UMat>>
fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRef<'_, UMat>>
extracts a rectangular sub-matrix
fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, UMat>>
fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, UMat>>
Sourcefn is_continuous(&self) -> bool
fn is_continuous(&self) -> bool
returns true iff the matrix data is continuous
Sourcefn is_submatrix(&self) -> bool
fn is_submatrix(&self) -> bool
returns true if the matrix is a submatrix of another matrix
Sourcefn elem_size1(&self) -> size_t
fn elem_size1(&self) -> size_t
returns the size of element channel in bytes.
Sourcefn step1_def(&self) -> Result<size_t>
fn step1_def(&self) -> Result<size_t>
returns step/elemSize1()
§Note
This alternative version of UMatTraitConst::step1 function uses the following default values for its arguments:
- i: 0
Sourcefn check_vector(
&self,
elem_channels: i32,
depth: i32,
require_continuous: bool,
) -> Result<i32>
fn check_vector( &self, elem_channels: i32, depth: i32, require_continuous: bool, ) -> Result<i32>
returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
§C++ default parameters
- depth: -1
- require_continuous: true
Sourcefn check_vector_def(&self, elem_channels: i32) -> Result<i32>
fn check_vector_def(&self, elem_channels: i32) -> Result<i32>
returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
§Note
This alternative version of UMatTraitConst::check_vector function uses the following default values for its arguments:
- depth: -1
- require_continuous: true
Sourcefn handle(&self, access_flags: AccessFlag) -> Result<*mut c_void>
fn handle(&self, access_flags: AccessFlag) -> Result<*mut c_void>
! Returns the OpenCL buffer handle on which UMat operates on. The UMat instance should be kept alive during the use of the handle to prevent the buffer to be returned to the OpenCV buffer pool.
fn ndoffset(&self, ofs: &mut size_t) -> Result<()>
fn size(&self) -> Result<Size>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.