DGtal 1.4.0
Loading...
Searching...
No Matches
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>

Public Types

using iterator_category = std::output_iterator_tag
 
using value_type = void
 
using difference_type = void
 
using pointer = void
 
using reference = void
 
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

◆ difference_type

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
using DGtal::SetValueIterator< TImage, TIteratorOnPts >::difference_type = void

Definition at line 74 of file SetValueIterator.h.

◆ Image

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

Definition at line 78 of file SetValueIterator.h.

◆ iterator_category

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
using DGtal::SetValueIterator< TImage, TIteratorOnPts >::iterator_category = std::output_iterator_tag

Definition at line 72 of file SetValueIterator.h.

◆ pointer

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
using DGtal::SetValueIterator< TImage, TIteratorOnPts >::pointer = void

Definition at line 75 of file SetValueIterator.h.

◆ reference

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
using DGtal::SetValueIterator< TImage, TIteratorOnPts >::reference = void

Definition at line 76 of file SetValueIterator.h.

◆ value_type

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
using DGtal::SetValueIterator< TImage, TIteratorOnPts >::value_type = void

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 89 of file SetValueIterator.h.

90: 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 97 of file SetValueIterator.h.

98: 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 104 of file SetValueIterator.h.

105: 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 110 of file SetValueIterator.h.

110{}

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 130 of file SetValueIterator.h.

130{ 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 136 of file SetValueIterator.h.

136{ ++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 142 of file SetValueIterator.h.

143 {
144 SetValueIterator tmp = *this;
145 ++myItOnPts;
146 return tmp;
147 }
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 120 of file SetValueIterator.h.

121 {
122 myImg->setValue( *myItOnPts, aValue );
123 return *this;
124 }

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 166 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

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