Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes

mln::dpoints_fwd_pixter< I > Class Template Reference

A generic forward iterator on the pixels of a dpoint-based window or neighborhood. More...

#include <dpoints_pixter.hh>

Inheritance diagram for mln::dpoints_fwd_pixter< I >:
Inheritance graph

List of all members.

Public Types

typedef Object< void > category
typedef dpoints_fwd_pixter< I > exact_t
typedef I image
 Image type.
typedef I::lvalue lvalue
 Image lvalue type.
typedef I::rvalue rvalue
 Image rvalue type.
typedef I::value value
 Image value type.

Public Member Functions

value ** address_ () const
 Address of the current iterator value/pixel.
const I::value & center_val () const
 The value around which this iterator moves.
template<typename Dps , typename Pref >
 dpoints_fwd_pixter (const Generalized_Pixel< Pref > &pxl_ref, const Dps &dps)
 Constructor (using a generalized pixel).
template<typename Dps , typename Pref >
 dpoints_fwd_pixter (I &image, const Dps &dps, const Pref &p_ref)
 Constructor (using an image).
I & ima () const
 Give the pixel image.
void next ()
 Go to the next element.
 operator unsigned () const
rvalue val () const
 Get the pixel iterator value.
lvalue val ()
 pixel iterator value.

void start ()
 Manipulation.
void next_ ()
 Go to the next pixel.
void invalidate ()
 Invalidate the iterator.
bool is_valid () const
 Test the iterator validity.
void update ()
 Force this iterator to update its location to take into account that its center point may have moved.

Private Types

typedef internal::pixel_impl_
< I, dpoints_fwd_pixter< I > > 
super_

Private Member Functions

template<typename Dps >
void init_ (const Dps &dps)

Private Attributes

std::vector< int >::const_iterator i_
 Current offset.
std::vector< int > offset_
 Offset of each delta-point.

I::qlf_value ** value_ref_
 Reference value or pixel.
const I::psite * p_ref_
 Reference pixel / point in the image.

Detailed Description

template<typename I>
class mln::dpoints_fwd_pixter< I >

A generic forward iterator on the pixels of a dpoint-based window or neighborhood.

Parameter I is the image type.

Definition at line 57 of file dpoints_pixter.hh.


Member Typedef Documentation

typedef Object<void> mln::Object< dpoints_fwd_pixter< I > >::category [inherited]

Definition at line 174 of file object.hh.

typedef dpoints_fwd_pixter< I > mln::Object< dpoints_fwd_pixter< I > >::exact_t [inherited]

Definition at line 173 of file object.hh.

typedef I mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::image [inherited]

Image type.

Definition at line 129 of file pixel_impl.hh.

typedef I ::lvalue mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::lvalue [inherited]

Image lvalue type.

Definition at line 135 of file pixel_impl.hh.

typedef I ::rvalue mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::rvalue [inherited]

Image rvalue type.

Definition at line 138 of file pixel_impl.hh.

template<typename I >
typedef internal::pixel_impl_< I, dpoints_fwd_pixter<I> > mln::dpoints_fwd_pixter< I >::super_ [private]

Reimplemented from mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >.

Definition at line 61 of file dpoints_pixter.hh.

typedef I ::value mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::value [inherited]

Image value type.

Definition at line 132 of file pixel_impl.hh.


Constructor & Destructor Documentation

template<typename I >
template<typename Dps , typename Pref >
mln::dpoints_fwd_pixter< I >::dpoints_fwd_pixter ( I &  image,
const Dps &  dps,
const Pref &  p_ref 
) [inline]

Constructor (using an image).

Parameters:
[in] image The image to iterate over.
[in] dps An object (neighborhood or window) that can provide a set of delta-points.
[in] p_ref Center (resp. reference) point of the neighborhood (resp. window).

Definition at line 224 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::init_(), mln::dpoints_fwd_pixter< I >::p_ref_, and mln::dpoints_fwd_pixter< I >::value_ref_.

template<typename I >
template<typename Dps , typename Pref >
mln::dpoints_fwd_pixter< I >::dpoints_fwd_pixter ( const Generalized_Pixel< Pref > &  pxl_ref,
const Dps &  dps 
) [inline]

Constructor (using a generalized pixel).

Parameters:
[in] pxl_ref Center (generalized) pixel to iterate around.
[in] dps An object (neighborhood or window) that can provide a set of delta-points.

Definition at line 241 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::init_(), mln::dpoints_fwd_pixter< I >::p_ref_, and mln::dpoints_fwd_pixter< I >::value_ref_.


Member Function Documentation

value** mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::address_ (  )  const [inherited]

Address of the current iterator value/pixel.

template<typename I >
const I::value & mln::dpoints_fwd_pixter< I >::center_val (  )  const [inline]

The value around which this iterator moves.

Definition at line 256 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::p_ref_, and mln::dpoints_fwd_pixter< I >::value_ref_.

I& mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::ima (  )  const [inherited]

Give the pixel image.

template<typename I >
template<typename Dps >
void mln::dpoints_fwd_pixter< I >::init_ ( const Dps &  dps  )  [inline, private]
template<typename I >
void mln::dpoints_fwd_pixter< I >::invalidate (  )  [inline]

Invalidate the iterator.

Definition at line 325 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::i_, and mln::dpoints_fwd_pixter< I >::offset_.

Referenced by mln::dpoints_fwd_pixter< I >::init_().

template<typename I >
bool mln::dpoints_fwd_pixter< I >::is_valid (  )  const [inline]
void mln::Iterator< dpoints_fwd_pixter< I > >::next (  )  [inherited]

Go to the next element.

Warning:
This is a final method; iterator classes should not re-defined this method. The actual "next" operation has to be defined through the next_ method.
Precondition:
The iterator is valid.
template<typename I >
void mln::dpoints_fwd_pixter< I >::next_ (  )  [inline]

Go to the next pixel.

Definition at line 307 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::i_, and mln::dpoints_fwd_pixter< I >::is_valid().

mln::Generalized_Pixel< dpoints_fwd_pixter< I > >::operator unsigned (  )  const [inline, inherited]

Definition at line 65 of file generalized_pixel.hh.

template<typename I >
void mln::dpoints_fwd_pixter< I >::start (  )  [inline]

Manipulation.

Start an iteration.

Definition at line 298 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::i_, mln::dpoints_fwd_pixter< I >::offset_, and mln::dpoints_fwd_pixter< I >::update().

template<typename I >
void mln::dpoints_fwd_pixter< I >::update (  )  [inline]

Force this iterator to update its location to take into account that its center point may have moved.

Definition at line 284 of file dpoints_pixter.hh.

References mln::dpoints_fwd_pixter< I >::i_, mln::dpoints_fwd_pixter< I >::is_valid(), mln::dpoints_fwd_pixter< I >::p_ref_, and mln::dpoints_fwd_pixter< I >::value_ref_.

Referenced by mln::dpoints_fwd_pixter< I >::start().

rvalue mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::val (  )  const [inherited]

Get the pixel iterator value.

lvalue mln::internal::pixel_impl_< I, dpoints_fwd_pixter< I > >::val (  )  [inherited]

pixel iterator value.


Member Data Documentation

template<typename I >
std::vector<int>::const_iterator mln::dpoints_fwd_pixter< I >::i_ [private]
template<typename I >
std::vector<int> mln::dpoints_fwd_pixter< I >::offset_ [private]

Offset of each delta-point.

offset_[0] is absolute, while other offsets are relative (i.e., offset_[i] is the memory difference to go from pixel i-1 to pixel i.

Definition at line 115 of file dpoints_pixter.hh.

Referenced by mln::dpoints_fwd_pixter< I >::init_(), mln::dpoints_fwd_pixter< I >::invalidate(), mln::dpoints_fwd_pixter< I >::is_valid(), and mln::dpoints_fwd_pixter< I >::start().

template<typename I >
const I ::psite* mln::dpoints_fwd_pixter< I >::p_ref_ [private]
template<typename I >
I ::qlf_value** mln::dpoints_fwd_pixter< I >::value_ref_ [private]

Reference value or pixel.

One and only one of these pointers should be non-null.

Reference value the image

Definition at line 124 of file dpoints_pixter.hh.

Referenced by mln::dpoints_fwd_pixter< I >::center_val(), mln::dpoints_fwd_pixter< I >::dpoints_fwd_pixter(), and mln::dpoints_fwd_pixter< I >::update().