#include <Interpolators.h>
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 |
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.
|
|||||
|
the iterators' pixel type
Definition at line 862 of file Interpolators.h. |
|
||||||||||||||||
|
init from given accessor
Definition at line 866 of file Interpolators.h. |
|
||||||||||||||||||||||||||||||||
|
Interpolate the data item at a non-integer position 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
Definition at line 937 of file Interpolators.h. |
|
||||||||||||||||||||||||
|
Interpolate the data item at a non-integer position 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
Definition at line 887 of file Interpolators.h. |
|
|||||
|
Definition at line 975 of file Interpolators.h. |
|
|||||
|
Definition at line 976 of file Interpolators.h. |
|
|||||
|
Definition at line 976 of file Interpolators.h. |
1.3.9.1