Skip to main content

RasterizerCompoundAa

Struct RasterizerCompoundAa 

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

Compound anti-aliased rasterizer with per-edge style indices.

Port of C++ rasterizer_compound_aa. Each edge can have independent left and right fill styles, enabling multi-style rendering in a single pass.

Implementations§

Source§

impl RasterizerCompoundAa

Source

pub fn new() -> Self

Source

pub fn reset(&mut self)

Source

pub fn reset_clipping(&mut self)

Source

pub fn clip_box(&mut self, x1: f64, y1: f64, x2: f64, y2: f64)

Source

pub fn filling_rule(&mut self, rule: FillingRule)

Source

pub fn layer_order(&mut self, order: LayerOrder)

Source

pub fn styles(&mut self, left: i32, right: i32)

Set the left and right fill styles for subsequent edges.

Source

pub fn move_to(&mut self, x: i32, y: i32)

Move to position (subpixel integer coords).

Source

pub fn line_to(&mut self, x: i32, y: i32)

Line to position (subpixel integer coords).

Source

pub fn move_to_d(&mut self, x: f64, y: f64)

Move to position (f64 coords).

Source

pub fn line_to_d(&mut self, x: f64, y: f64)

Line to position (f64 coords).

Source

pub fn add_vertex(&mut self, x: f64, y: f64, cmd: u32)

Process a vertex command.

Source

pub fn edge(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)

Add a single edge (subpixel integer coords).

Source

pub fn edge_d(&mut self, x1: f64, y1: f64, x2: f64, y2: f64)

Add a single edge (f64 coords).

Source

pub fn add_path<VS: VertexSource>(&mut self, vs: &mut VS, path_id: u32)

Add an entire path from a vertex source.

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 min_style(&self) -> i32

Source

pub fn max_style(&self) -> i32

Source

pub fn sort(&mut self)

Sort cells.

Source

pub fn rewind_scanlines(&mut self) -> bool

Prepare for scanline iteration.

Source

pub fn calculate_alpha(&self, area: i32) -> u32

Calculate alpha from coverage area.

Source

pub fn sweep_styles(&mut self) -> u32

Process the current scanline and return the number of active styles.

Call style(idx) to get the actual style ID for each index 0..n-1.

Source

pub fn style(&self, style_idx: u32) -> u32

Get the actual style ID for the given style index (0-based).

Source

pub fn scanline_start(&self) -> i32

Get the X start of the current scanline.

Source

pub fn scanline_length(&self) -> u32

Get the length of the current scanline.

Source

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

Sweep one scanline for one style.

style_idx is -1 for the “no fill” style, or 0..n-1 for actual styles.

Source

pub fn navigate_scanline(&mut self, y: i32) -> bool

Navigate to a specific scanline.

Source

pub fn allocate_cover_buffer(&mut self, len: u32) -> &mut [u8]

Allocate a cover buffer of the given length. Returns a mutable slice.

Trait Implementations§

Source§

impl Default for RasterizerCompoundAa

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.