latest version v1.9 - last update 10 Apr 2010 |
This functor use nearestNeighbor interpolation to approximate values between the pixels or elements of vectors and matrices. More...
#include <ltiNearestNeighborInterpolator.h>
Public Member Functions | |
nearestNeighborInterpolator () | |
nearestNeighborInterpolator (const eBoundaryType boundaryType) | |
nearestNeighborInterpolator (const nearestNeighborInterpolator< T > &other) | |
virtual | ~nearestNeighborInterpolator () |
virtual const char * | getTypeName () const |
T | apply (const vector< T > &src, const float &x) const |
T | apply (const float &x) const |
T | apply (const matrix< T > &src, const float &row, const float &col) const |
T | apply (const matrix< T > &src, const tpoint< float > &p) const |
T | apply (const float &row, const float &col) const |
T | apply (const tpoint< float > &p) const |
T | interpolate (const matrix< T > &src, const float row, const float col) const |
nearestNeighborInterpolator & | copy (const nearestNeighborInterpolator &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This functor use nearestNeighbor interpolation to approximate values between the pixels or elements of vectors and matrices.
The type T of the template is the type of the elements of the vector or matrix used.
lti::nearestNeighborInterpolator< T >::nearestNeighborInterpolator | ( | ) |
default constructor
lti::nearestNeighborInterpolator< T >::nearestNeighborInterpolator | ( | const eBoundaryType | boundaryType | ) |
Construct an interpolator with the given boundary type.
lti::nearestNeighborInterpolator< T >::nearestNeighborInterpolator | ( | const nearestNeighborInterpolator< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::nearestNeighborInterpolator< T >::~nearestNeighborInterpolator | ( | ) | [virtual] |
destructor
T lti::nearestNeighborInterpolator< T >::apply | ( | const tpoint< float > & | p | ) | const [virtual] |
Returns the interpolated value of the matrix specified with use() at the real valued position p.
p | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::apply | ( | const float & | row, | |
const float & | col | |||
) | const [virtual] |
Returns the interpolated value of the matrix specified with use() at the real valued position (row,col).
row | which row | |
col | which column |
Implements lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::apply | ( | const matrix< T > & | src, | |
const tpoint< float > & | p | |||
) | const [virtual] |
Returns the interpolated value of the matrix at the real valued position p.
src | matrix<T> with the source data. | |
p | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::apply | ( | const matrix< T > & | src, | |
const float & | row, | |||
const float & | col | |||
) | const [virtual] |
Returns the interpolated value of the matrix at the real valued position (row,col).
src | matrix<T> with the source data. | |
row | which row | |
col | which column |
Implements lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::apply | ( | const float & | x | ) | const [virtual] |
Returns the interpolated value of the vector specified with use() at the real valued position x.
x | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::apply | ( | const vector< T > & | src, | |
const float & | x | |||
) | const [virtual] |
Returns the interpolated value of the vector at the real valued position x.
src | vector<T> with the source data. | |
x | the real valued position to be interpolated. |
Implements lti::scalarValuedInterpolation< T >.
virtual functor* lti::nearestNeighborInterpolator< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::scalarValuedInterpolation< T >.
nearestNeighborInterpolator& lti::nearestNeighborInterpolator< T >::copy | ( | const nearestNeighborInterpolator< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::scalarValuedInterpolation< T >.
const parameters& lti::nearestNeighborInterpolator< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::scalarValuedInterpolation< T >.
Referenced by lti::nearestNeighborInterpolator< T >::interpolate().
virtual const char* lti::nearestNeighborInterpolator< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("nearestNeighborInterpolator")
Reimplemented from lti::scalarValuedInterpolation< T >.
T lti::nearestNeighborInterpolator< T >::interpolate | ( | const matrix< T > & | src, | |
const float | row, | |||
const float | col | |||
) | const [inline] |
Returns the interpolated value of the matrix at the real valued position (row,col).
This method is not virtual and can be used if this interpolation type is used as template parameter in time critical situations
src | matrix<T> with the source data. | |
row | which row | |
col | which column |
References lti::genericMatrix< T >::at(), lti::genericMatrix< T >::columns(), lti::Constant, lti::nearestNeighborInterpolator< T >::getParameters(), lti::iround(), lti::genericMatrix< T >::lastColumn(), lti::genericMatrix< T >::lastRow(), lti::Mirror, lti::NoBoundary, lti::Periodic, lti::genericMatrix< T >::rows(), and lti::Zero.