It interpolates one pixel based on a selected algorithm. Methods currently available are Nearest Neighbor, Bilinear, and Bicubic.
More...
#include <Interpolator.h>
|
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. More...
|
|
|
void | bicubicGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Bicubic interpolation method. More...
|
|
void | bilinearGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Bilinear interpolation method. More...
|
|
bool | initialize (Raster const *const rasterPointer, int method, const std::vector< std::complex< double > > &noDataValues) |
| Initialize this instance.. More...
|
|
void | nearestNeighborGetValue (const double &c, const double &r, std::complex< double > &v, const std::size_t &b) |
| Nearest neighbor interpolation method. More...
|
|
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 156 of file Interpolator.h.
◆ Method
◆ Interpolator() [1/2]
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/2]
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()
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).
◆ 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 93 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.
◆ initialize()
bool te::rst::Interpolator::initialize |
( |
Raster const *const |
rasterPointer, |
|
|
int |
method, |
|
|
const std::vector< std::complex< double > > & |
noDataValues |
|
) |
| |
|
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. |
- Returns
- true if OK, false on errors.
◆ 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 220 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 219 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 192 of file Interpolator.h.
◆ m_bilColDifMin
double te::rst::Interpolator::m_bilColDifMin |
|
protected |
Minimum difference between columns (min/max).
Definition at line 191 of file Interpolator.h.
◆ m_bilColMax
double te::rst::Interpolator::m_bilColMax |
|
protected |
Maximum column for bilinear interpolation.
Definition at line 188 of file Interpolator.h.
◆ m_bilColMin
double te::rst::Interpolator::m_bilColMin |
|
protected |
Minimum column for bilinear interpolation.
Definition at line 187 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 197 of file Interpolator.h.
◆ m_bilLastRow
double te::rst::Interpolator::m_bilLastRow |
|
protected |
Last row available for bilinear interpolation.
Definition at line 196 of file Interpolator.h.
◆ m_bilRowDifMax
double te::rst::Interpolator::m_bilRowDifMax |
|
protected |
Maximum difference between rows (min/max).
Definition at line 190 of file Interpolator.h.
◆ m_bilRowDifMin
double te::rst::Interpolator::m_bilRowDifMin |
|
protected |
Minimum difference between rows (min/max).
Definition at line 189 of file Interpolator.h.
◆ m_bilRowMax
double te::rst::Interpolator::m_bilRowMax |
|
protected |
Maximum row for bilinear interpolation.
Definition at line 186 of file Interpolator.h.
◆ m_bilRowMin
double te::rst::Interpolator::m_bilRowMin |
|
protected |
Minimum row for bilinear interpolation.
Definition at line 185 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 173 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 181 of file Interpolator.h.
◆ m_nnLastRow
double te::rst::Interpolator::m_nnLastRow |
|
protected |
Last row available for nearest Neighbor interpolation.
Definition at line 180 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 |
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/src/terralib/raster/Interpolator.h