RgbaBitmap

class RgbaBitmap(val width: Int, val height: Int, val pixels: ByteArray)

PREMULTIPLIED RGBA8888, row major, no padding.

Premultiplied is what both platform rasterizers actually produce (Android's ARGB_8888 copy and CoreGraphics' premultiplied context) and what the Compose and Metal consumers upload without conversion. The 2026-08-17 audit found this doc claiming straight alpha while half the consumers premultiplied AGAIN, turning white 50% text grey; one written contract with raw-copy consumers is the fix. A producer that computes straight colour premultiplies once at emit and documents it, as the libass renderer does.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, pixels: ByteArray)

Properties

Link copied to clipboard
val height: Int
Link copied to clipboard

SHARED, not copied. A renderer reads these bytes once per frame, and copying a bitmap that often to protect against a caller who mutates it is the wrong trade. Treat it as read-only: writing to it changes what every other consumer of the same cue draws.

Link copied to clipboard
val width: Int