OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType > Class Template Reference

#include <otbMaskedIteratorDecorator.h>

Public Types

typedef TIteratorType::ImageType ImageType
 
typedef ImageType::IndexType IndexType
 
typedef MaskType::PixelType MaskPixelType
 
typedef TMaskIteratorType::ImageType MaskType
 
typedef ImageType::PixelType PixelType
 
typedef ImageType::RegionType RegionType
 
typedef MaskedIteratorDecorator< TIteratorType, TMaskIteratorType > Self
 

Public Member Functions

TIteratorType & GetImageIterator ()
 
const TIteratorType & GetImageIterator () const
 
IndexType GetIndex () const
 
TMaskIteratorType & GetMaskIterator ()
 
const TMaskIteratorType & GetMaskIterator () const
 
void GoToBegin ()
 
void GoToEnd ()
 
const bool & HasMask () const
 
bool IsAtBegin () const
 
bool IsAtEnd () const
 
 itkTypeMacroNoParent (MaskedIteratorDecorator)
 
 MaskedIteratorDecorator (MaskType *mask, ImageType *image, const RegionType &region)
 
Selfoperator++ ()
 
Selfoperator-- ()
 
const PixelTypeValue (void) const
 

Private Member Functions

void ComputeMaskedBegin ()
 

Private Attributes

TIteratorType m_ItImage
 
TMaskIteratorType m_ItMask
 
TIteratorType m_StartImage
 
TMaskIteratorType m_StartMask
 
bool m_UseMask
 

Detailed Description

template<typename TIteratorType, typename TMaskIteratorType = TIteratorType>
class otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >

Decorate an iterator to ignore masked pixels.

An iterator that dispatches its operations on both an image and a mask using two iterators of the same type. It skips over pixels where the value of the mask is zero. There is a limitation that the image and the mask must both be of the same type.

Definition at line 40 of file otbMaskedIteratorDecorator.h.

Member Typedef Documentation

◆ ImageType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef TIteratorType::ImageType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::ImageType

Definition at line 45 of file otbMaskedIteratorDecorator.h.

◆ IndexType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef ImageType::IndexType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::IndexType

Definition at line 46 of file otbMaskedIteratorDecorator.h.

◆ MaskPixelType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef MaskType::PixelType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::MaskPixelType

Definition at line 49 of file otbMaskedIteratorDecorator.h.

◆ MaskType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef TMaskIteratorType::ImageType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::MaskType

Definition at line 44 of file otbMaskedIteratorDecorator.h.

◆ PixelType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef ImageType::PixelType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::PixelType

Definition at line 48 of file otbMaskedIteratorDecorator.h.

◆ RegionType

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef ImageType::RegionType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::RegionType

Definition at line 47 of file otbMaskedIteratorDecorator.h.

◆ Self

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
typedef MaskedIteratorDecorator<TIteratorType, TMaskIteratorType> otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::Self

Definition at line 43 of file otbMaskedIteratorDecorator.h.

Constructor & Destructor Documentation

◆ MaskedIteratorDecorator()

template<typename TIteratorType , typename TMaskIteratorType >
otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::MaskedIteratorDecorator ( MaskType mask,
ImageType image,
const RegionType region 
)

Constructors forward arguments to both iterators Beware that the iterator is in a undefinite state after construction GoToBegin() or GoToEnd() should be called

Definition at line 31 of file otbMaskedIteratorDecorator.hxx.

Member Function Documentation

◆ ComputeMaskedBegin()

template<typename TIteratorType , typename TMaskIteratorType >
void otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::ComputeMaskedBegin
private

Private method to compute the begin iterator position taking into account the mask. Called by the constructor.

Definition at line 191 of file otbMaskedIteratorDecorator.hxx.

◆ GetImageIterator() [1/2]

template<typename TIteratorType , typename TMaskIteratorType >
const TIteratorType & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GetImageIterator

Underlying image iterator accessor

Definition at line 172 of file otbMaskedIteratorDecorator.hxx.

◆ GetImageIterator() [2/2]

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
const TIteratorType& otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GetImageIterator ( ) const

Underlying image iterator const accessor

◆ GetIndex()

template<typename TIteratorType , typename TMaskIteratorType >
MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::IndexType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GetIndex

Current iterator index. Wraps the underlying iterator GetIndex()

Definition at line 55 of file otbMaskedIteratorDecorator.hxx.

◆ GetMaskIterator() [1/2]

template<typename TIteratorType , typename TMaskIteratorType >
const TMaskIteratorType & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GetMaskIterator

Underlying mask iterator accessor

Definition at line 160 of file otbMaskedIteratorDecorator.hxx.

◆ GetMaskIterator() [2/2]

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
const TMaskIteratorType& otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GetMaskIterator ( ) const

Underlying mask iterator const accessor

◆ GoToBegin()

template<typename TIteratorType , typename TMaskIteratorType >
void otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GoToBegin

Move to the first valid iteration position. Note that this is different from the underlying iterators GoToBegin because their first pixels might be masked

Definition at line 61 of file otbMaskedIteratorDecorator.hxx.

◆ GoToEnd()

template<typename TIteratorType , typename TMaskIteratorType >
void otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::GoToEnd

Move one pixel past the last valid iteration index

Definition at line 74 of file otbMaskedIteratorDecorator.hxx.

◆ HasMask()

template<typename TIteratorType , typename TMaskIteratorType >
const bool & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::HasMask

Definition at line 184 of file otbMaskedIteratorDecorator.hxx.

◆ IsAtBegin()

template<typename TIteratorType , typename TMaskIteratorType >
bool otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::IsAtBegin

True if the iterator is at the beginning

Definition at line 87 of file otbMaskedIteratorDecorator.hxx.

◆ IsAtEnd()

template<typename TIteratorType , typename TMaskIteratorType >
bool otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::IsAtEnd

True if the iterator is at the end

Definition at line 97 of file otbMaskedIteratorDecorator.hxx.

◆ itkTypeMacroNoParent()

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::itkTypeMacroNoParent ( MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >  )

◆ operator++()

template<typename TIteratorType , typename TMaskIteratorType >
MaskedIteratorDecorator< TIteratorType, TMaskIteratorType > & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::operator++

Advance to the next valid iteration position. That is the next non masked position of the image iterator

Definition at line 108 of file otbMaskedIteratorDecorator.hxx.

◆ operator--()

template<typename TIteratorType , typename TMaskIteratorType >
MaskedIteratorDecorator< TIteratorType, TMaskIteratorType > & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::operator--

Move to the previous valid iteration position. That is the previous non masked position of the image iterator

Definition at line 127 of file otbMaskedIteratorDecorator.hxx.

◆ Value()

template<typename TIteratorType , typename TMaskIteratorType >
const MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::PixelType & otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::Value ( void  ) const

Set the image pixel value Get the image pixel value

Definition at line 154 of file otbMaskedIteratorDecorator.hxx.

Member Data Documentation

◆ m_ItImage

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
TIteratorType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::m_ItImage
private

Definition at line 115 of file otbMaskedIteratorDecorator.h.

◆ m_ItMask

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
TMaskIteratorType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::m_ItMask
private

Definition at line 114 of file otbMaskedIteratorDecorator.h.

◆ m_StartImage

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
TIteratorType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::m_StartImage
private

Definition at line 122 of file otbMaskedIteratorDecorator.h.

◆ m_StartMask

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
TMaskIteratorType otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::m_StartMask
private

Definition at line 121 of file otbMaskedIteratorDecorator.h.

◆ m_UseMask

template<typename TIteratorType , typename TMaskIteratorType = TIteratorType>
bool otb::MaskedIteratorDecorator< TIteratorType, TMaskIteratorType >::m_UseMask
private

Definition at line 118 of file otbMaskedIteratorDecorator.h.


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