Expand description
stet-tiny-skia-based rasterizer for stet display lists.
This crate rasterizes any
DisplayList to RGBA pixels
— whether the list came from the PostScript interpreter
(stet-core) or the PDF reader
(stet-pdf-reader) makes
no difference. Rendering is multi-threaded and banded (sized to fit
L2), with mask caching, clip fast paths, and ICC-aware CMYK handling.
§Two ways to render
render_to_rgba— one-shot: aDisplayListin, aVec<u8>of RGBA out. Banded page rasterizer with automatic parallelism.prepare_display_list+render_region_prepared— viewport rendering: pre-compute bounding boxes once, then render any rectangular region at any zoom without reinterpreting or reallocating. Used by the interactive viewer and the WASM frontend.
§Sinks
PngSinkFactory streams banded output straight to a PNG file.
Implement stet_graphics::device::PageSink /
PageSinkFactory yourself
for other streaming destinations.
Most users should use the stet
facade crate rather than depending on stet-render directly.
Structs§
- Image
Cache - Pre-converted RGBA image data cache, indexed by display list element index.
- PngSink
Factory - Factory that creates
PngSinkinstances for each page. - Prepared
Display List - Pre-computed metadata for fast viewport rendering.
- Skia
Device - tiny-skia based raster device.
Functions§
- build_
icc_ cache_ for_ list - Pre-downsample an image when the transform indicates significant downscaling.
- debug_
bbox_ comparison - prepare_
display_ list - Precompute display list metadata for fast viewport rendering.
- render_
region - Render a rectangular viewport region of a display list to RGBA pixels.
- render_
region_ prepared - Render a rectangular viewport region using precomputed metadata.
- render_
region_ prepared_ parallel - Render a viewport region using parallel banded rendering via rayon.
- render_
region_ prepared_ parallel_ cancellable - Like
render_region_prepared_parallel()but checks a cancellation flag between band chunks. ReturnsNoneif cancelled. - render_
region_ prepared_ parallel_ with_ progress - Like
render_region_prepared_parallel()but with an atomic progress counter. - render_
region_ single_ band - Render a single horizontal band of a viewport region.
- render_
to_ rgba - Render a full-page display list to RGBA pixels using the banded parallel renderer.
- render_
to_ rgba_ viewport - Render a display list to RGBA using the viewport code path, with the viewport set to the full page at 1:1 scale.
- render_
to_ rgba_ with_ layers - Like
render_to_rgbabut consults the suppliedLayerSetwhen evaluating eachOcgGroup’s visibility. - viewport_
band_ count - Compute the number of bands and band height for viewport banding.