It interpolates one pixel based on a selected algorithm. Methods currently available are Nearest Neighbor, Bilinear, and Bicubic.
More...
#include <Interpolator.h>
|
te::rst::Interpolator * | clone () const |
| Create a clone copy of this instance.
|
|
void | getValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Get the interpolated value at specific band.
|
|
void | getValues (const double &c, const double &r, std::vector< std::complex< double > > &values) |
| Get the interpolated value for all bands.
|
|
unsigned int | getWindowRadius () const |
| Get the interpolator windows radius around the target pixel (when applicable).
|
|
| Interpolator (Raster const *r, int m) |
| Constructor.
|
|
| Interpolator (Raster const *r, int m, const std::vector< std::complex< double > > &noDataValues) |
| Constructor.
|
|
| Interpolator (Raster const *r, int m, const std::vector< std::complex< double > > &noDataValues, const unsigned int windowRadius) |
| Constructor.
|
|
virtual | ~Interpolator () |
| Destructor.
|
|
|
typedef void(Interpolator::* | InterpolationFunction) (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Type definition for the interpolation function.
|
|
|
void | bicubicGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Bicubic interpolation method.
|
|
void | bilinearGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Bilinear interpolation method.
|
|
bool | initialize (Raster const *const rasterPointer, int method, const std::vector< std::complex< double > > &noDataValues, const unsigned int windowRadius) |
| Initialize this instance..
|
|
void | maxGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Max interpolation method.
|
|
void | meanGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Mean interpolation method.
|
|
void | medianGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Median interpolation method.
|
|
void | minGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Min interpolation method.
|
|
void | modeGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Mode interpolation method.
|
|
void | nearestNeighborGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Nearest neighbor interpolation method.
|
|
It interpolates one pixel based on a selected algorithm. Methods currently available are Nearest Neighbor, Bilinear, and Bicubic.
Definition at line 55 of file Interpolator.h.
◆ InterpolationFunction
typedef void(Interpolator::* te::rst::Interpolator::InterpolationFunction) (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
|
protected |
Type definition for the interpolation function.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
Definition at line 147 of file Interpolator.h.
◆ Method
◆ Interpolator() [1/3]
te::rst::Interpolator::Interpolator |
( |
Raster const * |
r, |
|
|
int |
m |
|
) |
| |
Constructor.
- Parameters
-
r | The raster where to resample. |
m | The method of interpolation to apply. |
◆ Interpolator() [2/3]
te::rst::Interpolator::Interpolator |
( |
Raster const * |
r, |
|
|
int |
m, |
|
|
const std::vector< std::complex< double > > & |
noDataValues |
|
) |
| |
Constructor.
- Parameters
-
r | The raster where to resample. |
m | The method of interpolation to apply. |
noDataValues | A vector with no-data values (will overwride the input raster no-data values) or an empty vectory if the input raster no-data values must be used. |
◆ Interpolator() [3/3]
te::rst::Interpolator::Interpolator |
( |
Raster const * |
r, |
|
|
int |
m, |
|
|
const std::vector< std::complex< double > > & |
noDataValues, |
|
|
const unsigned int |
windowRadius |
|
) |
| |
Constructor.
- Parameters
-
r | The raster where to resample. |
m | The method of interpolation to apply. |
noDataValues | A vector with no-data values (will overwride the input raster no-data values) or an empty vectory if the input raster no-data values must be used. |
windowRadius | Interpolator windows radius around the target pixel (when applicable). |
◆ ~Interpolator()
virtual te::rst::Interpolator::~Interpolator |
( |
| ) |
|
|
virtual |
◆ bicubicGetValue()
void te::rst::Interpolator::bicubicGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Bicubic interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ bilinearGetValue()
void te::rst::Interpolator::bilinearGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Bilinear interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ clone()
Create a clone copy of this instance.
- Returns
- A clone copy of this instance (the caller of this method must take the ownership of the returned object).
◆ getInterpMethodsInfo()
◆ getValue()
void te::rst::Interpolator::getValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
inline |
Get the interpolated value at specific band.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value or the current input raster no-data value if the requested coordinates are outside the valid image bounds. |
b | The band to obtain the value. |
- Note
- The caller of this method must be aware that the returned value may be outside the original input rasters valid values range.
Definition at line 104 of file Interpolator.h.
◆ getValues()
void te::rst::Interpolator::getValues |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::vector< std::complex< double > > & |
values |
|
) |
| |
Get the interpolated value for all bands.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | A vector of values, for all bands, or the current input raster no-data values if the requested coordinates are outside the valid image bounds.. |
- Note
- The caller of this method must be aware that the returned values may be outside the original input rasters valid values range.
◆ getWindowRadius()
unsigned int te::rst::Interpolator::getWindowRadius |
( |
| ) |
const |
Get the interpolator windows radius around the target pixel (when applicable).
- Returns
- Get the interpolator windows radius around the target pixel (when applicable).
◆ initialize()
bool te::rst::Interpolator::initialize |
( |
Raster const *const |
rasterPointer, |
|
|
int |
method, |
|
|
const std::vector< std::complex< double > > & |
noDataValues, |
|
|
const unsigned int |
windowRadius |
|
) |
| |
|
protected |
Initialize this instance..
- Parameters
-
r | The raster where to resample. |
method | The method of interpolation to apply. |
noDataValues | A vector with no-data values (will overwride the input raster no-data values) or an empty vectory if the input raster no-data values must be used. |
windowRadius | Interpolator windows radius around the target pixel (when applicable). |
- Returns
- true if OK, false on errors.
◆ maxGetValue()
void te::rst::Interpolator::maxGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Max interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ meanGetValue()
void te::rst::Interpolator::meanGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Mean interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ medianGetValue()
void te::rst::Interpolator::medianGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Median interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ minGetValue()
void te::rst::Interpolator::minGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Min interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ modeGetValue()
void te::rst::Interpolator::modeGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Mode interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ nearestNeighborGetValue()
void te::rst::Interpolator::nearestNeighborGetValue |
( |
const double & |
c, |
|
|
const double & |
r, |
|
|
std::complex< double > & |
v, |
|
|
const std::size_t & |
b |
|
) |
| |
|
protected |
Nearest neighbor interpolation method.
- Parameters
-
c | The column position (double). |
r | The row position (double). |
v | The output value. |
b | The band to obtain the value. |
◆ m_bicBbufferImag
double te::rst::Interpolator::m_bicBbufferImag[4][4] |
|
protected |
◆ m_bicBbufferReal
double te::rst::Interpolator::m_bicBbufferReal[4][4] |
|
protected |
◆ m_bicBufCol
unsigned te::rst::Interpolator::m_bicBufCol |
|
protected |
◆ m_bicBufRow
unsigned te::rst::Interpolator::m_bicBufRow |
|
protected |
◆ m_bicColBound
double te::rst::Interpolator::m_bicColBound |
|
protected |
Last column available for bicubic interpolation.
Definition at line 296 of file Interpolator.h.
◆ m_bicGridCol
unsigned te::rst::Interpolator::m_bicGridCol |
|
protected |
◆ m_bicGridRow
unsigned te::rst::Interpolator::m_bicGridRow |
|
protected |
◆ m_bicHSum
double te::rst::Interpolator::m_bicHSum |
|
protected |
◆ m_bicHWeights
double te::rst::Interpolator::m_bicHWeights[4] |
|
protected |
◆ m_bicKernel
double te::rst::Interpolator::m_bicKernel |
|
protected |
◆ m_bicOffsetX
double te::rst::Interpolator::m_bicOffsetX |
|
protected |
◆ m_bicOffsetY
double te::rst::Interpolator::m_bicOffsetY |
|
protected |
◆ m_bicReadImagValue
double te::rst::Interpolator::m_bicReadImagValue |
|
protected |
◆ m_bicReadRealValue
double te::rst::Interpolator::m_bicReadRealValue |
|
protected |
◆ m_bicRowAccumImag
double te::rst::Interpolator::m_bicRowAccumImag |
|
protected |
◆ m_bicRowAccumReal
double te::rst::Interpolator::m_bicRowAccumReal |
|
protected |
◆ m_bicRowBound
double te::rst::Interpolator::m_bicRowBound |
|
protected |
Last row available for bicubic interpolation.
Definition at line 295 of file Interpolator.h.
◆ m_bicRowsValuesImag
double te::rst::Interpolator::m_bicRowsValuesImag[4] |
|
protected |
◆ m_bicRowsValuesReal
double te::rst::Interpolator::m_bicRowsValuesReal[4] |
|
protected |
◆ m_bicVSum
double te::rst::Interpolator::m_bicVSum |
|
protected |
◆ m_bicVWeights
double te::rst::Interpolator::m_bicVWeights[4] |
|
protected |
◆ m_bilColDifMax
double te::rst::Interpolator::m_bilColDifMax |
|
protected |
Maximum difference between columns (min/max).
Definition at line 268 of file Interpolator.h.
◆ m_bilColDifMin
double te::rst::Interpolator::m_bilColDifMin |
|
protected |
Minimum difference between columns (min/max).
Definition at line 267 of file Interpolator.h.
◆ m_bilColMax
double te::rst::Interpolator::m_bilColMax |
|
protected |
Maximum column for bilinear interpolation.
Definition at line 264 of file Interpolator.h.
◆ m_bilColMin
double te::rst::Interpolator::m_bilColMin |
|
protected |
Minimum column for bilinear interpolation.
Definition at line 263 of file Interpolator.h.
◆ m_bilDistances
double te::rst::Interpolator::m_bilDistances[4] |
|
protected |
◆ m_bilLastCol
double te::rst::Interpolator::m_bilLastCol |
|
protected |
Last column available for bilinear interpolation.
Definition at line 273 of file Interpolator.h.
◆ m_bilLastRow
double te::rst::Interpolator::m_bilLastRow |
|
protected |
Last row available for bilinear interpolation.
Definition at line 272 of file Interpolator.h.
◆ m_bilRowDifMax
double te::rst::Interpolator::m_bilRowDifMax |
|
protected |
Maximum difference between rows (min/max).
Definition at line 266 of file Interpolator.h.
◆ m_bilRowDifMin
double te::rst::Interpolator::m_bilRowDifMin |
|
protected |
Minimum difference between rows (min/max).
Definition at line 265 of file Interpolator.h.
◆ m_bilRowMax
double te::rst::Interpolator::m_bilRowMax |
|
protected |
Maximum row for bilinear interpolation.
Definition at line 262 of file Interpolator.h.
◆ m_bilRowMin
double te::rst::Interpolator::m_bilRowMin |
|
protected |
Minimum row for bilinear interpolation.
Definition at line 261 of file Interpolator.h.
◆ m_bilValues
std::vector<std::complex<double> > te::rst::Interpolator::m_bilValues |
|
protected |
◆ m_bilWeights
double te::rst::Interpolator::m_bilWeights[4] |
|
protected |
◆ m_function
The current interpolation function pointer.
Definition at line 246 of file Interpolator.h.
◆ m_method
int te::rst::Interpolator::m_method |
|
protected |
◆ m_nnCR
unsigned int te::rst::Interpolator::m_nnCR |
|
protected |
◆ m_nnLastCol
double te::rst::Interpolator::m_nnLastCol |
|
protected |
Last column available for nearest Neighbor interpolation.
Definition at line 257 of file Interpolator.h.
◆ m_nnLastRow
double te::rst::Interpolator::m_nnLastRow |
|
protected |
Last row available for nearest Neighbor interpolation.
Definition at line 256 of file Interpolator.h.
◆ m_nnRR
unsigned int te::rst::Interpolator::m_nnRR |
|
protected |
◆ m_noDataValues
std::vector< std::complex<double> > te::rst::Interpolator::m_noDataValues |
|
protected |
◆ m_raster
Raster const* te::rst::Interpolator::m_raster |
|
protected |
◆ m_rasterNCols
unsigned int te::rst::Interpolator::m_rasterNCols |
|
protected |
◆ m_rasterNRows
unsigned int te::rst::Interpolator::m_rasterNRows |
|
protected |
◆ m_windowRadius
unsigned int te::rst::Interpolator::m_windowRadius |
|
protected |
◆ m_wInterpAuxCValue
std::complex<double> te::rst::Interpolator::m_wInterpAuxCValue |
|
protected |
◆ m_wInterpAuxCValues
std::vector< std::complex<double> > te::rst::Interpolator::m_wInterpAuxCValues |
|
protected |
◆ m_wInterpAuxCValuesFreq
std::vector< unsigned int > te::rst::Interpolator::m_wInterpAuxCValuesFreq |
|
protected |
◆ m_wInterpAuxCValuesIdx
std::size_t te::rst::Interpolator::m_wInterpAuxCValuesIdx |
|
protected |
◆ m_wInterpAuxCValuesSize
std::size_t te::rst::Interpolator::m_wInterpAuxCValuesSize |
|
protected |
◆ m_wInterpValueFound
bool te::rst::Interpolator::m_wInterpValueFound |
|
protected |
◆ m_wInterpWindowCol
long int te::rst::Interpolator::m_wInterpWindowCol |
|
protected |
◆ m_wInterpWindowColsBound
long int te::rst::Interpolator::m_wInterpWindowColsBound |
|
protected |
◆ m_wInterpWindowFirstCol
long int te::rst::Interpolator::m_wInterpWindowFirstCol |
|
protected |
◆ m_wInterpWindowFirstRow
long int te::rst::Interpolator::m_wInterpWindowFirstRow |
|
protected |
◆ m_wInterpWindowRow
long int te::rst::Interpolator::m_wInterpWindowRow |
|
protected |
◆ m_wInterpWindowRowsBound
long int te::rst::Interpolator::m_wInterpWindowRowsBound |
|
protected |
◆ m_wInterpWindowValidElementsCount
unsigned int te::rst::Interpolator::m_wInterpWindowValidElementsCount |
|
protected |
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/raster/Interpolator.h