[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
StandardAccessor< VALUETYPE > Class Template Reference |
Encapsulate access to the values an iterator points to. More...
#include <vigra/accessor.hxx>
Public Types | |
typedef VALUETYPE | value_type |
Public Member Functions | |
template<class ITERATOR > | |
VALUETYPE const & | operator() (ITERATOR const &i) const |
template<class ITERATOR , class OFFSET > | |
VALUETYPE const & | operator() (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 |
Encapsulate access to the values an iterator points to.
StandardAccessor is a trivial accessor that simply encapsulates the iterator's operator*() and operator[]() in its read and write functions. It passes its arguments by reference. If you want to return items by value, you must use StandardValueAccessor instead of StandardAccessor. Both 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 appropriate.
#include <vigra/accessor.hxx>
Namespace: vigra
typedef VALUETYPE value_type |
the value_type
VALUETYPE const& operator() | ( | ITERATOR const & | i | ) | const |
read the current data item
VALUETYPE 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).
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 VALUETYPE
. In case of a conversion floating point -> integral this includes rounding and clipping.
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 VALUETYPE
. In case of a conversion floating point -> integral this includes rounding and clipping.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|