Skip to main content

PixelSink

Trait PixelSink 

Source
pub trait PixelSink {
    // Required method
    fn draw_pixel(&mut self, x: u32, y: u32, rgba: Rgba<u8>);
}
Expand description

Trait for pixel rendering backends.

Implementations of this trait define how individual pixels are rendered to a target. Different implementations support different output formats (PNG, PDF, etc.).

Required Methods§

Source

fn draw_pixel(&mut self, x: u32, y: u32, rgba: Rgba<u8>)

Draw a single pixel at the given coordinates with the specified RGBA color.

§Arguments
  • x - X coordinate (0 = left)
  • y - Y coordinate (0 = top)
  • rgba - RGBA color value [0, 255]

Implementors§