Interpolator that reads the nearest entry of an evenly spaced table.
More...
#include <interpolator.h>
|
| | TableInterpolator (int nCount, float fX0, float fX1) |
| | Construct an interpolator with a zeroed table.
|
| | TableInterpolator (float fX0, float fX1, const DataArray *pArray, int nFirst) |
| | Construct an interpolator from the numbers of an array.
|
| | ~TableInterpolator () override |
| | Release the table.
|
| float | Interp (float fX) override |
| | Read the entry nearest an input.
|
| void | Reset (float fY0, float fY1, float fX0, float fX1) override |
| | Report that a table cannot be rebuilt from end points.
|
| virtual void | Resample (Interpolator &source, int nCount) |
| | Fill the table by sampling another interpolator evenly across its range.
|
| virtual void | SetSize (int nCount, float fX0, float fX1) |
| | Size the table, zeroing it when it is reallocated, and set the input range.
|
| virtual void | Update () |
| | Recompute the spacing of the entries from the input range.
|
| virtual | ~Interpolator () |
| | Release the interpolator.
|
| virtual float | Eval (float fX) |
| | Map an input, clamping it to the range first.
|
| float | GetY0 () const |
| float | GetY1 () const |
| float | GetX0 () const |
| float | GetX1 () const |
|
| void | FillTable (const DataArray *pArray, int nFirst) |
| | Read the numbers of an array into the table.
|
Interpolator that reads the nearest entry of an evenly spaced table.
The RTTI records the class as deriving from Interpolator. The object is 0x24 bytes.
◆ TableInterpolator() [1/2]
| TableInterpolator::TableInterpolator |
( |
int | nCount, |
|
|
float | fX0, |
|
|
float | fX1 ) |
Construct an interpolator with a zeroed table.
- Parameters
-
| nCount | The table entries. |
| fX0 | The start of the input range. |
| fX1 | The end of the input range. |
- Ghidra address:
- NTSC-U/C: 0x00291a40
- Ghidra address:
- PAL: 0x0029b408
◆ TableInterpolator() [2/2]
| TableInterpolator::TableInterpolator |
( |
float | fX0, |
|
|
float | fX1, |
|
|
const DataArray * | pArray, |
|
|
int | nFirst ) |
Construct an interpolator from the numbers of an array.
The end outputs are taken before the table is filled. mTable and mCount are not cleared first, and SetSize() reads them as the allocation left them.
- Parameters
-
| fX0 | The start of the input range. |
| fX1 | The end of the input range. |
| pArray | The array. |
| nFirst | The index of the first table entry in the array. |
- Ghidra address:
- NTSC-U/C: 0x00291a90
- Ghidra address:
- PAL: 0x0029b458
◆ ~TableInterpolator()
| TableInterpolator::~TableInterpolator |
( |
| ) |
|
|
override |
Release the table.
- Ghidra address:
- NTSC-U/C: 0x00291b30
- Ghidra address:
- PAL: 0x0029b4f8
◆ Interp()
| float TableInterpolator::Interp |
( |
float | fX | ) |
|
|
overridevirtual |
Read the entry nearest an input.
- Parameters
-
- Returns
- The entry, the first or the last outside the range.
- Ghidra address:
- NTSC-U/C: 0x00291db0
- Ghidra address:
- PAL: 0x0029b778
Implements Interpolator.
Reimplemented in TableLinInterpolator.
◆ Reset()
| void TableInterpolator::Reset |
( |
float | fY0, |
|
|
float | fY1, |
|
|
float | fX0, |
|
|
float | fX1 ) |
|
overridevirtual |
Report that a table cannot be rebuilt from end points.
- Parameters
-
| fY0 | Not used. |
| fY1 | Not used. |
| fX0 | Not used. |
| fX1 | Not used. |
- Ghidra address:
- NTSC-U/C: 0x00291d90
- Ghidra address:
- PAL: 0x0029b758
Implements Interpolator.
◆ Resample()
| virtual void TableInterpolator::Resample |
( |
Interpolator & | source, |
|
|
int | nCount ) |
|
virtual |
Fill the table by sampling another interpolator evenly across its range.
- Parameters
-
| source | The interpolator to sample. |
| nCount | The table entries. |
- Ghidra address:
- NTSC-U/C: 0x00291b98
- Ghidra address:
- PAL: 0x0029b560
Reimplemented in TableLinInterpolator.
◆ SetSize()
| virtual void TableInterpolator::SetSize |
( |
int | nCount, |
|
|
float | fX0, |
|
|
float | fX1 ) |
|
virtual |
Size the table, zeroing it when it is reallocated, and set the input range.
- Parameters
-
| nCount | The table entries. |
| fX0 | The start of the input range. |
| fX1 | The end of the input range. |
- Ghidra address:
- NTSC-U/C: 0x00291cb8
- Ghidra address:
- PAL: 0x0029b680
Reimplemented in TableLinInterpolator.
◆ Update()
| virtual void TableInterpolator::Update |
( |
| ) |
|
|
virtual |
Recompute the spacing of the entries from the input range.
- Ghidra address:
- NTSC-U/C: 0x00291e18
- Ghidra address:
- PAL: 0x0029b7e0
Reimplemented in TableLinInterpolator.
◆ FillTable()
| void TableInterpolator::FillTable |
( |
const DataArray * | pArray, |
|
|
int | nFirst ) |
|
protected |
Read the numbers of an array into the table.
- Parameters
-
| pArray | The array. |
| nFirst | The index of the first entry in the array. |
◆ mStep
| float TableInterpolator::mStep |
|
protected |
The input range covered by one entry.
◆ mInvStep
| float TableInterpolator::mInvStep |
|
protected |
The entries per unit of input, or 1 for a range narrower than 1e-6.
◆ mTable
| float* TableInterpolator::mTable |
|
protected |
◆ mCount
| int TableInterpolator::mCount |
|
protected |
The documentation for this class was generated from the following file: