videoContentRect

fun videoContentRect(output: Size, available: Size, contentScale: VideoContentScale): Rect(source)

The rectangle output fills inside available, for contentScale.

Built on videoRect, so a caller outside this module reads the same letterbox an overlay would otherwise have to re-derive. The rectangle is centred inside available, which is what every surface already does with the size videoRect returns.

Return

The centred rectangle the video is drawn into.

Parameters

output

The frame size the composition outputs.

available

The space the surface was given.

contentScale

How the video fills that space.


fun videoContentRect(outputAspect: Float, available: Size, contentScale: VideoContentScale): Rect(source)

The rectangle a frame of outputAspect fills inside available, for contentScale.

The same rectangle the Size form returns, for a caller holding the shape of the output frame without its pixel dimensions. A host that has laid a box out to an aspect already knows only that much, and rounding the aspect back into a pair of pixel sides to ask the question loses precision the letterbox never needed.

Return

The centred rectangle the video is drawn into.

Parameters

outputAspect

Width over height of the frame the composition outputs.

available

The space the surface was given.

contentScale

How the video fills that space.