[][src]Trait pix::chan::Channel

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; }

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.

Associated Constants

const MIN: Self

Minimum intensity (zero)

const MID: Self

Mid intensity

const MAX: Self

Maximum intensity (one)

Loading content...

Required methods

fn to_f32(self) -> f32

Convert to f32

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

Wrapping addition

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

Wrapping subtraction

fn encode_srgb(self) -> Self

Encode an sRGB gamma value from linear intensity

fn decode_srgb(self) -> Self

Decode an sRGB gamma value into linear intensity

fn lerp(self, rhs: Self, t: Self) -> Self

Linear interpolation

Loading content...

Implementors

impl Channel for Ch16[src]

fn to_f32(self) -> f32[src]

Convert to f32

fn wrapping_add(self, rhs: Self) -> Self[src]

Wrapping addition

fn wrapping_sub(self, rhs: Self) -> Self[src]

Wrapping subtraction

fn encode_srgb(self) -> Self[src]

Encode an sRGB gamma value from linear intensity

fn decode_srgb(self) -> Self[src]

Decode an sRGB gamma value into linear intensity

fn lerp(self, rhs: Self, t: Self) -> Self[src]

Linear interpolation

impl Channel for Ch32[src]

fn to_f32(self) -> f32[src]

Convert to f32

fn wrapping_add(self, rhs: Self) -> Self[src]

Wrapping addition

fn wrapping_sub(self, rhs: Self) -> Self[src]

Wrapping subtraction

fn encode_srgb(self) -> Self[src]

Encode an sRGB gamma value from linear intensity

fn decode_srgb(self) -> Self[src]

Decode an sRGB gamma value into linear intensity

fn lerp(self, rhs: Self, t: Self) -> Self[src]

Linear interpolation

impl Channel for Ch8[src]

fn to_f32(self) -> f32[src]

Convert to f32

fn wrapping_add(self, rhs: Self) -> Self[src]

Wrapping addition

fn wrapping_sub(self, rhs: Self) -> Self[src]

Wrapping subtraction

fn encode_srgb(self) -> Self[src]

Encode an sRGB gamma value from linear intensity

fn decode_srgb(self) -> Self[src]

Decode an sRGB gamma value into linear intensity

fn lerp(self, rhs: Self, t: Self) -> Self[src]

Linear interpolation

Loading content...