Skip to main content

ScanlineBin

Struct ScanlineBin 

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

Binary scanline container — no per-pixel coverage, just on/off spans.

Port of C++ scanline_bin. Useful for non-AA rendering or clipping masks.

Implementations§

Source§

impl ScanlineBin

Source

pub fn new() -> Self

Source

pub fn reset(&mut self, _min_x: i32, max_x: i32)

Prepare for a new scanline with the given X range.

Source

pub fn begin(&self) -> &[BinSpan]

Get the slice of active spans (for renderer iteration).

Trait Implementations§

Source§

impl Default for ScanlineBin

Source§

fn default() -> Self

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

impl Scanline for ScanlineBin

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.

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.