pub trait Channel:
Copy
+ Sized
+ PartialOrd
+ PartialEq {
type NearestFloat: Float + Channel;
Show 16 methods
// Required methods
fn from<T: Channel>(chan: T) -> Self;
fn to_channel_u8(self) -> u8;
fn to_channel_u16(self) -> u16;
fn to_channel_u32(self) -> u32;
fn to_channel_f16(self) -> f16;
fn to_channel_f32(self) -> f32;
fn to_channel_f64(self) -> f64;
fn to_nearest_precision_float(self) -> Self::NearestFloat;
fn invert_channel(self) -> Self;
fn max() -> Self;
fn mix(self, rhs: Self, value: Self) -> Self;
fn zero() -> Self;
// Provided methods
fn to_channel<T: Channel>(self) -> T { ... }
fn clamp(self, lo: Self, hi: Self) -> Self { ... }
fn normalized_mul(self, rhs: Self) -> Self { ... }
fn normalized_div(self, rhs: Self) -> Self { ... }
}
Required Associated Types§
type NearestFloat: Float + Channel
Required Methods§
fn from<T: Channel>(chan: T) -> Self
fn to_channel_u8(self) -> u8
fn to_channel_u16(self) -> u16
fn to_channel_u32(self) -> u32
fn to_channel_f16(self) -> f16
fn to_channel_f32(self) -> f32
fn to_channel_f64(self) -> f64
fn to_nearest_precision_float(self) -> Self::NearestFloat
fn invert_channel(self) -> Self
fn max() -> Self
fn mix(self, rhs: Self, value: Self) -> Self
fn zero() -> Self
Provided Methods§
fn to_channel<T: Channel>(self) -> T
fn clamp(self, lo: Self, hi: Self) -> Self
fn normalized_mul(self, rhs: Self) -> Self
fn normalized_div(self, rhs: Self) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.