[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

VectorElementAccessor< ACCESSOR > Class Template Reference

Accessor for one component of a vector. More...

#include <vigra/accessor.hxx>

Public Types

typedef ACCESSOR::component_type value_type
 

Public Member Functions

template<class ITERATOR >
value_type constoperator() (ITERATOR const &i) const
 
template<class ITERATOR , class OFFSET >
value_type constoperator() (ITERATOR const &i, OFFSET const &diff) const
 
template<class V , class ITERATOR >
void set (V const &value, ITERATOR const &i) const
 
template<class V , class ITERATOR , class OFFSET >
void set (V const &value, ITERATOR const &i, OFFSET const &diff) const
 
void setIndex (int i)
 
 VectorElementAccessor (int index, ACCESSOR a=ACCESSOR())
 

Detailed Description

template<class ACCESSOR>
class vigra::VectorElementAccessor< ACCESSOR >

Accessor for one component of a vector.

This works like VectorComponentAccessor, only the template parameters differ: Here, we need a vector accessor type , whereas VectorComponentAccessor requires a vector type.

Usage:

// init red channel with 255
initImage(destImageRange(image,
255);
Class for a single RGB value.
Definition rgbvalue.hxx:128
void initImage(...)
Write a value to every pixel in an image or rectangular ROI.

#include <vigra/accessor.hxx>
Namespace: vigra

Member Typedef Documentation

◆ value_type

template<class ACCESSOR >
typedef ACCESSOR::component_type value_type

the value_type

Constructor & Destructor Documentation

◆ VectorElementAccessor()

template<class ACCESSOR >
VectorElementAccessor ( int  index,
ACCESSOR  a = ACCESSOR() 
)

determine the component to be accessed

Member Function Documentation

◆ operator()() [1/2]

template<class ACCESSOR >
template<class ITERATOR >
value_type const & operator() ( ITERATOR const i) const

read the current data item

◆ operator()() [2/2]

template<class ACCESSOR >
template<class ITERATOR , class OFFSET >
value_type const & operator() ( ITERATOR const i,
OFFSET const diff 
) const

read the data item at an offset (can be 1D or 2D or higher order difference).

◆ set() [1/2]

template<class ACCESSOR >
template<class V , class ITERATOR >
void set ( V const value,
ITERATOR const i 
) const

Write the current data item. The type V of the passed in value is automatically converted to value_type. In case of a conversion floating point -> integral this includes rounding and clipping.

◆ set() [2/2]

template<class ACCESSOR >
template<class V , class ITERATOR , class OFFSET >
void set ( V const value,
ITERATOR const i,
OFFSET const diff 
) const

Write the data item at an offset (can be 1D or 2D or higher order difference).. The type V of the passed in value is automatically converted to value_type. In case of a conversion floating point -> integral this includes rounding and clipping.

◆ setIndex()

template<class ACCESSOR >
void setIndex ( int  i)

Reset the index to the given number.


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

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.11.2