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

VectorComponentValueAccessor< VECTORTYPE > Class Template Reference

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

#include <vigra/accessor.hxx>

Public Types

typedef VECTORTYPE::value_type value_type
 

Public Member Functions

template<class ITERATOR>
value_type operator() (ITERATOR const &i) const
 
template<class ITERATOR, class OFFSET>
value_type operator() (ITERATOR const &i, OFFSET const &diff) const
 
template<class V, class ITERATOR>
void set (V value, ITERATOR const &i) const
 
template<class V, class ITERATOR, class OFFSET>
void set (V value, ITERATOR const &i, OFFSET const &diff) const
 
void setIndex (int i)
 
 VectorComponentValueAccessor (int index)
 

Detailed Description

template<class VECTORTYPE>
class vigra::VectorComponentValueAccessor< VECTORTYPE >

Accessor for one component of a vector.

This accessor allows to select a single component (a single 'band') of a vector valued pixel type. The pixel type must support operator[]. The index of the component to be selected is passed in the constructor. The accessor returns its items by value. If you want to pass/return items by reference, use VectorComponentAccessor. If a floating point number is assigned by means of an accessor with integral value_type, the value is rounded and clipped as appropriate.

Usage:

vigra::BRGBImage image(w,h);
// init red channel with 255
initImage(destImageRange(image,
255);
VectorComponentValueAccessor(int index)
Definition accessor.hxx:459
BasicImage< RGBValue< UInt8 > > BRGBImage
Definition stdimage.hxx:164
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 VECTORTYPE>
typedef VECTORTYPE::value_type value_type

Constructor & Destructor Documentation

◆ VectorComponentValueAccessor()

template<class VECTORTYPE>
VectorComponentValueAccessor ( int index)

determine the component to be accessed

Member Function Documentation

◆ operator()() [1/2]

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

Read the current data item. The type ITERATOR::index_reference::value_type is automatically converted to value_type. In case of a conversion floating point -> integral this includes rounding and clipping.

◆ operator()() [2/2]

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

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

◆ set() [1/2]

template<class VECTORTYPE>
template<class V, class ITERATOR>
void set ( V 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 VECTORTYPE>
template<class V, class ITERATOR, class OFFSET>
void set ( V 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 VECTORTYPE>
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.12.2 (Mon Apr 14 2025)