USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Interpolator Class Reference

Pixel interpolator. More...

#include <Interpolator.h>

Collaboration diagram for Isis::Interpolator:
Collaboration graph

Public Types

enum  interpType { None = 0, NearestNeighborType = 1, BiLinearType = 2, CubicConvolutionType = 4 }
 The interpolator type, including: None, Nearest Neighbor, BiLinear or Cubic Convultion. More...
 

Public Member Functions

 Interpolator ()
 Constructs an empty Interpolator object.
 
 Interpolator (const interpType &type)
 Constructs an Interpolator object, and sets the type of interpolation.
 
 ~Interpolator ()
 Destroys the Interpolator object.
 
double Interpolate (const double isamp, const double iline, const double buf[])
 Performs an interpolation on the data according to the parameters set in the constructor.
 
void SetType (const interpType &type)
 Sets the type of interpolation.
 
int Samples ()
 Returns the number of samples needed by the interpolator.
 
int Lines ()
 Returns the number of lines needed by the interpolator.
 
double HotSample ()
 Returns the sample coordinate of the center pixel in the buffer for the interpolator.
 
double HotLine ()
 Returns the line coordinate of the center pixel in the buffer for the interpolator.
 

Private Member Functions

void Init ()
 Initializes the object data members.
 
double NearestNeighbor (const double isamp, const double iline, const double buf[])
 Performs a nearest-neighbor interpolation on the buffer data.
 
double BiLinear (const double isamp, const double iline, const double buf[])
 Performs a bi-linear interpolation on the buffer data.
 
double CubicConvolution (const double isamp, const double iline, const double buf[])
 Performs a cubic-convulsion interpolation on the buffer data.
 

Private Attributes

interpType p_type
 The type of interpolation to be performed.
 

Detailed Description

Pixel interpolator.

This class is used for interpolating buffers of pixel data. It is usually associated with spacial translation, rotations and scaling in geometric warping algorithums (i.e., rubber sheeting). When special-pixel values are found in the data buffer the current interpolator is abandonded and the next lower interpolator is used instead (i.e.; if Cubic-convolution can not be performed then a bi-linear is used and if the bi-linear can not be performed then nearest-neighbor will be used.

Author
2002-10-09 Stuart Sides
Todo:
This class needs an example.
History:

2003-02-12 Stuart Sides Fixed misspelling of object name in XML file. (Note: XML files no longer used in documentation.)

2003-05-16 Stuart Sides modified schema from astrogeology...isis.astrogeology.

Definition at line 51 of file Interpolator.h.

Member Enumeration Documentation

The interpolator type, including: None, Nearest Neighbor, BiLinear or Cubic Convultion.

Definition at line 57 of file Interpolator.h.

Constructor & Destructor Documentation

Isis::Interpolator::Interpolator ( )

Constructs an empty Interpolator object.

Definition at line 33 of file Interpolator.cpp.

Isis::Interpolator::Interpolator ( const interpType type)

Constructs an Interpolator object, and sets the type of interpolation.

Parameters
typeThe type of interpolation to be performed. (NearestNeighbor, BiLinear or CubicConvulsion)
See Also
Interpolator.h

Definition at line 44 of file Interpolator.cpp.

Isis::Interpolator::~Interpolator ( )

Destroys the Interpolator object.

Definition at line 50 of file Interpolator.cpp.

Member Function Documentation

double Isis::Interpolator::BiLinear ( const double  isamp,
const double  iline,
const double  buf[] 
)
private

Performs a bi-linear interpolation on the buffer data.

Parameters
isampThe input sample/column/x coordinate.
ilineThe input line/row/y coordinate.
buf[]The data buffer to be interpolated. For bi-linear there are four values with the pixel of interest in the upper left corner of a 2x2 window.
Todo:
Add a
Returns
tag to this method.

Definition at line 134 of file Interpolator.cpp.

References Isis::IsSpecial().

double Isis::Interpolator::CubicConvolution ( const double  isamp,
const double  iline,
const double  buf[] 
)
private

Performs a cubic-convulsion interpolation on the buffer data.

Parameters
isampThe input sample/column/x coordinate.
ilineThe input line/row/y coordinate.
buf[]The data buffer to be interpolated. For cubic-convultion there are sixteen values with the pixel of interest in the second row and second column of a 4x4 window.
Todo:
Add a
Returns
tag to this method.

This algorithm has been checked extensively, and is correctly coded!

This algorithm works by modeling the picture locally with a polynomial surface, which means DNs less than all inputs or greater than all inputs are possible.

Definition at line 172 of file Interpolator.cpp.

References Isis::IsSpecial().

double Isis::Interpolator::HotLine ( )

Returns the line coordinate of the center pixel in the buffer for the interpolator.

Returns
The line coordinate of the center pixel.

Definition at line 313 of file Interpolator.cpp.

References _FILEINFO_.

Referenced by Isis::QnetTool::demRadius(), Isis::DemShape::DemShape(), Isis::Chip::Extract(), Isis::ProcessRubberSheet::processPatchTransform(), Isis::Chip::Read(), and Isis::ProcessRubberSheet::StartProcess().

double Isis::Interpolator::HotSample ( )

Returns the sample coordinate of the center pixel in the buffer for the interpolator.

Returns
The sample coordinate of the center pixel.

Definition at line 281 of file Interpolator.cpp.

References _FILEINFO_.

Referenced by Isis::QnetTool::demRadius(), Isis::DemShape::DemShape(), Isis::Chip::Extract(), Isis::ProcessRubberSheet::processPatchTransform(), Isis::Chip::Read(), and Isis::ProcessRubberSheet::StartProcess().

void Isis::Interpolator::Init ( )
private

Initializes the object data members.

Definition at line 53 of file Interpolator.cpp.

double Isis::Interpolator::Interpolate ( const double  isamp,
const double  iline,
const double  buf[] 
)

Performs an interpolation on the data according to the parameters set in the constructor.

If the buffer contains special pixel values then the current interpolation is abandoned and the next lower type of interpolation is attempted. The order from highest to lowest is (Cubic Convolution, Bi-linear and Nearest Neighbor).

Parameters
isampThe exact sample position being interpolated within the image.
ilineThe exact line position being interpolated within the image.
buf[]The buffer of data to be interpolated. The buffer is assumed to be the correct dimensions for the interpolator.
Todo:
Add a
Returns
statement to this method.

Definition at line 72 of file Interpolator.cpp.

References _FILEINFO_.

Referenced by Isis::QnetTool::demRadius(), Isis::Chip::Extract(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::DemShape::localRadius(), and Isis::Chip::Read().

int Isis::Interpolator::Lines ( )
double Isis::Interpolator::NearestNeighbor ( const double  isamp,
const double  iline,
const double  buf[] 
)
private

Performs a nearest-neighbor interpolation on the buffer data.

Parameters
isampThe input sample/column/x coordinate.
ilineThe input line/row/y coordinate.
buf[]The data buffer to be interpolated. For nearest-neighbor there is only one value, the pixel of interest.
Todo:
Add a
Returns
tag to this method.

Definition at line 117 of file Interpolator.cpp.

int Isis::Interpolator::Samples ( )

Returns the number of samples needed by the interpolator.

Returns
The number of samples needed.

Definition at line 224 of file Interpolator.cpp.

References _FILEINFO_.

Referenced by Isis::QnetTool::demRadius(), Isis::DemShape::DemShape(), Isis::Chip::Extract(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::ProcessRubberSheet::processPatchTransform(), Isis::Chip::Read(), and Isis::ProcessRubberSheet::StartProcess().

void Isis::Interpolator::SetType ( const interpType type)

Sets the type of interpolation.

(NearestNeighbor, BiLinear, CubicConvulsion).

See Also
Interpolator.h
Parameters
typeThe type of interpolation to be set.

Definition at line 101 of file Interpolator.cpp.

Referenced by Isis::SpatialPlotTool::getSpatialStatistics().

Member Data Documentation

interpType Isis::Interpolator::p_type
private

The type of interpolation to be performed.

(NearestNeighbor, BiLinear or CubicConvultion

Definition at line 69 of file Interpolator.h.


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