[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
|   | VectorElementAccessor [Data Accessors] |  | 
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, class DIFFERENCE> | |
| value_type const & | operator() (ITERATOR const &i, DIFFERENCE const &diff) const | 
| template<class ITERATOR> | |
| value_type const & | operator() (ITERATOR const &i) const | 
| template<class V, class ITERATOR, class DIFFERENCE> | |
| void | set (V const &value, ITERATOR const &i, DIFFERENCE const &diff) const | 
| template<class V, class ITERATOR> | |
| void | set (V const &value, ITERATOR const &i) const | 
| void | setIndex (int i) | 
| VectorElementAccessor (int index, ACCESSOR a=ACCESSOR()) | |
This works like VectorComponentAccessor, only the template paramters differ: Here, we need a vector accessor type , wheras VectorComponentAccessor requires a vector type.
Usage:
vigra::BRGBImage image(w,h); // init red channel with 255 initImage(destImageRange(image, VectorElementAccessor<vigra::BRGBImage::Accessor>(0)), 255);
#include <vigra/accessor.hxx>
 Namespace: vigra 
| typedef ACCESSOR::component_type value_type | 
the value_type
| VectorElementAccessor | ( | int | index, | |
| ACCESSOR | a = ACCESSOR() | |||
| ) | 
determine the component to be accessed
| value_type const& operator() | ( | ITERATOR const & | i, | |
| DIFFERENCE const & | diff | |||
| ) | const | 
read the data item at an offset (can be 1D or 2D or higher order difference).
| value_type const& operator() | ( | ITERATOR const & | i | ) | const | 
read the current data item
| template<class V, class ITERATOR, class DIFFERENCE> | ||||
| void set | ( | V const & | value, | |
| ITERATOR const & | i, | |||
| DIFFERENCE 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 -> intergral this includes rounding and clipping. 
| 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 -> intergral this includes rounding and clipping. 
| void setIndex | ( | int | i | ) | 
Reset the index to the given number.
| 
© Ullrich Köthe     (ullrich.koethe@iwr.uni-heidelberg.de)  | 
html generated using doxygen and Python
 |