DGtal  0.9.4beta
Public Types | Public Member Functions | Static Public Attributes | Private Attributes
DGtal::ImageContainerBySTLMap< TDomain, TValue > Class Template Reference

#include <DGtal/images/ImageContainerBySTLMap.h>

Inheritance diagram for DGtal::ImageContainerBySTLMap< TDomain, TValue >:
[legend]
Collaboration diagram for DGtal::ImageContainerBySTLMap< TDomain, TValue >:
[legend]

Public Types

typedef ImageContainerBySTLMap< TDomain, TValue > Self
 
typedef std::map< typename TDomain::Point, TValue > Parent
 
typedef TDomain Domain
 
typedef Domain::Point Point
 
typedef Domain::Vector Vector
 
typedef Domain::Integer Integer
 
typedef Domain::Size Size
 
typedef Domain::Dimension Dimension
 
typedef Point Vertex
 
typedef CowPtr< const DomainDomainPtr
 
typedef TValue Value
 
typedef DefaultConstImageRange< SelfConstRange
 
typedef DefaultImageRange< SelfRange
 
typedef SetValueIterator< SelfOutputIterator
 
typedef std::map< Point, Value >::iterator Iterator
 
typedef std::map< Point, Value >::const_iterator ConstIterator
 
typedef std::map< Point, Value >::reverse_iterator ReverseIterator
 
typedef std::map< Point, Value >::const_reverse_iterator ConstReverseIterator
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDomain< TDomain >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CLabel< TValue >))
 
 ImageContainerBySTLMap (Clone< const Domain > aDomain, const Value &aValue=0)
 
 ImageContainerBySTLMap (const ImageContainerBySTLMap &other)
 
ImageContainerBySTLMapoperator= (const ImageContainerBySTLMap &other)
 
 ~ImageContainerBySTLMap ()
 
Value operator() (const Point &aPoint) const
 
void setValue (const Point &aPoint, const Value &aValue)
 
const Domaindomain () const
 
ConstRange constRange () const
 
Range range ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
std::string className () const
 
OutputIterator outputIterator ()
 

Static Public Attributes

static const Domain::Dimension dimension
 

Private Attributes

DomainPtr myDomainPtr
 
Value myDefaultValue
 

Detailed Description

template<typename TDomain, typename TValue>
class DGtal::ImageContainerBySTLMap< TDomain, TValue >

Description of class 'ImageContainerBySTLMap'

Aim: Model of CImage implementing the association Point<->Value using an STL map.

Once constructed, the image is valid, i.e. every point of the image domain has a value, which can be read and overwritten. Note that the default value (returned for points that are not stored in the underlying STL map) can be chosen by the user.

As a model of concepts::CImage, this class provides two ways of accessing values:

This class also provides a setValue() method and an output iterator, which is returned by the outputIterator() method for writting purposes.

See also
testImage.cpp
Examples:
geometry/volumes/distance/exampleFMM2D.cpp, geometry/volumes/distance/exampleFMM3D.cpp, topology/ctopo-fillContours.cpp, and tutorial-examples/FMMErosion.cpp.

Definition at line 96 of file ImageContainerBySTLMap.h.

Member Typedef Documentation

template<typename TDomain, typename TValue>
typedef std::map<Point,Value>::const_iterator DGtal::ImageContainerBySTLMap< TDomain, TValue >::ConstIterator

Definition at line 239 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef DefaultConstImageRange<Self> DGtal::ImageContainerBySTLMap< TDomain, TValue >::ConstRange

Definition at line 124 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef std::map<Point,Value>::const_reverse_iterator DGtal::ImageContainerBySTLMap< TDomain, TValue >::ConstReverseIterator

Definition at line 241 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Domain::Dimension DGtal::ImageContainerBySTLMap< TDomain, TValue >::Dimension

Definition at line 112 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef TDomain DGtal::ImageContainerBySTLMap< TDomain, TValue >::Domain

Definition at line 107 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef CowPtr< const Domain > DGtal::ImageContainerBySTLMap< TDomain, TValue >::DomainPtr

Definition at line 116 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Domain::Integer DGtal::ImageContainerBySTLMap< TDomain, TValue >::Integer

Definition at line 110 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef std::map<Point,Value>::iterator DGtal::ImageContainerBySTLMap< TDomain, TValue >::Iterator

built-in iterators

Definition at line 238 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef SetValueIterator<Self> DGtal::ImageContainerBySTLMap< TDomain, TValue >::OutputIterator

output iterator

Definition at line 128 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef std::map<typename TDomain::Point, TValue > DGtal::ImageContainerBySTLMap< TDomain, TValue >::Parent

Definition at line 103 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Domain::Point DGtal::ImageContainerBySTLMap< TDomain, TValue >::Point

Definition at line 108 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef DefaultImageRange<Self> DGtal::ImageContainerBySTLMap< TDomain, TValue >::Range

Definition at line 125 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef std::map<Point,Value>::reverse_iterator DGtal::ImageContainerBySTLMap< TDomain, TValue >::ReverseIterator

Definition at line 240 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef ImageContainerBySTLMap<TDomain,TValue> DGtal::ImageContainerBySTLMap< TDomain, TValue >::Self

Definition at line 102 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Domain::Size DGtal::ImageContainerBySTLMap< TDomain, TValue >::Size

Definition at line 111 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef TValue DGtal::ImageContainerBySTLMap< TDomain, TValue >::Value

Definition at line 123 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Domain::Vector DGtal::ImageContainerBySTLMap< TDomain, TValue >::Vector

Definition at line 109 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
typedef Point DGtal::ImageContainerBySTLMap< TDomain, TValue >::Vertex

Definition at line 113 of file ImageContainerBySTLMap.h.

Constructor & Destructor Documentation

template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLMap< TDomain, TValue >::ImageContainerBySTLMap ( Clone< const Domain aDomain,
const Value aValue = 0 
)

Constructor from a pointer to a domain.

If Domain is a heavy type, consider giving instead a smart pointer on the domain (like CountedPtr).

Parameters
aDomainthe image domain.
aValuea default value associated to the domain points that are not contained in the underlying map.
template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLMap< TDomain, TValue >::ImageContainerBySTLMap ( const ImageContainerBySTLMap< TDomain, TValue > &  other)

Copy operator

Parameters
otherthe object to copy.
template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLMap< TDomain, TValue >::~ImageContainerBySTLMap ( )

Destructor.

Member Function Documentation

template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLMap< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >)  )

domain

template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLMap< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CLabel< TValue >)  )

range of values

template<typename TDomain, typename TValue>
std::string DGtal::ImageContainerBySTLMap< TDomain, TValue >::className ( ) const
Returns
the style name used for drawing this object.
template<typename TDomain, typename TValue>
ConstRange DGtal::ImageContainerBySTLMap< TDomain, TValue >::constRange ( ) const
Returns
the const range providing constant iterators to iterate over the values of the image.
template<typename TDomain, typename TValue>
const Domain& DGtal::ImageContainerBySTLMap< TDomain, TValue >::domain ( ) const
Returns
the domain associated to the image.
template<typename TDomain, typename TValue>
bool DGtal::ImageContainerBySTLMap< TDomain, TValue >::isValid ( ) const
Returns
the validity of the Image
template<typename TDomain, typename TValue>
Value DGtal::ImageContainerBySTLMap< TDomain, TValue >::operator() ( const Point aPoint) const

Get the value of an image at a given position given by a Point.

Precondition
the point must be in the domain
Parameters
aPointthe point.
Returns
the value at aPoint.
template<typename TDomain, typename TValue>
ImageContainerBySTLMap& DGtal::ImageContainerBySTLMap< TDomain, TValue >::operator= ( const ImageContainerBySTLMap< TDomain, TValue > &  other)

Assignement operator

Parameters
otherthe object to copy.
Returns
this
template<typename TDomain, typename TValue>
OutputIterator DGtal::ImageContainerBySTLMap< TDomain, TValue >::outputIterator ( )

Construct a Iterator on the image

Returns
a Iterator
template<typename TDomain, typename TValue>
Range DGtal::ImageContainerBySTLMap< TDomain, TValue >::range ( )
Returns
the range providing constant iterators and output iterators on the values of the image.
template<typename TDomain, typename TValue>
void DGtal::ImageContainerBySTLMap< TDomain, TValue >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TDomain, typename TValue>
void DGtal::ImageContainerBySTLMap< TDomain, TValue >::setValue ( const Point aPoint,
const Value aValue 
)

Set a value on an Image at a position specified by a Point.

Precondition
it must be a point in the image domain.
Parameters
aPointthe point.
aValuethe value.

Field Documentation

template<typename TDomain, typename TValue>
const Domain::Dimension DGtal::ImageContainerBySTLMap< TDomain, TValue >::dimension
static

static constants

Definition at line 119 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
Value DGtal::ImageContainerBySTLMap< TDomain, TValue >::myDefaultValue
private

Default value.

Definition at line 139 of file ImageContainerBySTLMap.h.

template<typename TDomain, typename TValue>
DomainPtr DGtal::ImageContainerBySTLMap< TDomain, TValue >::myDomainPtr
private

Shared pointer on the image domain, Since the domain is not mutable, not assignable, it is shared by all the copies of *this

Definition at line 136 of file ImageContainerBySTLMap.h.


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