[−][src]Trait opencv::core::prelude::UMatTrait
@todo document
Required methods
fn as_raw_UMat(&self) -> *const c_void
fn as_raw_mut_UMat(&mut self) -> *mut c_void
Provided methods
fn flags(&self) -> i32
! includes several bit-fields:
- the magic signature
- continuity flag
- depth
- number of channels
fn set_flags(&mut self, val: i32)
! includes several bit-fields:
- the magic signature
- continuity flag
- depth
- number of channels
fn dims(&self) -> i32
the matrix dimensionality, >= 2
fn set_dims(&mut self, val: i32)
the matrix dimensionality, >= 2
fn rows(&self) -> i32
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
fn set_rows(&mut self, val: i32)
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
fn cols(&self) -> i32
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
fn set_cols(&mut self, val: i32)
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
fn usage_flags(&self) -> UMatUsageFlags
fn set_usage_flags(&mut self, val: UMatUsageFlags)
fn u(&mut self) -> UMatData
fn set_u(&mut self, val: &mut UMatData)
fn offset(&self) -> size_t
fn set_offset(&mut self, val: 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<UMat>
returns a new matrix header for the specified row
fn col(&self, x: i32) -> Result<UMat>
returns a new matrix header for the specified column
fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<UMat>
... for the specified row span
fn row_range(&self, r: &Range) -> Result<UMat>
fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<UMat>
... for the specified column span
fn col_range(&self, r: &Range) -> Result<UMat>
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)
C++ default parameters
- d: 0
fn try_clone(&self) -> Result<UMat>
returns deep copy of the matrix, i.e. the data is copied
fn copy_to(&self, m: &mut dyn ToOutputArray) -> Result<()>
copies the matrix content to "m".
fn copy_to_masked(
&self,
m: &mut dyn ToOutputArray,
mask: &dyn ToInputArray
) -> Result<()>
&self,
m: &mut dyn ToOutputArray,
mask: &dyn ToInputArray
) -> Result<()>
copies those matrix elements to "m" that are marked with non-zero mask elements.
fn convert_to(
&self,
m: &mut dyn ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64
) -> Result<()>
&self,
m: &mut dyn 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
fn assign_to(&self, m: &mut UMat, typ: i32) -> Result<()>
C++ default parameters
- typ: -1
fn set_to(
&mut self,
value: &dyn ToInputArray,
mask: &dyn ToInputArray
) -> Result<UMat>
&mut self,
value: &dyn ToInputArray,
mask: &dyn ToInputArray
) -> Result<UMat>
fn reshape(&self, cn: i32, rows: i32) -> Result<UMat>
fn reshape_1(&self, cn: i32, newndims: i32, newsz: &i32) -> Result<UMat>
fn t(&self) -> Result<UMat>
matrix transposition by means of matrix expressions
fn inv(&self, method: i32) -> Result<UMat>
fn mul(&self, m: &dyn ToInputArray, scale: f64) -> Result<UMat>
fn dot(&self, m: &dyn ToInputArray) -> Result<f64>
computes dot-product
unsafe fn create_rows_cols(
&mut self,
rows: i32,
cols: i32,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
&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.
C++ default parameters
- usage_flags: USAGE_DEFAULT
unsafe fn create_size(
&mut self,
size: Size,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
&mut self,
size: Size,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
C++ default parameters
- usage_flags: USAGE_DEFAULT
unsafe fn create_nd(
&mut self,
sizes: &[i32],
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
&mut self,
sizes: &[i32],
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
C++ default parameters
- usage_flags: USAGE_DEFAULT
unsafe fn create_nd_vec(
&mut self,
sizes: &Vector<i32>,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
&mut self,
sizes: &Vector<i32>,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
C++ default parameters
- usage_flags: USAGE_DEFAULT
fn addref(&mut self) -> Result<()>
increases the reference counter; use with care to avoid memleaks
fn release(&mut self) -> Result<()>
decreases reference counter;
fn deallocate(&mut self) -> Result<()>
deallocates the matrix data
fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>
locates matrix header within a parent matrix. See below
fn adjust_roi(
&mut self,
dtop: i32,
dbottom: i32,
dleft: i32,
dright: i32
) -> Result<UMat>
&mut self,
dtop: i32,
dbottom: i32,
dleft: i32,
dright: i32
) -> Result<UMat>
moves/resizes the current matrix ROI inside the parent matrix.
fn is_continuous(&self) -> Result<bool>
returns true iff the matrix data is continuous
fn is_submatrix(&self) -> Result<bool>
returns true if the matrix is a submatrix of another matrix
fn elem_size(&self) -> Result<size_t>
returns element size in bytes,
fn elem_size1(&self) -> Result<size_t>
returns the size of element channel in bytes.
fn typ(&self) -> Result<i32>
returns element type, similar to CV_MAT_TYPE(cvmat->type)
fn depth(&self) -> Result<i32>
returns element type, similar to CV_MAT_DEPTH(cvmat->type)
fn channels(&self) -> Result<i32>
returns element type, similar to CV_MAT_CN(cvmat->type)
fn step1(&self, i: i32) -> Result<size_t>
fn empty(&self) -> Result<bool>
returns true if matrix data is NULL
fn total(&self) -> Result<size_t>
returns the total number of matrix elements
fn check_vector(
&self,
elem_channels: i32,
depth: i32,
require_continuous: bool
) -> Result<i32>
&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
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 update_continuity_flag(&mut self) -> Result<()>
internal use method: updates the continuity flag