31 #if defined(TiledImage_RECURSES)
32 #error Recursive header files inclusion detected in TiledImage.h
35 #define TiledImage_RECURSES
37 #if !defined TiledImage_h
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConceptUtils.h"
46 #include "DGtal/images/CImage.h"
47 #include "DGtal/images/CImageFactory.h"
48 #include "DGtal/images/CImageCacheReadPolicy.h"
49 #include "DGtal/images/CImageCacheWritePolicy.h"
50 #include "DGtal/base/Alias.h"
52 #include "DGtal/images/ImageCache.h"
54 #include "DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h"
55 #include "DGtal/base/TiledImageBidirectionalRangeFromPoint.h"
75 template <
typename TImageContainer,
typename TImageFactory,
typename TImageCacheReadPolicy,
typename TImageCacheWritePolicy>
171 if (
this != &other )
212 Point lowerBoundCords, upperBoundCoords;
216 lowerBoundCords[i] = 0;
217 upperBoundCoords[i] =
myN;
220 upperBoundCoords[i]--;
223 return Domain(lowerBoundCords, upperBoundCoords);
504 for(i=0; i<Domain::dimension; i++)
516 for(i=0; i<Domain::dimension; i++)
575 return Range(
this );
608 for(i=0; i<Domain::dimension; i++)
614 for(i=0; i<Domain::dimension; i++)
617 dMax[i] = dMin[i] + (
mySize[i]-1);
640 for(i=0; i<Domain::dimension; i++)
664 for(i=0; i<Domain::dimension; i++)
667 dMax[i] = dMin[i] + (
mySize[i]-1);
815 template <
typename TImageContainer,
typename TImageFactory,
typename TImageCacheReadPolicy,
typename TImageCacheWritePolicy>
824 #include "DGtal/images/TiledImage.ih"
831 #undef TiledImage_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Iterator for HyperRectDomain.
Aim: implements an images cache with 'read and write' policies.
void clearCacheAndResetCacheMisses()
bool read(const Point &aPoint, Value &aValue) const
ImageContainer * getPage(const Domain &aDomain) const
unsigned int getCacheMissRead()
void update(const Domain &aDomain)
bool write(const Point &aPoint, const Value &aValue)
unsigned int getCacheMissWrite()
std::vector< Value >::difference_type Difference
SimpleRandomAccessRangeFromPoint< ConstIterator, Iterator, DistanceFunctorFromPoint< Self > > Range
Aim: model of CConstBidirectionalRangeFromPoint that adapts a TiledImage range of elements bounded by...
Aim: model of CBidirectionalRangeFromPoint that adapts a TiledImage range of elements bounded by two ...
void nextLexicographicOrder()
Domain::Iterator BlockCoordsIterator
std::bidirectional_iterator_tag iterator_category
bool operator!=(const TiledIterator &it) const
bool operator==(const TiledIterator &it) const
TiledIterator & operator--()
void prevLexicographicOrder()
TiledIterator(BlockCoordsIterator aBlockCoordsIterator, const Point &aPoint, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
ptrdiff_t difference_type
ImageContainer * myTile
Alias on the current tile.
BlockCoordsIterator myBlockCoordsIterator
Current block coords iterator.
const TiledImage * myTiledImage
TiledImage pointer.
TiledIterator(BlockCoordsIterator aBlockCoordsIterator, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
ImageContainer::Range::Iterator TiledRangeIterator
TiledIterator & operator++()
TiledRangeIterator myTiledRangeIterator
Current tiled range iterator.
Aim: implements a tiled image from a "bigger/original" one from an ImageFactory.
ConstIterator begin() const
TiledIterator ConstIterator
ImageContainer * findTileFromBlockCoords(const Point &aCoord) const
TImageCacheReadPolicy ImageCacheReadPolicy
std::reverse_iterator< TiledIterator > ReverseTiledIterator
TImageCacheWritePolicy ImageCacheWritePolicy
TImageCacheReadPolicy * myReadPolicy
TImageCacheReadPolicy pointer.
ImageContainer::Point Point
ReverseTiledIterator ReverseOutputIterator
ReverseTiledIterator ConstReverseIterator
BOOST_CONCEPT_ASSERT((concepts::CImageCacheReadPolicy< TImageCacheReadPolicy >))
ConstReverseIterator rend() const
unsigned int getCacheMissRead()
TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy > Self
const Domain findSubDomain(const Point &aPoint) const
ImageFactory * myImageFactory
ImageFactory pointer.
const Domain domainBlockCoords() const
ConstReverseIterator rend()
TiledImageBidirectionalConstRangeFromPoint< TiledImage > ConstRange
const Domain findSubDomainFromBlockCoords(const Point &aCoord) const
BOOST_CONCEPT_ASSERT((concepts::CImageFactory< TImageFactory >))
ImageContainer::Difference Difference
ImageFactory::OutputImage OutputImage
void selfDisplay(std::ostream &out) const
const Domain & domain() const
ReverseOutputIterator routputIterator(const Point &aPoint)
MyImageCache * myImageCache
ImageCache pointer.
ReverseOutputIterator routputIterator()
Domain::Integer myN
Number of tiles per dimension.
ImageContainer::Value Value
TiledImageBidirectionalRangeFromPoint< TiledImage > Range
ConstIterator begin(const Point &aPoint) const
TiledImage(const TiledImage &other)
OutputIterator outputIterator()
OutputIterator outputIterator(const Point &aPoint)
void setValue(const Point &aPoint, const Value &aValue)
TImageCacheWritePolicy * myWritePolicy
TImageCacheWritePolicy pointer.
ConstRange constRange() const
TiledImage & operator=(const TiledImage &other)
ReverseOutputIterator rbegin(const Point &aPoint)
ConstReverseIterator rbegin(const Point &aPoint) const
ImageCache< OutputImage, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > MyImageCache
TImageContainer ImageContainer
Types copied from the container.
Point mySize
Width of a tile (for each dimension)
ReverseOutputIterator rbegin()
TiledIterator OutputIterator
ConstIterator end() const
ConstReverseIterator rbegin() const
Point m_lowerBound
domain lower and upper bound
TiledImage(Alias< ImageFactory > anImageFactory, Alias< ImageCacheReadPolicy > aReadPolicy, Alias< ImageCacheWritePolicy > aWritePolicy, typename Domain::Integer N)
void clearCacheAndResetCacheMisses()
ImageContainer::Domain Domain
BOOST_CONCEPT_ASSERT((concepts::CImage< TImageContainer >))
Checking concepts.
OutputIterator begin(const Point &aPoint)
Value operator()(const Point &aPoint) const
TImageFactory ImageFactory
Types.
BOOST_CONCEPT_ASSERT((concepts::CImageCacheWritePolicy< TImageCacheWritePolicy >))
unsigned int getCacheMissWrite()
const Point findBlockCoordsFromPoint(const Point &aPoint) const
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Aim: Defines the concept describing a cache read policy.
Aim: Defines the concept describing a cache write policy.
Aim: Defines the concept describing an image factory.
Aim: Defines the concept describing a read/write image, having an output iterator.
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer