Automatically map an input value to an output range without knowing the precise range of inputs beforehand. More...
#include <AutoMap.h>
Public Member Functions | |
AutoMap (int min_expected, int max_expected, int map_to_min, int map_to_max) | |
Constructor. More... | |
int | next (int n) |
Process the next value and return it mapped to the range which was set in the constructor. More... | |
int | operator() (int n) |
Process the next value and return it mapped to the range which was set in the constructor. More... | |
int | getMin () |
Returns the current minimum. More... | |
int | getMax () |
Returns the current maximum. More... | |
int | getRange () |
Returns the current range. More... | |
Automatically map an input value to an output range without knowing the precise range of inputs beforehand.
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Process the next value and return it mapped to the range which was set in the constructor.
Can use the operator instead if you prefer, eg. myMap(n) instead of myMap.next(n).
n | the next value to process. |
|
inline |
Process the next value and return it mapped to the range which was set in the constructor.
This is an alternative to next() if you prefer, eg. myMap(n) instead of myMap.next(n).
n | the next value to process. |