Stay organized with collections Save and categorize content based on your preferences.

ColorInfo

@UnstableApi
public final class ColorInfo implements Bundleable


Stores color info.

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

Summary

Constants

static final Bundleable.Creator<ColorInfo>
static final ColorInfo

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

Public fields

final @C.ColorRange int

The color range of the video.

final int

The color space of the video.

final int

The color transfer characteristics of the video.

final @Nullable byte[]

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

Public constructors

ColorInfo(
    @C.ColorSpace int colorSpace,
    @C.ColorRange int colorRange,
    @C.ColorTransfer int colorTransfer,
    @Nullable byte[] hdrStaticInfo
)

Constructs the ColorInfo.

Public methods

boolean
int
static boolean

Returns whether the ColorInfo uses an HDR C.ColorTransfer.

static int

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

static int
@Pure
@C.ColorTransfer
isoTransferCharacteristicsToColorTransfer(
    int isoTransferCharacteristics
)

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

Bundle

Returns a Bundle representing the information stored in this object.

String

Constants

CREATOR

public static final Bundleable.Creator<ColorInfoCREATOR

SDR_BT709_LIMITED

public static final ColorInfo SDR_BT709_LIMITED

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

Public fields

colorRange

public final @C.ColorRange int colorRange

The color range of the video. Valid values are COLOR_RANGE_LIMITED, COLOR_RANGE_FULL or NO_VALUE if unknown.

colorSpace

@C.ColorSpace
public final int colorSpace

The color space of the video. Valid values are COLOR_SPACE_BT601, COLOR_SPACE_BT709, COLOR_SPACE_BT2020 or NO_VALUE if unknown.

colorTransfer

@C.ColorTransfer
public final int colorTransfer

The color transfer characteristics of the video. Valid values are COLOR_TRANSFER_HLG, COLOR_TRANSFER_ST2084, COLOR_TRANSFER_SDR or NO_VALUE if unknown.

hdrStaticInfo

public final @Nullable byte[] hdrStaticInfo

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

Public constructors

ColorInfo

public ColorInfo(
    @C.ColorSpace int colorSpace,
    @C.ColorRange int colorRange,
    @C.ColorTransfer int colorTransfer,
    @Nullable byte[] hdrStaticInfo
)

Constructs the ColorInfo.

Parameters
@C.ColorSpace int colorSpace

The color space of the video.

@C.ColorRange int colorRange

The color range of the video.

@C.ColorTransfer int colorTransfer

The color transfer characteristics of the video.

@Nullable byte[] hdrStaticInfo

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

Public methods

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()

isTransferHdr

public static boolean isTransferHdr(@Nullable ColorInfo colorInfo)

Returns whether the ColorInfo uses an HDR C.ColorTransfer.

isoColorPrimariesToColorSpace

@Pure
@C.ColorSpace
public static int isoColorPrimariesToColorSpace(int isoColorPrimaries)

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
public static int isoTransferCharacteristicsToColorTransfer(
    int isoTransferCharacteristics
)

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

public Bundle toBundle()

Returns a Bundle representing the information stored in this object.

toString

public String toString()