class cv::SparseMatIterator

Overview

Read-write Sparse Matrix Iterator. Moreā€¦

#include <mat.hpp>

class SparseMatIterator: public cv::SparseMatConstIterator
{
public:
    // construction

    SparseMatIterator();
    SparseMatIterator(SparseMat* _m);

    SparseMatIterator(
        SparseMat* _m,
        const int* idx
        );

    SparseMatIterator(const SparseMatIterator& it);

    // methods

    SparseMat::Node*
    node() const;

    SparseMatIterator&
    operator++();

    SparseMatIterator
    operator++(int);

    SparseMatIterator&
    operator=(const SparseMatIterator& it);

    template <typename _Tp>
    _Tp&
    value() const;
};

Inherited Members

public:
    // fields

    size_t hashidx;
    const SparseMat* m;
    uchar* ptr;

    // methods

    const SparseMat::Node*
    node() const;

    SparseMatConstIterator&
    operator++();

    SparseMatConstIterator
    operator++(int);

    SparseMatConstIterator&
    operator--();

    SparseMatConstIterator
    operator--(int);

    SparseMatConstIterator&
    operator=(const SparseMatConstIterator& it);

    void
    seekEnd();

    template <typename _Tp>
    const _Tp&
    value() const;

Detailed Documentation

Read-write Sparse Matrix Iterator.

The class is similar to cv::SparseMatConstIterator, but can be used for in-place modification of the matrix elements.

Construction

SparseMatIterator()

the default constructor

SparseMatIterator(SparseMat* _m)

the full constructor setting the iterator to the first sparse matrix element

SparseMatIterator(
    SparseMat* _m,
    const int* idx
    )

the full constructor setting the iterator to the specified sparse matrix element

SparseMatIterator(const SparseMatIterator& it)

the copy constructor

Methods

SparseMat::Node*
node() const

returns pointer to the current sparse matrix node. it.node->idx is the index of the current element (do not modify it!)

SparseMatIterator&
operator++()

moves iterator to the next element

SparseMatIterator
operator++(int)

moves iterator to the next element

SparseMatIterator&
operator=(const SparseMatIterator& it)

the assignment operator

template <typename _Tp>
_Tp&
value() const

returns read-write reference to the current sparse matrix element