[][src]Trait resize::PixelFormat

pub trait PixelFormat {
    type Accumulator: AsRef<[f32]> + AsMut<[f32]>;
    type Subpixel: Copy;
    fn new_accum() -> Self::Accumulator;
fn into_subpixel(v: f32) -> Self::Subpixel;
fn from_subpixel(v: &Self::Subpixel) -> f32; fn get_size(&self) -> usize { ... }
fn get_ncomponents(&self) -> usize { ... } }

See Pixel

Associated Types

type Accumulator: AsRef<[f32]> + AsMut<[f32]>

Array to hold temporary values.

type Subpixel: Copy

Type of a Subpixel of each pixel (8 or 16 bits).

Loading content...

Required methods

fn new_accum() -> Self::Accumulator

New empty Accumulator.

fn into_subpixel(v: f32) -> Self::Subpixel

Convert float to integer value in range appropriate for this pixel format.

fn from_subpixel(v: &Self::Subpixel) -> f32

Convert pixel component to float

Loading content...

Provided methods

fn get_size(&self) -> usize

Size of one pixel in that format in bytes.

fn get_ncomponents(&self) -> usize

Return number of components of that format.

Loading content...

Implementors

impl PixelFormat for Gray16[src]

type Accumulator = [f32; 1]

type Subpixel = u16

impl PixelFormat for Gray8[src]

type Accumulator = [f32; 1]

type Subpixel = u8

impl PixelFormat for RGB24[src]

type Accumulator = [f32; 3]

type Subpixel = u8

impl PixelFormat for RGB48[src]

type Accumulator = [f32; 3]

type Subpixel = u16

impl PixelFormat for RGBA[src]

type Accumulator = [f32; 4]

type Subpixel = u8

impl PixelFormat for RGBA64[src]

type Accumulator = [f32; 4]

type Subpixel = u16

Loading content...