forma 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 forma::{Buffer, BufferBuilder, Composition, LinearLayout, Fill, Point, Style}; fn main() { const WIDTH: usize = 256; const HEIGHT: usize = 256; let mut buffer = vec![255u8; WIDTH * HEIGHT * 4]; let mut layout = LinearLayout::new(WIDTH, WIDTH * 4); 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(); 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(&mut BufferBuilder::new(&mut buffer, &mut layout).build(), [1.0, 1.0, 1.0, 1.0], None); }