Trait PixelFormat

Source
pub trait PixelFormat:
    Sized
    + Copy
    + Clone {
    type ChannelValue: ChannelFormat;

    // Required methods
    fn channel(&self, i: usize) -> &Self::ChannelValue;
    fn channel_mut(&mut self, i: usize) -> &mut Self::ChannelValue;

    // Provided methods
    fn num_components() -> usize { ... }
    fn components() -> ImageComponent { ... }
    fn num_bits_depth() -> usize { ... }
    fn bit_depth() -> BitDepth { ... }
}

Required Associated Types§

Required Methods§

Source

fn channel(&self, i: usize) -> &Self::ChannelValue

Source

fn channel_mut(&mut self, i: usize) -> &mut Self::ChannelValue

Provided Methods§

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 PixelFormat for f32

Source§

type ChannelValue = f32

Source§

fn channel(&self, i: usize) -> &Self::ChannelValue

Source§

fn channel_mut(&mut self, i: usize) -> &mut Self::ChannelValue

Source§

impl PixelFormat for u8

Source§

type ChannelValue = u8

Source§

fn channel(&self, i: usize) -> &Self::ChannelValue

Source§

fn channel_mut(&mut self, i: usize) -> &mut Self::ChannelValue

Source§

impl PixelFormat for u16

Source§

type ChannelValue = u16

Source§

fn channel(&self, i: usize) -> &Self::ChannelValue

Source§

fn channel_mut(&mut self, i: usize) -> &mut Self::ChannelValue

Implementors§