| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/linearmapper.h>

Public Member Functions | |
| LinearMapper () | |
| Creates an empty mapping table. | |
| bool | add (SOURCE_TYPE source, TARGET_TYPE target) |
| bool | remove (SOURCE_TYPE source) |
| virtual TARGET_TYPE | map (SOURCE_TYPE source) |
| VRS_TYPEINFO (LinearMapper, VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper)) | |
| VRS_SERIALIZABLE (LinearMapper) | |
| VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::LinearMapper | ( | ) | [inline] |
Creates an empty mapping table.
| bool VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::add | ( | SOURCE_TYPE | source, | |
| TARGET_TYPE | target | |||
| ) | [inline] |
Adds a new entry to the mapping table. Returns true, if there was not already a mapping from the specified source value to some target value.
| bool VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::remove | ( | SOURCE_TYPE | source | ) | [inline] |
Removes an existing entry from the mapping table. Returns true, if there was a mapping from the specified source value to some target value.
| TARGET_TYPE VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::map | ( | SOURCE_TYPE | source | ) | [inline, virtual] |
The resulting target value is calculated by linearly interpolate the target values which are stored in the mapping table for the greatest source value less than or equal to the given source value and the smallest source value greater than the given source value. If all source values stored in the mapping table are greater than the given source value then the target value for the smallest source value stored in the mapping table is returned. If all source values stored in the mapping table are smaller than the given source value then the target value for the greatest source value stored in the mapping table is returned.
Implements VRS::Mapper< TARGET_TYPE, SOURCE_TYPE >.
| VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_TYPEINFO | ( | LinearMapper< TARGET_TYPE, SOURCE_TYPE > | , | |
| VRS_TEMPLATE_ARGS_2(TARGET_TYPE, SOURCE_TYPE, Mapper) | ||||
| ) |
| VRS::LinearMapper< TARGET_TYPE, SOURCE_TYPE >::VRS_SERIALIZABLE | ( | LinearMapper< TARGET_TYPE, SOURCE_TYPE > | ) |