color

Trait Channel

Source
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§

Required Methods§

Source

fn from<T: Channel>(chan: T) -> Self

Source

fn to_channel_u8(self) -> u8

Source

fn to_channel_u16(self) -> u16

Source

fn to_channel_u32(self) -> u32

Source

fn to_channel_f16(self) -> f16

Source

fn to_channel_f32(self) -> f32

Source

fn to_channel_f64(self) -> f64

Source

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source

fn invert_channel(self) -> Self

Source

fn max() -> Self

Source

fn mix(self, rhs: Self, value: Self) -> Self

Source

fn zero() -> Self

Provided Methods§

Source

fn to_channel<T: Channel>(self) -> T

Source

fn clamp(self, lo: Self, hi: Self) -> Self

Source

fn normalized_mul(self, rhs: Self) -> Self

Source

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.

Implementations on Foreign Types§

Source§

impl Channel for f32

Source§

type NearestFloat = f32

Source§

fn from<T: Channel>(chan: T) -> f32

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> f32

Source§

fn normalized_mul(self, rhs: Self) -> Self

Source§

fn normalized_div(self, rhs: Self) -> Self

Source§

fn max() -> f32

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Source§

impl Channel for f64

Source§

type NearestFloat = f64

Source§

fn from<T: Channel>(chan: T) -> f64

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> f64

Source§

fn normalized_mul(self, rhs: Self) -> Self

Source§

fn normalized_div(self, rhs: Self) -> Self

Source§

fn max() -> f64

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Source§

impl Channel for u8

Source§

type NearestFloat = f32

Source§

fn from<T: Channel>(chan: T) -> u8

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> u8

Source§

fn max() -> u8

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Source§

impl Channel for u16

Source§

type NearestFloat = f32

Source§

fn from<T: Channel>(chan: T) -> u16

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> u16

Source§

fn max() -> u16

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Source§

impl Channel for u32

Source§

type NearestFloat = f32

Source§

fn from<T: Channel>(chan: T) -> u32

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> u32

Source§

fn max() -> u32

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Source§

impl Channel for f16

Source§

type NearestFloat = f32

Source§

fn from<T: Channel>(chan: T) -> f16

Source§

fn to_channel_u8(self) -> u8

Source§

fn to_channel_u16(self) -> u16

Source§

fn to_channel_u32(self) -> u32

Source§

fn to_channel_f16(self) -> f16

Source§

fn to_channel_f32(self) -> f32

Source§

fn to_channel_f64(self) -> f64

Source§

fn to_nearest_precision_float(self) -> Self::NearestFloat

Source§

fn invert_channel(self) -> f16

Source§

fn normalized_mul(self, rhs: Self) -> Self

Source§

fn normalized_div(self, rhs: Self) -> Self

Source§

fn max() -> f16

Source§

fn mix(self, rhs: Self, value: Self) -> Self

Source§

fn zero() -> Self

Implementors§