LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::nearestNeighborInterpolator< T > Class Template Reference

This functor use nearestNeighbor interpolation to approximate values between the pixels or elements of vectors and matrices. More...

#include <ltiNearestNeighborInterpolator.h>

Inheritance diagram for lti::nearestNeighborInterpolator< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::nearestNeighborInterpolator< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nearestNeighborInterpolator ()
 nearestNeighborInterpolator (const eBoundaryType boundaryType)
 nearestNeighborInterpolator (const nearestNeighborInterpolator< T > &other)
virtual ~nearestNeighborInterpolator ()
virtual const char * getTypeName () const
apply (const vector< T > &src, const float &x) const
apply (const float &x) const
apply (const matrix< T > &src, const float &row, const float &col) const
apply (const matrix< T > &src, const tpoint< float > &p) const
apply (const float &row, const float &col) const
apply (const tpoint< float > &p) const
interpolate (const matrix< T > &src, const float row, const float col) const
nearestNeighborInterpolatorcopy (const nearestNeighborInterpolator &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

template<class T>
class lti::nearestNeighborInterpolator< T >

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.


Constructor & Destructor Documentation

default constructor

template<class T>
lti::nearestNeighborInterpolator< T >::nearestNeighborInterpolator ( const eBoundaryType  boundaryType  ) 

Construct an interpolator with the given boundary type.

copy constructor

Parameters:
other the object to be copied
template<class T>
virtual lti::nearestNeighborInterpolator< T >::~nearestNeighborInterpolator (  )  [virtual]

destructor


Member Function Documentation

template<class T>
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.

Parameters:
p the real valued position to be interpolated.
Returns:
the interpolated value of the matrix.

Implements lti::scalarValuedInterpolation< T >.

template<class 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).

Parameters:
row which row
col which column
Returns:
the interpolated value of the matrix.

Implements lti::scalarValuedInterpolation< T >.

template<class 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.

Parameters:
src matrix<T> with the source data.
p the real valued position to be interpolated.
Returns:
the interpolated value of the matrix.

Implements lti::scalarValuedInterpolation< T >.

template<class 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).

Parameters:
src matrix<T> with the source data.
row which row
col which column
Returns:
the interpolated value of the matrix.

Implements lti::scalarValuedInterpolation< T >.

template<class 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.

Parameters:
x the real valued position to be interpolated.
Returns:
the interpolated value of the vector.

Implements lti::scalarValuedInterpolation< T >.

template<class 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.

Parameters:
src vector<T> with the source data.
x the real valued position to be interpolated.
Returns:
the interpolated value of the vector.

Implements lti::scalarValuedInterpolation< T >.

template<class T>
virtual functor* lti::nearestNeighborInterpolator< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::scalarValuedInterpolation< T >.

template<class T>
nearestNeighborInterpolator& lti::nearestNeighborInterpolator< T >::copy ( const nearestNeighborInterpolator< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::scalarValuedInterpolation< T >.

template<class T>
const parameters& lti::nearestNeighborInterpolator< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::scalarValuedInterpolation< T >.

Referenced by lti::nearestNeighborInterpolator< T >::interpolate().

template<class T>
virtual const char* lti::nearestNeighborInterpolator< T >::getTypeName (  )  const [virtual]

returns the name of this type ("nearestNeighborInterpolator")

Reimplemented from lti::scalarValuedInterpolation< T >.

template<class 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

Parameters:
src matrix<T> with the source data.
row which row
col which column
Returns:
the interpolated value of the matrix.

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.


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

Generated on Sat Apr 10 15:27:37 2010 for LTI-Lib by Doxygen 1.6.1