1//! Coverage rasterization for lines, quadratic & cubic beziers.
2//! Useful for drawing .otf font glyphs.
3//!
4//! ```
5//! use ab_glyph_rasterizer::Rasterizer;
6//! # let (width, height) = (1, 1);
7//! let mut rasterizer = Rasterizer::new(width, height);
8//!
9//! // draw outlines
10//! # let [l0, l1, q0, q1, q2, c0, c1, c2, c3] = [ab_glyph_rasterizer::point(0.0, 0.0); 9];
11//! rasterizer.draw_line(l0, l1);
12//! rasterizer.draw_quad(q0, q1, q2);
13//! rasterizer.draw_cubic(c0, c1, c2, c3);
14//!
15//! // iterate over the resultant pixel alphas, e.g. save pixel to a buffer
16//! rasterizer.for_each_pixel(|index, alpha| {
17//! // ...
18//! });
19//! ```
20
21#![cfg_attr(not(feature = "std"), no_std)]
22#[cfg(not(feature = "std"))]
23#[macro_use]
24extern crate alloc;
25
26#[cfg(all(feature = "libm", not(feature = "std")))]
27mod nostd_float;
28
29#[cfg(not(any(feature = "libm", feature = "std")))]
30compile_error!("You need to activate either the `std` or `libm` feature.");
31
32mod geometry;
33mod raster;
34
35pub use geometry::{point, Point};
36pub use raster::Rasterizer;
37