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
impl RasterizerCompoundAa
pub fn new() -> Self
pub fn reset(&mut self)
pub fn reset_clipping(&mut self)
pub fn clip_box(&mut self, x1: f64, y1: f64, x2: f64, y2: f64)
pub fn filling_rule(&mut self, rule: FillingRule)
pub fn layer_order(&mut self, order: LayerOrder)
Sourcepub fn styles(&mut self, left: i32, right: i32)
pub fn styles(&mut self, left: i32, right: i32)
Set the left and right fill styles for subsequent edges.
Sourcepub fn add_vertex(&mut self, x: f64, y: f64, cmd: u32)
pub fn add_vertex(&mut self, x: f64, y: f64, cmd: u32)
Process a vertex command.
Sourcepub fn edge(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)
pub fn edge(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)
Add a single edge (subpixel integer coords).
Sourcepub fn add_path<VS: VertexSource>(&mut self, vs: &mut VS, path_id: u32)
pub fn add_path<VS: VertexSource>(&mut self, vs: &mut VS, path_id: u32)
Add an entire path from a vertex source.
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 min_style(&self) -> i32
pub fn max_style(&self) -> i32
Sourcepub fn rewind_scanlines(&mut self) -> bool
pub fn rewind_scanlines(&mut self) -> bool
Prepare for scanline iteration.
Sourcepub fn calculate_alpha(&self, area: i32) -> u32
pub fn calculate_alpha(&self, area: i32) -> u32
Calculate alpha from coverage area.
Sourcepub fn sweep_styles(&mut self) -> u32
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.
Sourcepub fn style(&self, style_idx: u32) -> u32
pub fn style(&self, style_idx: u32) -> u32
Get the actual style ID for the given style index (0-based).
Sourcepub fn scanline_start(&self) -> i32
pub fn scanline_start(&self) -> i32
Get the X start of the current scanline.
Sourcepub fn scanline_length(&self) -> u32
pub fn scanline_length(&self) -> u32
Get the length of the current scanline.
Sourcepub fn sweep_scanline<SL: Scanline>(&self, sl: &mut SL, style_idx: i32) -> bool
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.
Navigate to a specific scanline.
Sourcepub fn allocate_cover_buffer(&mut self, len: u32) -> &mut [u8] ⓘ
pub fn allocate_cover_buffer(&mut self, len: u32) -> &mut [u8] ⓘ
Allocate a cover buffer of the given length. Returns a mutable slice.