Skip to main content

SpanGenerator

Trait SpanGenerator 

Source
pub trait SpanGenerator {
    type Color;

    // Required methods
    fn prepare(&mut self);
    fn generate(&mut self, span: &mut [Self::Color], x: i32, y: i32, len: u32);
}
Expand description

Trait for span generators that produce per-pixel colors.

Span generators are called during rendering to fill color arrays for each scanline span. The renderer then blends these colors into the output buffer.

Port of the C++ span generator concept used by render_scanlines_aa.

Required Associated Types§

Required Methods§

Source

fn prepare(&mut self)

Called once before rendering begins.

Source

fn generate(&mut self, span: &mut [Self::Color], x: i32, y: i32, len: u32)

Generate colors for a horizontal span.

Fills span[0..len] with colors for pixels starting at (x, y).

Implementors§