Skip to main content

ScanlineStorageBin

Struct ScanlineStorageBin 

Source
pub struct ScanlineStorageBin { /* private fields */ }
Expand description

Binary (non-AA) scanline storage.

Port of C++ scanline_storage_bin. Like ScanlineStorageAa but stores only span extents, no coverage.

Implementations§

Source§

impl ScanlineStorageBin

Source

pub fn new() -> Self

Source

pub fn prepare(&mut self)

Prepare for new rendering (clear all stored data).

Source

pub fn render_scanline_bin(&mut self, sl: &ScanlineBin)

Store a scanline from a ScanlineBin.

Source

pub fn render_scanline_u8(&mut self, sl: &ScanlineU8)

Store a scanline from any Scanline type (uses add_span with cover_full).

Source

pub fn rewind_scanlines(&mut self) -> bool

Reset the scanline iteration pointer.

Source

pub fn sweep_scanline<SL: Scanline>(&mut self, sl: &mut SL) -> bool

Sweep the next stored scanline into an output scanline container.

Source

pub fn min_x(&self) -> i32

Source

pub fn min_y(&self) -> i32

Source

pub fn max_x(&self) -> i32

Source

pub fn max_y(&self) -> i32

Source

pub fn num_scanlines(&self) -> usize

Source

pub fn scanline_y(&self, idx: usize) -> i32

Get the Y coordinate for a stored scanline by index.

Source

pub fn scanline_num_spans(&self, idx: usize) -> u32

Get the number of spans for a stored scanline.

Source

pub fn embedded_spans( &self, sl_idx: usize, ) -> impl Iterator<Item = EmbeddedBinSpan> + '_

Iterate over embedded spans for boolean algebra.

Trait Implementations§

Source§

impl Default for ScanlineStorageBin

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.