pub struct ScanlineU8 { /* private fields */ }Expand description
Unpacked scanline container with per-pixel u8 coverage values.
Port of C++ scanline_u8. Each pixel in a span has its own coverage
byte, stored in a flat array indexed by x - min_x.
Usage protocol:
reset(min_x, max_x)— allocate covers and spans arraysadd_cell()/add_span()— accumulate span data (X must be monotonically increasing)finalize(y)— set the Y coordinate- Iterate with
begin()andcovers()for rendering reset_spans()— prepare for next scanline
Implementations§
Trait Implementations§
Source§impl Default for ScanlineU8
impl Default for ScanlineU8
Source§impl Scanline for ScanlineU8
impl Scanline for ScanlineU8
Source§fn reset_spans(&mut self)
fn reset_spans(&mut self)
Prepare for a new scanline, clearing all span data.
Source§fn add_cell(&mut self, x: i32, cover: u32)
fn add_cell(&mut self, x: i32, cover: u32)
Add a single cell at position
x with coverage cover.Auto Trait Implementations§
impl Freeze for ScanlineU8
impl RefUnwindSafe for ScanlineU8
impl Send for ScanlineU8
impl Sync for ScanlineU8
impl Unpin for ScanlineU8
impl UnsafeUnpin for ScanlineU8
impl UnwindSafe for ScanlineU8
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more