ColorInfo

data class ColorInfo(val matrix: ColorMatrix = ColorMatrix.Unspecified, val primaries: ColorPrimaries = ColorPrimaries.Unspecified, val transfer: ColorTransfer = ColorTransfer.Unspecified, val fullRange: Boolean = false, val chromaLocation: ChromaLocation = ChromaLocation.Unspecified, val rangeSpecified: Boolean = false, val matrixSpecified: Boolean = false, val primariesSpecified: Boolean = false, val transferSpecified: Boolean = false)

The colour metadata a renderer must honour to draw a frame correctly.

None of this is subtle once it is wrong, and all of it is already known at decode time:

FieldWhat a wrong value looks like
matrixHues shift. Faces go green or magenta, worst on saturated reds.
fullRangeBlacks turn grey and whites clip, or contrast is crushed.
chromaLocationColour bleeds half a pixel at sharp coloured edges.
transferHigh dynamic range content looks washed out or far too dark.

The values map one to one onto FFmpeg's own enumerations, so nothing is lost or guessed at the boundary. Unspecified is a real and common answer: many containers declare nothing, and guessFor gives the conventional interpretation.

Constructors

Link copied to clipboard
constructor(matrix: ColorMatrix = ColorMatrix.Unspecified, primaries: ColorPrimaries = ColorPrimaries.Unspecified, transfer: ColorTransfer = ColorTransfer.Unspecified, fullRange: Boolean = false, chromaLocation: ChromaLocation = ChromaLocation.Unspecified, rangeSpecified: Boolean = false, matrixSpecified: Boolean = false, primariesSpecified: Boolean = false, transferSpecified: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

True for 0 to 255. False for the 16 to 235 studio range, or when no range was declared.

Link copied to clipboard

True when the transfer function means high dynamic range.

Link copied to clipboard

True when nothing usable was declared, so guessFor should be applied.

Link copied to clipboard
Link copied to clipboard

True when the container or codec DECLARED this matrix, false when guessFor supplied it.

Link copied to clipboard
Link copied to clipboard

True when the primaries were declared rather than guessed. See matrixSpecified.

Link copied to clipboard

Distinguishes an explicitly declared studio range from an absent range declaration.

Link copied to clipboard
Link copied to clipboard

True when the transfer function was declared rather than guessed. See matrixSpecified.