Rasterized

data class Rasterized(val quality: Float = 1.0f, val maxBitmapLongSide: Int = 4096, val rerasterizeOnZoom: Boolean = true, val preserveHairlines: Boolean = true, val cacheBudgetBytes: Long = 96L * 1024 * 1024) : PdfRenderSpec

Vector-render each page once into a bitmap per size/zoom bucket, then draw that bitmap and GPU-transform it during gestures, so scrolling and zoom never re-execute the content stream. Heavy gesturing is cheap and content-independent; the costs are one rasterization hitch per bucket and softness when zoomed past the raster resolution until the zoom settles and it re-rasterizes. Best for slow devices and dense pages.

Parameters

quality

supersampling multiplier over the on-screen pixel size. 1 = rasterize exactly at display resolution (sharpest and cheapest, the default). >1 = oversample, e.g. for screenshots or print-ish export. <1 = undersample for cheap previews/thumbnails.

maxBitmapLongSide

hard cap on the longest bitmap side, protecting memory on huge pages and deep zooms.

rerasterizeOnZoom

after a zoom settles, re-render the visible page at the zoomed resolution so deep zoom stays crisp instead of upscaling the base raster. Costs one extra rasterization per zoom settle.

preserveHairlines

compensate the engine's 1-px hairline floor for any raster-vs-screen scale difference, so sub-pixel strokes (0.1-width ECG traces, fine table rules) never vanish when the bitmap is downscaled.

Constructors

Link copied to clipboard
constructor(quality: Float = 1.0f, maxBitmapLongSide: Int = 4096, rerasterizeOnZoom: Boolean = true, preserveHairlines: Boolean = true, cacheBudgetBytes: Long = 96L * 1024 * 1024)

Properties

Link copied to clipboard

Byte budget of the per-PdfViewState page-bitmap LRU (T-15), so scrolling back is a cache hit instead of a re-raster. 0 disables caching (every slot re-rasterizes on recomposition, the pre-cache behaviour).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard