Generic Image Library: channel_multiply

###  | #  |

- Main Page
- Modules
- Namespaces
- Classes
- Files

Classes | Functions
channel_multiply
Algorithms and Utility Functions

Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value. More...

## Classes
struct | channel_multiplier_unsigned< ChannelValue >
| This is the default implementation. Performance specializatons are provided. More...
struct | channel_multiplier_unsigned< uint8_t >
| Specialization of channel_multiply for 8-bit unsigned channels. More...
struct | channel_multiplier_unsigned< uint16_t >
| Specialization of channel_multiply for 16-bit unsigned channels. More...
struct | channel_multiplier_unsigned< float32_t >
| Specialization of channel_multiply for float 0..1 channels. More...
struct | channel_multiplier< ChannelValue >
| A function object to multiply two channels. result = a * b / max_value. More...

## Functions
template<typename Channel >
channel_traits< Channel > ::value_type | channel_multiply (Channel a, Channel b)
| A function multiplying two channels. result = a * b / max_value.

## Detailed Description

Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value.

Example:

uint8_t x=128;
uint8_t y=128;
uint8_t mul = channel_multiply(x,y);
assert(mul == 64); // 64 = 128 * 128 / 255