@UnstableApi
class ColorInfo


Stores color info.

When a nullColorInfo instance is used, this often represents a generic SDR_BT709_LIMITED instance.

Summary

Nested types

Builds ColorInfo instances.

Constants

const ColorInfo!

Color info representing SDR BT.709 limited range, which is a common SDR video color format.

const ColorInfo!

Color info representing SDR sRGB in accordance with DATASPACE_SRGB, which is a common SDR image color format.

Public functions

ColorInfo.Builder!

Returns a Builder initialized with the values of this instance.

Boolean
equals(obj: Any?)
java-static ColorInfo!
fromBundle(bundle: Bundle!)

Restores a ColorInfo from a Bundle.

Int
Boolean

Returns whether this instance has valid bitdepths.

Boolean

Returns whether this instance has valid DataSpace members.

java-static Boolean
@EnsuresNonNullIf(result = false, expression = "#1")
isEquivalentToAssumedSdrDefault(colorInfo: ColorInfo?)

Returns whether the given color info is equivalent to values for a standard dynamic range video that could generally be assumed if no further information is given.

java-static Boolean
isTransferHdr(colorInfo: ColorInfo?)

Returns whether the ColorInfo uses an HDR C.ColorTransfer.

Boolean

Returns whether this instance is valid.

java-static Int

Returns the C.ColorSpace corresponding to the given ISO color primary code, as per table A.7.21.1 in Rec.

java-static Int

Returns the C.ColorTransfer corresponding to the given ISO transfer characteristics code, as per table A.7.21.2 in Rec.

Bundle!
String!

Returns a prettier String than toString, intended for logging.

String!

Public properties

Int

The bit depth of the chroma samples of the video, or NO_VALUE if not set.

@C.ColorRange Int

The C.ColorRange, or NO_VALUE if not set.

Int

The C.ColorSpace, or NO_VALUE if not set.

Int

The C.ColorTransfer, or NO_VALUE if not set.

ByteArray<Byte>?

HdrStaticInfo as defined in CTA-861.3, or null if none specified.

Int

The bit depth of the luma samples of the video, or NO_VALUE if not set.

Constants

SDR_BT709_LIMITED

const val SDR_BT709_LIMITEDColorInfo!

Color info representing SDR BT.709 limited range, which is a common SDR video color format.

SRGB_BT709_FULL

const val SRGB_BT709_FULLColorInfo!

Color info representing SDR sRGB in accordance with DATASPACE_SRGB, which is a common SDR image color format.

Public functions

buildUpon

fun buildUpon(): ColorInfo.Builder!

Returns a Builder initialized with the values of this instance.

equals

fun equals(obj: Any?): Boolean

fromBundle

java-static fun fromBundle(bundle: Bundle!): ColorInfo!

Restores a ColorInfo from a Bundle.

hashCode

fun hashCode(): Int

isBitdepthValid

fun isBitdepthValid(): Boolean

Returns whether this instance has valid bitdepths.

This instance has valid bitdepths if none of them is NO_VALUE.

isDataSpaceValid

fun isDataSpaceValid(): Boolean

Returns whether this instance has valid DataSpace members.

This instance is valid if no DataSpace members are NO_VALUE.

isEquivalentToAssumedSdrDefault

@EnsuresNonNullIf(result = false, expression = "#1")
java-static fun isEquivalentToAssumedSdrDefault(colorInfo: ColorInfo?): Boolean

Returns whether the given color info is equivalent to values for a standard dynamic range video that could generally be assumed if no further information is given.

The color info is deemed to be equivalent to SDR video if it either has unset values or values matching a 8-bit (chroma+luma), BT.709 or BT.601 color space, SDR transfer and Limited range color info.

Parameters
colorInfo: ColorInfo?

The color info to evaluate.

Returns
Boolean

Whether the given color info is equivalent to the assumed default SDR color info.

isTransferHdr

java-static fun isTransferHdr(colorInfo: ColorInfo?): Boolean

Returns whether the ColorInfo uses an HDR C.ColorTransfer.

COLOR_TRANSFER_LINEAR is not considered to be an HDR C.ColorTransfer, because it may represent either SDR or HDR contents.

isValid

fun isValid(): Boolean

Returns whether this instance is valid.

This instance is valid if at least one between bitdepths and DataSpace info are valid.

isoColorPrimariesToColorSpace

@Pure
@C.ColorSpace
java-static fun isoColorPrimariesToColorSpace(isoColorPrimaries: Int): Int

Returns the C.ColorSpace corresponding to the given ISO color primary code, as per table A.7.21.1 in Rec. ITU-T T.832 (03/2009), or NO_VALUE if no mapping can be made.

isoTransferCharacteristicsToColorTransfer

@Pure
@C.ColorTransfer
java-static fun isoTransferCharacteristicsToColorTransfer(
    isoTransferCharacteristics: Int
): Int

Returns the C.ColorTransfer corresponding to the given ISO transfer characteristics code, as per table A.7.21.2 in Rec. ITU-T T.832 (03/2009), or NO_VALUE if no mapping can be made.

toBundle

fun toBundle(): Bundle!

toLogString

fun toLogString(): String!

Returns a prettier String than toString, intended for logging.

See also
toLogString

toString

fun toString(): String!

Public properties

chromaBitdepth

val chromaBitdepthInt

The bit depth of the chroma samples of the video, or NO_VALUE if not set. It may differ from the luma bit depth.

colorRange

val colorRange: @C.ColorRange Int

The C.ColorRange, or NO_VALUE if not set.

colorSpace

@C.ColorSpace
val colorSpaceInt

The C.ColorSpace, or NO_VALUE if not set.

colorTransfer

@C.ColorTransfer
val colorTransferInt

The C.ColorTransfer, or NO_VALUE if not set.

hdrStaticInfo

val hdrStaticInfoByteArray<Byte>?

HdrStaticInfo as defined in CTA-861.3, or null if none specified.

lumaBitdepth

val lumaBitdepthInt

The bit depth of the luma samples of the video, or NO_VALUE if not set.