pub trait Channel: Copy + Debug + Default + From<f32> + Ord + Add<Output = Self> + Div<Output = Self> + Mul<Output = Self> + Sub<Output = Self> + Sealed {
    const MIN: Self;
    const MID: Self;
    const MAX: Self;

    fn to_f32(self) -> f32;
    fn wrapping_add(self, rhs: Self) -> Self;
    fn wrapping_sub(self, rhs: Self) -> Self;
    fn encode_srgb(self) -> Self;
    fn decode_srgb(self) -> Self;
    fn lerp(self, rhs: Self, t: Self) -> Self;
}
Expand description

Component of a color model, such as red, green, etc.

Existing Channels are Ch8, Ch16 and Ch32.

This trait is sealed, and cannot be implemented outside of this crate.

Required Associated Constants

Minimum intensity (zero)

Mid intensity

Maximum intensity (one)

Required Methods

Convert to f32

Wrapping addition

Wrapping subtraction

Encode an sRGB gamma value from linear intensity

Decode an sRGB gamma value into linear intensity

Linear interpolation

Implementors