Trait opencv::prelude::SparseMatTraitConst  
source · pub trait SparseMatTraitConst {
Show 24 methods
    // Required method
    fn as_raw_SparseMat(&self) -> *const c_void;
    // Provided methods
    fn flags(&self) -> i32 { ... }
    fn try_clone(&self) -> Result<SparseMat> { ... }
    fn copy_to(&self, m: &mut SparseMat) -> Result<()> { ... }
    fn copy_to_mat(&self, m: &mut Mat) -> Result<()> { ... }
    fn convert_to(
        &self,
        m: &mut SparseMat,
        rtype: i32,
        alpha: f64
    ) -> Result<()> { ... }
    fn convert_to_1(
        &self,
        m: &mut Mat,
        rtype: i32,
        alpha: f64,
        beta: f64
    ) -> Result<()> { ... }
    fn assign_to(&self, m: &mut SparseMat, typ: i32) -> Result<()> { ... }
    fn elem_size(&self) -> size_t { ... }
    fn elem_size1(&self) -> size_t { ... }
    fn typ(&self) -> i32 { ... }
    fn depth(&self) -> i32 { ... }
    fn channels(&self) -> i32 { ... }
    fn size(&self) -> Result<*const i32> { ... }
    fn size_1(&self, i: i32) -> Result<i32> { ... }
    fn dims(&self) -> Result<i32> { ... }
    fn nzcount(&self) -> Result<size_t> { ... }
    fn hash(&self, i0: i32) -> Result<size_t> { ... }
    fn hash_1(&self, i0: i32, i1: i32) -> Result<size_t> { ... }
    fn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t> { ... }
    fn hash_3(&self, idx: &i32) -> Result<size_t> { ... }
    fn begin(&self) -> Result<SparseMatConstIterator> { ... }
    fn end(&self) -> Result<SparseMatConstIterator> { ... }
    fn node(&self, nidx: size_t) -> Result<SparseMat_Node> { ... }
}Expand description
Constant methods for core::SparseMat
Required Methods§
fn as_raw_SparseMat(&self) -> *const c_void
Provided Methods§
fn flags(&self) -> i32
sourcefn copy_to(&self, m: &mut SparseMat) -> Result<()>
 
fn copy_to(&self, m: &mut SparseMat) -> Result<()>
copies all the data to the destination matrix. All the previous content of m is erased
sourcefn copy_to_mat(&self, m: &mut Mat) -> Result<()>
 
fn copy_to_mat(&self, m: &mut Mat) -> Result<()>
converts sparse matrix to dense matrix.
sourcefn convert_to(&self, m: &mut SparseMat, rtype: i32, alpha: f64) -> Result<()>
 
fn convert_to(&self, m: &mut SparseMat, rtype: i32, alpha: f64) -> Result<()>
multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type
C++ default parameters
- alpha: 1
sourcefn convert_to_1(
    &self,
    m: &mut Mat,
    rtype: i32,
    alpha: f64,
    beta: f64
) -> Result<()>
 
fn convert_to_1( &self, m: &mut Mat, rtype: i32, alpha: f64, beta: f64 ) -> Result<()>
converts sparse matrix to dense n-dim matrix with optional type conversion and scaling.
Parameters
- m:[out] - output matrix; if it does not have a proper size or type before the operation, it is reallocated
- rtype: - desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.
- alpha: - optional scale factor
- beta: - optional delta added to the scaled values
C++ default parameters
- alpha: 1
- beta: 0
sourcefn elem_size(&self) -> size_t
 
fn elem_size(&self) -> size_t
returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements)
sourcefn elem_size1(&self) -> size_t
 
fn elem_size1(&self) -> size_t
returns elemSize()/channels()
sourcefn size(&self) -> Result<*const i32>
 
fn size(&self) -> Result<*const i32>
returns the array of sizes, or NULL if the matrix is not allocated
sourcefn nzcount(&self) -> Result<size_t>
 
fn nzcount(&self) -> Result<size_t>
returns the number of non-zero elements (=the number of hash table nodes)
sourcefn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t>
 
fn hash_2(&self, i0: i32, i1: i32, i2: i32) -> Result<size_t>
computes the element hash value (3D case)
sourcefn begin(&self) -> Result<SparseMatConstIterator>
 
fn begin(&self) -> Result<SparseMatConstIterator>
returns the read-only sparse matrix iterator at the matrix beginning
sourcefn end(&self) -> Result<SparseMatConstIterator>
 
fn end(&self) -> Result<SparseMatConstIterator>
returns the read-only sparse matrix iterator at the matrix end