#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 pointer = dip::Image::View::Iterator::value_type*
The type of a pointer to a pixel
using reference = dip::Image::View::Iterator::value_type
The type of a reference to a pixel
using value_type = dip::Image::Pixel
The data type obtained when dereferencing the iterator

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 Offset() const -> dip::sint
Return the current offset
auto Pointer() const -> void*
Return the current pointer
auto Pointer(dip::uint index) const -> void*
Return a pointer to the tensor element index
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 bool() const -> bool explicit
Test to see if the iterator is still pointing at a pixel
auto operator!=(dip::Image::View::Iterator const& other) const -> bool
Inequality comparison
auto operator*() const -> dip::Image::View::Iterator::value_type
Dereference
auto operator++() -> dip::Image::View::Iterator&
Pre-increment
auto operator->() const -> dip::Image::View::Iterator::value_type
Dereference
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::uint index) const -> dip::Image::Sample
Index into tensor, it[index] is equal to (*it)[index].

Alias documentation

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

Function documentation

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

value_type::Iterator begin( ) const

Get an iterator over the tensor for the current pixel, it.begin() is equal to (*it).begin().

value_type::Iterator end( ) const

Get an end iterator over the tensor for the current pixel

bool IsAtEnd( ) const

Test to see if the iterator reached past the last pixel

void* Pointer( ) const

Return the current pointer

void* Pointer( dip::uint index) const

Return a pointer to the tensor element index

dip::sint Offset( ) const

Return the current offset

dip::uint Position( ) const

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)

dip::Image::Sample operator[]( dip::uint index) const

Index into tensor, it[index] is equal to (*it)[index].

bool operator==( dip::Image::View::Iterator const& other) const

Equality comparison, is equal if the two iterators have the same position.

bool operator!=( dip::Image::View::Iterator const& other) const

Inequality comparison

bool operator bool( ) const explicit

Test to see if the iterator is still pointing at a pixel