pub enum TransferFunction {
Identity,
Table(SmallVec<[f32; 2]>),
Discrete(Vec<f32>),
Linear(LinearTransferFunction),
Gamma(GammaTransferFunction),
}Expand description
Transfer functions for component transfer operations.
These functions map input color channel values to output values, enabling gamma correction, color grading, and custom color curves. Input and output values are typically in the range [0, 1].
Variants§
Identity
Identity function (output = input, no change).
Table(SmallVec<[f32; 2]>)
Table lookup with linear interpolation.
Maps input values using a lookup table with linear interpolation between entries. Input 0.0 maps to values[0], 1.0 maps to values[n-1], intermediate values interpolate.
Lookup table values defining the transfer curve. More values provide smoother curves. Minimum 2 values required.
Discrete(Vec<f32>)
Discrete step function (posterization).
Maps input to discrete output values without interpolation, creating step/banding effects. Each segment gets a constant output value from the table.
Step values for each discrete output level. Input range is divided into len(values) segments, each mapping to one value.
Linear(LinearTransferFunction)
Linear function: output = slope × input + intercept.
Gamma(GammaTransferFunction)
Trait Implementations§
Source§impl Clone for TransferFunction
impl Clone for TransferFunction
Source§fn clone(&self) -> TransferFunction
fn clone(&self) -> TransferFunction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more