opencv::core

Struct Mat_

Source
pub struct Mat_<T> { /* private fields */ }
Expand description

docs.opencv.org

This struct is freely convertible into and from Mat using into and try_from methods. You might want to convert Mat to Mat_ before calling typed methods (like at, data_typed) when more performance is required because this way you will skip the data type checks.

Implementations§

Source§

impl<T: DataType> Mat_<T>

Source

pub fn into_untyped(self) -> Mat

Source

pub fn as_untyped(&self) -> &Mat

Source

pub fn as_raw_Mat_(&self) -> *const c_void

Source

pub fn as_raw_mut_Mat_(&mut self) -> *mut c_void

Source

pub fn at(&self, i0: i32) -> Result<&T>

See Mat::at

Source

pub fn at_2d(&self, row: i32, col: i32) -> Result<&T>

Source

pub fn at_3d(&self, i0: i32, i1: i32, i2: i32) -> Result<&T>

Source

pub fn at_nd(&self, idx: &[i32]) -> Result<&T>

Source

pub fn at_pt(&self, pt: Point) -> Result<&T>

Source

pub fn at_row(&self, row: i32) -> Result<&[T]>

See [Mat::at_row]

Source

pub fn at_mut(&mut self, i0: i32) -> Result<&mut T>

Source

pub fn at_2d_mut(&mut self, row: i32, col: i32) -> Result<&mut T>

Source

pub fn at_3d_mut(&mut self, i0: i32, i1: i32, i2: i32) -> Result<&mut T>

Source

pub fn at_nd_mut(&mut self, idx: &[i32]) -> Result<&mut T>

Source

pub fn at_pt_mut(&mut self, pt: Point) -> Result<&mut T>

Source

pub fn at_row_mut(&mut self, row: i32) -> Result<&mut [T]>

See [Mat::at_row_mut]

Source

pub fn data_typed(&self) -> Result<&[T]>

See [Mat::data_typed]

Source

pub fn data_typed_mut(&mut self) -> Result<&mut [T]>

See [Mat::data_typed_mut]

Trait Implementations§

Source§

impl<T> Boxed for Mat_<T>

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 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<T> Debug for Mat_<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: DataType> From<Mat_<T>> for Mat

Source§

fn from(s: Mat_<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> MatTrait for Mat_<T>

Source§

fn as_raw_mut_Mat(&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)

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Source§

fn set_cols(&mut self, val: i32)

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Source§

fn data_mut(&mut self) -> *mut u8

pointer to the data
Source§

unsafe fn set_data(&mut self, val: *const u8)

pointer to the data
Source§

fn u(&mut self) -> UMatData

interaction with UMat
Source§

fn set_u(&mut self, val: &impl UMatDataTraitConst)

interaction with UMat
Source§

fn set_size(&mut self, val: MatSize)

Source§

fn set_matexpr(&mut self, expr: &impl MatExprTraitConst) -> Result<()>

assignment operators Read more
Source§

fn row_mut(&mut self, y: i32) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified matrix row. Read more
Source§

fn col_mut(&mut self, x: i32) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified matrix column. Read more
Source§

fn row_bounds_mut( &mut self, startrow: i32, endrow: i32, ) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified row span. Read more
Source§

fn row_range_mut( &mut self, r: &impl RangeTraitConst, ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

fn col_bounds_mut( &mut self, startcol: i32, endcol: i32, ) -> Result<BoxedRefMut<'_, Mat>>

Creates a matrix header for the specified column span. Read more
Source§

fn col_range_mut( &mut self, r: &impl RangeTraitConst, ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

fn diag_def_mut(&mut self) -> Result<BoxedRefMut<'_, Mat>>

Extracts a diagonal from a matrix Read more
Source§

fn diag_mut(&mut self, d: i32) -> Result<BoxedRefMut<'_, Mat>>

Extracts a diagonal from a matrix Read more
Source§

fn set_scalar(&mut self, s: Scalar) -> Result<()>

Sets all or some of the array elements to the specified value. Read more
Source§

fn set_to( &mut self, value: &impl ToInputArray, mask: &impl ToInputArray, ) -> Result<Mat>

Sets all or some of the array elements to the specified value. Read more
Source§

fn set_to_def(&mut self, value: &impl ToInputArray) -> Result<Mat>

Sets all or some of the array elements to the specified value. Read more
Source§

fn reshape_def_mut(&mut self, cn: i32) -> Result<BoxedRefMut<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn reshape_mut(&mut self, cn: i32, rows: i32) -> Result<BoxedRefMut<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn reshape_nd_mut( &mut self, cn: i32, newsz: &[i32], ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

fn reshape_nd_vec_mut( &mut self, cn: i32, newshape: &Vector<i32>, ) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

unsafe fn create_rows_cols( &mut self, rows: i32, cols: i32, typ: i32, ) -> Result<()>

Allocates new array data if needed. Read more
Source§

unsafe fn create_size(&mut self, size: Size, typ: i32) -> Result<()>

Allocates new array data if needed. Read more
Source§

unsafe fn create_nd(&mut self, sizes: &[i32], typ: i32) -> Result<()>

Allocates new array data if needed. Read more
Source§

unsafe fn create_nd_vec(&mut self, sizes: &Vector<i32>, typ: i32) -> Result<()>

Allocates new array data if needed. Read more
Source§

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

Increments the reference counter. Read more
Source§

unsafe fn release(&mut self) -> Result<()>

Decrements the reference counter and deallocates the matrix if needed. Read more
Source§

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

internal use function, consider to use ‘release’ method instead; deallocates the matrix data
Source§

fn reserve(&mut self, sz: size_t) -> Result<()>

Reserves space for the certain number of rows. Read more
Source§

fn reserve_buffer(&mut self, sz: size_t) -> Result<()>

Reserves space for the certain number of bytes. Read more
Source§

fn resize(&mut self, sz: size_t) -> Result<()>

Changes the number of matrix rows. Read more
Source§

fn resize_with_default(&mut self, sz: size_t, s: Scalar) -> Result<()>

Changes the number of matrix rows. Read more
Source§

fn push_back(&mut self, m: &impl MatTraitConst) -> Result<()>

Adds elements to the bottom of the matrix. Read more
Source§

fn pop_back(&mut self, nelems: size_t) -> Result<()>

Removes elements from the bottom of the matrix. Read more
Source§

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

Removes elements from the bottom of the matrix. Read more
Source§

fn adjust_roi( &mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32, ) -> Result<Mat>

Adjusts a submatrix size and position within the parent matrix. Read more
Source§

fn rowscols_mut( &mut self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRefMut<'_, Mat>>

Extracts a rectangular submatrix. Read more
Source§

fn roi_mut(&mut self, roi: Rect) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

fn ranges_mut(&mut self, ranges: &Vector<Range>) -> Result<BoxedRefMut<'_, Mat>>

@overload Read more
Source§

fn ptr_mut(&mut self, i0: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_mut_def(&mut self) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_2d_mut(&mut self, row: i32, col: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_3d_mut(&mut self, i0: i32, i1: i32, i2: i32) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_nd_mut(&mut self, idx: &[i32]) -> Result<*mut u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn at_mut<T: DataType>(&mut self, i0: i32) -> Result<&mut T>

Returns a reference to the specified array element. Read more
Source§

fn at_2d_mut<T: DataType>(&mut self, row: i32, col: i32) -> Result<&mut T>

Returns a reference to the specified array element. Read more
Source§

fn at_3d_mut<T: DataType>( &mut self, i0: i32, i1: i32, i2: i32, ) -> Result<&mut T>

Returns a reference to the specified array element. Read more
Source§

fn at_nd_mut<T: DataType>(&mut self, idx: &[i32]) -> Result<&mut T>

Returns a reference to the specified array element. Read more
Source§

fn at_pt_mut<T: DataType>(&mut self, pt: Point) -> Result<&mut T>

Returns a reference to the specified array element. Read more
Source§

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

Source§

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

internal use method: updates the continuity flag
Source§

impl<T> MatTraitConst for Mat_<T>

Source§

fn as_raw_Mat(&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

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Source§

fn cols(&self) -> i32

the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Source§

fn data(&self) -> *const u8

pointer to the data
Source§

fn datastart(&self) -> *const u8

helper fields used in locateROI and adjustROI
Source§

fn dataend(&self) -> *const u8

Source§

fn datalimit(&self) -> *const u8

Source§

fn mat_size(&self) -> MatSize

Source§

fn mat_step(&self) -> MatStep

Source§

fn get_umat( &self, access_flags: AccessFlag, usage_flags: UMatUsageFlags, ) -> Result<UMat>

retrieve UMat from Mat Read more
Source§

fn get_umat_def(&self, access_flags: AccessFlag) -> Result<UMat>

retrieve UMat from Mat Read more
Source§

fn row(&self, y: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified matrix row. Read more
Source§

fn col(&self, x: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified matrix column. Read more
Source§

fn row_bounds(&self, startrow: i32, endrow: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified row span. Read more
Source§

fn row_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified row span. Read more
Source§

fn col_bounds(&self, startcol: i32, endcol: i32) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified column span. Read more
Source§

fn col_range(&self, r: &impl RangeTraitConst) -> Result<BoxedRef<'_, Mat>>

Creates a matrix header for the specified column span. Read more
Source§

fn diag(&self, d: i32) -> Result<BoxedRef<'_, Mat>>

Extracts a diagonal from a matrix Read more
Source§

fn diag_def(&self) -> Result<BoxedRef<'_, Mat>>

Extracts a diagonal from a matrix Read more
Source§

fn try_clone(&self) -> Result<Mat>

Creates a full copy of the array and the underlying data. Read more
Source§

fn copy_to(&self, m: &mut impl ToOutputArray) -> Result<()>

Copies the matrix to another one. Read more
Source§

fn copy_to_masked( &self, m: &mut impl ToOutputArray, mask: &impl ToInputArray, ) -> Result<()>

Copies the matrix to another one. Read more
Source§

fn convert_to( &self, m: &mut impl ToOutputArray, rtype: i32, alpha: f64, beta: f64, ) -> Result<()>

Converts an array to another data type with optional scaling. Read more
Source§

fn convert_to_def(&self, m: &mut impl ToOutputArray, rtype: i32) -> Result<()>

Converts an array to another data type with optional scaling. Read more
Source§

fn assign_to(&self, m: &mut impl MatTrait, typ: i32) -> Result<()>

Provides a functional form of convertTo. Read more
Source§

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

Provides a functional form of convertTo. Read more
Source§

fn reshape(&self, cn: i32, rows: i32) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn reshape_def(&self, cn: i32) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn reshape_nd(&self, cn: i32, newsz: &[i32]) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn reshape_nd_vec( &self, cn: i32, newshape: &Vector<i32>, ) -> Result<BoxedRef<'_, Mat>>

Changes the shape and/or the number of channels of a 2D matrix without copying the data. Read more
Source§

fn t(&self) -> Result<MatExpr>

Transposes a matrix. Read more
Source§

fn inv(&self, method: i32) -> Result<MatExpr>

Inverses a matrix. Read more
Source§

fn inv_def(&self) -> Result<MatExpr>

Inverses a matrix. Read more
Source§

fn mul(&self, m: &impl ToInputArray, scale: f64) -> Result<MatExpr>

Performs an element-wise multiplication or division of the two matrices. Read more
Source§

fn mul_def(&self, m: &impl ToInputArray) -> Result<MatExpr>

Performs an element-wise multiplication or division of the two matrices. Read more
Source§

fn cross(&self, m: &impl ToInputArray) -> Result<Mat>

Computes a cross-product of two 3-element vectors. Read more
Source§

fn dot(&self, m: &impl ToInputArray) -> Result<f64>

Computes a dot-product of two vectors. Read more
Source§

fn locate_roi(&self, whole_size: &mut Size, ofs: &mut Point) -> Result<()>

Locates the matrix header within a parent matrix. Read more
Source§

fn rowscols( &self, row_range: impl RangeTrait, col_range: impl RangeTrait, ) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
Source§

fn roi(&self, roi: Rect) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
Source§

fn ranges(&self, ranges: &Vector<Range>) -> Result<BoxedRef<'_, Mat>>

Extracts a rectangular submatrix. Read more
Source§

fn is_continuous(&self) -> bool

Reports whether the matrix is continuous or not. Read more
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 the matrix element size in bytes. Read more
Source§

fn elem_size1(&self) -> size_t

Returns the size of each matrix element channel in bytes. Read more
Source§

fn typ(&self) -> i32

Returns the type of a matrix element. Read more
Source§

fn depth(&self) -> i32

Returns the depth of a matrix element. Read more
Source§

fn channels(&self) -> i32

Returns the number of matrix channels. Read more
Source§

fn step1(&self, i: i32) -> Result<size_t>

Returns a normalized step. Read more
Source§

fn step1_def(&self) -> Result<size_t>

Returns a normalized step. Read more
Source§

fn empty(&self) -> bool

Returns true if the array has no elements. Read more
Source§

fn total(&self) -> size_t

Returns the total number of array elements. Read more
Source§

fn total_slice(&self, start_dim: i32, end_dim: i32) -> Result<size_t>

Returns the total number of array elements. Read more
Source§

fn total_slice_def(&self, start_dim: i32) -> Result<size_t>

Returns the total number of array elements. Read more
Source§

fn check_vector( &self, elem_channels: i32, depth: i32, require_continuous: bool, ) -> Result<i32>

Parameters Read more
Source§

fn check_vector_def(&self, elem_channels: i32) -> Result<i32>

Parameters Read more
Source§

fn ptr(&self, i0: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_def(&self) -> Result<*const u8>

@overload Read more
Source§

fn ptr_2d(&self, row: i32, col: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_3d(&self, i0: i32, i1: i32, i2: i32) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn ptr_nd(&self, idx: &[i32]) -> Result<*const u8>

Returns a pointer to the specified matrix row. Read more
Source§

fn at<T: DataType>(&self, i0: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
Source§

fn at_2d<T: DataType>(&self, row: i32, col: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
Source§

fn at_3d<T: DataType>(&self, i0: i32, i1: i32, i2: i32) -> Result<&T>

Returns a reference to the specified array element. Read more
Source§

fn at_nd<T: DataType>(&self, idx: &[i32]) -> Result<&T>

Returns a reference to the specified array element. Read more
Source§

fn at_pt<T: DataType>(&self, pt: Point) -> Result<&T>

Returns a reference to the specified array element. Read more
Source§

fn size(&self) -> Result<Size>

Source§

fn get_data_dump(&self) -> Result<String>

Return the dump of the Mat’s data
Source§

impl<T> ToInputArray for Mat_<T>

Source§

impl<T> ToInputOutputArray for Mat_<T>

Source§

impl<T> ToOutputArray for Mat_<T>

Source§

impl<T: DataType> TryFrom<Mat> for Mat_<T>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(mat: Mat) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<T> Freeze for Mat_<T>

§

impl<T> RefUnwindSafe for Mat_<T>
where T: RefUnwindSafe,

§

impl<T> Send for Mat_<T>
where T: Send,

§

impl<T> Sync for Mat_<T>
where T: Sync,

§

impl<T> Unpin for Mat_<T>
where T: Unpin,

§

impl<T> UnwindSafe for Mat_<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> MatTraitConstManual for T
where T: MatTraitConst + ?Sized,

Source§

unsafe fn at_unchecked<T: DataType>(&self, i0: i32) -> Result<&T>

Like Mat::at() but performs no bounds or type checks Read more
Source§

unsafe fn at_2d_unchecked<T: DataType>(&self, row: i32, col: i32) -> Result<&T>

Like Mat::at_2d() but performs no bounds or type checks Read more
Source§

unsafe fn at_pt_unchecked<T: DataType>(&self, pt: Point) -> Result<&T>

Like Mat::at_pt() but performs no bounds or type checks Read more
Source§

unsafe fn at_3d_unchecked<T: DataType>( &self, i0: i32, i1: i32, i2: i32, ) -> Result<&T>

Like Mat::at_3d() but performs no bounds or type checks Read more
Source§

unsafe fn at_nd_unchecked<T: DataType>(&self, idx: &[i32]) -> Result<&T>

Like Mat::at_nd() but performs no bounds or type checks Read more
Source§

fn at_row<T: DataType>(&self, row: i32) -> Result<&[T]>

Return a complete read-only row
Source§

unsafe fn at_row_unchecked<T: DataType>(&self, row: i32) -> Result<&[T]>

Like Mat::at_row() but performs no bounds or type checks Read more
Source§

fn is_allocated(&self) -> bool

Source§

fn data_bytes(&self) -> Result<&[u8]>

Returns underlying data array as byte slice, Mat must be continuous
Source§

fn data_typed<T: DataType>(&self) -> Result<&[T]>

Source§

unsafe fn data_typed_unchecked<T: DataType>(&self) -> Result<&[T]>

Safety Read more
Source§

fn to_vec_2d<T: DataType>(&self) -> Result<Vec<Vec<T>>>

Source§

fn iter<T: DataType>(&self) -> Result<MatIter<'_, T>>
where Self: Sized,

Returns an iterator over Mat elements and their positions
Source§

fn try_into_typed<T: DataType>(self) -> Result<Mat_<T>>
where Self: Sized, Mat_<T>: TryFrom<Self, Error = Error>,

Source§

impl<T> MatTraitManual for T
where T: MatTrait + ?Sized,

Source§

unsafe fn at_unchecked_mut<T: DataType>(&mut self, i0: i32) -> Result<&mut T>

Like Mat::at_mut() but performs no bounds or type checks Read more
Source§

unsafe fn at_2d_unchecked_mut<T: DataType>( &mut self, row: i32, col: i32, ) -> Result<&mut T>

Like Mat::at_2d_mut() but performs no bounds or type checks Read more
Source§

unsafe fn at_pt_unchecked_mut<T: DataType>( &mut self, pt: Point, ) -> Result<&mut T>

Like Mat::at_pt_mut() but performs no bounds or type checks Read more
Source§

unsafe fn at_3d_unchecked_mut<T: DataType>( &mut self, i0: i32, i1: i32, i2: i32, ) -> Result<&mut T>

Like Mat::at_3d_mut() but performs no bounds or type checks Read more
Source§

unsafe fn at_nd_unchecked_mut<T: DataType>( &mut self, idx: &[i32], ) -> Result<&mut T>

Like Mat::at_nd_mut() but performs no bounds or type checks Read more
Source§

fn at_row_mut<T: DataType>(&mut self, row: i32) -> Result<&mut [T]>

Return a complete writeable row
Source§

unsafe fn at_row_unchecked_mut<T: DataType>( &mut self, row: i32, ) -> Result<&mut [T]>

Like Mat::at_row_mut() but performs no bounds or type checks Read more
Source§

fn data_bytes_mut(&mut self) -> Result<&mut [u8]>

Returns underlying data array as mutable byte slice, Mat must be continuous.
Source§

fn data_typed_mut<T: DataType>(&mut self) -> Result<&mut [T]>

Source§

unsafe fn data_typed_unchecked_mut<T: DataType>(&mut self) -> Result<&mut [T]>

Safety Read more
Source§

fn iter_mut<T: DataType>(&mut self) -> Result<MatIterMut<'_, T>>
where Self: Sized,

Returns a mutable iterator over Mat elements and their positions
Source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a 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 unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.