|
CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
|
Go to the source code of this file.
Functions | |
| constexpr uint8_t | map_color_channel (int low, int high, int val, int start, int end) |
| Remap a value between low and high to an output between start and end. | |
Remap a value between low and high to an output between start and end.
Perform linear scaling of a value from one range to another. This function is primarily intended for mapping bytes to color channel values.
| low | Lower bound of input range. Must be less than high. [0-255] |
| high | Upper bound of input range. Must be greater than low. [0-255] |
| val | Value in [low, high] to scale. |
| start | Lower bound of output range. May be greater than end. [0-255] |
| end | Upper bound of output range. May be less than start. [0-255] |