#include "diplib.h"
dip::Image::View::Iterator class

View iterator, similar in functionality to dip::GenericImageIterator.

Constructors, destructors, assignment and conversion operators

Iterator()
Default constructor yields an invalid iterator that cannot be dereferenced, and is equivalent to an end iterator
Iterator(dip::Image::View const& view) explicit
To construct a useful iterator, provide a view
Iterator(dip::Image::View&& view) explicit
To construct a useful iterator, provide a view

Aliases

using iterator_category = std::forward_iterator_tag
Iterator category
using value_type = dip::Image::Pixel
The data type obtained when dereferencing the iterator
using reference = dip::Image::View::Iterator::value_type
The type of a reference to a pixel
using pointer = dip::Image::View::Iterator::value_type*
The type of a pointer to a pixel

Functions

auto begin() const -> value_type::Iterator
Get an iterator over the tensor for the current pixel, it.begin() is equal to (*it).begin().
auto end() const -> value_type::Iterator
Get an end iterator over the tensor for the current pixel
auto IsAtEnd() const -> bool
Test to see if the iterator reached past the last pixel
auto Pointer() const -> void*
Return the current pointer
auto Pointer(dip::uint index) const -> void*
Return a pointer to the tensor element index
auto Offset() const -> dip::sint
Return the current offset
auto Position() const -> dip::uint
Return the current position within the view (i.e. how many times we’ve advanced the iterator)
void Reset()
Reset the iterator to the first pixel in the image (as it was when first created)

Operators

auto operator*() const -> dip::Image::View::Iterator::value_type
Dereference
auto operator->() const -> dip::Image::View::Iterator::value_type
Dereference
auto operator[](dip::uint index) const -> dip::Image::Sample
Index into tensor, it[index] is equal to (*it)[index].
auto operator++() -> dip::Image::View::Iterator&
Pre-increment
auto operator==(dip::Image::View::Iterator const& other) const -> bool
Equality comparison, is equal if the two iterators have the same position.
auto operator!=(dip::Image::View::Iterator const& other) const -> bool
Inequality comparison
auto operator bool() const -> bool explicit
Test to see if the iterator is still pointing at a pixel