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 fn new_def() -> UMat
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
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 fn new_rows_cols_def(rows: i32, cols: i32, typ: i32) -> Result<UMat>
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
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_size_def(size: Size, typ: i32) -> Result<UMat>
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
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_rows_cols_with_default_def(
rows: i32,
cols: i32,
typ: i32,
s: Scalar
) -> Result<UMat>
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
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_size_with_default_def(
size: Size,
typ: i32,
s: Scalar
) -> Result<UMat>
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
sourcepub fn new_nd_def(sizes: &[i32], typ: i32) -> Result<UMat>
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
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 new_nd_with_default_def(
sizes: &[i32],
typ: i32,
s: Scalar
) -> Result<UMat>
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
sourcepub fn copy(m: &impl UMatTraitConst) -> Result<UMat>
pub fn copy(m: &impl UMatTraitConst) -> Result<UMat>
copy constructor
sourcepub fn rowscols<'boxed>(
m: &'boxed impl UMatTraitConst,
row_range: &impl RangeTraitConst,
col_range: &impl RangeTraitConst
) -> Result<BoxedRef<'boxed, UMat>>
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()
sourcepub fn rowscols_def_mut<'boxed>(
m: &'boxed mut impl UMatTrait,
row_range: &impl RangeTraitConst
) -> Result<BoxedRefMut<'boxed, UMat>>
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()
sourcepub fn rowscols_def<'boxed>(
m: &'boxed impl UMatTraitConst,
row_range: &impl RangeTraitConst
) -> Result<BoxedRef<'boxed, UMat>>
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()
sourcepub fn rowscols_mut<'boxed>(
m: &'boxed mut impl UMatTrait,
row_range: &impl RangeTraitConst,
col_range: &impl RangeTraitConst
) -> Result<BoxedRefMut<'boxed, UMat>>
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()
pub fn roi(m: &impl UMatTraitConst, roi: Rect) -> Result<BoxedRef<'_, UMat>>
pub fn roi_mut( m: &mut impl UMatTrait, roi: Rect ) -> Result<BoxedRefMut<'_, UMat>>
pub fn ranges<'boxed>( m: &'boxed impl UMatTraitConst, ranges: &Vector<Range> ) -> Result<BoxedRef<'boxed, UMat>>
pub fn ranges_mut<'boxed>( m: &'boxed mut impl UMatTrait, ranges: &Vector<Range> ) -> Result<BoxedRefMut<'boxed, UMat>>
sourcepub fn diag_flags(
d: &impl UMatTraitConst,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub fn diag_flags( d: &impl UMatTraitConst, usage_flags: UMatUsageFlags ) -> Result<UMat>
constructs a square diagonal matrix which main diagonal is vector “d”
pub fn diag(d: &impl UMatTraitConst) -> Result<UMat>
sourcepub fn zeros_flags(
rows: i32,
cols: i32,
typ: i32,
usage_flags: UMatUsageFlags
) -> Result<UMat>
pub fn zeros_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
Matlab-style matrix initialization
pub fn zeros_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn zeros_nd_flags( sz: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn zeros(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn zeros_size(size: Size, typ: i32) -> Result<UMat>
pub fn zeros_nd(sz: &[i32], typ: i32) -> Result<UMat>
pub fn ones_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn ones_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn ones_nd_flags( sz: &[i32], typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn ones(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn ones_size(size: Size, typ: i32) -> Result<UMat>
pub fn ones_nd(sz: &[i32], typ: i32) -> Result<UMat>
pub fn eye_flags( rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn eye_size_flags( size: Size, typ: i32, usage_flags: UMatUsageFlags ) -> Result<UMat>
pub fn eye(rows: i32, cols: i32, typ: i32) -> Result<UMat>
pub fn eye_size(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§unsafe fn from_raw(ptr: <UMat as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <UMat as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <UMat as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <UMat as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(&mut self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <UMat as OpenCVTypeExternContainer>::ExternSendMut
source§impl ToInputArray for &UMat
impl ToInputArray for &UMat
fn input_array(&self) -> Result<BoxedRef<'_, _InputArray>>
source§impl ToInputArray for UMat
impl ToInputArray for UMat
fn input_array(&self) -> Result<BoxedRef<'_, _InputArray>>
source§impl ToInputOutputArray for &mut UMat
impl ToInputOutputArray for &mut UMat
fn input_output_array(&mut self) -> Result<BoxedRefMut<'_, _InputOutputArray>>
source§impl ToInputOutputArray for UMat
impl ToInputOutputArray for UMat
fn input_output_array(&mut self) -> Result<BoxedRefMut<'_, _InputOutputArray>>
source§impl ToOutputArray for &mut UMat
impl ToOutputArray for &mut UMat
fn output_array(&mut self) -> Result<BoxedRefMut<'_, _OutputArray>>
source§impl ToOutputArray for UMat
impl ToOutputArray for UMat
fn output_array(&mut self) -> Result<BoxedRefMut<'_, _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)
source§fn set_cols(&mut self, val: i32)
fn set_cols(&mut self, val: i32)
source§fn set_usage_flags(&mut self, val: UMatUsageFlags)
fn set_usage_flags(&mut self, val: UMatUsageFlags)
source§fn set_u(&mut self, val: &impl UMatDataTraitConst)
fn set_u(&mut self, val: &impl UMatDataTraitConst)
source§fn set_offset(&mut self, val: size_t)
fn set_offset(&mut self, val: size_t)
source§fn set_size(&mut self, val: MatSize)
fn set_size(&mut self, val: MatSize)
source§fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, UMat>>
fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, UMat>>
source§fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, UMat>>
fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, UMat>>
source§fn row_bounds_mut(
&mut self,
startrow: i32,
endrow: i32
) -> Result<BoxedRefMut<'_, UMat>>
fn row_bounds_mut( &mut self, startrow: i32, endrow: i32 ) -> Result<BoxedRefMut<'_, UMat>>
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>>
fn col_bounds_mut( &mut self, startcol: i32, endcol: i32 ) -> Result<BoxedRefMut<'_, UMat>>
fn col_range_mut( &mut self, r: &impl RangeTraitConst ) -> Result<BoxedRefMut<'_, UMat>>
source§fn diag_def_mut(&mut self) -> Result<BoxedRefMut<'_, UMat>>
fn diag_def_mut(&mut self) -> Result<BoxedRefMut<'_, UMat>>
source§fn diag_mut(&mut self, d: i32) -> Result<BoxedRefMut<'_, UMat>>
fn diag_mut(&mut self, d: i32) -> Result<BoxedRefMut<'_, UMat>>
source§fn set_to(
&mut self,
value: &impl ToInputArray,
mask: &impl ToInputArray
) -> Result<UMat>
fn set_to( &mut self, value: &impl ToInputArray, mask: &impl ToInputArray ) -> Result<UMat>
source§fn set_to_def(&mut self, value: &impl ToInputArray) -> Result<UMat>
fn set_to_def(&mut self, value: &impl ToInputArray) -> Result<UMat>
source§fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, UMat>>
fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, UMat>>
source§fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, UMat>>
fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, UMat>>
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<()>
unsafe fn create_rows_cols( &mut self, rows: i32, cols: i32, typ: i32, usage_flags: UMatUsageFlags ) -> Result<()>
source§fn create_rows_cols_def(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
fn create_rows_cols_def(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>
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<()>
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<()>
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<()>
source§unsafe fn addref(&mut self) -> Result<()>
unsafe fn addref(&mut self) -> Result<()>
source§fn deallocate(&mut self) -> Result<()>
fn deallocate(&mut self) -> Result<()>
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>
source§fn rowscols_mut(
&mut self,
row_range: impl RangeTrait,
col_range: impl RangeTrait
) -> Result<BoxedRefMut<'_, UMat>>
fn rowscols_mut( &mut self, row_range: impl RangeTrait, col_range: impl RangeTrait ) -> Result<BoxedRefMut<'_, UMat>>
fn roi_mut(&mut self, roi: Rect) -> Result<BoxedRefMut<'_, UMat>>
fn ranges_mut( &mut self, ranges: &Vector<Range> ) -> Result<BoxedRefMut<'_, UMat>>
fn set_1(&mut self, m: UMat) -> Result<()>
source§fn update_continuity_flag(&mut self) -> Result<()>
fn update_continuity_flag(&mut self) -> Result<()>
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
source§fn cols(&self) -> i32
fn cols(&self) -> i32
source§fn usage_flags(&self) -> UMatUsageFlags
fn usage_flags(&self) -> UMatUsageFlags
source§fn mat_step(&self) -> MatStep
fn mat_step(&self) -> MatStep
fn get_mat(&self, flags: AccessFlag) -> Result<Mat>
source§fn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>>
fn row(&self, y: i32) -> Result<BoxedRef<'_, UMat>>
source§fn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>>
fn col(&self, x: i32) -> Result<BoxedRef<'_, UMat>>
source§fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, UMat>>
fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, UMat>>
fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>
source§fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, UMat>>
fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, UMat>>
fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, UMat>>
source§fn diag(&self, d: i32) -> Result<BoxedRef<'_, UMat>>
fn diag(&self, d: i32) -> Result<BoxedRef<'_, UMat>>
source§fn diag_def(&self) -> Result<BoxedRef<'_, UMat>>
fn diag_def(&self) -> Result<BoxedRef<'_, UMat>>
source§fn copy_to_masked(
&self,
m: &mut impl ToOutputArray,
mask: &impl ToInputArray
) -> Result<()>
fn copy_to_masked( &self, m: &mut impl ToOutputArray, mask: &impl ToInputArray ) -> Result<()>
source§fn convert_to(
&self,
m: &mut impl ToOutputArray,
rtype: i32,
alpha: f64,
beta: f64
) -> Result<()>
fn convert_to( &self, m: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64 ) -> Result<()>
source§fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>
fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>
source§fn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()>
fn assign_to(&self, m: &mut impl UMatTrait, typ: i32) -> Result<()>
source§fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, UMat>>
fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, UMat>>
source§fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, UMat>>
fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, UMat>>
fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, UMat>>
source§fn inv(&self, method: i32) -> Result<UMat>
fn inv(&self, method: i32) -> Result<UMat>
source§fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<UMat>
fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<UMat>
source§fn mul_def(&self, m: &impl ToInputArray) -> Result<UMat>
fn mul_def(&self, m: &impl ToInputArray) -> Result<UMat>
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<()>
source§fn rowscols(
&self,
row_range: impl RangeTrait,
col_range: impl RangeTrait
) -> Result<BoxedRef<'_, UMat>>
fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait ) -> Result<BoxedRef<'_, UMat>>
fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, UMat>>
fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, UMat>>
source§fn is_continuous(&self) -> bool
fn is_continuous(&self) -> bool
source§fn is_submatrix(&self) -> bool
fn is_submatrix(&self) -> bool
source§fn elem_size1(&self) -> size_t
fn elem_size1(&self) -> size_t
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>
source§fn check_vector_def(&self, elem_channels: i32) -> Result<i32>
fn check_vector_def(&self, elem_channels: i32) -> Result<i32>
source§fn handle(&self, access_flags: AccessFlag) -> Result<*mut c_void>
fn handle(&self, access_flags: AccessFlag) -> Result<*mut c_void>
fn ndoffset(&self, ofs: &mut size_t) -> Result<()>
fn size(&self) -> Result<Size>
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> 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
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
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