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 Channel
s are Ch8, Ch16 and Ch32.
This trait is sealed, and cannot be implemented outside of this crate.
Required Associated Constants
Required Methods
fn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
Wrapping addition
fn wrapping_sub(self, rhs: Self) -> Self
fn wrapping_sub(self, rhs: Self) -> Self
Wrapping subtraction
fn encode_srgb(self) -> Self
fn encode_srgb(self) -> Self
Encode an sRGB gamma value from linear intensity
fn decode_srgb(self) -> Self
fn decode_srgb(self) -> Self
Decode an sRGB gamma value into linear intensity