29 #if defined(ArrayImageIterator_RECURSES)
30 #error Recursive header files inclusion detected in ArrayImageIterator.h
33 #define ArrayImageIterator_RECURSES
35 #if !defined ArrayImageIterator_h
37 #define ArrayImageIterator_h
42 #include <type_traits>
43 #include <boost/iterator/iterator_facade.hpp>
44 #include <DGtal/kernel/domains/Linearizer.h>
73 typename TIterableClass
76 :
public boost::iterator_facade <
77 ArrayImageIterator<TIterableClass>,
78 typename TIterableClass::Value,
79 std::random_access_iterator_tag,
80 decltype( ((new TIterableClass))->dereference( TIterableClass::Point::diagonal(0), typename TIterableClass::Point::Coordinate(0) ) )
140 template <
typename TOtherIterableClass >
143 typename std::enable_if< std::is_convertible<TOtherIterableClass*, IterableClass*>::value >::type* = 0
150 template <
typename TOtherIterableClass >
153 typename std::enable_if< std::is_convertible<TOtherIterableClass*, IterableClass*>::value >::type* = 0
165 template < typename TOtherIterableClass >
166 typename std::enable_if<
167 std::is_convertible<TOtherIterableClass*,
IterableClass*>::value,
179 template < typename TOtherIterableClass >
180 typename std::enable_if<
181 std::is_convertible<TOtherIterableClass*,
IterableClass*>::value,
230 friend class
boost::iterator_core_access;
270 template <typename TIterableClass>
279 #include "DGtal/images/ArrayImageIterator.ih"
286 #undef ArrayImageIterator_RECURSES
Aim: Random access iterator over an image given his definition domain and viewable domain.
Point myViewExtent
Extent of the viewable domain.
ArrayImageIterator()
Default constructor.
bool equal(Self const &other) const
void selfDisplay(std::ostream &out) const
void decrement()
Decrement of one step.
Point const & getPoint() const noexcept
TIterableClass IterableClass
Iterable class type.
Point::Coordinate myFullIndex
Linearized index of the current point.
IterableClass * myIterableClassPtr
Pointer to the iterable class.
ArrayImageIterator(IterableClass *anIterableClassPtr, Domain const &aFullDomain, bool)
ArrayImageIterator(IterableClass *anIterableClassPtr, Domain const &aFullDomain, Domain const &aViewDomain, Point const &aPoint)
ArrayImageIterator(IterableClass *anIterableClassPtr, Domain const &aFullDomain)
std::ptrdiff_t distance_to(Point const &aPoint) const noexcept
ArrayImageIterator(IterableClass *anIterableClassPtr, Domain const &aFullDomain, Domain const &aViewDomain)
void increment()
Increment of one step.
typename Domain::Point Point
Point type.
Domain myFullDomain
Full domain of the image.
ArrayImageIterator(ArrayImageIterator< TOtherIterableClass > &&other, typename std::enable_if< std::is_convertible< TOtherIterableClass *, IterableClass * >::value >::type *=0) noexcept
ArrayImageIterator(IterableClass *anIterableClassPtr, Domain const &aFullDomain, Domain const &aViewDomain, bool)
Point myFullExtent
Extent of the full domain.
Reference dereference() const
Dereference.
Point myPoint
Current point where the iterator point to.
decltype(((new IterableClass) ->dereference(Point::diagonal(0), typename Point::Coordinate(0)))) Reference
Return type when dereferencing this iterator.
void advance(std::ptrdiff_t n)
Domain myViewDomain
Iterable (viewable) domain of the image.
typename IterableClass::Domain Domain
Domain type.
ArrayImageIterator(ArrayImageIterator< TOtherIterableClass > const &other, typename std::enable_if< std::is_convertible< TOtherIterableClass *, IterableClass * >::value >::type *=0)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Linearization and de-linearization interface for domains.
HyperRectDomain< Space > Domain