DGtal
0.6.devel
|
#include <ImageAdapter.h>
Public Types | |
typedef ImageAdapter < TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 > | Self |
typedef TNewDomain | Domain |
typedef TNewDomain::Point | Point |
typedef TNewValue | Value |
typedef TImageContainer | ImageContainer |
typedef DefaultConstImageRange < Self > | ConstRange |
typedef DefaultImageRange< Self > | Range |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((CImage< TImageContainer >)) | |
BOOST_CONCEPT_ASSERT ((CDomain< TNewDomain >)) | |
BOOST_CONCEPT_ASSERT ((CUnaryFunctor< TFunctorD, typename TImageContainer::Point, Point >)) | |
BOOST_CONCEPT_ASSERT ((CUnaryFunctor< TFunctorVm1, typename TImageContainer::Value, Value >)) | |
ImageAdapter (ImageContainer &anImage, const Domain &aDomain, const TFunctorD &aFD, const TFunctorV &aFV, const TFunctorVm1 &aFVm1) | |
ImageAdapter & | operator= (const ImageAdapter &other) |
~ImageAdapter () | |
const Domain & | domain () const |
ConstRange | constRange () const |
Range | range () |
Value | operator() (const Point &aPoint) const |
void | setValue (const Point &aPoint, const typename TImageContainer::Value &aValue) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
const ImageContainer * | getPointer () const |
Protected Attributes | |
ImageContainer * | myImagePtr |
const Domain * | mySubDomainPtr |
const TFunctorD * | myFD |
const TFunctorV * | myFV |
const TFunctorVm1 * | myFVm1 |
Private Member Functions | |
ImageAdapter () |
Aim: implements an image adapter with a given domain (i.e. a subdomain) and 3 functors : g for domain, f for accessing point values and f-1 for writing point values.
Description of template class 'ImageAdapter'
This class is (like Image class) a lightweight proxy on ImageContainers (models of CImage). It uses a given Domain (i.e. a subdomain) but work directly (for reading and writing processes) thanks to an alias (i.e. a pointer) on the original Image given in argument.
ImageAdapter class is also a model of CImage.
Caution :
TImageContainer | an image container type (model of CImage). |
TDomain | a domain. |
TFunctorD | the functor g that transforms the domain into another one |
TNewValue | the type of value return by the functor f. |
TFunctorV | the functor f that transforms the value into another one during reading process |
TFunctorVm1 | the functor f-1 that transforms the value into another one during writing process |
The values associated to accessing the point values are adapted with a functor g and a functor f given at construction so that operator() calls f(img(g(aPoint))), instead of calling directly operator() of the underlying image img.
The values associated to writing the points are adapted with a functor g and a functor f-1 given at construction so that setValue() is img.setValue(g(aPoint), f-1(aValue))
Here is the construction of a simple image adapter that is a thresholded view of the initial scalar image:
NB: the underlying image as well as the 3 functors are stored in the adapter as aliasing pointer in order to avoid copies. The pointed objects must exist and must not be deleted during the use of the adapter
Definition at line 112 of file ImageAdapter.h.
typedef DefaultConstImageRange<Self> DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::ConstRange |
Definition at line 134 of file ImageAdapter.h.
typedef TNewDomain DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::Domain |
Definition at line 124 of file ImageAdapter.h.
typedef TImageContainer DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::ImageContainer |
Types copied from the container.
Definition at line 132 of file ImageAdapter.h.
typedef TNewDomain::Point DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::Point |
Definition at line 125 of file ImageAdapter.h.
typedef DefaultImageRange<Self> DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::Range |
Definition at line 135 of file ImageAdapter.h.
typedef ImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1> DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::Self |
Definition at line 118 of file ImageAdapter.h.
typedef TNewValue DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::Value |
Definition at line 126 of file ImageAdapter.h.
|
inline |
Definition at line 141 of file ImageAdapter.h.
References DGtal::trace, and DGtal::Trace::warning().
|
inline |
|
inlineprivate |
Default constructor.
Definition at line 288 of file ImageAdapter.h.
References DGtal::trace, and DGtal::Trace::warning().
DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::BOOST_CONCEPT_ASSERT | ( | (CImage< TImageContainer >) | ) |
Checking concepts.
DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::BOOST_CONCEPT_ASSERT | ( | (CDomain< TNewDomain >) | ) |
DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::BOOST_CONCEPT_ASSERT | ( | (CUnaryFunctor< TFunctorD, typename TImageContainer::Point, Point >) | ) |
DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::BOOST_CONCEPT_ASSERT | ( | (CUnaryFunctor< TFunctorVm1, typename TImageContainer::Value, Value >) | ) |
|
inline |
Returns the range of the underlying image to iterate over its values
Definition at line 198 of file ImageAdapter.h.
|
inline |
Returns a reference to the underlying image domain.
Definition at line 187 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator()(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::setValue().
|
inline |
Returns the pointer on the Image container data.
Definition at line 278 of file ImageAdapter.h.
References DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myImagePtr.
|
inline |
Checks the validity/consistency of the object.
Definition at line 268 of file ImageAdapter.h.
References DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myImagePtr.
|
inline |
Get the value of an image at a given position given by a Point.
aPoint | the point. |
Definition at line 226 of file ImageAdapter.h.
References DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::domain(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFD, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFV, and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myImagePtr.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 154 of file ImageAdapter.h.
References DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFD, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFV, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFVm1, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myImagePtr, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::mySubDomainPtr, DGtal::trace, and DGtal::Trace::warning().
|
inline |
Returns the range of the underlying image to iterate over its values
Definition at line 209 of file ImageAdapter.h.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 57 of file ImageAdapter.ih.
|
inline |
Set a value on an Image at a position specified by a Point.
it
must be a point in the image domain.aPoint | the point. |
aValue | the value. |
Definition at line 244 of file ImageAdapter.h.
References DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::domain(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFD, DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myFVm1, and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::myImagePtr.
|
protected |
Aliasing pointer on the underlying Domain functor
Definition at line 308 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator()(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::setValue().
|
protected |
Aliasing pointer on the underlying Value functor
Definition at line 313 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator()(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=().
|
protected |
Aliasing pointer on the underlying "m-1" Value functor
Definition at line 318 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::setValue().
|
protected |
Alias on the image container.
Definition at line 298 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::getPointer(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::isValid(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator()(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::setValue().
|
protected |
The image SubDomain
Definition at line 303 of file ImageAdapter.h.
Referenced by DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::domain(), and DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=().