Trait UMatTraitConst

Source
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§

Provided Methods§

Source

fn flags(&self) -> i32

! includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels
Source

fn dims(&self) -> i32

the matrix dimensionality, >= 2

Source

fn rows(&self) -> i32

number of rows in the matrix; -1 when the matrix has more than 2 dimensions

Source

fn cols(&self) -> i32

number of columns in the matrix; -1 when the matrix has more than 2 dimensions

Source

fn usage_flags(&self) -> UMatUsageFlags

usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat

Source

fn offset(&self) -> size_t

offset of the submatrix (or 0)

Source

fn mat_size(&self) -> MatSize<'_>

dimensional size of the matrix; accessible in various formats

Source

fn mat_step(&self) -> MatStep

number of bytes each matrix element/row/plane/dimension occupies

Source

fn get_mat(&self, flags: AccessFlag) -> Result<Mat>

Source

fn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>>

returns a new matrix header for the specified row

Source

fn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>>

returns a new matrix header for the specified column

Source

fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, UMat>>

… for the specified row span

Source

fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>

Source

fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, UMat>>

… for the specified column span

Source

fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>

Source

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
Source

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
Source

fn try_clone(&self) -> Result<UMat>

returns deep copy of the matrix, i.e. the data is copied

Source

fn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()>

copies the matrix content to “m”.

Source

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.

Source

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
Source

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
Source

fn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()>

§C++ default parameters
  • typ: -1
Source

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
Source

fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, UMat>>

creates alternative matrix header for the same data, with different

§C++ default parameters
  • rows: 0
Source

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
Source

fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, UMat>>

Source

fn t(&self) -> Result<UMat>

matrix transposition by means of matrix expressions

Source

fn inv(&self, method: i32) -> Result<UMat>

matrix inversion by means of matrix expressions

§C++ default parameters
  • method: DECOMP_LU
Source

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
Source

fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<UMat>

per-element matrix multiplication by means of matrix expressions

§C++ default parameters
  • scale: 1
Source

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
Source

fn dot(&self, m: &impl ToInputArray) -> Result<f64>

computes dot-product

Source

fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>

locates matrix header within a parent matrix. See below

Source

fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRef<'_, UMat>>

extracts a rectangular sub-matrix

Source

fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, UMat>>

Source

fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, UMat>>

Source

fn is_continuous(&self) -> bool

returns true iff the matrix data is continuous

Source

fn is_submatrix(&self) -> bool

returns true if the matrix is a submatrix of another matrix

Source

fn elem_size(&self) -> Result<size_t>

returns element size in bytes,

Source

fn elem_size1(&self) -> size_t

returns the size of element channel in bytes.

Source

fn typ(&self) -> i32

returns element type, similar to CV_MAT_TYPE(cvmat->type)

Source

fn depth(&self) -> i32

returns element type, similar to CV_MAT_DEPTH(cvmat->type)

Source

fn channels(&self) -> i32

returns element type, similar to CV_MAT_CN(cvmat->type)

Source

fn step1(&self, i: i32) -> Result<size_t>

returns step/elemSize1()

§C++ default parameters
  • i: 0
Source

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
Source

fn empty(&self) -> bool

returns true if matrix data is NULL

Source

fn total(&self) -> size_t

returns the total number of matrix elements

Source

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
Source

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
Source

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.

Source

fn ndoffset(&self, ofs: &mut size_t) -> Result<()>

Source

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.

Implementors§