mold is a highly efficient vector content renderer and composer that makes use of all processor cores and vector units.
It currently supports:
The renderer achieves its performance through a few principles that are present throughout the code-base:
use mold::{Buffer, Composition, Fill, Point, Style}; fn main() { const WIDTH: usize = 256; const HEIGHT: usize = 256; let mut buffer = vec![[255u8; 4]; WIDTH * HEIGHT]; let mut composition = Composition::new(); let mut triangle_path = Path::new(); triangle_path.line( Point::new(100.0, 100.0), Point::new(150.0, 200.0), ); triangle_path.line( Point::new(150.0, 200.0), Point::new(200.0, 100.0), ); triangle_path.line( Point::new(200.0, 100.0), Point::new(100.0, 100.0), ); let layer_id = composition.create_layer().expect("layer limit reached"); composition.insert_in_layer(layer_id, &triangle_path).set_style(Style { fill: Fill::Solid([1.0, 0.0, 0.0, 1.0]), ..Default::default() }); composition.render( Buffer { buffer: &mut buffer, width: WIDTH, ..Default::default() }, [1.0, 1.0, 1.0, 1.0], None, ); }