template class cv::MatIterator_

Overview

Matrix read-write iterator. Moreā€¦

#include <mat.hpp>

template <typename _Tp>
class MatIterator_: public cv::MatConstIterator_
{
public:
    // typedefs

    typedef std::random_access_iterator_tag iterator_category;
    typedef _Tp* pointer;
    typedef _Tp& reference;

    // construction

    MatIterator_();
    MatIterator_(Mat_<_Tp>* _m);

    MatIterator_(
        Mat_<_Tp>* _m,
        int _row,
        int _col = 0
        );

    MatIterator_(
        Mat_<_Tp>* _m,
        Point _pt
        );

    MatIterator_(
        Mat_<_Tp>* _m,
        const int* _idx
        );

    MatIterator_(const MatIterator_& it);

    // methods

    _Tp&
    operator*() const;

    MatIterator_&
    operator++();

    MatIterator_
    operator++(int);

    MatIterator_&
    operator+=(ptrdiff_t ofs);

    MatIterator_&
    operator--();

    MatIterator_
    operator--(int);

    MatIterator_&
    operator-=(ptrdiff_t ofs);

    MatIterator_&
    operator=(const MatIterator_<_Tp>& it);

    _Tp&
    operator[](ptrdiff_t i) const;
};

Inherited Members

public:
    // typedefs

    typedef ptrdiff_t difference_type;
    typedef std::random_access_iterator_tag iterator_category;
    typedef const uchar** pointer;
    typedef uchar* reference;
    typedef uchar* value_type;
    typedef ptrdiff_t difference_type;
    typedef std::random_access_iterator_tag iterator_category;
    typedef const _Tp* pointer;
    typedef const _Tp& reference;
    typedef _Tp value_type;

    // fields

    size_t elemSize;
    const Mat* m;
    const uchar* ptr;
    const uchar* sliceEnd;
    const uchar* sliceStart;

    // methods

    ptrdiff_t
    lpos() const;

    const uchar*
    operator*() const;

    MatConstIterator&
    operator++();

    MatConstIterator
    operator++(int);

    MatConstIterator&
    operator+=(ptrdiff_t ofs);

    MatConstIterator&
    operator--();

    MatConstIterator
    operator--(int);

    MatConstIterator&
    operator-=(ptrdiff_t ofs);

    MatConstIterator&
    operator=(const MatConstIterator& it);

    const uchar*
    operator[](ptrdiff_t i) const;

    Point
    pos() const;

    void
    pos(int* _idx) const;

    void
    seek(
        ptrdiff_t ofs,
        bool relative = false
        );

    void
    seek(
        const int* _idx,
        bool relative = false
        );

    const _Tp&
    operator*() const;

    MatConstIterator_&
    operator++();

    MatConstIterator_
    operator++(int);

    MatConstIterator_&
    operator+=(ptrdiff_t ofs);

    MatConstIterator_&
    operator--();

    MatConstIterator_
    operator--(int);

    MatConstIterator_&
    operator-=(ptrdiff_t ofs);

    MatConstIterator_&
    operator=(const MatConstIterator_& it);

    const _Tp&
    operator[](ptrdiff_t i) const;

    Point
    pos() const;

Detailed Documentation

Matrix read-write iterator.

Construction

MatIterator_()

the default constructor

MatIterator_(Mat_<_Tp>* _m)

constructor that sets the iterator to the beginning of the matrix

MatIterator_(
    Mat_<_Tp>* _m,
    int _row,
    int _col = 0
    )

constructor that sets the iterator to the specified element of the matrix

MatIterator_(
    Mat_<_Tp>* _m,
    Point _pt
    )

constructor that sets the iterator to the specified element of the matrix

MatIterator_(
    Mat_<_Tp>* _m,
    const int* _idx
    )

constructor that sets the iterator to the specified element of the matrix

MatIterator_(const MatIterator_& it)

copy constructor

Methods

_Tp&
operator*() const

returns the current matrix element

MatIterator_&
operator++()

increments the iterator

MatIterator_
operator++(int)

increments the iterator

MatIterator_&
operator+=(ptrdiff_t ofs)

shifts the iterator forward by the specified number of elements

MatIterator_&
operator--()

decrements the iterator

MatIterator_
operator--(int)

decrements the iterator

MatIterator_&
operator-=(ptrdiff_t ofs)

shifts the iterator backward by the specified number of elements

MatIterator_&
operator=(const MatIterator_<_Tp>& it)

copy operator

_Tp&
operator[](ptrdiff_t i) const

returns the i-th matrix element, relative to the current