[][src]Trait resize::PixelFormat

pub trait PixelFormat {
    type InputPixel: Copy;
    type OutputPixel;
    type Accumulator: Copy;
    fn new() -> Self::Accumulator;
fn add(
        &self,
        acc: &mut Self::Accumulator,
        inp: Self::InputPixel,
        coeff: f32
    );
fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32);
fn into_pixel(&self, acc: Self::Accumulator) -> Self::OutputPixel; }

Use Pixel presets to specify pixel format.

Temporary object that adds pixels together

Associated Types

type InputPixel: Copy

Pixel type in the source image

type OutputPixel

Pixel type in the destination image (usually the same as Input)

type Accumulator: Copy

Temporary struct for the pixel in floating-point

Loading content...

Required methods

fn new() -> Self::Accumulator

Create new floating-point pixel

fn add(&self, acc: &mut Self::Accumulator, inp: Self::InputPixel, coeff: f32)

Add new pixel with a given weight (first axis)

fn add_acc(acc: &mut Self::Accumulator, inp: Self::Accumulator, coeff: f32)

Add bunch of accumulated pixels with a weight (second axis)

fn into_pixel(&self, acc: Self::Accumulator) -> Self::OutputPixel

Finalize, convert to output pixel format

Loading content...

Implementors

Loading content...