VideoTransform

data class VideoTransform(val aspectOverride: Float? = null, val zoom: Float = 1.0f, val panX: Float = 0.0f, val panY: Float = 0.0f, val rotationDegrees: Int = 0, val mirrorHorizontal: Boolean = false, val mirrorVertical: Boolean = false)

The viewer's framing controls, on top of VideoScale: force a display aspect the container did not declare (mpv's video-aspect-override), magnify (mpv's video-zoom), and pan the magnified picture (mpv's video-pan-x/-y). The engine owns the value and every renderer is told it, the same delivery law as VideoScale and VideoAdjustments; the renderers fold it into the same one-pass geometry that letterboxes, so it costs nothing per frame.

Order, applied by the geometry: the aspect override reshapes the content, the scale mode fits that shape to the viewport, the zoom scales the fitted rectangle about its centre, and the pan then moves it by a fraction of its own drawn size. Pixel aspect and rotation are folded in before all four, as always.

It also turns and mirrors the picture (#428), on top of what the file asks for, as mpv's video-rotate and VLC's transform do: for a phone clip filmed sideways with no rotation tag, a webcam that recorded mirrored, or a screen mounted on its side. The mirrors apply to the picture as the file shows it, and the turn after them. Every renderer folds the result into the turn it already draws, through orient, so it costs nothing per frame and keeps hardware decoding, and everything that follows the picture's shape follows it.

Constructors

Link copied to clipboard
constructor(aspectOverride: Float? = null, zoom: Float = 1.0f, panX: Float = 0.0f, panY: Float = 0.0f, rotationDegrees: Int = 0, mirrorHorizontal: Boolean = false, mirrorVertical: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The display aspect (width over height) to present the picture at, replacing the container's own, or null to trust the container. The classic use is a DVD rip that stored 4:3 pixels and lost its 16:9 flag.

Link copied to clipboard

True for the neutral value, which keeps every geometry on its untouched fast path.

Link copied to clipboard

Mirrors the picture left to right, as the file shows it.

Link copied to clipboard

Mirrors the picture top to bottom, as the file shows it.

Link copied to clipboard
val panX: Float

Horizontal shift as a fraction of the drawn width, positive right. 0 is centred.

Link copied to clipboard
val panY: Float

Vertical shift as a fraction of the drawn height, positive down. 0 is centred.

Link copied to clipboard

A clockwise turn of the picture, after the file's own: 0, 90, 180 or 270 degrees.

Link copied to clipboard

True when this turns or mirrors the picture at all.

Link copied to clipboard
val zoom: Float

Magnification of the fitted picture about its centre. 1 is none.

Functions

Link copied to clipboard

orient for frame's own turn and mirror.

fun orient(rotationDegrees: Int, mirrored: Boolean): PictureOrientation

How a picture whose file asks for rotationDegrees and mirrored is drawn under this transform: as one mirror and one turn, the form every renderer draws a frame's own in (#428). A turn that is not a quarter turn counts as none, as a renderer draws it.