ColorInfo
@UnstableApi
class ColorInfo
Stores color info.
When a nullColorInfo instance is used, this often represents a generic SDR_BT709_LIMITED instance.
Summary
Nested types |
|---|
class ColorInfo.BuilderBuilds |
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 |
Public functions |
|
|---|---|
ColorInfo.Builder! |
Returns a |
java-static Int |
colorSpaceToIsoColorPrimaries(@C.ColorSpace colorSpace: Int)Returns the ISO color primary code corresponding to the given |
java-static Int |
colorSpaceToIsoMatrixCoefficients(@C.ColorSpace colorSpace: Int)Returns the ISO matrix coefficients code corresponding to the given |
java-static Int |
colorTransferToIsoTransferCharacteristics(Returns the ISO transfer characteristics code corresponding to the given |
Boolean |
|
java-static ColorInfo! |
fromBundle(bundle: Bundle!)Restores a |
Int |
hashCode() |
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")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 |
Boolean |
isValid()Returns whether this instance is valid. |
java-static Int |
@PureReturns the |
java-static Int |
@PureReturns the |
Bundle! |
toBundle() |
String! |
Returns a prettier |
String! |
toString() |
Public properties |
|
|---|---|
Int |
The bit depth of the chroma samples of the video, or |
@C.ColorRange Int |
The |
Int |
The |
Int |
The |
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 |
Constants
SDR_BT709_LIMITED
const val SDR_BT709_LIMITED: ColorInfo!
Color info representing SDR BT.709 limited range, which is a common SDR video color format.
SRGB_BT709_FULL
const val SRGB_BT709_FULL: ColorInfo!
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.
colorSpaceToIsoColorPrimaries
java-static fun colorSpaceToIsoColorPrimaries(@C.ColorSpace colorSpace: Int): Int
Returns the ISO color primary code corresponding to the given C.ColorSpace, as per table A.7.21.1 in Rec. ITU-T T.832 (06/2019). made.
colorSpaceToIsoMatrixCoefficients
java-static fun colorSpaceToIsoMatrixCoefficients(@C.ColorSpace colorSpace: Int): Int
Returns the ISO matrix coefficients code corresponding to the given C.ColorSpace, as per table A.7.21.3 in Rec. ITU-T T.832 (06/2019).
colorTransferToIsoTransferCharacteristics
java-static fun colorTransferToIsoTransferCharacteristics(
@C.ColorTransfer colorTransfer: Int
): Int
Returns the ISO transfer characteristics code corresponding to the given C.ColorTransfer, as per table A.7.21.2 in Rec. ITU-T T.832 (06/2019).
fromBundle
java-static fun fromBundle(bundle: Bundle!): ColorInfo!
Restores a ColorInfo from a Bundle.
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 (06/2019), 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 (06/2019), or NO_VALUE if no mapping can be made.
toLogString
fun toLogString(): String!
Returns a prettier String than toString, intended for logging.
| See also | |
|---|---|
toLogString |
Public properties
chromaBitdepth
val chromaBitdepth: Int
The bit depth of the chroma samples of the video, or NO_VALUE if not set. It may differ from the luma bit depth.
hdrStaticInfo
val hdrStaticInfo: ByteArray<Byte>?
HdrStaticInfo as defined in CTA-861.3, or null if none specified.
lumaBitdepth
val lumaBitdepth: Int
The bit depth of the luma samples of the video, or NO_VALUE if not set.