Struct opencv::core::UMat

source ·
pub struct UMat { /* private fields */ }
Expand description

@todo document

Implementations§

source§

impl UMat

source

pub fn new(usage_flags: UMatUsageFlags) -> UMat

default constructor

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_def() -> UMat

default constructor

§Note

This alternative version of [new] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub unsafe fn new_rows_cols( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

constructs 2D matrix of the specified size and type

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_rows_cols_def(rows: i32, cols: i32, typ: i32) -> Result<UMat>

constructs 2D matrix of the specified size and type

§Note

This alternative version of [new_rows_cols] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub unsafe fn new_size( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_size_def(size: Size, typ: i32) -> Result<UMat>

§Note

This alternative version of [new_size] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub fn new_rows_cols_with_default( rows: i32, cols: i32, typ: i32, s: Scalar, usage_flags: UMatUsageFlags ) -> Result<UMat>

constructs 2D matrix and fills it with the specified value _s.

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_rows_cols_with_default_def( rows: i32, cols: i32, typ: i32, s: Scalar ) -> Result<UMat>

constructs 2D matrix 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:

  • usage_flags: USAGE_DEFAULT
source

pub fn new_size_with_default( size: Size, typ: i32, s: Scalar, usage_flags: UMatUsageFlags ) -> Result<UMat>

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_size_with_default_def( size: Size, typ: i32, s: Scalar ) -> Result<UMat>

§Note

This alternative version of [new_size_with_default] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub unsafe fn new_nd( sizes: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

constructs n-dimensional matrix

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_nd_def(sizes: &[i32], typ: i32) -> Result<UMat>

constructs n-dimensional matrix

§Note

This alternative version of [new_nd] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub fn new_nd_with_default( sizes: &[i32], typ: i32, s: Scalar, usage_flags: UMatUsageFlags ) -> Result<UMat>

§C++ default parameters
  • usage_flags: USAGE_DEFAULT
source

pub fn new_nd_with_default_def( sizes: &[i32], typ: i32, s: Scalar ) -> Result<UMat>

§Note

This alternative version of [new_nd_with_default] function uses the following default values for its arguments:

  • usage_flags: USAGE_DEFAULT
source

pub fn copy(m: &impl UMatTraitConst) -> Result<UMat>

copy constructor

source

pub fn rowscols<'boxed>( m: &'boxed impl UMatTraitConst, row_range: &impl RangeTraitConst, col_range: &impl RangeTraitConst ) -> Result<BoxedRef<'boxed, UMat>>

creates a matrix header for a part of the bigger matrix

§C++ default parameters
  • col_range: Range::all()
source

pub fn rowscols_def_mut<'boxed>( m: &'boxed mut impl UMatTrait, row_range: &impl RangeTraitConst ) -> Result<BoxedRefMut<'boxed, UMat>>

creates a matrix header for a part of the bigger matrix

§Note

This alternative version of [rowscols] function uses the following default values for its arguments:

  • col_range: Range::all()
source

pub fn rowscols_def<'boxed>( m: &'boxed impl UMatTraitConst, row_range: &impl RangeTraitConst ) -> Result<BoxedRef<'boxed, UMat>>

creates a matrix header for a part of the bigger matrix

§Note

This alternative version of [rowscols] function uses the following default values for its arguments:

  • col_range: Range::all()
source

pub fn rowscols_mut<'boxed>( m: &'boxed mut impl UMatTrait, row_range: &impl RangeTraitConst, col_range: &impl RangeTraitConst ) -> Result<BoxedRefMut<'boxed, UMat>>

creates a matrix header for a part of the bigger matrix

§C++ default parameters
  • col_range: Range::all()
source

pub fn roi(m: &impl UMatTraitConst, roi: Rect) -> Result<BoxedRef<'_, UMat>>

source

pub fn roi_mut( m: &mut impl UMatTrait, roi: Rect ) -> Result<BoxedRefMut<'_, UMat>>

source

pub fn ranges<'boxed>( m: &'boxed impl UMatTraitConst, ranges: &Vector<Range> ) -> Result<BoxedRef<'boxed, UMat>>

source

pub fn ranges_mut<'boxed>( m: &'boxed mut impl UMatTrait, ranges: &Vector<Range> ) -> Result<BoxedRefMut<'boxed, UMat>>

source

pub fn diag_flags( d: &impl UMatTraitConst, usage_flags: UMatUsageFlags ) -> Result<UMat>

constructs a square diagonal matrix which main diagonal is vector “d”

source

pub fn diag(d: &impl UMatTraitConst) -> Result<UMat>

source

pub fn zeros_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

Matlab-style matrix initialization

source

pub fn zeros_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn zeros_nd_flags( sz: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn zeros(rows: i32, cols: i32, typ: i32) -> Result<UMat>

source

pub fn zeros_size(size: Size, typ: i32) -> Result<UMat>

source

pub fn zeros_nd(sz: &[i32], typ: i32) -> Result<UMat>

source

pub fn ones_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn ones_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn ones_nd_flags( sz: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn ones(rows: i32, cols: i32, typ: i32) -> Result<UMat>

source

pub fn ones_size(size: Size, typ: i32) -> Result<UMat>

source

pub fn ones_nd(sz: &[i32], typ: i32) -> Result<UMat>

source

pub fn eye_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn eye_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

pub fn eye(rows: i32, cols: i32, typ: i32) -> Result<UMat>

source

pub fn eye_size(size: Size, typ: i32) -> Result<UMat>

source

pub fn copy_mut(m: UMat) -> Result<UMat>

Trait Implementations§

source§

impl Boxed for UMat

source§

unsafe fn from_raw(ptr: <UMat as OpenCVFromExtern>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> <UMat as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
source§

impl Clone for UMat

source§

fn clone(&self) -> Self

Calls try_clone() and panics if that fails

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UMat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for UMat

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl ToInputArray for &UMat

source§

impl ToInputArray for UMat

source§

impl ToInputOutputArray for &mut UMat

source§

impl ToInputOutputArray for UMat

source§

impl ToOutputArray for &mut UMat

source§

impl ToOutputArray for UMat

source§

impl UMatTrait for UMat

source§

fn as_raw_mut_UMat(&mut self) -> *mut c_void

source§

fn set_flags(&mut self, val: i32)

! includes several bit-fields: Read more
source§

fn set_dims(&mut self, val: i32)

the matrix dimensionality, >= 2
source§

fn set_rows(&mut self, val: i32)

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

fn set_cols(&mut self, val: i32)

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

fn set_usage_flags(&mut self, val: UMatUsageFlags)

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

fn u(&mut self) -> UMatData

black-box container of UMat data
source§

fn set_u(&mut self, val: &impl UMatDataTraitConst)

black-box container of UMat data
source§

fn set_offset(&mut self, val: size_t)

offset of the submatrix (or 0)
source§

fn set_size(&mut self, val: MatSize)

dimensional size of the matrix; accessible in various formats
source§

fn set(&mut self, m: &impl UMatTraitConst) -> Result<()>

assignment operators
source§

fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, UMat>>

returns a new matrix header for the specified row
source§

fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, UMat>>

returns a new matrix header for the specified column
source§

fn row_bounds_mut( &mut self, startrow: i32, endrow: i32 ) -> Result<BoxedRefMut<'_, UMat>>

… for the specified row span
source§

fn row_range_mut( &mut self, r: &impl RangeTraitConst ) -> Result<BoxedRefMut<'_, UMat>>

source§

fn col_bounds_mut( &mut self, startcol: i32, endcol: i32 ) -> Result<BoxedRefMut<'_, UMat>>

… for the specified column span
source§

fn col_range_mut( &mut self, r: &impl RangeTraitConst ) -> Result<BoxedRefMut<'_, UMat>>

source§

fn diag_def_mut(&mut self) -> Result<BoxedRefMut<'_, UMat>>

… for the specified diagonal (d=0 - the main diagonal, >0 - a diagonal from the upper half, <0 - a diagonal from the lower half) Read more
source§

fn diag_mut(&mut self, d: i32) -> Result<BoxedRefMut<'_, UMat>>

… for the specified diagonal (d=0 - the main diagonal, >0 - a diagonal from the upper half, <0 - a diagonal from the lower half) Read more
source§

fn set_scalar(&mut self, s: Scalar) -> Result<()>

sets every matrix element to s
source§

fn set_to( &mut self, value: &impl ToInputArray, mask: &impl ToInputArray ) -> Result<UMat>

sets some of the matrix elements to s, according to the mask Read more
source§

fn set_to_def(&mut self, value: &impl ToInputArray) -> Result<UMat>

sets some of the matrix elements to s, according to the mask Read more
source§

fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, UMat>>

creates alternative matrix header for the same data, with different Read more
source§

fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, UMat>>

creates alternative matrix header for the same data, with different Read more
source§

fn reshape_nd_mut( &mut self, cn: i32, newsz: &[i32] ) -> Result<BoxedRefMut<'_, UMat>>

source§

unsafe fn create_rows_cols( &mut self, rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>

allocates new matrix data unless the matrix already has specified size and type. Read more
source§

fn create_rows_cols_def(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>

allocates new matrix data unless the matrix already has specified size and type. Read more
source§

unsafe fn create_size( &mut self, size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>

C++ default parameters Read more
source§

fn create_size_def(&mut self, size: Size, typ: i32) -> Result<()>

source§

unsafe fn create_nd( &mut self, sizes: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>

C++ default parameters Read more
source§

fn create_nd_def(&mut self, sizes: &[i32], typ: i32) -> Result<()>

source§

unsafe fn create_nd_vec( &mut self, sizes: &Vector<i32>, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>

C++ default parameters Read more
source§

fn create_nd_vec_def(&mut self, sizes: &Vector<i32>, typ: i32) -> Result<()>

source§

unsafe fn addref(&mut self) -> Result<()>

increases the reference counter; use with care to avoid memleaks
source§

unsafe fn release(&mut self) -> Result<()>

decreases reference counter;
source§

fn deallocate(&mut self) -> Result<()>

deallocates the matrix data
source§

fn adjust_roi( &mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32 ) -> Result<UMat>

moves/resizes the current matrix ROI inside the parent matrix.
source§

fn rowscols_mut( &mut self, row_range: impl RangeTrait, col_range: impl RangeTrait ) -> Result<BoxedRefMut<'_, UMat>>

extracts a rectangular sub-matrix
source§

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

source§

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

source§

fn set_1(&mut self, m: UMat) -> Result<()>

source§

fn update_continuity_flag(&mut self) -> Result<()>

internal use method: updates the continuity flag
source§

impl UMatTraitConst for UMat

source§

fn as_raw_UMat(&self) -> *const c_void

source§

fn flags(&self) -> i32

! includes several bit-fields: Read more
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) Read more
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) Read more
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. Read more
source§

fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>

converts matrix to another datatype with optional scaling. See cvConvertScale. Read more
source§

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

C++ default parameters Read more
source§

fn assign_to_def(&self, m: &mut impl UMatTrait) -> Result<()>

source§

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

creates alternative matrix header for the same data, with different Read more
source§

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

creates alternative matrix header for the same data, with different Read more
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 Read more
source§

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

matrix inversion by means of matrix expressions Read more
source§

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

per-element matrix multiplication by means of matrix expressions Read more
source§

fn mul_def(&self, m: &impl ToInputArray) -> Result<UMat>

per-element matrix multiplication by means of matrix expressions Read more
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() Read more
source§

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

returns step/elemSize1() Read more
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 Read more
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 Read more
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>

source§

impl Send for UMat

Auto Trait Implementations§

§

impl Freeze for UMat

§

impl RefUnwindSafe for UMat

§

impl !Sync for UMat

§

impl Unpin for UMat

§

impl UnwindSafe for UMat

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a 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 of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.