Package-level declarations

Types

Link copied to clipboard
sealed interface HeadlessFrame

An immutable, thread-safe result of one synchronous headless render.

Link copied to clipboard
sealed interface HeadlessImage

An immutable, thread-safe row-major physical ARGB image produced by headless rendering.

Link copied to clipboard

Reuses exact source-color weights during one synchronous rasterization or native frame preparation. Calls belong to the constructing thread. The key is the complete ARGB tint; destination, cutoff and geometry are not retained. At most four least-recently-used tints each retain sixteen alpha rows, with less than 256 KiB of primitive storage in total. No image, command or destination is retained. Close releases every table and permanently rejects further use.

Functions

Link copied to clipboard
fun rasterizeHeadless(commands: List<DrawCommand>, viewport: IntSize, scale: Int = 1): HeadlessImage

Rasterizes ordered portable commands into an immutable physical ARGB image.

Link copied to clipboard
fun rasterizeHeadlessInto(commands: List<DrawCommand>, bounds: IntRect, scale: Int, pixels: IntArray)

Rasterizes an original-coordinate region into borrowed caller-owned ARGB storage for synchronous native upload. Materializes the transparent background lazily and writes only the checked physical region prefix; excess capacity remains untouched. Every output pixel is initialized before use, including empty commands and clipped primitives. The caller exclusively owns pixels throughout this call, and no image, command, array or callback is retained. Preflight rejects invalid input before any storage changes. Pixel arithmetic follows rasterizeHeadlessRegion.

fun rasterizeHeadlessInto(commands: List<DrawCommand>, bounds: IntRect, scale: Int, pixels: IntArray, scratch: HeadlessRasterScratch)

Borrows owner-thread source-color scratch across regions in one synchronous frame preparation. The caller closes scratch after the final region or failure; this call retains no borrowed storage. Preflight and exact pixel semantics follow rasterizeHeadlessInto.

Link copied to clipboard

Rasterizes a nonnegative logical region for runtime presentation without translating source-sampling coordinates. Output storage contains only the checked physical extent of bounds; ordered commands retain their original coordinates. Validation, clip balance, exact Float sampling and pixel composition follow rasterizeHeadless. No commands, pixels or region history are retained after the returned immutable image is released.

Link copied to clipboard
fun renderHeadless(description: Element, viewport: IntSize, scale: Int = 1): HeadlessFrame

Synchronously renders an element description through the retained core and rasterizes its paint output.