pub struct UMat { /* private fields */ }
Expand description
@todo document
Implementations
sourceimpl 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
sourceimpl Boxed for UMat
impl Boxed for UMat
sourceimpl ToInputArray for &UMat
impl ToInputArray for &UMat
fn input_array(&self) -> Result<_InputArray>
sourceimpl ToInputArray for UMat
impl ToInputArray for UMat
fn input_array(&self) -> Result<_InputArray>
sourceimpl ToInputOutputArray for &mut UMat
impl ToInputOutputArray for &mut UMat
fn input_output_array(&mut self) -> Result<_InputOutputArray>
sourceimpl ToInputOutputArray for UMat
impl ToInputOutputArray for UMat
fn input_output_array(&mut self) -> Result<_InputOutputArray>
sourceimpl ToOutputArray for &mut UMat
impl ToOutputArray for &mut UMat
fn output_array(&mut self) -> Result<_OutputArray>
sourceimpl ToOutputArray for UMat
impl ToOutputArray for UMat
fn output_array(&mut self) -> Result<_OutputArray>
sourceimpl UMatTrait for UMat
impl UMatTrait for UMat
fn as_raw_mut_UMat(&mut self) -> *mut c_void
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn set_offset(&mut self, val: size_t)
fn set_offset(&mut self, val: size_t)
offset of the submatrix (or 0)
sourcefn 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
sourceunsafe 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
sourceunsafe 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
sourceunsafe 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
sourceunsafe 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
sourcefn addref(&mut self) -> Result<()>
fn addref(&mut self) -> Result<()>
increases the reference counter; use with care to avoid memleaks
sourcefn deallocate(&mut self) -> Result<()>
fn deallocate(&mut self) -> Result<()>
deallocates the matrix data
sourcefn 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.
sourcefn update_continuity_flag(&mut self) -> Result<()>
fn update_continuity_flag(&mut self) -> Result<()>
internal use method: updates the continuity flag
sourceimpl UMatTraitConst for UMat
impl UMatTraitConst for UMat
fn as_raw_UMat(&self) -> *const c_void
sourcefn rows(&self) -> i32
fn rows(&self) -> i32
number of rows in the matrix; -1 when the matrix has more than 2 dimensions
sourcefn cols(&self) -> i32
fn cols(&self) -> i32
number of columns in the matrix; -1 when the matrix has more than 2 dimensions
sourcefn usage_flags(&self) -> UMatUsageFlags
fn usage_flags(&self) -> UMatUsageFlags
usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat
fn get_mat(&self, flags: AccessFlag) -> Result<Mat>
fn row_range(&self, r: &Range) -> Result<UMat>
sourcefn 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>
sourcefn 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
sourcefn copy_to(&self, m: &mut dyn ToOutputArray) -> Result<()>
fn copy_to(&self, m: &mut dyn ToOutputArray) -> Result<()>
copies the matrix content to “m”.
sourcefn 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.
sourcefn 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
sourcefn 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>
sourcefn inv(&self, method: i32) -> Result<UMat>
fn inv(&self, method: i32) -> Result<UMat>
matrix inversion by means of matrix expressions Read more
sourcefn 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
sourcefn dot(&self, m: &dyn ToInputArray) -> Result<f64>
fn dot(&self, m: &dyn ToInputArray) -> Result<f64>
computes dot-product
sourcefn 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
sourcefn is_continuous(&self) -> bool
fn is_continuous(&self) -> bool
returns true iff the matrix data is continuous
sourcefn is_submatrix(&self) -> bool
fn is_submatrix(&self) -> bool
returns true if the matrix is a submatrix of another matrix
sourcefn elem_size1(&self) -> size_t
fn elem_size1(&self) -> size_t
returns the size of element channel in bytes.
sourcefn 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
sourcefn 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. Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more