DGtal  1.5.beta
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator Class Reference

#include <DGtal/images/TiledImage.h>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 
using value_type = Value
 
using difference_type = ptrdiff_t
 
using pointer = Value *
 
using reference = Value &
 
typedef ImageContainer::Range::Iterator TiledRangeIterator
 
typedef Domain::Iterator BlockCoordsIterator
 

Public Member Functions

 TiledIterator (BlockCoordsIterator aBlockCoordsIterator, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
 
 TiledIterator (BlockCoordsIterator aBlockCoordsIterator, const Point &aPoint, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
 
Valueoperator* ()
 
bool operator== (const TiledIterator &it) const
 
bool operator!= (const TiledIterator &it) const
 
void nextLexicographicOrder ()
 
TiledIteratoroperator++ ()
 
TiledIterator operator++ (int)
 
void prevLexicographicOrder ()
 
TiledIteratoroperator-- ()
 
TiledIterator operator-- (int)
 

Private Attributes

const TiledImagemyTiledImage
 TiledImage pointer. More...
 
ImageContainermyTile
 Alias on the current tile. More...
 
TiledRangeIterator myTiledRangeIterator
 Current tiled range iterator. More...
 
BlockCoordsIterator myBlockCoordsIterator
 Current block coords iterator. More...
 

Friends

class TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy >
 

Detailed Description

template<typename TImageContainer, typename TImageFactory, typename TImageCacheReadPolicy, typename TImageCacheWritePolicy>
class DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator

Specific TiledIterator on TiledImage.

Definition at line 232 of file TiledImage.h.

Member Typedef Documentation

◆ BlockCoordsIterator

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef Domain::Iterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::BlockCoordsIterator

Definition at line 246 of file TiledImage.h.

◆ difference_type

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
using DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::difference_type = ptrdiff_t

Definition at line 241 of file TiledImage.h.

◆ iterator_category

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
using DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::iterator_category = std::bidirectional_iterator_tag

Definition at line 239 of file TiledImage.h.

◆ pointer

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
using DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::pointer = Value*

Definition at line 242 of file TiledImage.h.

◆ reference

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
using DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::reference = Value&

Definition at line 243 of file TiledImage.h.

◆ TiledRangeIterator

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageContainer::Range:: Iterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::TiledRangeIterator

Definition at line 245 of file TiledImage.h.

◆ value_type

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
using DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::value_type = Value

Definition at line 240 of file TiledImage.h.

Constructor & Destructor Documentation

◆ TiledIterator() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::TiledIterator ( BlockCoordsIterator  aBlockCoordsIterator,
const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *  aTiledImage 
)
inline

Constructor.

Parameters
aBlockCoordsIteratora block coords iterator
aTiledImagepointer to the TiledImage

Definition at line 256 of file TiledImage.h.

258  : myTiledImage ( aTiledImage ),
259  myBlockCoordsIterator ( aBlockCoordsIterator )
260  {
262  {
264  myTiledRangeIterator = myTile->range().begin();
265  }
266  }
ImageContainer * myTile
Alias on the current tile.
Definition: TiledImage.h:439
BlockCoordsIterator myBlockCoordsIterator
Current block coords iterator.
Definition: TiledImage.h:445
const TiledImage * myTiledImage
TiledImage pointer.
Definition: TiledImage.h:436
TiledRangeIterator myTiledRangeIterator
Current tiled range iterator.
Definition: TiledImage.h:442
ImageContainer * findTileFromBlockCoords(const Point &aCoord) const
Definition: TiledImage.h:683
const Domain domainBlockCoords() const
Definition: TiledImage.h:210

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myBlockCoordsIterator, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTile, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledImage, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledRangeIterator.

◆ TiledIterator() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::TiledIterator ( BlockCoordsIterator  aBlockCoordsIterator,
const Point aPoint,
const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *  aTiledImage 
)
inline

Member Function Documentation

◆ nextLexicographicOrder()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
void DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::nextLexicographicOrder ( )
inline

Implements the next() method to scan the domain points dimension by dimension (lexicographic order).

Definition at line 329 of file TiledImage.h.

330  {
332 
333  if ( myTiledRangeIterator != myTile->range().end() )
334  return;
335  else
336  {
338 
340  return;
341 
343  myTiledRangeIterator = myTile->range().begin();
344  }
345  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myBlockCoordsIterator, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTile, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledImage, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledRangeIterator.

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator++().

◆ operator!=()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
bool DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator!= ( const TiledIterator it) const
inline

◆ operator*()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
Value& DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator* ( )
inline

operator *

Returns
the value associated to the current TiledRangeIterator position.

Definition at line 294 of file TiledImage.h.

295  {
296  return (*myTiledRangeIterator);
297  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledRangeIterator.

◆ operator++() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TiledIterator& DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator++ ( )
inline

◆ operator++() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TiledIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator++ ( int  )
inline

Operator ++ (it++)

Definition at line 363 of file TiledImage.h.

364  {
365  TiledIterator tmp = *this;
367  return tmp;
368  }
TiledIterator(BlockCoordsIterator aBlockCoordsIterator, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
Definition: TiledImage.h:256

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::nextLexicographicOrder().

◆ operator--() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TiledIterator& DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator-- ( )
inline

◆ operator--() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TiledIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator-- ( int  )
inline

Operator – (it–)

Definition at line 427 of file TiledImage.h.

428  {
429  TiledIterator tmp = *this;
431  return tmp;
432  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::prevLexicographicOrder().

◆ operator==()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
bool DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator== ( const TiledIterator it) const
inline

Operator ==

Returns
true if this and it are equals.

Definition at line 305 of file TiledImage.h.

306  {
307  return ( ( this->myBlockCoordsIterator == it.myBlockCoordsIterator ) && ( this->myTiledRangeIterator == it.myTiledRangeIterator ) );
308  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myBlockCoordsIterator, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledRangeIterator.

◆ prevLexicographicOrder()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
void DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::prevLexicographicOrder ( )
inline

Implements the prev() method to scan the domain points dimension by dimension (lexicographic order).

Definition at line 375 of file TiledImage.h.

376  {
377  // -- IF we are at the end... (reverse, --)
379  {
381 
383 
384  myTiledRangeIterator = myTile->range().end();
386 
387  return;
388  }
389  // -- IF we are at the end... (reverse, --)
390 
391  // ---
392 
393  if ( myTiledRangeIterator != myTile->range().begin() )
394  {
396  return;
397  }
398  else
399  {
401  return;
402 
404 
406 
407  myTiledRangeIterator = myTile->range().end();
409  }
410  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myBlockCoordsIterator, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTile, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledImage, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::myTiledRangeIterator.

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator--().

Friends And Related Function Documentation

◆ TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy >

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
friend class TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy >
friend

Definition at line 802 of file TiledImage.h.

Field Documentation

◆ myBlockCoordsIterator

◆ myTile

◆ myTiledImage

◆ myTiledRangeIterator


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