[][src]Trait fon::sample::Sample

pub trait Sample: Clone + Copy + Debug + Default + PartialEq + Sealed {
    type Chan: Channel;

    const CHAN_COUNT: usize;

    fn channels(&self) -> &[Self::Chan];
fn channels_mut(&mut self) -> &mut [Self::Chan];
fn from_channels(ch: &[Self::Chan]) -> Self; fn lerp(&self, rhs: Self, t: Self) -> Self { ... }
fn blend_sample<O>(dst: &mut [Self], sample: &Self, op: O)
    where
        O: Blend
, { ... }
fn blend_slice<O>(dst: &mut [Self], src: &[Self], op: O)
    where
        O: Blend
, { ... }
fn blend<O>(&mut self, src: &Self, _op: O)
    where
        O: Blend
, { ... }
fn convert<D>(self) -> D
    where
        D: Sample,
        D::Chan: From<Self::Chan> + From<f64>
, { ... } }

Sample - A number of channels.

Associated Types

type Chan: Channel

Channel type

Loading content...

Associated Constants

const CHAN_COUNT: usize

Number of channels

Loading content...

Required methods

fn channels(&self) -> &[Self::Chan]

Get the channels.

fn channels_mut(&mut self) -> &mut [Self::Chan]

Get the channels mutably.

fn from_channels(ch: &[Self::Chan]) -> Self

Make a pixel from a slice of channels.

Loading content...

Provided methods

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

Linear interpolation.

fn blend_sample<O>(dst: &mut [Self], sample: &Self, op: O) where
    O: Blend

Synthesis of a sample with a slice of samples.

fn blend_slice<O>(dst: &mut [Self], src: &[Self], op: O) where
    O: Blend

Synthesis of two slices of samples.

fn blend<O>(&mut self, src: &Self, _op: O) where
    O: Blend

Synthesize two samples together.

fn convert<D>(self) -> D where
    D: Sample,
    D::Chan: From<Self::Chan> + From<f64>, 

Convert a sample to another format.

Loading content...

Implementors

impl<C: Channel> Sample for Sample1<C>[src]

type Chan = C

impl<C: Channel> Sample for Sample2<C>[src]

type Chan = C

impl<C: Channel> Sample for Sample4<C>[src]

type Chan = C

impl<C: Channel> Sample for Sample6<C>[src]

type Chan = C

impl<C: Channel> Sample for Sample8<C>[src]

type Chan = C

Loading content...