VIGRA - TemplateStandardValueAccessor class Reference

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

| StandardValueAccessor Class Template Reference |
--- | --- | ---

Encapsulate access to the values an iterator points to. More...

`#include "vigra/accessor.hxx"`

## Public Types
typedef VALUETYPE | value_type
## Public Methods
template<class ITERATOR> VALUETYPE | operator() (ITERATOR const &i) const
template<class ITERATOR, class DIFFERENCE> VALUETYPE | operator() (ITERATOR const &i, DIFFERENCE const &diff) const
template<class V, class ITERATOR> void | set (V value, ITERATOR const &i) const
template<class V, class ITERATOR, class DIFFERENCE> void | set (V value, ITERATOR const &i, DIFFERENCE const &diff) const

## Detailed Description

### template<class VALUETYPE>
class vigra::StandardValueAccessor< VALUETYPE >

Encapsulate access to the values an iterator points to.

StandardValueAccessor is a trivial accessor that simply encapsulates the iterator's operator *() and operator[]() in its read and write functions. It passes its arguments by value. If the iterator returns its items by reference (such as vigra::ImageIterator), you can also use StandardAccessor. These accessors have different optimization properties -- StandardAccessor is usually faster for compound pixel types, while StandardValueAccessor is faster for the built-in types.

When a floating point number is assigned by means of an accessor with integral value_type, the value is rounded and clipped as approriate.

#include "vigra/accessor.hxx"
Namespace: vigra

## Member Typedef Documentation

typedef VALUETYPE value_type

| the value_type

## Member Function Documentation

VALUETYPE operator() | ( | ITERATOR const & | i,
|  | DIFFERENCE const & | diff
| ) | const`[inline]`

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

VALUETYPE operator() | ( | ITERATOR const & | i | ) | const`[inline]`

| Read the current data item. The type `ITERATOR::reference` is automatically converted to `VALUETYPE`. In case of a conversion floating point -> intergral this includes rounding and clipping.

void set | ( | V | value,
|  | ITERATOR const & | i,
|  | DIFFERENCE const & | diff
| ) | const`[inline]`

| 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 `VALUETYPE`. In case of a conversion floating point -> intergral this includes rounding and clipping.

void set | ( | V | value,
|  | ITERATOR const & | i
| ) | const`[inline]`

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

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

- vigra/accessor.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)