LibassRenderer

Whole-document rendering, one call per picture, for tools and tests.

Playback does not use this: the engine streams events into a LibassTypesetter and renders per frame. This wraps the same typesetter for the case where a caller holds a complete script and wants the picture at one instant as a bitmap cue, which is what the module's reference tests compare the streamed path against.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun addFont(name: String, data: ByteArray)

Adds one font from memory, under name, for libass to shape with.

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun renderDocument(script: String, timeMillis: Long, frameWidth: Int, frameHeight: Int, startMicros: Long = timeMillis * 1000, endMicros: Long = (timeMillis + 1) * 1000): SubtitleCue.Bitmap?

Renders script at timeMillis into bitmap regions for a frameWidth x frameHeight frame. Returns null when nothing is visible there. The script is parsed once and kept until a different one arrives.