DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
DGtal::SetValueIterator< TImage, TIteratorOnPts > Class Template Reference

Aim: implements an output iterator, which is able to write values in an underlying image, by calling its setValue method. More...

#include <DGtal/images/SetValueIterator.h>

Inheritance diagram for DGtal::SetValueIterator< TImage, TIteratorOnPts >:

Public Types

typedef TImage Image
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CTrivialImage< Image >))
 
 SetValueIterator (const TIteratorOnPts &aItOnPts, Image &aImg)
 
 SetValueIterator (Image &aImg)
 
 SetValueIterator (const SetValueIterator &other)
 
 ~SetValueIterator ()
 
SetValueIteratoroperator= (const typename Image::Value &aValue)
 
SetValueIteratoroperator* ()
 
SetValueIteratoroperator++ ()
 
SetValueIterator operator++ (int)
 

Private Attributes

ImagemyImg
 
TIteratorOnPts myItOnPts
 

Detailed Description

template<typename TImage, typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
class DGtal::SetValueIterator< TImage, TIteratorOnPts >

Aim: implements an output iterator, which is able to write values in an underlying image, by calling its setValue method.

Description of template class 'SetValueIterator'

Template Parameters
TImagea model of CSetValueImage

Definition at line 67 of file SetValueIterator.h.

Member Typedef Documentation

◆ Image

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
typedef TImage DGtal::SetValueIterator< TImage, TIteratorOnPts >::Image

Definition at line 73 of file SetValueIterator.h.

Constructor & Destructor Documentation

◆ SetValueIterator() [1/3]

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( const TIteratorOnPts &  aItOnPts,
Image aImg 
)
inline

Constructor.

Parameters
aItOnPtsan iterator on points
aImgany image passed by reference

Definition at line 84 of file SetValueIterator.h.

85: myImg(&aImg), myItOnPts(aItOnPts) {}

◆ SetValueIterator() [2/3]

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( Image aImg)
inline

Overloaded constructor, which can be used with the default template argument.

Parameters
aImgany image passed by reference

Definition at line 92 of file SetValueIterator.h.

93: myImg(&aImg), myItOnPts(myImg->domain().begin()) {}

◆ SetValueIterator() [3/3]

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( const SetValueIterator< TImage, TIteratorOnPts > &  other)
inline

Copy constructor.

Parameters
otherthe object to clone.

Definition at line 99 of file SetValueIterator.h.

100: myImg(other.myImg), myItOnPts(other.myItOnPts) {}

◆ ~SetValueIterator()

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::~SetValueIterator ( )
inline

Destructor.

Definition at line 105 of file SetValueIterator.h.

105{}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::BOOST_CONCEPT_ASSERT ( (concepts::CTrivialImage< Image >)  )

◆ operator*()

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator & DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator* ( )
inline

Dereference operator

Returns
a reference to *this

Definition at line 125 of file SetValueIterator.h.

125{ return *this; }

◆ operator++() [1/2]

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator & DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++ ( )
inline

Pre-increment operator

Returns
a reference to *this

Definition at line 131 of file SetValueIterator.h.

131{ ++myItOnPts; return *this; }

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

◆ operator++() [2/2]

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++ ( int  )
inline

Post-increment operator

Returns
*this

Definition at line 137 of file SetValueIterator.h.

138 {
139 SetValueIterator tmp = *this;
140 ++myItOnPts;
141 return tmp;
142 }
SetValueIterator(const TIteratorOnPts &aItOnPts, Image &aImg)

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

◆ operator=()

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator & DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator= ( const typename Image::Value aValue)
inline

Assignment

Parameters
aValueany value
Returns
a reference to *this

Definition at line 115 of file SetValueIterator.h.

116 {
117 myImg->setValue( *myItOnPts, aValue );
118 return *this;
119 }

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myImg, and DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

Field Documentation

◆ myImg

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
Image* DGtal::SetValueIterator< TImage, TIteratorOnPts >::myImg
private

Aliasing pointer on the underlying image

Definition at line 161 of file SetValueIterator.h.

Referenced by DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator=().

◆ myItOnPts

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
TIteratorOnPts DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts
private

Iterator on points that scan the domain of the underlying image

Definition at line 166 of file SetValueIterator.h.

Referenced by DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++(), and DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator=().


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