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§
sourcefn composite_buffer(src: &[Self], dest: &mut [Self])
fn composite_buffer(src: &[Self], dest: &mut [Self])
Composites the src
pixel slice to the dest
pixel slice.
sourcefn weight_blend(origin: Self, other: Self, blend: f32) -> Self
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
.