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);
233 std::iterator<std::bidirectional_iterator_tag, Value, ptrdiff_t, Value*, Value&>
505 for(i=0; i<Domain::dimension; i++)
517 for(i=0; i<Domain::dimension; i++)
576 return Range(
this );
609 for(i=0; i<Domain::dimension; i++)
615 for(i=0; i<Domain::dimension; i++)
618 dMax[i] = dMin[i] + (
mySize[i]-1);
641 for(i=0; i<Domain::dimension; i++)
665 for(i=0; i<Domain::dimension; i++)
668 dMax[i] = dMin[i] + (
mySize[i]-1);
710 typename OutputImage::Value aValue;
816 template <
typename TImageContainer,
typename TImageFactory,
typename TImageCacheReadPolicy,
typename TImageCacheWritePolicy>
825#include "DGtal/images/TiledImage.ih"
832#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
unsigned int getCacheMissRead()
void update(const Domain &aDomain)
bool write(const Point &aPoint, const Value &aValue)
ImageContainer * getPage(const Domain &aDomain) const
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
TiledIterator & operator--()
bool operator!=(const TiledIterator &it) const
bool operator==(const TiledIterator &it) const
void prevLexicographicOrder()
TiledIterator(BlockCoordsIterator aBlockCoordsIterator, const Point &aPoint, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
ImageContainer * myTile
Alias on the current tile.
BlockCoordsIterator myBlockCoordsIterator
Current block coords iterator.
TiledIterator & operator++()
const TiledImage * myTiledImage
TiledImage pointer.
TiledIterator(BlockCoordsIterator aBlockCoordsIterator, const TiledImage< ImageContainer, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > *aTiledImage)
ImageContainer::Range::Iterator TiledRangeIterator
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
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
const Domain & domain() const
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
ReverseOutputIterator rbegin(const Point &aPoint)
ConstReverseIterator rbegin(const Point &aPoint) const
ImageCache< OutputImage, ImageFactory, ImageCacheReadPolicy, ImageCacheWritePolicy > MyImageCache
TiledImage & operator=(const TiledImage &other)
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 ClosedIntegerHalfPlane< TSpace > &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