Package com.google.android.exoplayer2.effect

## Class SingleColorLut

- java.lang.Object
- - com.google.android.exoplayer2.effect.SingleColorLut

- All Implemented Interfaces:
    `ColorLut`, `GlEffect`, `Effect`

      public class SingleColorLut
      extends Object
      implements ColorLut

  Transforms the colors of a frame by applying the same color lookup table to each frame.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static SingleColorLut` | `createFromBitmap​(Bitmap lut)` | Creates a new instance.
    `static SingleColorLut` | `createFromCube​(int[][][] lutCube)` | Creates a new instance.
    `int` | `getLength​(long presentationTimeUs)` | Returns the length N of the 3D N x N x N LUT cube with the given timestamp.
    `int` | `getLutTextureId​(long presentationTimeUs)` | Must be called after `toGlTextureProcessor(Context, boolean)`.
    `void` | `release()` | Releases the OpenGL texture of the LUT.
    `SingleFrameGlTextureProcessor` | `toGlTextureProcessor​(Context context, boolean useHdr)` | This method must be executed on the same thread as other GL commands.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### createFromCube

          public static SingleColorLut createFromCube​(int[][][] lutCube)

      Creates a new instance.

      `lutCube` needs to be a `N x N x N` cube and each element is an integer representing a color using the `Bitmap.Config.ARGB_8888` format.

    - #### createFromBitmap

          public static SingleColorLut createFromBitmap​(Bitmap lut)

      Creates a new instance.

      LUT needs to be a Bitmap of a flattened HALD image of width `N` and height `N^2`. Each element must be an integer representing a color using the `Bitmap.Config.ARGB_8888` format.

    - #### getLutTextureId

          public int getLutTextureId​(long presentationTimeUs)

      Must be called after `toGlTextureProcessor(Context, boolean)`.
      Specified by:
        `getLutTextureId` in interface `ColorLut`

    - #### getLength

          public int getLength​(long presentationTimeUs)

      Description copied from interface: `ColorLut`
      Returns the length N of the 3D N x N x N LUT cube with the given timestamp.
      Specified by:
        `getLength` in interface `ColorLut`

    - #### release

          public void release()
                       throws GlUtil.GlException

      Description copied from interface: `ColorLut`
      Releases the OpenGL texture of the LUT.
      Specified by:
        `release` in interface `ColorLut`
      Throws:
        `GlUtil.GlException`

    - #### toGlTextureProcessor

          public SingleFrameGlTextureProcessor toGlTextureProcessor​(Context context,
                                                                    boolean useHdr)
                                                             throws FrameProcessingException

      Description copied from interface: `ColorLut`
      This method must be executed on the same thread as other GL commands.
      Specified by:
        `toGlTextureProcessor` in interface `ColorLut`
      Specified by:
        `toGlTextureProcessor` in interface `GlEffect`
      Parameters:
        `context` - A `Context`.
        `useHdr` - Whether input textures come from an HDR source. If `true`, colors will be in linear RGB BT.2020. If `false`, colors will be in linear RGB BT.709.
      Throws:
        `FrameProcessingException`