vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR > Class Template Reference

interpolation at non-integer positions. More...

#include <Interpolators.h>

List of all members.

Public Types

typedef VALUETYPE value_type
 the iterators' pixel type

Public Member Functions

 InterpolatingAccessor (ACCESSOR a, INTERPOLATOR inter)
 init from given accessor
template<class ITERATOR>
value_type operator() (ITERATOR const &i, float x, float y) const
 Interpolate the data item at a non-integer position x, y.
template<class ITERATOR, class ALPHAITERATOR, class ALPHAACCESSOR>
bool operator() (ITERATOR const &i, std::pair< ALPHAITERATOR, ALPHAACCESSOR > const &alpha, float x, float y, value_type &result) const
 Interpolate the data item at a non-integer position x, y.

Private Attributes

ACCESSOR a_
INTERPOLATOR inter_x
INTERPOLATOR inter_y


Detailed Description

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
class vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >

interpolation at non-integer positions.

This accessor allows an image be accessed at arbitrary non-integer coordinates and performs an interpolation to obtain a pixel value. It uses the given ACCESSOR (which is usually the accessor originally associated with the iterator) to access data.

The interpolation algorithm is given as a template parameter, INTERPOLATOR. See the interp_bilin interp_cubic, interp_spline16, interp_spline36, interp_spline64 and interp_sinc for possible interpolators

Namespace: vigra

Usage

    // used variables:
    // iterator  : pointing to upperLeft
    // accessor  : accessor to the source image
    // dest      : value, interpolated at sx, m_sIter (relative to iterator)

    interp_cubic iterp;
    InterpolatingAccessor<SrcAccessor,
        typename SrcAccessor::value_type,Interpolator> interpol(accessor, interp);

    ...
    double sx = 102.1;
    double m_sIter = 58,81;
    dest = interpol(iterator, sx, m_sIter);

    <b> Required Interface:</b>

    \code
    ITERATOR iter;
    ACCESSOR a;
    VALUETYPE destvalue;
    INTERPOLATOR interp;
    const int interp.size;
    float s;
    int x, y;

    void interp::calc_coeff(double x);
    destvalue = s * a(iter, x, y) + s * a(iter, x, y);

Definition at line 857 of file Interpolators.h.


Member Typedef Documentation

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
typedef VALUETYPE vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::value_type
 

the iterators' pixel type

Definition at line 862 of file Interpolators.h.


Constructor & Destructor Documentation

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::InterpolatingAccessor ACCESSOR  a,
INTERPOLATOR  inter
[inline]
 

init from given accessor

Definition at line 866 of file Interpolators.h.


Member Function Documentation

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
template<class ITERATOR, class ALPHAITERATOR, class ALPHAACCESSOR>
bool vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::operator() ITERATOR const &  i,
std::pair< ALPHAITERATOR, ALPHAACCESSOR > const &  alpha,
float  x,
float  y,
value_type result
const [inline]
 

Interpolate the data item at a non-integer position x, y.

It checks if the interpolation would access a pixel with alpha = 0 and returns false in that case.

be careful, no bounds checking is done here. take INTERPOLATOR::size into accout before iterating over the picture.

the used image pixels are [i-(n/2 -1) .. i+n/2], where n is the size of the interpolator

Parameters:
i base iterator
alpha alpha image
x x position, relative to i and alpha.first
y y position, relative to i and alpha.first
result the interpolation result
Returns:
true if interpolation ok, false if one or more pixels were masked out

Definition at line 937 of file Interpolators.h.

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
template<class ITERATOR>
value_type vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::operator() ITERATOR const &  i,
float  x,
float  y
const [inline]
 

Interpolate the data item at a non-integer position x, y.

be careful, no bounds checking is done here. take INTERPOLATOR::size into accout before iterating over the picture.

the used image pixels are [i-(n/2 -1) .. i+n/2], where n is the size of the interpolator

Parameters:
i base iterator
x x position, relative to i and alpha.first
y y position, relative to i and alpha.first
Returns:
interpolation result

Definition at line 887 of file Interpolators.h.


Member Data Documentation

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
ACCESSOR vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::a_ [private]
 

Definition at line 975 of file Interpolators.h.

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
INTERPOLATOR vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::inter_x [private]
 

Definition at line 976 of file Interpolators.h.

template<class ACCESSOR, class VALUETYPE, class INTERPOLATOR>
INTERPOLATOR vigra_ext::InterpolatingAccessor< ACCESSOR, VALUETYPE, INTERPOLATOR >::inter_y [private]
 

Definition at line 976 of file Interpolators.h.


The documentation for this class was generated from the following file:
Generated on Mon Jul 28 01:26:04 2014 for Hugintrunk by  doxygen 1.3.9.1