template class cv::MatConstIterator_

Overview

Matrix read-only iterator. Moreā€¦

#include <mat.hpp>

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

    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;

    // construction

    MatConstIterator_();
    MatConstIterator_(const Mat_<_Tp>* _m);

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

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

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

    MatConstIterator_(const MatConstIterator_& it);

    // methods

    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;
};

// direct descendants

template <typename _Tp>
class MatIterator_;

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;

    // 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
        );

Detailed Documentation

Matrix read-only iterator.

Construction

MatConstIterator_()

default constructor

MatConstIterator_(const Mat_<_Tp>* _m)

constructor that sets the iterator to the beginning of the matrix

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

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

MatConstIterator_(
    const Mat_<_Tp>* _m,
    Point _pt
    )

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

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

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

MatConstIterator_(const MatConstIterator_& it)

copy constructor

Methods

const _Tp&
operator*() const

returns the current matrix element

MatConstIterator_&
operator++()

increments the iterator

MatConstIterator_
operator++(int)

increments the iterator

MatConstIterator_&
operator+=(ptrdiff_t ofs)

shifts the iterator forward by the specified number of elements

MatConstIterator_&
operator--()

decrements the iterator

MatConstIterator_
operator--(int)

decrements the iterator

MatConstIterator_&
operator-=(ptrdiff_t ofs)

shifts the iterator backward by the specified number of elements

MatConstIterator_&
operator=(const MatConstIterator_& it)

copy operator

const _Tp&
operator[](ptrdiff_t i) const

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

Point
pos() const

returns the current iterator position