rasterizeHeadless
Rasterizes portable draw commands into a deterministic physical image.
Commands are snapshotted in their supplied order before pixel allocation or painting. The caller must not mutate the supplied list or command graph concurrently with this call. Each call owns its raster storage and shares no mutable state with another call. Rectangles use the logical origin at the top-left, x increasing rightward, y increasing downward, and half-open edges; the positive viewport and every active nested child clip are intersected before each logical pixel is replicated by scale. BlitImage uses nearest pixel-center sampling: for destination-relative coordinate d, source extent S, and destination extent D, the sampled source offset is floor(((2 * d + 1) * S) / (2 * D)); viewport clipping preserves this mapping against the original unclipped destination rectangle. Painting starts with transparent black and uses straight ARGB source-over with Long intermediates. For source alpha sa, destination alpha da, and channel values sc and dc, alphaN = sa * 255 + da * (255 - sa), oa = floor((alphaN + 127) / 255), and when alphaN != 0 each channel is floor((sc * sa * 255 + dc * da * (255 - sa) + floor(alphaN / 2)) / alphaN). When alphaN == 0, the result is exactly 0x00000000. Each channel and alpha is rounded half-up per command, with canonical zero for transparent output. Transparent sources are no-ops, opaque sources replace, and no gamma conversion, interpolation, or saturation is applied.
Return
an immutable physical ARGB image with transparent-black initial pixels. The physical size is the checked viewport width and height multiplied by scale.
Parameters
the core-emitted draw commands in execution order; opaque platform commands are unsupported.
the positive logical viewport.
the positive integer logical-to-physical scale.
Throws
when the viewport or scale is invalid, a command is unsupported or null from Java, or the clip stack is unbalanced.
when checked physical dimensions, pixel area, or derived raster storage exceeds Int.MAX_VALUE.