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

Aim: implements a tiled image from a "bigger/original" one from an ImageFactory. More...

#include <DGtal/images/TiledImage.h>

Data Structures

class  TiledIterator
 

Public Types

typedef TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy > Self
 
typedef TImageContainer ImageContainer
 Types copied from the container. More...
 
typedef ImageContainer::Domain Domain
 
typedef ImageContainer::Point Point
 
typedef ImageContainer::Value Value
 
typedef ImageContainer::Difference Difference
 
typedef TImageFactory ImageFactory
 Types. More...
 
typedef ImageFactory::OutputImage OutputImage
 
typedef TImageCacheReadPolicy ImageCacheReadPolicy
 
typedef TImageCacheWritePolicy ImageCacheWritePolicy
 
typedef ImageCache< OutputImage, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicyMyImageCache
 
typedef TiledIterator ConstIterator
 
typedef TiledIterator OutputIterator
 
typedef std::reverse_iterator< TiledIteratorReverseTiledIterator
 
typedef ReverseTiledIterator ConstReverseIterator
 
typedef ReverseTiledIterator ReverseOutputIterator
 
typedef TiledImageBidirectionalConstRangeFromPoint< TiledImageConstRange
 
typedef TiledImageBidirectionalRangeFromPoint< TiledImageRange
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 Checking concepts. More...
 
 BOOST_CONCEPT_ASSERT ((concepts::CImageFactory< TImageFactory >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CImageCacheReadPolicy< TImageCacheReadPolicy >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CImageCacheWritePolicy< TImageCacheWritePolicy >))
 
 TiledImage (Alias< ImageFactory > anImageFactory, Alias< ImageCacheReadPolicy > aReadPolicy, Alias< ImageCacheWritePolicy > aWritePolicy, typename Domain::Integer N)
 
 ~TiledImage ()
 
 TiledImage (const TiledImage &other)
 
TiledImageoperator= (const TiledImage &other)
 
const Domaindomain () const
 
const Domain domainBlockCoords () const
 
ConstIterator begin () const
 
OutputIterator begin ()
 
ConstIterator begin (const Point &aPoint) const
 
OutputIterator begin (const Point &aPoint)
 
ConstIterator end () const
 
OutputIterator end ()
 
ConstReverseIterator rbegin () const
 
ReverseOutputIterator rbegin ()
 
ConstReverseIterator rbegin (const Point &aPoint) const
 
ReverseOutputIterator rbegin (const Point &aPoint)
 
ConstReverseIterator rend () const
 
ConstReverseIterator rend ()
 
OutputIterator outputIterator ()
 
OutputIterator outputIterator (const Point &aPoint)
 
ReverseOutputIterator routputIterator ()
 
ReverseOutputIterator routputIterator (const Point &aPoint)
 
ConstRange constRange () const
 
Range range ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
const Domain findSubDomain (const Point &aPoint) const
 
const Point findBlockCoordsFromPoint (const Point &aPoint) const
 
const Domain findSubDomainFromBlockCoords (const Point &aCoord) const
 
ImageContainerfindTileFromBlockCoords (const Point &aCoord) const
 
Value operator() (const Point &aPoint) const
 
void setValue (const Point &aPoint, const Value &aValue)
 
unsigned int getCacheMissRead ()
 
unsigned int getCacheMissWrite ()
 
void clearCacheAndResetCacheMisses ()
 

Protected Attributes

Domain::Integer myN
 Number of tiles per dimension. More...
 
Point mySize
 Width of a tile (for each dimension) More...
 
ImageFactorymyImageFactory
 ImageFactory pointer. More...
 
MyImageCachemyImageCache
 ImageCache pointer. More...
 
Point m_lowerBound
 domain lower and upper bound More...
 
Point m_upperBound
 
TImageCacheReadPolicy * myReadPolicy
 TImageCacheReadPolicy pointer. More...
 
TImageCacheWritePolicy * myWritePolicy
 TImageCacheWritePolicy pointer. More...
 

Detailed Description

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

Aim: implements a tiled image from a "bigger/original" one from an ImageFactory.

Description of template class 'TiledImage'

Template Parameters
TImageContaineran image container type (model of ).
TImageFactoryan image factory type (model of CImageFactory).
TImageCacheReadPolicyan image cache read policy class (model of CImageCacheReadPolicy).
TImageCacheWritePolicyan image cache write policy class (model of CImageCacheWritePolicy).
Note
It is important to take into account that read and write policies are passed as aliases in the TiledImage constructor, so for example, if two TiledImage instances are successively created with the same read policy instance, the state of the cache for a given time is therefore the same for the two TiledImage instances !

Definition at line 76 of file TiledImage.h.

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 449 of file TiledImage.h.

◆ ConstRange

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TiledImageBidirectionalConstRangeFromPoint<TiledImage > DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ConstRange

Definition at line 557 of file TiledImage.h.

◆ ConstReverseIterator

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ReverseTiledIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ConstReverseIterator

Definition at line 453 of file TiledImage.h.

◆ Difference

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageContainer::Difference DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Difference

Definition at line 96 of file TiledImage.h.

◆ Domain

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageContainer::Domain DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Domain

Definition at line 92 of file TiledImage.h.

◆ ImageCacheReadPolicy

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TImageCacheReadPolicy DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ImageCacheReadPolicy

Definition at line 102 of file TiledImage.h.

◆ ImageCacheWritePolicy

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TImageCacheWritePolicy DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ImageCacheWritePolicy

Definition at line 103 of file TiledImage.h.

◆ ImageContainer

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TImageContainer DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ImageContainer

Types copied from the container.

Definition at line 91 of file TiledImage.h.

◆ ImageFactory

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TImageFactory DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ImageFactory

Types.

Definition at line 99 of file TiledImage.h.

◆ MyImageCache

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageCache<OutputImage, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::MyImageCache

Definition at line 104 of file TiledImage.h.

◆ OutputImage

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageFactory::OutputImage DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::OutputImage

Definition at line 100 of file TiledImage.h.

◆ OutputIterator

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

Definition at line 450 of file TiledImage.h.

◆ Point

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageContainer::Point DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Point

Definition at line 93 of file TiledImage.h.

◆ Range

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TiledImageBidirectionalRangeFromPoint<TiledImage > DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Range

Definition at line 558 of file TiledImage.h.

◆ ReverseOutputIterator

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ReverseTiledIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ReverseOutputIterator

Definition at line 454 of file TiledImage.h.

◆ ReverseTiledIterator

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef std::reverse_iterator<TiledIterator> DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::ReverseTiledIterator

Definition at line 452 of file TiledImage.h.

◆ Self

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef TiledImage<TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy> DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Self

Definition at line 82 of file TiledImage.h.

◆ Value

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
typedef ImageContainer::Value DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::Value

Definition at line 94 of file TiledImage.h.

Constructor & Destructor Documentation

◆ TiledImage() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledImage ( Alias< ImageFactory anImageFactory,
Alias< ImageCacheReadPolicy aReadPolicy,
Alias< ImageCacheWritePolicy aWritePolicy,
typename Domain::Integer  N 
)
inline

Constructor.

Parameters
anImageFactoryalias on the image factory (see ImageFactoryFromImage or ImageFactoryFromHDF5).
aReadPolicyalias on a read policy.
aWritePolicyalias on a write policy.
Nhow many tiles we want for each dimension.

Definition at line 117 of file TiledImage.h.

120  :
121  myN(N), myImageFactory(&anImageFactory), myReadPolicy(&aReadPolicy), myWritePolicy(&aWritePolicy)
122  {
124 
125  m_lowerBound = myImageFactory->domain().lowerBound();
126  m_upperBound = myImageFactory->domain().upperBound();
127 
128  for(typename DGtal::Dimension i=0; i<Domain::dimension; i++)
129  mySize[i] = (m_upperBound[i]-m_lowerBound[i]+1)/myN;
130  }
TImageCacheReadPolicy * myReadPolicy
TImageCacheReadPolicy pointer.
Definition: TiledImage.h:799
ImageFactory * myImageFactory
ImageFactory pointer.
Definition: TiledImage.h:790
MyImageCache * myImageCache
ImageCache pointer.
Definition: TiledImage.h:793
Domain::Integer myN
Number of tiles per dimension.
Definition: TiledImage.h:784
TImageCacheWritePolicy * myWritePolicy
TImageCacheWritePolicy pointer.
Definition: TiledImage.h:802
ImageCache< OutputImage, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > MyImageCache
Definition: TiledImage.h:104
Point mySize
Width of a tile (for each dimension)
Definition: TiledImage.h:787
Point m_lowerBound
domain lower and upper bound
Definition: TiledImage.h:796
DGtal::uint32_t Dimension
Definition: Common.h:136

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myN, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myReadPolicy, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myWritePolicy.

◆ ~TiledImage()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::~TiledImage ( )
inline

◆ TiledImage() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledImage ( const TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy > &  other)
inline

Copy constructor.

Parameters
otherthe TiledImage to clone.

Definition at line 148 of file TiledImage.h.

149  {
150  myN = other.myN;
151  myImageFactory = other.myImageFactory;
152  myReadPolicy = other.myReadPolicy;
153  myWritePolicy = other.myWritePolicy;
154 
156 
157  m_lowerBound = myImageFactory->domain().lowerBound();
158  m_upperBound = myImageFactory->domain().upperBound();
159 
160  for(typename DGtal::Dimension i=0; i<Domain::dimension; i++)
161  mySize[i] = (m_upperBound[i]-m_lowerBound[i]+1)/myN;
162  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myN, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myReadPolicy, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myWritePolicy.

Member Function Documentation

◆ begin() [1/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
OutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::begin ( )
inline

◆ begin() [2/4]

◆ begin() [3/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
OutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::begin ( const Point aPoint)
inline

◆ begin() [4/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::begin ( const Point aPoint) const
inline

◆ BOOST_CONCEPT_ASSERT() [1/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TImageContainer >)  )

Checking concepts.

◆ BOOST_CONCEPT_ASSERT() [2/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::BOOST_CONCEPT_ASSERT ( (concepts::CImageCacheReadPolicy< TImageCacheReadPolicy >)  )

◆ BOOST_CONCEPT_ASSERT() [3/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::BOOST_CONCEPT_ASSERT ( (concepts::CImageCacheWritePolicy< TImageCacheWritePolicy >)  )

◆ BOOST_CONCEPT_ASSERT() [4/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::BOOST_CONCEPT_ASSERT ( (concepts::CImageFactory< TImageFactory >)  )

◆ clearCacheAndResetCacheMisses()

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

◆ constRange()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstRange DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::constRange ( ) const
inline
Returns
the range providing begin and end iterators (with this) to scan the values of image.

Definition at line 564 of file TiledImage.h.

565  {
566  return ConstRange( this );
567  }
TiledImageBidirectionalConstRangeFromPoint< TiledImage > ConstRange
Definition: TiledImage.h:557

◆ domain()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
const Domain& DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domain ( ) const
inline

Returns a reference to the underlying image domain.

Returns
a reference to the domain.

Definition at line 200 of file TiledImage.h.

201  {
202  return myImageFactory->domain();
203  }

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

◆ domainBlockCoords()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
const Domain DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords ( ) const
inline

Returns the block coords domain.

Returns
the block coords domain.

Definition at line 210 of file TiledImage.h.

211  {
212  Point lowerBoundCords, upperBoundCoords;
213 
214  for(typename DGtal::Dimension i=0; i<Domain::dimension; i++)
215  {
216  lowerBoundCords[i] = 0;
217  upperBoundCoords[i] = myN;
218 
219  if (((m_upperBound[i]-m_lowerBound[i]+1) % myN) == 0)
220  upperBoundCoords[i]--;
221  }
222 
223  return Domain(lowerBoundCords, upperBoundCoords);
224  }
ImageContainer::Domain Domain
Definition: TiledImage.h:92

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myN.

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::begin(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::end(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findSubDomainFromBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::nextLexicographicOrder(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::operator!=(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::prevLexicographicOrder(), and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::TiledIterator().

◆ end() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
OutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::end ( )
inline

◆ end() [2/2]

◆ findBlockCoordsFromPoint()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
const Point DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findBlockCoordsFromPoint ( const Point aPoint) const
inline

Get the block coords containing aPoint.

Parameters
aPointthe point.
Returns
the block coords containing aPoint.

Definition at line 633 of file TiledImage.h.

634  {
635  ASSERT(myImageFactory->domain().isInside(aPoint));
636 
637  typename DGtal::Dimension i;
638 
639  Point low;
640  for(i=0; i<Domain::dimension; i++)
641  {
642  /*if ( (aPoint[i]-m_lowerBound[i]) < mySize[i] )
643  low[i] = 0;
644  else*/
645  low[i] = (aPoint[i]-m_lowerBound[i])/mySize[i];
646  }
647 
648  return low;
649  }

References aPoint(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize.

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::begin().

◆ findSubDomain()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
const Domain DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findSubDomain ( const Point aPoint) const
inline

Get the domain containing aPoint.

Parameters
aPointthe point.
Returns
the domain containing aPoint.

Definition at line 601 of file TiledImage.h.

602  {
603  ASSERT(myImageFactory->domain().isInside(aPoint));
604 
605  typename DGtal::Dimension i;
606 
607  Point low;
608  for(i=0; i<Domain::dimension; i++)
609  {
610  low[i] = (aPoint[i]-m_lowerBound[i])/mySize[i];
611  }
612 
613  Point dMin, dMax;
614  for(i=0; i<Domain::dimension; i++)
615  {
616  dMin[i] = (low[i]*mySize[i])+m_lowerBound[i];
617  dMax[i] = dMin[i] + (mySize[i]-1);
618 
619  if (dMax[i] > m_upperBound[i]) // last tile
620  dMax[i] = m_upperBound[i];
621  }
622 
623  Domain di(dMin, dMax);
624  return di;
625  }
HyperRectDomain< Space > Domain

References aPoint(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize.

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

◆ findSubDomainFromBlockCoords()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
const Domain DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findSubDomainFromBlockCoords ( const Point aCoord) const
inline

Get the domain with his block coords.

Parameters
aCoordthe block coords.
Returns
the domain.

Definition at line 657 of file TiledImage.h.

658  {
659  ASSERT(domainBlockCoords().isInside(aCoord));
660 
661  typename DGtal::Dimension i;
662 
663  Point dMin, dMax;
664  for(i=0; i<Domain::dimension; i++)
665  {
666  dMin[i] = (aCoord[i]*mySize[i])+m_lowerBound[i];
667  dMax[i] = dMin[i] + (mySize[i]-1);
668 
669  if (dMax[i] > m_upperBound[i]) // last tile
670  dMax[i] = m_upperBound[i];
671  }
672 
673  Domain di(dMin, dMax);
674  return di;
675  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize.

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords().

◆ findTileFromBlockCoords()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ImageContainer* DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findTileFromBlockCoords ( const Point aCoord) const
inline

Returns an ImageContainer pointer for the block coords aCoord.

Parameters
aCoordthe block coords.
Returns
an ImageContainer pointer.

Definition at line 683 of file TiledImage.h.

684  {
685  ASSERT(domainBlockCoords().isInside(aCoord));
686 
687  Domain d = findSubDomainFromBlockCoords( aCoord );
688  ImageContainer *tile = myImageCache->getPage(d);
689  if (!tile)
690  {
692  myImageCache->update(d);
693  tile = myImageCache->getPage(d);
694  }
695 
696  return tile;
697  }
ImageContainer * getPage(const Domain &aDomain) const
void update(const Domain &aDomain)
void incCacheMissRead()
Definition: ImageCache.h:219
const Domain findSubDomainFromBlockCoords(const Point &aCoord) const
Definition: TiledImage.h:657
TImageContainer ImageContainer
Types copied from the container.
Definition: TiledImage.h:91

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::domainBlockCoords(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findSubDomainFromBlockCoords(), DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::getPage(), DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::incCacheMissRead(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache, and DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::update().

Referenced by DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::nextLexicographicOrder(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::prevLexicographicOrder(), and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::TiledIterator::TiledIterator().

◆ getCacheMissRead()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
unsigned int DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::getCacheMissRead ( )
inline

◆ getCacheMissWrite()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
unsigned int DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::getCacheMissWrite ( )
inline

◆ isValid()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
bool DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::isValid ( ) const
inline

◆ operator()()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
Value DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::operator() ( const Point aPoint) const
inline

Get the value of an image (from cache) at a given position given by aPoint.

Parameters
aPointthe point.
Returns
the value at aPoint.

Definition at line 705 of file TiledImage.h.

706  {
707  ASSERT(myImageFactory->domain().isInside(aPoint));
708 
709  typename OutputImage::Value aValue;
710  bool res;
711 
712  res = myImageCache->read(aPoint, aValue);
713 
714  if (res)
715  return aValue;
716  else
717  {
719  Domain d;
720 #ifdef DEBUG_VERBOSE
721  trace.info()<<"+";
722 #endif
723  d = findSubDomain(aPoint);
724 
725  myImageCache->update(d);
726 
727  myImageCache->read(aPoint, aValue);
728 
729  return aValue;
730  }
731 
732  // Unspecified behavior, returning the default constructed value.
733  return aValue;
734  }
bool read(const Point &aPoint, Value &aValue) const
const Domain findSubDomain(const Point &aPoint) const
Definition: TiledImage.h:601
std::ostream & info()
Trace trace
Definition: Common.h:153

References aPoint(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::findSubDomain(), DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::incCacheMissRead(), DGtal::Trace::info(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::read(), DGtal::trace, and DGtal::ImageCache< TImageContainer, TImageFactory, TReadPolicy, TWritePolicy >::update().

◆ operator=()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TiledImage& DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::operator= ( const TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy > &  other)
inline

Assignment.

Parameters
otherthe TiledImage to copy.
Returns
a reference on 'this'.

Definition at line 169 of file TiledImage.h.

170  {
171  if ( this != &other )
172  {
173  myN = other.myN;
174  myImageFactory = other.myImageFactory;
175  myReadPolicy = other.myReadPolicy;
176  myWritePolicy = other.myWritePolicy;
177 
179 
180  m_lowerBound = myImageFactory->domain().lowerBound();
181  m_upperBound = myImageFactory->domain().upperBound();
182 
183  for(typename DGtal::Dimension i=0; i<Domain::dimension; i++)
184  mySize[i] = (m_upperBound[i]-m_lowerBound[i]+1)/myN;
185  }
186 
187  return *this;
188  }

References DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_lowerBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::m_upperBound, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageFactory, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myN, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myReadPolicy, DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::mySize, and DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myWritePolicy.

◆ outputIterator() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
OutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::outputIterator ( )
inline

◆ outputIterator() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
OutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::outputIterator ( const Point aPoint)
inline

◆ range()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
Range DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::range ( )
inline
Returns
the range providing begin and end iterators (with this) to scan the values of image.

Definition at line 573 of file TiledImage.h.

574  {
575  return Range( this );
576  }
TiledImageBidirectionalRangeFromPoint< TiledImage > Range
Definition: TiledImage.h:558

◆ rbegin() [1/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ReverseOutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rbegin ( )
inline

Definition at line 494 of file TiledImage.h.

495  {
496  return ReverseTiledIterator( end() );
497  }
std::reverse_iterator< TiledIterator > ReverseTiledIterator
Definition: TiledImage.h:452

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

◆ rbegin() [2/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstReverseIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rbegin ( ) const
inline

◆ rbegin() [3/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ReverseOutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rbegin ( const Point aPoint)
inline

◆ rbegin() [4/4]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstReverseIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rbegin ( const Point aPoint) const
inline

◆ rend() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstReverseIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rend ( )
inline

◆ rend() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ConstReverseIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::rend ( ) const
inline

◆ routputIterator() [1/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ReverseOutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::routputIterator ( )
inline

Definition at line 545 of file TiledImage.h.

546  {
547  return ReverseOutputIterator( end() );
548  }
ReverseTiledIterator ReverseOutputIterator
Definition: TiledImage.h:454

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

◆ routputIterator() [2/2]

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
ReverseOutputIterator DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::routputIterator ( const Point aPoint)
inline

◆ selfDisplay()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
void DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setValue()

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
void DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::setValue ( const Point aPoint,
const Value aValue 
)
inline

Field Documentation

◆ m_lowerBound

◆ m_upperBound

◆ myImageCache

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
MyImageCache* DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myImageCache
protected

◆ myImageFactory

◆ myN

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
Domain::Integer DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myN
protected

◆ myReadPolicy

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TImageCacheReadPolicy* DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myReadPolicy
protected

◆ mySize

◆ myWritePolicy

template<typename TImageContainer , typename TImageFactory , typename TImageCacheReadPolicy , typename TImageCacheWritePolicy >
TImageCacheWritePolicy* DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::myWritePolicy
protected

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