Tonc's internal look-up tables and related routines.
More...
|
#define | SIN_LUT_SIZE 514 |
|
#define | DIV_LUT_SIZE 257 |
|
|
INLINE s32 | lu_sin (uint theta) |
| Look-up a sine value (2π = 0x10000)
|
|
INLINE s32 | lu_cos (uint theta) |
| Look-up a cosine value (2π = 0x10000)
|
|
INLINE uint | lu_div (uint x) |
| Look-up a division value between 0 and 255.
|
|
INLINE int | lu_lerp32 (const s32 lut[], uint x, const uint shift) |
| Linear interpolator for 32bit LUTs.
|
|
INLINE int | lu_lerp16 (const s16 lut[], uint x, const uint shift) |
| As lu_lerp32, but for 16bit LUTs.
|
|
|
s32 | div_lut [257] |
|
s16 | sin_lut [514] |
|
Tonc's internal look-up tables and related routines.
◆ lu_cos()
INLINE s32 lu_cos |
( |
uint |
theta | ) |
|
◆ lu_div()
Look-up a division value between 0 and 255.
- Parameters
-
- Returns
- 1/x (.16f)
Referenced by clr_rgbscale().
◆ lu_lerp32()
INLINE int lu_lerp32 |
( |
const s32 |
lut[], |
|
|
uint |
x, |
|
|
const uint |
shift |
|
) |
| |
Linear interpolator for 32bit LUTs.
A lut is essentially the discrete form of a function, f(x). You can get values for non-integer x via (linear) interpolation between f(x) and f(x+1).
- Parameters
-
lut | The LUT to interpolate from. |
x | Fixed point number to interpolate at. |
shift | Number of fixed-point bits of x. |
◆ lu_sin()
INLINE s32 lu_sin |
( |
uint |
theta | ) |
|