TypesetFrame

data class TypesetFrame(val width: Int, val height: Int, val videoWidth: Int, val videoHeight: Int, val marginTop: Int = 0, val marginBottom: Int = 0, val marginLeft: Int = 0, val marginRight: Int = 0, val fontScale: Float = 1.0f, val linePosition: Float = 1.0f, val videoColor: ColorSpaceInfo? = null)

The geometry one SubtitleTypesetter.render call draws into.

width and height are the renderer's output surface, the space overlays are composited in. videoWidth and videoHeight are the picture's own display size, which the script's play resolution is scaled against. The margins are the letterbox or pillarbox bars around the fitted picture inside the surface: the typesetter positions text relative to the picture, and events that ask for it may spill into the bars.

fontScale is the viewer's size multiplier over the authored size. linePosition is where the default bottom stack anchors as a fraction of the picture height: 1.0 is the authored bottom edge, 0.5 mid-screen. Both are the same knobs the Kotlin tier honours.

videoColor is the colour of the video the overlays are drawn over, which a typesetter matches the script's colours to through the script's YCbCr Matrix header (#499): each colour goes from RGB to YCbCr with the header's matrix and range, rounded to 8-bit steps, and back to RGB with these. A header of None, one that cannot be read, and a videoColor whose matrix is the header's own at the same range leave a colour as it is, and so does a null videoColor. The engine gives null when SubtitleConfig.assColorMatching is off, when there is no picture, and for HDR video and video that is not YCbCr, so a typesetter converts whenever it is given a colour, to the matrix and the range given. A matrix the file left unstated arrives already guessed by ColorSpaceInfo.guessFor.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, videoWidth: Int, videoHeight: Int, marginTop: Int = 0, marginBottom: Int = 0, marginLeft: Int = 0, marginRight: Int = 0, fontScale: Float = 1.0f, linePosition: Float = 1.0f, videoColor: ColorSpaceInfo? = null)

Properties

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