|
resonance 1.0.1
|
Linear map from one integer range onto another, clamped to the output range. More...
#include <lineartransform.h>
Public Member Functions | |
| LinearTransform (int nInMin, int nInMax, int nOutMin, int nOutMax) | |
| Map inMin onto outMin and inMax onto outMax. | |
| int | Apply (int nValue) |
| Map a value, truncating toward zero and clamping to the output range. | |
Linear map from one integer range onto another, clamped to the output range.
The class is not polymorphic and emits no RTTI. The object is 0x20 bytes. PitchPicker's pitch chooser at 0x001c4488 builds one on its stack, storing the four range words directly before calling Recalc(). The sequence has the shape of an inline constructor around an out-of-line initialiser.
|
inline |
Map inMin onto outMin and inMax onto outMax.
| nInMin | The start of the input range. |
| nInMax | The end of the input range. |
| nOutMin | The value nInMin maps to. |
| nOutMax | The value nInMax maps to. |
| int LinearTransform::Apply | ( | int | nValue | ) |
Map a value, truncating toward zero and clamping to the output range.
| nValue | The input value. |