class cv::MatConstIterator

Overview

#include <mat.hpp>

class MatConstIterator
{
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;

    // construction

    MatConstIterator();
    MatConstIterator(const Mat* _m);

    MatConstIterator(
        const Mat* _m,
        int _row,
        int _col = 0
        );

    MatConstIterator(
        const Mat* _m,
        Point _pt
        );

    MatConstIterator(
        const Mat* _m,
        const int* _idx
        );

    MatConstIterator(const MatConstIterator& it);

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

// direct descendants

template <typename _Tp>
class MatConstIterator_;

Detailed Documentation

Construction

MatConstIterator()

default constructor

MatConstIterator(const Mat* _m)

constructor that sets the iterator to the beginning of the matrix

MatConstIterator(
    const Mat* _m,
    int _row,
    int _col = 0
    )

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

MatConstIterator(
    const Mat* _m,
    Point _pt
    )

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

MatConstIterator(
    const Mat* _m,
    const int* _idx
    )

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

MatConstIterator(const MatConstIterator& it)

copy constructor

Methods

const uchar*
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 uchar*
operator[](ptrdiff_t i) const

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

Point
pos() const

returns the current iterator position

void
pos(int* _idx) const

returns the current iterator position