DGtal
0.9.3
|
#include <DGtal/images/ConstImageAdapter.h>
Public Types | |
typedef ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV > | Self |
typedef TNewDomain | Domain |
typedef TNewDomain::Point | Point |
typedef TNewValue | Value |
typedef TImageContainer | ImageContainer |
typedef DefaultConstImageRange< Self > | ConstRange |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CConstImage< TImageContainer >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CDomain< TNewDomain >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TFunctorD, Point, typename TImageContainer::Point >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TFunctorV, typename TImageContainer::Value, Value >)) | |
ConstImageAdapter (ConstAlias< ImageContainer > anImage, ConstAlias< Domain > aDomain, ConstAlias< TFunctorD > aFD, ConstAlias< TFunctorV > aFV) | |
ConstImageAdapter & | operator= (const ConstImageAdapter &other) |
~ConstImageAdapter () | |
const Domain & | domain () const |
ConstRange | constRange () const |
Value | operator() (const Point &aPoint) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
std::string | className () const |
const ImageContainer * | getPointer () const |
void | setDefaultValue (Value aValue) |
Value | getDefaultValue () const |
Protected Attributes | |
const ImageContainer * | myImagePtr |
const Domain * | mySubDomainPtr |
const TFunctorD * | myFD |
const TFunctorV * | myFV |
Value | defaultValue |
Private Member Functions | |
ConstImageAdapter () | |
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for domain, f for accessing point values.
Description of template class 'ConstImageAdapter'
This class is (like Image class) a lightweight proxy on any models of CConstImage. It uses a given Domain (i.e. a subdomain) but work directly (for accessing process) thanks to an alias (i.e. a pointer) on the original Image given in argument.
ConstImageAdapter class is also a model of CConstImage.
Caution :
TImageContainer | an image container type (model of CConstImage). |
TNewDomain | 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 |
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.
Here is the construction of a simple ConstImageAdapter that is a thresholded view of the initial scalar image:
NB: the underlying image as well as the 2 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 105 of file ConstImageAdapter.h.
typedef DefaultConstImageRange<Self> DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::ConstRange |
Definition at line 128 of file ConstImageAdapter.h.
typedef TNewDomain DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::Domain |
Definition at line 117 of file ConstImageAdapter.h.
typedef TImageContainer DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::ImageContainer |
Types copied from the container.
Definition at line 126 of file ConstImageAdapter.h.
typedef TNewDomain::Point DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::Point |
Definition at line 118 of file ConstImageAdapter.h.
typedef ConstImageAdapter<TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV> DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::Self |
Definition at line 111 of file ConstImageAdapter.h.
typedef TNewValue DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::Value |
Definition at line 119 of file ConstImageAdapter.h.
|
inline |
Definition at line 134 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::defaultValue, DGtal::trace, and DGtal::Trace::warning().
|
inline |
|
inlineprivate |
Default constructor.
Definition at line 279 of file ConstImageAdapter.h.
References DGtal::trace, and DGtal::Trace::warning().
DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::BOOST_CONCEPT_ASSERT | ( | (concepts::CConstImage< TImageContainer >) | ) |
Checking concepts.
DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDomain< TNewDomain >) | ) |
DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnaryFunctor< TFunctorD, Point, typename TImageContainer::Point >) | ) |
DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnaryFunctor< TFunctorV, typename TImageContainer::Value, Value >) | ) |
std::string DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::className | ( | ) | const |
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::isValid().
|
inline |
Returns the range of the underlying image to iterate over its values
Definition at line 197 of file ConstImageAdapter.h.
|
inline |
Returns a reference to the underlying image domain.
Definition at line 186 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::mySubDomainPtr.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()().
|
inline |
Definition at line 269 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::defaultValue.
|
inline |
Returns the pointer on the Image container data.
Definition at line 254 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myImagePtr.
|
inline |
Checks the validity/consistency of the object.
Definition at line 238 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::className(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myImagePtr.
|
inline |
Get the value of an image at a given position given by a Point.
aPoint | the point. |
Definition at line 214 of file ConstImageAdapter.h.
References aPoint(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::defaultValue, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::domain(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myFD, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myFV, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myImagePtr, and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::selfDisplay().
|
inline |
Assignment.
other | the object to copy. |
Definition at line 153 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::defaultValue, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myFD, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myFV, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::myImagePtr, DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::mySubDomainPtr, DGtal::trace, and DGtal::Trace::warning().
void DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()().
|
inline |
Allows to define a default value returned when point transformed by domain functor does not belongs to image domain.
Definition at line 264 of file ConstImageAdapter.h.
References DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::defaultValue.
|
protected |
Default value returned when point transformed by image functor does not belongs to image. Initial value is 0.
Definition at line 310 of file ConstImageAdapter.h.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::ConstImageAdapter(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::getDefaultValue(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::setDefaultValue().
|
protected |
Aliasing pointer on the underlying Domain functor
Definition at line 299 of file ConstImageAdapter.h.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=().
|
protected |
Aliasing pointer on the underlying Value functor
Definition at line 304 of file ConstImageAdapter.h.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=().
|
protected |
Alias on the image container.
Definition at line 289 of file ConstImageAdapter.h.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::getPointer(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::isValid(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator()(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=().
|
protected |
The image SubDomain
Definition at line 294 of file ConstImageAdapter.h.
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::domain(), and DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=().