pdfrum-raster-agg 0.1.0

Analytic scanline rasterizer implementing pdfrum-render's RenderDevice
docs.rs failed to build pdfrum-raster-agg-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

pdfrum-raster-agg

An analytic scanline rasterizer implementing [pdfrum_render::RasterBackend]. No third-party rasterizer crate: coverage is exact area on a 256ths-of-a-pixel grid, mapped to alpha by alpha = min(255, floor(coverage * 256)) — PDFium's AGG path, by construction rather than by approximation.

use pdfrum_raster_agg::AggBackend;
use pdfrum_render::RasterBackend;

let backend = AggBackend::new();
let mut device = backend.new_target(8, 8, peniko::Color::WHITE);

That formula is the reason this backend exists. The other two CPU backends wrap someone else's rasterizer and bring its idea of a partly covered pixel with them — tiny-skia supersamples four times per axis, so a diagonal edge has seventeen coverage levels and a half-covered pixel quantises to 8/16 rather than to a half. Over the corpus that is a persistent few-count spread along every non-axis-aligned edge. AggBackend closes it; vello_cpu stays the facade default, because an API caller wants a fast production rasterizer rather than an oracle-matching one.

[AggBackend] is stateless — every [AggDevice] target is independent, so one backend value can be shared across threads. Layers and clips are both explicit stacks here, as they must be for a backend with neither natively: a layer is an offscreen target composited on pop, and a clip is a coverage plane pushed so pop restores the previous one rather than recomputing an intersection.

Facade feature agg.

Part of pdfrum. #![forbid(unsafe_code)].

MIT OR Apache-2.0