wavelength 1.0.0
Loading...
Searching...
No Matches
TableInterpolator Class Reference

Interpolator that reads the nearest entry of an evenly spaced table. More...

#include <interpolator.h>

Inheritance diagram for TableInterpolator:
Collaboration diagram for TableInterpolator:

Public Member Functions

 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.
Public Member Functions inherited from Interpolator
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

Protected Member Functions

void FillTable (const DataArray *pArray, int nFirst)
 Read the numbers of an array into the table.

Protected Attributes

float mStep
float mInvStep
float * mTable
int mCount
Protected Attributes inherited from Interpolator
float mY0
float mY1
float mX0
float mX1

Detailed Description

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.

Constructor & Destructor Documentation

◆ TableInterpolator() [1/2]

TableInterpolator::TableInterpolator ( int nCount,
float fX0,
float fX1 )

Construct an interpolator with a zeroed table.

Parameters
nCountThe table entries.
fX0The start of the input range.
fX1The 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
fX0The start of the input range.
fX1The end of the input range.
pArrayThe array.
nFirstThe 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

Member Function Documentation

◆ Interp()

float TableInterpolator::Interp ( float fX)
overridevirtual

Read the entry nearest an input.

Parameters
fXThe input.
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
fY0Not used.
fY1Not used.
fX0Not used.
fX1Not 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
sourceThe interpolator to sample.
nCountThe 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
nCountThe table entries.
fX0The start of the input range.
fX1The 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
pArrayThe array.
nFirstThe index of the first entry in the array.

Member Data Documentation

◆ 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

The entries.

◆ mCount

int TableInterpolator::mCount
protected

The entries of mTable.


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