Trait plasma::Mixer

source ·
pub trait Mixer<T: Sized + Default + Copy> {
    type IntermediateH: Sized + Default + Copy + BorrowMut<[T]> + Borrow<[T]>;
    type IntermediateV: Sized + Default + Copy + BorrowMut<[T]> + Borrow<[T]>;

    // Required method
    fn mix_pixels(
        vxp: &Self::IntermediateH,
        vyp: &Self::IntermediateV,
        next_pixel: &mut dyn FnMut(PixelRgb),
    );

    // Provided methods
    fn intermediate_h_len() -> usize { ... }
    fn intermediate_v_len() -> usize { ... }
}
Expand description

Implementations of this trait should compute the color of each pixel based on an intermediate data created by a IntermediateCalculator.

The type T should be a f32 or a packed simd f32x8 if a “use-simd” crate feature is enabled.

Required Associated Types§

source

type IntermediateH: Sized + Default + Copy + BorrowMut<[T]> + Borrow<[T]>

This type should be an array of the type T for an intermediate horizontal data.

source

type IntermediateV: Sized + Default + Copy + BorrowMut<[T]> + Borrow<[T]>

This type should be an array of the type T for an intermediate vertical data.

Required Methods§

source

fn mix_pixels( vxp: &Self::IntermediateH, vyp: &Self::IntermediateV, next_pixel: &mut dyn FnMut(PixelRgb), )

The implementors should compute a pixel and send it as an instance of PixelRgb to the provided next_pixel function.

The computation should be based on the provided combination of intermediate data.

Provided Methods§

source

fn intermediate_h_len() -> usize

Returns the number of intermediate horizontal values.

source

fn intermediate_v_len() -> usize

Returns the number of intermediate vertical values.

Object Safety§

This trait is not object safe.

Implementors§