pub struct UMat { /* private fields */ }
Expand description
@todo document
Implementations§
source§impl UMat
impl UMat
sourcepub fn new(usage_flags: UMatUsageFlags) -> UMat
pub fn new(usage_flags: UMatUsageFlags) -> UMat
sourcepub unsafe fn new_rows_cols(
rows: i32,
cols: i32,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<UMat>
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
sourcepub unsafe fn new_size(
size: Size,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub unsafe fn new_size( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
C++ default parameters
- usage_flags: USAGE_DEFAULT
sourcepub fn new_rows_cols_with_default(
rows: i32,
cols: i32,
typ: i32,
s: Scalar,
usage_flags: UMatUsageFlags
) -> Result<UMat>
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
sourcepub fn new_size_with_default(
size: Size,
typ: i32,
s: Scalar,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub fn new_size_with_default( size: Size, typ: i32, s: Scalar, usage_flags: UMatUsageFlags ) -> Result<UMat>
C++ default parameters
- usage_flags: USAGE_DEFAULT
sourcepub fn new_nd_with_default(
sizes: &[i32],
typ: i32,
s: Scalar,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub fn new_nd_with_default( sizes: &[i32], typ: i32, s: Scalar, usage_flags: UMatUsageFlags ) -> Result<UMat>
C++ default parameters
- usage_flags: USAGE_DEFAULT
sourcepub fn rowscols(m: &UMat, row_range: &Range, col_range: &Range) -> Result<UMat>
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()
pub fn roi(m: &UMat, roi: Rect) -> Result<UMat>
pub fn ranges(m: &UMat, ranges: &Vector<Range>) -> Result<UMat>
sourcepub fn diag(d: &UMat, usage_flags: UMatUsageFlags) -> Result<UMat>
pub fn diag(d: &UMat, usage_flags: UMatUsageFlags) -> Result<UMat>
constructs a square diagonal matrix which main diagonal is vector “d”
pub fn diag_1(d: &UMat) -> Result<UMat>
sourcepub fn zeros(
rows: i32,
cols: i32,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub fn zeros( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
Matlab-style matrix initialization
pub fn zeros_1( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn zeros_2( ndims: i32, sz: &i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn zeros_3(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn zeros_4(size: Size, typ: i32) -> Result<UMat>
pub fn zeros_5(ndims: i32, sz: &i32, typ: i32) -> Result<UMat>
pub fn ones( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn ones_1(size: Size, typ: i32, usage_flags: UMatUsageFlags) -> Result<UMat>
pub fn ones_2( ndims: i32, sz: &i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn ones_3(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn ones_4(size: Size, typ: i32) -> Result<UMat>
pub fn ones_5(ndims: i32, sz: &i32, typ: i32) -> Result<UMat>
pub fn eye( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn eye_1(size: Size, typ: i32, usage_flags: UMatUsageFlags) -> Result<UMat>
pub fn eye_2(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn eye_3(size: Size, typ: i32) -> Result<UMat>
pub fn copy_mut(m: UMat) -> Result<UMat>
Trait Implementations§
source§impl Boxed for UMat
impl Boxed for UMat
source§impl ToInputArray for &UMat
impl ToInputArray for &UMat
fn input_array(&self) -> Result<_InputArray>
source§impl ToInputArray for UMat
impl ToInputArray for UMat
fn input_array(&self) -> Result<_InputArray>
source§impl ToInputOutputArray for &mut UMat
impl ToInputOutputArray for &mut UMat
fn input_output_array(&mut self) -> Result<_InputOutputArray>
source§impl ToInputOutputArray for UMat
impl ToInputOutputArray for UMat
fn input_output_array(&mut self) -> Result<_InputOutputArray>
source§impl ToOutputArray for &mut UMat
impl ToOutputArray for &mut UMat
fn output_array(&mut self) -> Result<_OutputArray>
source§impl ToOutputArray for UMat
impl ToOutputArray for UMat
fn output_array(&mut self) -> Result<_OutputArray>
source§impl UMatTrait for UMat
impl UMatTrait for UMat
fn as_raw_mut_UMat(&mut self) -> *mut c_void
source§fn set_rows(&mut self, val: i32)
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)
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)
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 set_offset(&mut self, val: size_t)
fn set_offset(&mut self, val: size_t)
offset of the submatrix (or 0)
source§fn set_to(
&mut self,
value: &dyn ToInputArray,
mask: &dyn ToInputArray
) -> Result<UMat>
fn set_to( &mut self, value: &dyn ToInputArray, mask: &dyn 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<()>
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§unsafe fn create_size(
&mut self,
size: Size,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
unsafe fn create_size( &mut self, size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>
C++ default parameters Read more
source§unsafe fn create_nd(
&mut self,
sizes: &[i32],
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
unsafe fn create_nd( &mut self, sizes: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>
C++ default parameters Read more
source§unsafe fn create_nd_vec(
&mut self,
sizes: &Vector<i32>,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<()>
unsafe fn create_nd_vec( &mut self, sizes: &Vector<i32>, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>
C++ default parameters Read more
source§fn addref(&mut self) -> Result<()>
fn addref(&mut self) -> Result<()>
increases the reference counter; use with care to avoid memleaks
source§fn deallocate(&mut self) -> Result<()>
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>
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 update_continuity_flag(&mut self) -> Result<()>
fn update_continuity_flag(&mut self) -> Result<()>
internal use method: updates the continuity flag
source§impl UMatTraitConst for UMat
impl UMatTraitConst for UMat
fn as_raw_UMat(&self) -> *const c_void
source§fn rows(&self) -> i32
fn rows(&self) -> i32
number of rows in the matrix; -1 when the matrix has more than 2 dimensions
source§fn cols(&self) -> i32
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
fn usage_flags(&self) -> UMatUsageFlags
usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
source§fn mat_step(&self) -> MatStep
fn mat_step(&self) -> MatStep
number of bytes each matrix element/row/plane/dimension occupies
fn get_mat(&self, flags: AccessFlag) -> Result<Mat>
fn row_range(&self, r: &Range) -> Result<UMat>
source§fn col_bounds(&self, startcol: i32, endcol: i32) -> 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>
source§fn diag(&self, d: i32) -> 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) Read more
source§fn copy_to_masked(
&self,
m: &mut dyn ToOutputArray,
mask: &dyn ToInputArray
) -> Result<()>
fn copy_to_masked( &self, m: &mut dyn ToOutputArray, mask: &dyn ToInputArray ) -> Result<()>
copies those matrix elements to “m” that are marked with non-zero mask elements.
source§fn convert_to(
&self,
m: &mut dyn ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64
) -> Result<()>
fn convert_to( &self, m: &mut dyn ToOutputArray, rtype: i32, alpha: f64, beta: f64 ) -> Result<()>
converts matrix to another datatype with optional scaling. See cvConvertScale. Read more
source§fn reshape(&self, cn: i32, rows: i32) -> Result<UMat>
fn reshape(&self, cn: i32, rows: i32) -> Result<UMat>
creates alternative matrix header for the same data, with different Read more
fn reshape_1(&self, cn: i32, newndims: i32, newsz: &i32) -> Result<UMat>
source§fn inv(&self, method: i32) -> Result<UMat>
fn inv(&self, method: i32) -> Result<UMat>
matrix inversion by means of matrix expressions Read more
source§fn mul(&self, m: &dyn ToInputArray, scale: f64) -> Result<UMat>
fn mul(&self, m: &dyn ToInputArray, scale: f64) -> Result<UMat>
per-element matrix multiplication by means of matrix expressions Read more
source§fn 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
source§fn apply(&self, row_range: Range, col_range: Range) -> Result<UMat>
fn apply(&self, row_range: Range, col_range: Range) -> Result<UMat>
extracts a rectangular sub-matrix
fn apply_1(&self, roi: Rect) -> Result<UMat>
fn apply_2(&self, ranges: &Range) -> Result<UMat>
fn apply_3(&self, ranges: &Vector<Range>) -> Result<UMat>
source§fn is_continuous(&self) -> bool
fn is_continuous(&self) -> bool
returns true iff the matrix data is continuous
source§fn is_submatrix(&self) -> bool
fn is_submatrix(&self) -> bool
returns true if the matrix is a submatrix of another matrix
source§fn elem_size1(&self) -> size_t
fn elem_size1(&self) -> size_t
returns the size of element channel in bytes.
source§fn 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 Read more
source§fn 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<()>
impl Send for UMat
impl VectorElement for UMatwhere Vector<UMat>: VectorExtern<UMat>,
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more