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

lti::bilinearInterpolator< T > Class Template Reference

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

#include <ltiBilinearInterpolator.h>

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

List of all members.

Public Member Functions

 bilinearInterpolator ()
 bilinearInterpolator (const eBoundaryType boundaryType)
 bilinearInterpolator (const bilinearInterpolator< T > &other)
virtual ~bilinearInterpolator ()
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
interpolate (const float row, const float col) const
interpolateUnchk (const matrix< T > &src, const float row, const float col) const
interpolateUnchk (const float row, const float col) const
bilinearInterpolatorcopy (const bilinearInterpolator &other)
virtual functorclone () const
const parametersgetParameters () const
compute (const float fy, const float fx, const T syx, const T syx1, const T sy1x, const T sy1x1) const
compute (const float fx, const T sx, const T sx1) const

Detailed Description

template<class T>
class lti::bilinearInterpolator< T >

This functor use bilinear 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

template<class T>
lti::bilinearInterpolator< T >::bilinearInterpolator (  ) 

default constructor

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

Construct an interpolator with the given boundary type.

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

copy constructor

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

destructor


Member Function Documentation

template<class T>
T lti::bilinearInterpolator< 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::bilinearInterpolator< 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::bilinearInterpolator< 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::bilinearInterpolator< 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::bilinearInterpolator< 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::bilinearInterpolator< 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::bilinearInterpolator< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::scalarValuedInterpolation< T >.

template<class T>
T lti::bilinearInterpolator< T >::compute ( const float  fx,
const T  sx,
const T  sx1 
) const [inline]

Compute the linear interpolated value for the given coefficients and values.

This method is provided for convenience only. Use at your own risk.

Parameters:
fx fractional term between 0 and 1
sx value for sx==0
sx1 value for sx==1
Returns:
interpolated value between the two extremes.
template<class T>
T lti::bilinearInterpolator< T >::compute ( const float  fy,
const float  fx,
const T  syx,
const T  syx1,
const T  sy1x,
const T  sy1x1 
) const [inline]

Compute the bilinear interpolated value for the given coefficients and values.

This method is provided for convenience only. Use at your own risk.

Parameters:
fy fractional term between 0 and 1
fx fractional term between 0 and 1
syx value for fx==0 fy==0
syx1 value for fx==1 fy==0
sy1x value for fx==0 fy==1
sy1x1 value for fx==1 fy==1
Returns:
interpolated value between the four corners

Referenced by lti::bilinearInterpolator< T >::interpolateUnchk().

template<class T>
bilinearInterpolator& lti::bilinearInterpolator< T >::copy ( const bilinearInterpolator< 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::bilinearInterpolator< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::scalarValuedInterpolation< T >.

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

returns the name of this type ("bilinearInterpolator")

Reimplemented from lti::scalarValuedInterpolation< T >.

template<class T>
T lti::bilinearInterpolator< T >::interpolate ( const float  row,
const float  col 
) const [inline]

Returns the interpolated value of the matrix specified with use() 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:
row which row
col which column
Returns:
the interpolated value of the matrix.
template<class T>
T lti::bilinearInterpolator< T >::interpolate ( const matrix< T > &  src,
const float  row,
const float  col 
) const

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.

Referenced by lti::bilinearInterpolator< ubyte >::interpolate().

template<class T>
T lti::bilinearInterpolator< T >::interpolateUnchk ( const float  row,
const float  col 
) const [inline]

Returns the interpolated value of the matrix specified with use() 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:
row which row
col which column
Returns:
the interpolated value of the matrix.

References lti::bilinearInterpolator< T >::interpolateUnchk(), and lti::scalarValuedInterpolation< T >::theMatrix.

template<class T>
T lti::bilinearInterpolator< T >::interpolateUnchk ( 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 does not check if the given coordinates and the rest of used points in the src matrix lie within the valid range. This is left to you. Please consider that for the bilinear interpolation not only the point(trunc(col),trunc(row)) is used, but also its three "next" neighbors ((col,row+1),(col+1,row),(col+1,row+1)).

This method is not virtual and can be used in time critical situations, where you prefer to take the boundary control by yourself.

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(), and lti::bilinearInterpolator< T >::compute().

Referenced by lti::bilinearInterpolator< T >::interpolateUnchk().


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

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