[][src]Trait ffimage::core::traits::Pixel

pub trait Pixel: Sized + Copy + Send + Sync + IndexMut<usize> {
    type T: StorageType;
    fn at(&self, index: usize) -> Self::T;
fn try_from(raw: &[Self::T]) -> Result<Self, TryFromSliceError>;
fn channels() -> u8;
fn subpixels() -> u8; fn len() -> usize { ... } }

Generic pixel container

Associated Types

type T: StorageType

Type of the container elements

Loading content...

Required methods

fn at(&self, index: usize) -> Self::T

Returns the channel value at the specified index

fn try_from(raw: &[Self::T]) -> Result<Self, TryFromSliceError>

Convert a memory region into a pixel by copying the bytes

fn channels() -> u8

Number of channels for this pixel

fn subpixels() -> u8

Number of image pixels for this pixel

Loading content...

Provided methods

fn len() -> usize

Size of one pixel in bytes

Loading content...

Implementors

impl<T: StorageType> Pixel for Bgr<T>[src]

type T = T

impl<T: StorageType> Pixel for Bgra<T>[src]

type T = T

impl<T: StorageType> Pixel for Gray<T>[src]

type T = T

impl<T: StorageType> Pixel for Rgb<T>[src]

type T = T

impl<T: StorageType> Pixel for Rgba<T>[src]

type T = T

Loading content...