DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Attributes
DGtal::Image< TImageContainer > Class Template Reference

#include <Image.h>

Collaboration diagram for DGtal::Image< TImageContainer >:
Collaboration graph
[legend]

Public Types

typedef TImageContainer ImageContainer
typedef TImageContainer::Domain Domain
typedef TImageContainer::Point Point
typedef TImageContainer::Value Value
typedef TImageContainer::ConstRange ConstRange
typedef TImageContainer::Range Range
typedef
TImageContainer::OutputIterator 
OutputIterator
typedef CowPtr< TImageContainer > ImagePointer

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CImage< TImageContainer >))
 BOOST_CONCEPT_ASSERT ((CVertexMap< TImageContainer >))
 Image ()
 Image (ImageContainer *anImageContainer)
 Image (const CowPtr< ImageContainer > &anImageContainerCowPointer)
 Image (const ImageContainer &other)
 Image (const Image &other)
Imageoperator= (const Image &other)
 ~Image ()
const Domaindomain () const
ConstRange constRange () const
Range range ()
Value operator() (const Point &aPoint) const
void setValue (const Point &aPoint, const Value &aValue)
void selfDisplay (std::ostream &out) const
bool isValid () const
const ImagePointer getPointer () const

Protected Attributes

ImagePointer myImagePointer

Detailed Description

template<typename TImageContainer>
class DGtal::Image< TImageContainer >

Aim: implements association bewteen points lying in a digital domain and values.

Description of template class 'Image'

This class is a lightweight proxy on ImageContainers (models of CImage). Image class is also a model of CImage.

Template Parameters:
TImageContaineran image container type (model of CImage).
Examples:
geometry/surfaces/greedy-plane-segmentation-ex2.cpp, geometry/surfaces/greedy-plane-segmentation.cpp, io/digitalSetFromVol.cpp, io/display3DToOFF.cpp, topology/3dBorderExtractionImg.cpp, topology/ctopo-2-3d.cpp, topology/ctopo-2.cpp, topology/frontierAndBoundary.cpp, topology/volScanBoundary.cpp, topology/volToOFF.cpp, and topology/volTrackBoundary.cpp.

Definition at line 69 of file Image.h.


Member Typedef Documentation

template<typename TImageContainer>
typedef TImageContainer::ConstRange DGtal::Image< TImageContainer >::ConstRange

Definition at line 85 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer::Domain DGtal::Image< TImageContainer >::Domain

Definition at line 82 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer DGtal::Image< TImageContainer >::ImageContainer

Types copied from the container.

Definition at line 81 of file Image.h.

template<typename TImageContainer>
typedef CowPtr<TImageContainer> DGtal::Image< TImageContainer >::ImagePointer

Pointer to the image container data.

Definition at line 90 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer::OutputIterator DGtal::Image< TImageContainer >::OutputIterator

Definition at line 87 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer::Point DGtal::Image< TImageContainer >::Point

Definition at line 83 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer::Range DGtal::Image< TImageContainer >::Range

Definition at line 86 of file Image.h.

template<typename TImageContainer>
typedef TImageContainer::Value DGtal::Image< TImageContainer >::Value

Definition at line 84 of file Image.h.


Constructor & Destructor Documentation

template<typename TImageContainer>
DGtal::Image< TImageContainer >::Image ( )
inline

Default constructor.

Definition at line 99 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image Ctor default "<<std::endl;
#endif
};
template<typename TImageContainer>
DGtal::Image< TImageContainer >::Image ( ImageContainer anImageContainer)
inline

Constructor from a pointer on the underlying image container. (data pointer is acquired, ownership transfer)

Definition at line 110 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

:
myImagePointer(anImageContainer)
{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image Ctor fromPointer "<<std::endl;
#endif
}
template<typename TImageContainer>
DGtal::Image< TImageContainer >::Image ( const CowPtr< ImageContainer > &  anImageContainerCowPointer)
inline

Constructor from Copy on write pointer. (data is not copied if read-only)

Parameters:
anImageContainerCowPointera COW-pointer on the underlying container.

Definition at line 123 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

:
myImagePointer(anImageContainerCowPointer)
{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image Ctor fromCow "<<std::endl;
#endif
}
template<typename TImageContainer>
DGtal::Image< TImageContainer >::Image ( const ImageContainer other)
inline

Constructor from ImageContainer const reference (data is duplicated).

Parameters:
otheran object of same type to copy.

Definition at line 136 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

:
{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image Ctor fromConstRef "<<std::endl;
#endif
}
template<typename TImageContainer>
DGtal::Image< TImageContainer >::Image ( const Image< TImageContainer > &  other)
inline

Copy Constructor (data is not copied here).

Parameters:
otheran object of same type to copy.

Definition at line 150 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

:
{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image copy Ctor "<<std::endl;
#endif
}
template<typename TImageContainer>
DGtal::Image< TImageContainer >::~Image ( )
inline

Destructor. Does nothing, the cow pointer takes care of everything

Definition at line 180 of file Image.h.

{}

Member Function Documentation

template<typename TImageContainer>
DGtal::Image< TImageContainer >::BOOST_CONCEPT_ASSERT ( (CImage< TImageContainer >)  )

Checking concepts.

template<typename TImageContainer>
DGtal::Image< TImageContainer >::BOOST_CONCEPT_ASSERT ( (CVertexMap< TImageContainer >)  )
template<typename TImageContainer>
ConstRange DGtal::Image< TImageContainer >::constRange ( ) const
inline

Returns the range of the underlying image to iterate over its values

Returns:
a range.

Definition at line 203 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

{
return myImagePointer->constRange();
}
template<typename TImageContainer>
const Domain& DGtal::Image< TImageContainer >::domain ( ) const
inline

Returns a reference to the underlying image domain.

Returns:
a reference to the domain.
Examples:
geometry/surfaces/greedy-plane-segmentation-ex2.cpp, geometry/surfaces/greedy-plane-segmentation.cpp, io/digitalSetFromVol.cpp, io/display3DToOFF.cpp, topology/3dBorderExtractionImg.cpp, topology/ctopo-2-3d.cpp, topology/ctopo-2.cpp, topology/volScanBoundary.cpp, topology/volToOFF.cpp, and topology/volTrackBoundary.cpp.

Definition at line 192 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

Referenced by DGtal::SetFromImage< TSet >::append(), and DGtal::Display2DFactory::drawImage().

{
return myImagePointer->domain();
}
template<typename TImageContainer>
const ImagePointer DGtal::Image< TImageContainer >::getPointer ( ) const
inline

Returns the smart pointer on the Image container data.

Returns:
a const ImagePointer.

Definition at line 279 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

{
}
template<typename TImageContainer>
bool DGtal::Image< TImageContainer >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
the validity of the Image

Definition at line 269 of file Image.h.

References DGtal::CowPtr< T >::isValid(), and DGtal::Image< TImageContainer >::myImagePointer.

{
return (myImagePointer->isValid() );
}
template<typename TImageContainer>
Value DGtal::Image< TImageContainer >::operator() ( const Point aPoint) const
inline

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.

Definition at line 231 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

{
return myImagePointer->operator()(aPoint);
}
template<typename TImageContainer>
Image& DGtal::Image< TImageContainer >::operator= ( const Image< TImageContainer > &  other)
inline

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.

Definition at line 163 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer, DGtal::trace, and DGtal::Trace::warning().

{
#ifdef DEBUG_VERBOSE
trace.warning() << "Image assignment "<<std::endl;
#endif
if (&other != this)
{
}
return *this;
}
template<typename TImageContainer>
Range DGtal::Image< TImageContainer >::range ( )
inline

Returns the range of the underlying image to iterate over its values

Returns:
a range.

Definition at line 214 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

{
return myImagePointer->range();
}
template<typename T >
void DGtal::Image< T >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 52 of file Image.ih.

{
out << "[Image] "<< myImagePointer ;
}
template<typename TImageContainer>
void DGtal::Image< TImageContainer >::setValue ( const Point aPoint,
const Value aValue 
)
inline

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.
Examples:
topology/frontierAndBoundary.cpp.

Definition at line 247 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

{
myImagePointer->setValue(aPoint,aValue);
}

Field Documentation

template<typename TImageContainer>
ImagePointer DGtal::Image< TImageContainer >::myImagePointer
protected

Owning smart pointer on the image container.

Definition at line 290 of file Image.h.

Referenced by DGtal::Image< TImageContainer >::constRange(), DGtal::Image< TImageContainer >::domain(), DGtal::Image< TImageContainer >::getPointer(), DGtal::Image< TImageContainer >::isValid(), DGtal::Image< TImageContainer >::operator()(), DGtal::Image< TImageContainer >::operator=(), DGtal::Image< TImageContainer >::range(), and DGtal::Image< TImageContainer >::setValue().


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