pub struct ScanlineStorageAa { /* private fields */ }Expand description
Anti-aliased scanline storage.
Port of C++ scanline_storage_aa<T>.
Stores rendered scanlines for later replay, boolean operations, or serialization.
Implementations§
Source§impl ScanlineStorageAa
impl ScanlineStorageAa
pub fn new() -> Self
Sourcepub fn render_scanline_u8(&mut self, sl: &ScanlineU8)
pub fn render_scanline_u8(&mut self, sl: &ScanlineU8)
Store a scanline from a ScanlineU8 (unpacked, per-pixel covers).
Sourcepub fn render_scanline_p8(&mut self, sl: &ScanlineP8)
pub fn render_scanline_p8(&mut self, sl: &ScanlineP8)
Store a scanline from a ScanlineP8 (packed, may have solid spans).
Sourcepub fn rewind_scanlines(&mut self) -> bool
pub fn rewind_scanlines(&mut self) -> bool
Reset the scanline iteration pointer.
Sourcepub fn sweep_scanline<SL: Scanline>(&mut self, sl: &mut SL) -> bool
pub fn sweep_scanline<SL: Scanline>(&mut self, sl: &mut SL) -> bool
Sweep the next stored scanline into an output scanline container. Returns false when all scanlines have been consumed.
pub fn min_x(&self) -> i32
pub fn min_y(&self) -> i32
pub fn max_x(&self) -> i32
pub fn max_y(&self) -> i32
pub fn num_scanlines(&self) -> usize
Sourcepub fn scanline_y(&self, idx: usize) -> i32
pub fn scanline_y(&self, idx: usize) -> i32
Get the Y coordinate for a stored scanline by index.
Sourcepub fn scanline_num_spans(&self, idx: usize) -> u32
pub fn scanline_num_spans(&self, idx: usize) -> u32
Get the number of spans for a stored scanline by index.
Sourcepub fn embedded_spans(
&self,
sl_idx: usize,
) -> impl Iterator<Item = EmbeddedSpan<'_>> + '_
pub fn embedded_spans( &self, sl_idx: usize, ) -> impl Iterator<Item = EmbeddedSpan<'_>> + '_
Iterate over embedded scanline spans for boolean algebra. Returns an iterator of (x, len, covers_slice) tuples.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScanlineStorageAa
impl RefUnwindSafe for ScanlineStorageAa
impl Send for ScanlineStorageAa
impl Sync for ScanlineStorageAa
impl Unpin for ScanlineStorageAa
impl UnwindSafe for ScanlineStorageAa
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