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: &UMat) -> Result<UMat>

copy constructor

source

pub fn rowscols(m: &UMat, row_range: &Range, col_range: &Range) -> Result<UMat>

creates a matrix header for a part of the bigger matrix

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

pub fn rowscols_def(m: &UMat, row_range: &Range) -> Result<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 roi(m: &UMat, roi: Rect) -> Result<UMat>

source

pub fn ranges(m: &UMat, ranges: &Vector<Range>) -> Result<UMat>

source

pub fn diag(d: &UMat, usage_flags: UMatUsageFlags) -> Result<UMat>

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

source

pub fn diag_1(d: &UMat) -> Result<UMat>

source

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

Matlab-style matrix initialization

source

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

source

pub fn zeros_2( ndims: i32, sz: &i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

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

source

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

source

pub fn zeros_5(ndims: i32, sz: &i32, typ: i32) -> Result<UMat>

source

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

source

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

source

pub fn ones_2( ndims: i32, sz: &i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>

source

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

source

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

source

pub fn ones_5(ndims: i32, sz: &i32, typ: i32) -> Result<UMat>

source

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

source

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

source

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

source

pub fn eye_3(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: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

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

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

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

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: &mut UMatData)

black-box container of UMat data
source§

fn set_offset(&mut self, val: size_t)

offset of the submatrix (or 0)
source§

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

assignment operators
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§

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§

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

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

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 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<UMat>

returns a new matrix header for the specified row
source§

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

returns a new matrix header for the specified column
source§

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

… for the specified row span
source§

fn row_range(&self, r: &Range) -> Result<UMat>

source§

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

… for the specified column span
source§

fn col_range(&self, r: &Range) -> Result<UMat>

source§

fn diag(&self, d: i32) -> Result<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<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 UMat, typ: i32) -> Result<()>

C++ default parameters Read more
source§

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

source§

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

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

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

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

fn reshape_1(&self, cn: i32, newndims: i32, newsz: &i32) -> Result<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 apply(&self, row_range: Range, col_range: Range) -> Result<UMat>

extracts a rectangular sub-matrix
source§

fn apply_1(&self, roi: Rect) -> Result<UMat>

source§

fn apply_2(&self, ranges: &Range) -> Result<UMat>

source§

fn apply_3(&self, ranges: &Vector<Range>) -> Result<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

source§

impl VectorElement for UMatwhere Vector<UMat>: VectorExtern<UMat>,

Auto Trait Implementations§

§

impl RefUnwindSafe for UMat

§

impl !Sync for UMat

§

impl Unpin for UMat

§

impl UnwindSafe for UMat

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.