Algorithms and Utility Functions
|Converting from one channel type to another|
Conversion is done as a simple linear mapping of one channel range to the other, such that the minimum/maximum value of the source maps to the minimum/maximum value of the destination. One implication of this is that the value 0 of signed channels may not be preserved!
|Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value. |
|Returns the inverse of a channel. result = max_value - x + min_value. |
|Predicate metafunction returning whether two channels are compatible|
Channels are considered compatible if their value types (ignoring constness and references) are the same. More...