[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.


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);


Member Typedef Documentation

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

the iterators' pixel type


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


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

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


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

Generated on Mon Sep 20 01:01:37 2010 for Hugintrunk by doxygen 1.3.9.1