ScummVM API documentation
Common::CosineTable Class Reference

Public Member Functions

 CosineTable (int nPoints)
 
const float * getTable ()
 
float at (int index) const
 
float atLegacy (int index) const
 

Constructor & Destructor Documentation

◆ CosineTable()

Common::CosineTable::CosineTable ( int  nPoints)

Construct a cosine table given the number of points.

Parameters
nPointsNumber of distinct radian points that must be in range [16,65536] and be divisible by 4.

Member Function Documentation

◆ getTable()

const float* Common::CosineTable::getTable ( )
inline

Get a pointer to a table.

This table contains nPoints/2 entries. Prefer to use at() The layout of this table is as follows:

  • Entries 0 up to (including) nPoints/4: cos(0) till (including) cos(1/2*pi)
  • Entries (excluding) nPoints/4 up to nPoints/2: (excluding) cos(3/2*pi) till (excluding) cos(2*pi)

◆ at()

float Common::CosineTable::at ( int  index) const

Return cos(2*pi * index / nPoints ) Index must be in range [0, nPoints - 1] Faster than atLegacy.

◆ atLegacy()

float Common::CosineTable::atLegacy ( int  index) const

Returns cos(2*pi * index / nPoints ) Index must be in range [0, nPoints - 1]


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