Struct opencv::core::SparseMatConstIterator
source · pub struct SparseMatConstIterator { /* private fields */ }
Expand description
Read-Only Sparse Matrix Iterator.
Here is how to use the iterator to compute the sum of floating-point sparse matrix elements:
\code
SparseMatConstIterator it = m.begin(), it_end = m.end();
double s = 0;
CV_Assert( m.type() == CV_32F );
for( ; it != it_end; ++it )
s += it.value
Implementations§
source§impl SparseMatConstIterator
impl SparseMatConstIterator
sourcepub fn default() -> Result<SparseMatConstIterator>
pub fn default() -> Result<SparseMatConstIterator>
the default constructor
sourcepub fn new(_m: &impl SparseMatTraitConst) -> Result<SparseMatConstIterator>
pub fn new(_m: &impl SparseMatTraitConst) -> Result<SparseMatConstIterator>
the full constructor setting the iterator to the first sparse matrix element
sourcepub fn copy(
it: &impl SparseMatConstIteratorTraitConst
) -> Result<SparseMatConstIterator>
pub fn copy( it: &impl SparseMatConstIteratorTraitConst ) -> Result<SparseMatConstIterator>
the copy constructor
Trait Implementations§
source§impl Boxed for SparseMatConstIterator
impl Boxed for SparseMatConstIterator
source§unsafe fn from_raw(
ptr: <SparseMatConstIterator as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <SparseMatConstIterator as OpenCVFromExtern>::ExternReceive ) -> Self
Wrap the specified raw pointer Read more
source§fn into_raw(
self
) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self ) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
source§fn as_raw(
&self
) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSend
fn as_raw( &self ) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
source§fn as_raw_mut(
&mut self
) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <SparseMatConstIterator as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
source§impl Debug for SparseMatConstIterator
impl Debug for SparseMatConstIterator
source§impl Drop for SparseMatConstIterator
impl Drop for SparseMatConstIterator
source§impl From<SparseMatIterator> for SparseMatConstIterator
impl From<SparseMatIterator> for SparseMatConstIterator
source§fn from(s: SparseMatIterator) -> Self
fn from(s: SparseMatIterator) -> Self
Converts to this type from the input type.
source§impl SparseMatConstIteratorTrait for SparseMatConstIterator
impl SparseMatConstIteratorTrait for SparseMatConstIterator
fn as_raw_mut_SparseMatConstIterator(&mut self) -> *mut c_void
fn set_hashidx(&mut self, val: size_t)
fn ptr_mut(&mut self) -> *mut u8
unsafe fn set_ptr(&mut self, val: *const u8)
source§fn set(&mut self, it: &impl SparseMatConstIteratorTraitConst) -> Result<()>
fn set(&mut self, it: &impl SparseMatConstIteratorTraitConst) -> Result<()>
the assignment operator
source§fn incr(&mut self) -> Result<SparseMatConstIterator>
fn incr(&mut self) -> Result<SparseMatConstIterator>
moves iterator to the next element
impl Send for SparseMatConstIterator
Auto Trait Implementations§
impl Freeze for SparseMatConstIterator
impl RefUnwindSafe for SparseMatConstIterator
impl !Sync for SparseMatConstIterator
impl Unpin for SparseMatConstIterator
impl UnwindSafe for SparseMatConstIterator
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
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
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 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