Skip to main content

Scanline

Trait Scanline 

Source
pub trait Scanline {
    // Required methods
    fn reset_spans(&mut self);
    fn add_cell(&mut self, x: i32, cover: u32);
    fn add_span(&mut self, x: i32, len: u32, cover: u32);
    fn finalize(&mut self, y: i32);
    fn num_spans(&self) -> u32;
    fn y(&self) -> i32;
}
Expand description

Trait for scanline containers that accumulate coverage data.

Implementations include ScanlineU8 (unpacked per-pixel coverage), ScanlineP8 (packed/RLE), and ScanlineBin (binary, no coverage).

Required Methods§

Source

fn reset_spans(&mut self)

Prepare for a new scanline, clearing all span data.

Source

fn add_cell(&mut self, x: i32, cover: u32)

Add a single cell at position x with coverage cover.

Source

fn add_span(&mut self, x: i32, len: u32, cover: u32)

Add a horizontal span of len pixels starting at x, all with cover.

Source

fn finalize(&mut self, y: i32)

Finalize the scanline at the given Y coordinate.

Source

fn num_spans(&self) -> u32

Number of spans in this scanline (0 means empty).

Source

fn y(&self) -> i32

The Y coordinate of this scanline.

Implementors§