OTB  9.0.0
Orfeo Toolbox
Classes | List of all members
otb::internals::ZipIterator< TImageIterator, ConstOrMutable > Class Template Reference

#include <otbZipIterator.h>

+ Collaboration diagram for otb::internals::ZipIterator< TImageIterator, ConstOrMutable >:

Classes

struct  PixelListProxy
 

Public Member Functions

Constructions & Destruction
 This class follows the rule of 0/5
 ZipIterator ()=default
 
 ~ZipIterator ()=default
 
 ZipIterator (ZipIterator const &)=default
 
 ZipIterator (ZipIterator &&)=default
 
ZipIteratoroperator= (ZipIterator const &)=default
 
ZipIteratoroperator= (ZipIterator &&)=default
 
template<bool IsConst_ = std::is_same<ConstOrMutable, ConstTag>::value, class = std::enable_if<IsConst_>>
 ZipIterator (ZipIterator< ImageIteratorType, MutableTag > const &rhs)
 
template<bool IsConst_ = std::is_same<ConstOrMutable, ConstTag>::value, class = std::enable_if<IsConst_>>
 ZipIterator (ZipIterator< ImageIteratorType, MutableTag > &&rhs)
 
 ZipIterator (Span< ImageType *const > images, RegionType const &region)
 
Mutable Iterator Interface
template<typename MultiCompPixelType >
void Set (MultiCompPixelType const &p)
 

Friends

Comparison
bool operator== (ZipIterator const &lhs, ZipIterator const &rhs)
 
bool operator!= (ZipIterator const &lhs, ZipIterator const &rhs)
 
bool operator<= (ZipIterator const &lhs, ZipIterator const &rhs)
 
bool operator< (ZipIterator const &lhs, ZipIterator const &rhs)
 
bool operator>= (ZipIterator const &lhs, ZipIterator const &rhs)
 
bool operator> (ZipIterator const &lhs, ZipIterator const &rhs)
 

ITK Constants and Typedefs

using ImageIteratorType = TImageIterator
 
using ImageType = typename TImageIterator::ImageType
 
using Self = ZipIterator
 
using IndexType = typename ImageIteratorType::IndexType
 
using SizeType = typename ImageIteratorType::SizeType
 
using OffsetType = typename ImageIteratorType::OffsetType
 
using RegionType = typename ImageIteratorType::RegionType
 
using PixelContainer = typename ImageIteratorType::PixelContainer
 
using PixelContainerPointer = typename PixelContainer::Pointer
 
using InternalPixelType = typename ImageIteratorType::InternalPixelType
 
using PixelType = typename ImageIteratorType::PixelType
 
using AccessorType = typename ImageIteratorType::AccessorType
 
using AccessorFunctorType = typename ImageIteratorType::AccessorFunctorType
 
static constexpr unsigned int ImageIteratorDimension = ImageIteratorType::ImageIteratorDimension
 
 itkTypeMacroNoParent (ZipIterator)
 

ITK iterator interface

using ImageIteratorList_t = std::vector< ImageIteratorType >
 
auto const & GetRegion () const
 
void SetRegion (RegionType const &region)
 
SelfGoToBegin ()
 
SelfGoToEnd ()
 
bool IsAtBegin () const
 
bool IsAtEnd () const
 
Selfoperator++ ()
 
Self operator++ (int)=delete
 
PixelListProxy Get () const
 

ScanLine Iterator Interface

ImageIteratorList_t m_iterators
 
SelfNextLine ()
 
SelfGoToBeginOfLine ()
 
SelfGoToEndOfLine ()
 
bool IsAtEndOfLine () const
 

Detailed Description

template<typename TImageIterator, typename ConstOrMutable>
class otb::internals::ZipIterator< TImageIterator, ConstOrMutable >

Wrapper to present list of iterators as a single iterator.

Invariant
This class shall not be inherited.
All sub iterators are always synchronised (same region, size...)
!m_iterators.empty()
Author
Luc Hermitte (CS Group)

Definition at line 47 of file otbZipIterator.h.

Member Typedef Documentation

◆ AccessorFunctorType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::AccessorFunctorType = typename ImageIteratorType::AccessorFunctorType

Iterator type for zipped iterators.

Definition at line 98 of file otbZipIterator.h.

◆ AccessorType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::AccessorType = typename ImageIteratorType::AccessorType

Accessor type that convert data between internal and external representations.

Definition at line 97 of file otbZipIterator.h.

◆ ImageIteratorList_t

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ImageIteratorList_t = std::vector<ImageIteratorType>

Internal typedef to the type holding the list of ITK iterators.

Definition at line 250 of file otbZipIterator.h.

◆ ImageIteratorType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ImageIteratorType = TImageIterator

Iterator type for zipped iterators.

Definition at line 55 of file otbZipIterator.h.

◆ ImageType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ImageType = typename TImageIterator::ImageType

Image type alias support

Definition at line 58 of file otbZipIterator.h.

◆ IndexType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::IndexType = typename ImageIteratorType::IndexType

Index type alias support

Definition at line 72 of file otbZipIterator.h.

◆ InternalPixelType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::InternalPixelType = typename ImageIteratorType::InternalPixelType

Internal Pixel Type

Definition at line 90 of file otbZipIterator.h.

◆ OffsetType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::OffsetType = typename ImageIteratorType::OffsetType

Offset type alias support

Definition at line 78 of file otbZipIterator.h.

◆ PixelContainer

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::PixelContainer = typename ImageIteratorType::PixelContainer

PixelContainer type alias support. Used to refer to the container for the pixel data. While this was already typdef'ed in the superclass it needs to be redone here for this subclass to compile properly with gcc.

Definition at line 86 of file otbZipIterator.h.

◆ PixelContainerPointer

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::PixelContainerPointer = typename PixelContainer::Pointer

Iterator type for zipped iterators.

Definition at line 87 of file otbZipIterator.h.

◆ PixelType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::PixelType = typename ImageIteratorType::PixelType

External Pixel Type

Definition at line 93 of file otbZipIterator.h.

◆ RegionType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::RegionType = typename ImageIteratorType::RegionType

Region type alias support

Definition at line 81 of file otbZipIterator.h.

◆ Self

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::Self = ZipIterator

Iterator type for zipped iterators.

Definition at line 66 of file otbZipIterator.h.

◆ SizeType

template<typename TImageIterator , typename ConstOrMutable >
using otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::SizeType = typename ImageIteratorType::SizeType

Size type alias support

Definition at line 75 of file otbZipIterator.h.

Constructor & Destructor Documentation

◆ ZipIterator() [1/6]

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ ~ZipIterator()

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::~ZipIterator ( )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ ZipIterator() [2/6]

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( ZipIterator< TImageIterator, ConstOrMutable > const &  )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ ZipIterator() [3/6]

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( ZipIterator< TImageIterator, ConstOrMutable > &&  )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ ZipIterator() [4/6]

template<typename TImageIterator , typename ConstOrMutable >
template<bool IsConst_ = std::is_same<ConstOrMutable, ConstTag>::value, class = std::enable_if<IsConst_>>
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( ZipIterator< ImageIteratorType, MutableTag > const &  rhs)
inline

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

Definition at line 119 of file otbZipIterator.h.

◆ ZipIterator() [5/6]

template<typename TImageIterator , typename ConstOrMutable >
template<bool IsConst_ = std::is_same<ConstOrMutable, ConstTag>::value, class = std::enable_if<IsConst_>>
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( ZipIterator< ImageIteratorType, MutableTag > &&  rhs)
inline

Conversion move constructor. Move converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

Definition at line 128 of file otbZipIterator.h.

◆ ZipIterator() [6/6]

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ZipIterator ( Span< ImageType *const >  images,
RegionType const &  region 
)
inline

Init Constructor. Constructs a ZipIterator from a list of Images and a Region.

Parameters
[in,out]imagesList of images
[in]regionRegion to iterate over
Precondition
There should be at least one image

Definition at line 139 of file otbZipIterator.h.

References otb::Span< T >::empty(), otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators, and otb::Span< T >::size().

Member Function Documentation

◆ Get()

template<typename TImageIterator , typename ConstOrMutable >
PixelListProxy otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::Get ( ) const
inline

Fetches the value of the current pixel.

Returns
an iterable proxy over the pixel made of all images.

Definition at line 351 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

◆ GetRegion()

template<typename TImageIterator , typename ConstOrMutable >
auto const& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::GetRegion ( ) const
inline

Fetch the region iterated by the iterator.

Definition at line 191 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

◆ GoToBegin()

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::GoToBegin ( )
inline

◆ GoToBeginOfLine()

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::GoToBeginOfLine ( )
inline

◆ GoToEnd()

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::GoToEnd ( )
inline

◆ GoToEndOfLine()

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::GoToEndOfLine ( )
inline

◆ IsAtBegin()

template<typename TImageIterator , typename ConstOrMutable >
bool otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::IsAtBegin ( ) const
inline

Tells whether the iterator is at the begin of the region iterated.

Definition at line 221 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

◆ IsAtEnd()

template<typename TImageIterator , typename ConstOrMutable >
bool otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::IsAtEnd ( ) const
inline

Tells the iterator is at the end of the region iterated.

Definition at line 228 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

Referenced by otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::operator++().

◆ IsAtEndOfLine()

template<typename TImageIterator , typename ConstOrMutable >
bool otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::IsAtEndOfLine ( ) const
inline

Tells whether the iterator is a the end of a line.

Precondition
!m_iterators.empty()

Definition at line 402 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

◆ itkTypeMacroNoParent()

template<typename TImageIterator , typename ConstOrMutable >
otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::itkTypeMacroNoParent ( ZipIterator< TImageIterator, ConstOrMutable >  )

Run-time type information (and related methods).

◆ NextLine()

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::NextLine ( )
inline

◆ operator++() [1/2]

template<typename TImageIterator , typename ConstOrMutable >
Self& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::operator++ ( )
inline

Pre-increment the iterator. As post-increment is less efficient, it hasn't been provided.

Definition at line 237 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::IsAtEnd(), and otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

◆ operator++() [2/2]

template<typename TImageIterator , typename ConstOrMutable >
Self otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::operator++ ( int  )
delete

Removed post-increment operator. Please use the preincrement operator!

◆ operator=() [1/2]

template<typename TImageIterator , typename ConstOrMutable >
ZipIterator& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::operator= ( ZipIterator< TImageIterator, ConstOrMutable > &&  )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ operator=() [2/2]

template<typename TImageIterator , typename ConstOrMutable >
ZipIterator& otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::operator= ( ZipIterator< TImageIterator, ConstOrMutable > const &  )
default

Conversion constructor. Converts from mutable to const iterator

See also
https://quuxplusone.github.io/blog/2018/12/01/const-iterator-antipatterns/

◆ Set()

template<typename TImageIterator , typename ConstOrMutable >
template<typename MultiCompPixelType >
void otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::Set ( MultiCompPixelType const &  p)
inline

◆ SetRegion()

template<typename TImageIterator , typename ConstOrMutable >
void otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::SetRegion ( RegionType const &  region)
inline

Set the region iterated by the iterator.

Definition at line 199 of file otbZipIterator.h.

References otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators.

Friends And Related Function Documentation

◆ operator!=

template<typename TImageIterator , typename ConstOrMutable >
bool operator!= ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 163 of file otbZipIterator.h.

◆ operator<

template<typename TImageIterator , typename ConstOrMutable >
bool operator< ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 173 of file otbZipIterator.h.

◆ operator<=

template<typename TImageIterator , typename ConstOrMutable >
bool operator<= ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 166 of file otbZipIterator.h.

◆ operator==

template<typename TImageIterator , typename ConstOrMutable >
bool operator== ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 155 of file otbZipIterator.h.

◆ operator>

template<typename TImageIterator , typename ConstOrMutable >
bool operator> ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 182 of file otbZipIterator.h.

◆ operator>=

template<typename TImageIterator , typename ConstOrMutable >
bool operator>= ( ZipIterator< TImageIterator, ConstOrMutable > const &  lhs,
ZipIterator< TImageIterator, ConstOrMutable > const &  rhs 
)
friend

Definition at line 180 of file otbZipIterator.h.

Member Data Documentation

◆ ImageIteratorDimension

template<typename TImageIterator , typename ConstOrMutable >
constexpr unsigned int otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::ImageIteratorDimension = ImageIteratorType::ImageIteratorDimension
staticconstexpr

Dimension of the image the iterator walks. This constant is needed so functions that are templated over image iterator type (as opposed to being templated over pixel type and dimension) can have compile time access to the dimension of the image that the iterator walks.

Definition at line 64 of file otbZipIterator.h.

◆ m_iterators

template<typename TImageIterator , typename ConstOrMutable >
ImageIteratorList_t otb::internals::ZipIterator< TImageIterator, ConstOrMutable >::m_iterators
private

The documentation for this class was generated from the following file: