Trait opencv::core::prelude::SparseMatConstIteratorTrait [−][src]
pub trait SparseMatConstIteratorTrait { fn as_raw_SparseMatConstIterator(&self) -> *const c_void; fn as_raw_mut_SparseMatConstIterator(&mut self) -> *mut c_void; fn m(&self) -> SparseMat { ... } fn hashidx(&self) -> size_t { ... } fn set_hashidx(&mut self, val: size_t) { ... } fn ptr(&mut self) -> &mut u8 { ... } fn set_ptr(&mut self, val: &mut u8) { ... } fn node(&self) -> Result<SparseMat_Node> { ... } fn seek_end(&mut self) -> Result<()> { ... } }
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
Required methods
fn as_raw_SparseMatConstIterator(&self) -> *const c_void
fn as_raw_mut_SparseMatConstIterator(&mut self) -> *mut c_void
Provided methods
fn set_hashidx(&mut self, val: size_t)
fn node(&self) -> Result<SparseMat_Node>
fn node(&self) -> Result<SparseMat_Node>
returns the current node of the sparse matrix. it.node->idx is the current element index