Maps a unit value through an invertible function. More...
#include <UnitMaps.h>
Public Types | |
enum | MapType { MAP_LIN, MAP_POW, MAP_EXP2 } |
Mapping types. More... | |
Public Member Functions | |
UnitMapper (T max, T min=0., T p1=1., MapType type=MAP_POW, bool clip=true) | |
UnitMapper & | set (T max, T min=0., T p1=1., MapType type=MAP_POW, bool clip=true) |
Set all attributes. | |
T | map (T unit) |
Map a unit value. | |
T | unmap (T value) |
Unmap a value to a unit value. |
Maps a unit value through an invertible function.
enum MapType |
UnitMapper | ( | T | max, |
T | min = 0. , |
||
T | p1 = 1. , |
||
MapType | type = MAP_POW , |
||
bool | clip = true |
||
) |
[in] | max | upper endpoint of interval |
[in] | min | lower endpoint of interval |
[in] | p1 | mapping function function parameter |
[in] | type | mapping function |
[in] | clip | whether to clip values to interval |