Package com.google.android.exoplayer2.video

## Class ColorInfo

- java.lang.Object
- - com.google.android.exoplayer2.video.ColorInfo

- All Implemented Interfaces:
    `Bundleable`

      public final class ColorInfo
      extends Object
      implements Bundleable

  Stores color info.

  When a `null` `ColorInfo` instance is used, this often represents a generic `SDR_BT709_LIMITED` instance.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable

      `Bundleable.Creator<T extends Bundleable>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `@com.google.android.exoplayer2.C.ColorRange int` | `colorRange` | The color range of the video.
    `@com.google.android.exoplayer2.C.ColorSpace int` | `colorSpace` | The color space of the video.
    `@com.google.android.exoplayer2.C.ColorTransfer int` | `colorTransfer` | The color transfer characteristics of the video.
    `static Bundleable.Creator<ColorInfo>` | `CREATOR` |
    `byte[]` | `hdrStaticInfo` | HdrStaticInfo as defined in CTA-861.3, or null if none specified.
    `static ColorInfo` | `SDR_BT709_LIMITED` | Color info representing SDR BT.709 limited range, which is a common SDR video color format.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ColorInfo​(@com.google.android.exoplayer2.C.ColorSpace int colorSpace, @com.google.android.exoplayer2.C.ColorRange int colorRange, @com.google.android.exoplayer2.C.ColorTransfer int colorTransfer, byte[] hdrStaticInfo)` | Constructs the ColorInfo.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object obj)` |
    `int` | `hashCode()` |
    `static @com.google.android.exoplayer2.C.ColorSpace 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.
    `static @com.google.android.exoplayer2.C.ColorTransfer 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.
    `static boolean` | `isTransferHdr​(ColorInfo colorInfo)` | Returns whether the `ColorInfo` uses an HDR `C.ColorTransfer`.
    `Bundle` | `toBundle()` | Returns a `Bundle` representing the information stored in this object.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### 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.

    - #### colorSpace

          public final @com.google.android.exoplayer2.C.ColorSpace int colorSpace

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

    - #### colorRange

          public final @com.google.android.exoplayer2.C.ColorRange int colorRange

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

    - #### colorTransfer

          public final @com.google.android.exoplayer2.C.ColorTransfer int colorTransfer

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

    - #### hdrStaticInfo

          @Nullable
          public final byte[] hdrStaticInfo

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

    - #### CREATOR

          public static final Bundleable.Creator<ColorInfo> CREATOR

  - ### Constructor Detail

    - #### ColorInfo

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

      Constructs the ColorInfo.
      Parameters:
        `colorSpace` - The color space of the video.
        `colorRange` - The color range of the video.
        `colorTransfer` - The color transfer characteristics of the video.
        `hdrStaticInfo` - HdrStaticInfo as defined in CTA-861.3, or null if none specified.

  - ### Method Detail

    - #### isoColorPrimariesToColorSpace

          @Pure
          public static @com.google.android.exoplayer2.C.ColorSpace 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 `Format.NO_VALUE` if no mapping can be made.

    - #### isoTransferCharacteristicsToColorTransfer

          @Pure
          public static @com.google.android.exoplayer2.C.ColorTransfer 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 `Format.NO_VALUE` if no mapping can be made.

    - #### isTransferHdr

          public static boolean isTransferHdr​(@Nullable
                                              ColorInfo colorInfo)

      Returns whether the `ColorInfo` uses an HDR `C.ColorTransfer`.

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toBundle

          public Bundle toBundle()

      Description copied from interface: `Bundleable`
      Returns a `Bundle` representing the information stored in this object.
      Specified by:
        `toBundle` in interface `Bundleable`