pub trait TargetPixel: Sized + Copy {
    // Required methods
    fn blend(&mut self, color: PremultipliedRgbaColor);
    fn from_rgb(red: u8, green: u8, blue: u8) -> Self;

    // Provided method
    fn blend_slice(slice: &mut [Self], color: PremultipliedRgbaColor) { ... }
}
Expand description

Trait for the pixels in the buffer

Required Methods§

fn blend(&mut self, color: PremultipliedRgbaColor)

Blend a single pixel with a color

fn from_rgb(red: u8, green: u8, blue: u8) -> Self

Create a pixel from the red, gree, blue component in the range 0..=255

Provided Methods§

fn blend_slice(slice: &mut [Self], color: PremultipliedRgbaColor)

Blend a color to all the pixel in the slice.

Implementations on Foreign Types§

§

impl TargetPixel for RGB<u8>

§

fn blend(&mut self, color: PremultipliedRgbaColor)

§

fn from_rgb(r: u8, g: u8, b: u8) -> RGB<u8>

Implementors§