Package-level declarations

Types

Link copied to clipboard
data class BitmapRegion(val x: Int, val y: Int, val width: Int, val height: Int, val canvasWidth: Int, val canvasHeight: Int, val bitmap: RgbaBitmap, val forced: Boolean = false)

A pre-rendered subtitle image, positioned in the video's own coordinate space.

Link copied to clipboard
Link copied to clipboard
class CueIndex

A start-sorted cue list plus the small amount of derived data that makes lookups fast.

Link copied to clipboard
data class CueLayout(val alignment: CueAlignment = CueAlignment.BottomCenter, val marginLeft: Float = 0.05f, val marginRight: Float = 0.05f, val marginVertical: Float = 0.05f, val positionX: Float? = null, val positionY: Float? = null, val authoredHeight: Int? = null, val wrap: CueWrap = CueWrap.Balanced, val stacking: CueStacking = CueStacking.FirstAtBottom, val fadeInMicros: Long = 0, val fadeOutMicros: Long = 0, val scriptColorMatrix: ScriptColorMatrix? = null)

Where a cue goes.

Link copied to clipboard

The active-cue rule, as one pure function: which cues are visible at a media time.

Link copied to clipboard

The order cues pile up in when more than one is on screen.

Link copied to clipboard
data class CueStyle(val fontFamily: String? = null, val fontSizePx: Float? = null, val bold: Boolean = false, val italic: Boolean = false, val underline: Boolean = false, val strikeThrough: Boolean = false, val primaryColor: Int = 0xFFFFFFFF.toInt(), val outlineColor: Int = 0xFF000000.toInt(), val shadowColor: Int = 0x80000000.toInt(), val outlineWidthPx: Float = 2.0f, val shadowOffsetPx: Float = 1.0f, val backgroundColor: Int = 0, val backgroundPaddingPx: Float = 4.0f, val relativeSize: Float = 1.0f)

Visual style for a run of text.

Link copied to clipboard
Link copied to clipboard
class RgbaBitmap(val width: Int, val height: Int, val pixels: ByteArray)

PREMULTIPLIED RGBA8888, row major, no padding.

Link copied to clipboard

The value of an ASS script's YCbCr Matrix header (#499): the matrix and range its colours went through on the way into the video they were picked from, as libass reads it. Tv is studio range, 16 to 235, and Pc full range, 0 to 255. See SubtitleConfig.assColorMatching.

Link copied to clipboard
data class StyledSpan(val text: String, val style: CueStyle = CueStyle())

A run of text sharing one style. A cue is a list of these so that inline styling works.

Link copied to clipboard
sealed interface SubtitleCue

One subtitle event with a time window.

Link copied to clipboard
class SubtitleFont(val name: String, val data: ByteArray)

One font file an application hands to the subtitle typesetter, by name and bytes.

Link copied to clipboard
data class SubtitleSafeArea(val left: Float = 0.0f, val top: Float = 0.0f, val right: Float = 0.0f, val bottom: Float = 0.0f)

The part of the output that subtitles must stay inside, as an inset from each edge.

Link copied to clipboard
data class SubtitleStyleOverride(val fontFamily: String? = null, val fontSizePx: Float? = null, val primaryColor: Int? = null, val outlineColor: Int? = null, val outlineWidthPx: Float? = null, val shadowColor: Int? = null, val shadowOffsetPx: Float? = null, val backgroundColor: Int? = null, val backgroundPaddingPx: Float = 4.0f, val bold: Boolean? = null, val italic: Boolean? = null)

The viewer's word over the author's: fields set here replace the authored style on every span of every text cue, and null fields keep the authored value. Bitmap subtitles are authored pixels, not text, and pass through untouched.