/************************************************************************/
/* */
/* Copyright 1998-2002 by Ullrich Koethe */
/* Cognitive Systems Group, University of Hamburg, Germany */
/* */
/* This file is part of the VIGRA computer vision library. */
/* The VIGRA Website is */
/* http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ */
/* Please direct questions, bug reports, and contributions to */
/* koethe@informatik.uni-hamburg.de or */
/* vigra@kogs1.informatik.uni-hamburg.de */
/* */
/* Permission is hereby granted, free of charge, to any person */
/* obtaining a copy of this software and associated documentation */
/* files (the "Software"), to deal in the Software without */
/* restriction, including without limitation the rights to use, */
/* copy, modify, merge, publish, distribute, sublicense, and/or */
/* sell copies of the Software, and to permit persons to whom the */
/* Software is furnished to do so, subject to the following */
/* conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the */
/* Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
/* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
/* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
/* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
/* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
/* OTHER DEALINGS IN THE SOFTWARE. */
/* */
/************************************************************************/
#ifndef VIGRA_ACCESSOR_HXX
#define VIGRA_ACCESSOR_HXX
#include "vigra/metaprogramming.hxx"
#include "vigra/numerictraits.hxx"
#include "vigra/tuple.hxx"
namespace vigra {
/** \addtogroup DataAccessors Data Accessors
Basic templates to encapsulate access to the data of an iterator.
Data accessors are used to allow for flexible access to the data
an interator points to. When we access the data directly, we
are bound to what operator*() returns, if this method exists at
all. Encapsulating access in an accessor enables a better
decoupling of data structures and algorithms.
This paper contains
a detailed description of the concept. Here is a brief list of the basic
accessor requirements:
|
\htmlonly
|
\endhtmlonly
Operation
\htmlonly
|
\endhtmlonly
Result
\htmlonly
|
\endhtmlonly
Semantics
\htmlonly
|
\endhtmlonly
| accessor(iter) | convertible to Iterator::value_type const & |
read data at the current position of the iterator |
| accessor(iter, index) | convertible to Accessor::value_type const & |
read data at offset index relative to iterator's current position
(random-access iterator only) |
| accessor.set(value, iter) | void |
write data value at the current position of the iterator (mutable iterator only) |
| accessor.set(value, iter, index) | void |
write data value at offset index relative to iterator's current position
(mutable random-access iterator only) |
|
\htmlonly
|
\endhtmlonly
Accessor::value_type |
type of the data field the accessor refers to |
|
\htmlonly
|
\endhtmlonly
iter is an iterator
index has the iterator's index type (Iterator::difference_type)
value is convertible to Accessor::value_type const &
|
The template AccessorTraits<T> can be used to find the default accessor
associated with the type T, e.g.
\code
typedef typename AccessorTraits::default_accessor Accessor;
typedef typename AccessorTraits::default_const_accessor ConstAccessor;
\endcode
*/
//@{
/********************************************************/
/* */
/* StandardAccessor */
/* */
/********************************************************/
/** \brief 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 approriate.
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class StandardAccessor
{
public:
/** the value_type
*/
typedef VALUETYPE value_type;
/** read the current data item
*/
template
VALUETYPE const & operator()(ITERATOR const & i) const { return *i; }
VALUETYPE const & operator()(VALUETYPE const * i) const { return *i; }
/** read the data item at an offset (can be 1D or 2D or higher order difference).
*/
template
VALUETYPE const & operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return i[diff];
}
/** 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.
*/
template
void set(V const & value, ITERATOR const & i) const
{ *i = detail::RequiresExplicitCast::cast(value); }
/* This overload is needed to make the accessor work with a std::back_inserter */
template
void set(V const & value, ITERATOR & i) const
{ *i = detail::RequiresExplicitCast::cast(value); }
/** 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.
*/
template
void set(V const & value, ITERATOR const & i, DIFFERENCE const & diff) const
{
i[diff]= detail::RequiresExplicitCast::cast(value);
}
};
/** \brief 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 \ref 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
*/
template
class StandardValueAccessor
{
public:
/** the value_type
*/
typedef VALUETYPE value_type;
/** 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.
*/
template
VALUETYPE operator()(ITERATOR const & i) const
{ return detail::RequiresExplicitCast::cast(*i); }
/** 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.
*/
template
VALUETYPE operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return detail::RequiresExplicitCast::cast(i[diff]);
}
/** 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.
*/
template
void set(V value, ITERATOR const & i) const
{ *i = detail::RequiresExplicitCast::cast(value); }
/* This overload is needed to make the accessor work with a std::back_inserter */
template
void set(V value, ITERATOR & i) const
{ *i = detail::RequiresExplicitCast::cast(value); }
/** 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.
*/
template
void set(V value, ITERATOR const & i, DIFFERENCE const & diff) const
{
i[diff]= detail::RequiresExplicitCast::cast(value);
}
};
/********************************************************/
/* */
/* StandardConstAccessor */
/* */
/********************************************************/
/** \brief Encapsulate read access to the values an iterator points to.
StandardConstAccessor is a trivial accessor that simply encapsulates
the iterator's operator*() and operator[]() in its
read functions. It passes its arguments by reference.
If the iterator returns its items by value (such as \ref vigra::CoordinateIterator), you
must use StandardConstValueAccessor instead of StandardConstAccessor.
Both accessors also have different optimization properties --
StandardConstAccessor is usually faster for compound pixel types,
while StandardConstValueAccessor is faster for the built-in types.
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class StandardConstAccessor
{
public:
typedef VALUETYPE value_type;
/** read the current data item
*/
template
VALUETYPE const & operator()(ITERATOR const & i) const
{ return *i; }
/** read the data item at an offset (can be 1D or 2D or higher order difference).
*/
template
VALUETYPE const & operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return i[diff];
}
};
/** \brief Encapsulate access to the values an iterator points to.
StandardConstValueAccessor is a trivial accessor that simply encapsulates
the iterator's operator*() and operator[]() in its
read functions. It passes its arguments by value.
If the iterator returns its items by reference (such as \ref vigra::ConstImageIterator),
you can also use StandardConstAccessor.
These accessors have different optimization properties --
StandardConstAccessor is usually faster for compound pixel types,
while StandardConstValueAccessor is faster for the built-in types.
When an iterator passes a floating point number to an accessor
with integral value_type, the value is rounded and clipped as approriate.
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class StandardConstValueAccessor
{
public:
typedef VALUETYPE value_type;
/** 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.
*/
template
VALUETYPE operator()(ITERATOR const & i) const
{ return detail::RequiresExplicitCast::cast(*i); }
/** 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.
*/
template
VALUETYPE operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return detail::RequiresExplicitCast::cast(i[diff]);
}
};
/********************************************************/
/* */
/* VectorComponentAccessor */
/* */
/********************************************************/
/** \brief 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 reference. If you want to pass/return items by value,
use VectorComponentValueAccessor. 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:
\code
vigra::BRGBImage image(w,h);
// init red channel with 255
initImage(destImageRange(image,
VectorComponentAccessor(0)),
255);
\endcode
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class VectorComponentAccessor
{
int index_;
public:
/** the value_type
*/
typedef typename VECTORTYPE::value_type value_type;
/** determine the component to be accessed
*/
VectorComponentAccessor(int index)
: index_(index)
{}
/** read the current data item
*/
template
value_type const & operator()(ITERATOR const & i) const
{ return (*i)[index_]; }
/** read the data item at an offset (can be 1D or 2D or higher order difference).
*/
template
value_type const & operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return i[diff][index_];
}
/** 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.
*/
template
void set(V const & value, ITERATOR const & i) const
{
(*i)[index_] = detail::RequiresExplicitCast::cast(value);
}
/** 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
void set(V const & value, ITERATOR const & i, DIFFERENCE const & diff) const
{
i[diff][index_]= detail::RequiresExplicitCast::cast(value);
}
/** Reset the index to the given number.
*/
void setIndex(int i)
{
index_ = i;
}
};
/** \brief 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:
\code
vigra::BRGBImage image(w,h);
// init red channel with 255
initImage(destImageRange(image,
VectorComponentValueAccessor(0)),
255);
\endcode
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class VectorComponentValueAccessor
{
int index_;
public:
/** the value_type
*/
typedef typename VECTORTYPE::value_type value_type;
/** determine the component to be accessed
*/
VectorComponentValueAccessor(int index)
: index_(index)
{}
/** 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 -> intergral this includes rounding and clipping.
*/
template
value_type operator()(ITERATOR const & i) const
{ return detail::RequiresExplicitCast::cast((*i)[index_]); }
/** 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 -> intergral this includes rounding and clipping.
*/
template
value_type operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return detail::RequiresExplicitCast::cast(i[diff][index_]);
}
/** 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.
*/
template
void set(V value, ITERATOR const & i) const
{
(*i)[index_] = detail::RequiresExplicitCast::cast(value);
}
/** 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
void set(V value, ITERATOR const & i, DIFFERENCE const & diff) const
{
i[diff][index_]= detail::RequiresExplicitCast::cast(value);
}
/** Reset the index to the given number.
*/
void setIndex(int i)
{
index_ = i;
}
};
/********************************************************/
/* */
/* VectorElementAccessor */
/* */
/********************************************************/
/** \brief Accessor for one component of a vector.
This works like VectorComponentAccessor, only the template paramters differ:
Here, we need a vector accessor type , wheras VectorComponentAccessor requires a vector type.
Usage:
\code
vigra::BRGBImage image(w,h);
// init red channel with 255
initImage(destImageRange(image,
VectorElementAccessor(0)),
255);
\endcode
\#include "vigra/accessor.hxx"
Namespace: vigra
*/
template
class VectorElementAccessor
{
int index_;
ACCESSOR a_;
public:
/** the value_type
*/
typedef typename ACCESSOR::component_type value_type;
/** determine the component to be accessed
*/
VectorElementAccessor(int index, ACCESSOR a = ACCESSOR())
: index_(index),
a_(a)
{}
/** read the current data item
*/
template
value_type const & operator()(ITERATOR const & i) const
{ return a_.getComponent(i, index_); }
/** read the data item at an offset (can be 1D or 2D or higher order difference).
*/
template
value_type const & operator()(ITERATOR const & i, DIFFERENCE const & diff) const
{
return a_.getComponent(i, diff, index_);
}
/** 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.
*/
template
void set(V const & value, ITERATOR const & i) const
{
a_.setComponent(detail::RequiresExplicitCast::cast(value), i, index_);
}
/** 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
void set(V const & value, ITERATOR const & i, DIFFERENCE const & diff) const
{
a_.setComponent(detail::RequiresExplicitCast::cast(value), i, diff, index_);
}
/** Reset the index to the given number.
*/
void setIndex(int i)
{
index_ = i;
}
};
/********************************************************/
/* */
/* SequenceAccessor */
/* */
/********************************************************/
/** \brief Accessor for items that are STL compatible sequences.
It encapsulates access to the sequences' begin() and end()
functions.
Usage:
\#include "vigra/accessor.hxx"
Namespace: vigra
\code
typedef std::list > ListOfLists;
ListOfLists ll;
...
typedef vigra::SequenceAccessor ListOfListsAccessor;
ListOfListsAccessor a;
for(ListOfLists::iterator li = ll.begin(); li != ll.end(); ++li)
{
for(ListOfListsAccessor::iterator i = a.begin(li); i != a.end(li); ++i)
{
*i = 10;
}
}
\endcode
*/
template
class SequenceAccessor
: public StandardAccessor
{
public:
/** the sequence's value_type
*/
typedef typename SEQUENCE::value_type component_type;
#ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION
typedef typename
If::isConst,
typename SEQUENCE::const_iterator,
typename SEQUENCE::iterator>::type
iterator;
#else
/** the sequence's iterator type
*/
typedef typename SEQUENCE::iterator iterator;
#endif
/** get begin iterator for sequence at given iterator position
*/
template
iterator begin(ITERATOR const & i) const
{
return (*i).begin();
}
/** get end iterator for sequence at given iterator position
*/
template
iterator end(ITERATOR const & i) const
{
return (*i).end();
}
/** get begin iterator for sequence at an offset
of given iterator position
*/
template
iterator begin(ITERATOR const & i, DIFFERENCE const & diff) const
{
return i[diff].begin();
}
/** get end iterator for sequence at a 2D difference vector
of given iterator position
*/
template
iterator end(ITERATOR const & i, DIFFERENCE const & diff) const
{
return i[diff].end();
}
/** get size of sequence at given iterator position
*/
template
unsigned int size(ITERATOR const & i) const { return (*i).size(); }
/** get size of sequence at 2D difference vector of given iterator position
*/
template
unsigned int size(ITERATOR const & i, DIFFERENCE const & diff) const
{ return i[diff].size(); }
};
/********************************************************/
/* */
/* VectorAccessor */
/* */
/********************************************************/
/** \brief Accessor for items that are STL compatible vectors.
It encapsulates access to a vector's access functionality.
Usage:
\#include "vigra/accessor.hxx"
Namespace: vigra
The accessor has two modes of operation:
- Access the vector's iterator via the begin() and end()
functions:
\code
typedef std::list > ListOfVectors;
ListOfVectors ll;
...
typedef vigra::SequenceAccessor ListOfVectorsAccessor;
ListOfVectorsAccessor a;
for(ListOfVectors::iterator li = ll.begin(); li != ll.end(); ++li)
{
for(ListOfVectorsAccessor::iterator i = a.begin(li); i != a.end(li); ++i)
{
*i = 10;
}
}
\endcode
- Access the vector's components via an index (internally calls
the vector's operator[] ):
\code
typedef std::list > ListOfVectors;
ListOfVectors ll;
...
typedef vigra::SequenceAccessor ListOfVectorsAccessor;
ListOfVectorsAccessor a;
for(ListOfVectors::iterator li = ll.begin(); li != ll.end(); ++li)
{
for(int i = 0; i != a.size(li); ++i)
{
a.setComponent(10, li, i);
}
}
\endcode
Required Interface:
\code
VECTOR v;
VECTOR::iterator i;
value_type d;
int index;
d = v[index];
v[index] = d;
i = v.begin();
i = v.end();
v.size();
\endcode
*/
template
class VectorAccessor
: public SequenceAccessor
{
public:
/** the vector's value_type
*/
typedef typename VECTOR::value_type component_type;
/** Read the component data at given vector index
at given iterator position
*/
template
component_type const & getComponent(ITERATOR const & i, int idx) const
{
return (*i)[idx];
}
/** Set the component data at given vector index
at given iterator position. The type V of the passed
in value is automatically converted to component_type.
In case of a conversion floating point -> intergral this includes rounding and clipping.
*/
template
void setComponent(V const & value, ITERATOR const & i, int idx) const
{
(*i)[idx] = detail::RequiresExplicitCast::cast(value);
}
/** Read the component data at given vector index
at an offset of given iterator position
*/
template
component_type const & getComponent(ITERATOR const & i, DIFFERENCE const & diff, int idx) const
{
return i[diff][idx];
}
/** Set the component data at given vector index
at an offset of given iterator position. The type V of the passed
in value is automatically converted to component_type.
In case of a conversion floating point -> intergral this includes rounding and clipping.
*/
template
void
setComponent(V const & value, ITERATOR const & i, DIFFERENCE const & diff, int idx) const
{
i[diff][idx] = detail::RequiresExplicitCast::cast(value);
}
};
/********************************************************/
/* */
/* MultiImageAccessor2 */
/* */
/********************************************************/
/** \brief Access two images simultaneously.
This accessor is used when two images need to be treated as one
because an algorithm accepts only one image. For example,
\ref seededRegionGrowing() uses only one image two calculate
the cost for aggregating each pixel into a region. Somtimes, we
need more information to calcuate this cost, for example gray value
and local gradient magnitude. These values can be stored in two images,
which appear as only one when we pass a MultiImageAccessor2 to
the lagorithms. Of course, the cost functor must accept a pair
of values for this to work. Instead of an actual image iterator, we
pass a CoordinateIterator which
selects the right pixels form both images.
Usage:
\#include "vigra/accessor.hxx"
Namespace: vigra
\code
using namespace vigra;
FImage gray_values(w,h), gradient_magnitude(w,h);
IImage seeds(w,h), labels(w,h);
seededRegionGrowing(
srcIterRange(CoordinateIterator(), CoordinateIterator(w,h),
MultiImageAccessor2
(gray_values.upperLeft(), gray_values.accessor(),
gradient_magnitude.upperLeft(), gradient_magnitude.accessor())),
srcImage(seeds),
destImage(labels),
SomeCostFunctor());
\endcode
*/
template
class MultiImageAccessor2
{
public:
/** The accessors value_type: construct a pair that contains
the corresponding image values.
*/
typedef pair
value_type;
/** Construct from two image iterators and associated accessors.
*/
MultiImageAccessor2(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2)
: i1_(i1), a1_(a1), i2_(i2), a2_(a2)
{}
/** read the current data item
*/
template
value_type operator()(DIFFERENCE const & d) const
{
return std::make_pair(a1_(i1_, d), a2_(i2_, d));
}
/** read the data item at an offset
*/
template
value_type operator()(DIFFERENCE1 d1, DIFFERENCE2 const & d2) const
{
d1 += d2;
return std::make_pair(a1_(i1_, d1), a2_(i2_, d1));
}
private:
Iter1 i1_;
Acc1 a1_;
Iter2 i2_;
Acc2 a2_;
};
//@}
template
struct AccessorTraits
{
typedef StandardAccessor default_accessor;
typedef StandardConstAccessor default_const_accessor;
};
#define VIGRA_DEFINE_ACCESSOR_TRAITS(VALUE, ACCESSOR, CONST_ACCESSOR) \
template <> \
struct AccessorTraits \
{ \
typedef ACCESSOR default_accessor; \
typedef CONST_ACCESSOR default_const_accessor; \
};
VIGRA_DEFINE_ACCESSOR_TRAITS(signed char, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(unsigned char, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(short, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(unsigned short, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(int, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(unsigned int, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(long, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(unsigned long, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(float, StandardValueAccessor, StandardConstValueAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(double, StandardValueAccessor, StandardConstValueAccessor)
template class RGBValue;
template class RGBAccessor;
template class TinyVector;
#ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION
template
struct AccessorTraits >
{
typedef RGBAccessor > default_accessor;
typedef RGBAccessor > default_const_accessor;
};
template
struct AccessorTraits >
{
typedef VectorAccessor > default_accessor;
typedef VectorAccessor > default_const_accessor;
};
#else // NO_PARTIAL_TEMPLATE_SPECIALIZATION
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
VIGRA_DEFINE_ACCESSOR_TRAITS(RGBValue, RGBAccessor, RGBAccessor)
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#define VIGRA_PIXELTYPE TinyVector
VIGRA_DEFINE_ACCESSOR_TRAITS(VIGRA_PIXELTYPE, VectorAccessor, VectorAccessor)
#undef VIGRA_PIXELTYPE
#endif // NO_PARTIAL_TEMPLATE_SPECIALIZATION
#undef VIGRA_DEFINE_ACCESSOR_TRAITS
} // namespace vigra
#endif // VIGRA_ACCESSOR_HXX