Trait framebuffer::pixel::Pixel

source ·
pub trait Pixel: Copy + Hash + FromBytes {
    // Required methods
    fn composite_buffer(src: &[Self], dest: &mut [Self]);
    fn blend(self, other: Self) -> Self;
    fn weight_blend(origin: Self, other: Self, blend: f32) -> Self;
}
Expand description

A pixel provides methods to blend with others.

Required Methods§

source

fn composite_buffer(src: &[Self], dest: &mut [Self])

Composites the src pixel slice to the dest pixel slice.

source

fn blend(self, other: Self) -> Self

blend with another pixel considering their extra channel.

source

fn weight_blend(origin: Self, other: Self, blend: f32) -> Self

Blend two pixels linearly with weights, as blend for origin and (1-blend) for other.

Implementors§