Package com.google.android.exoplayer2.effect

## Class RgbFilter

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

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

      public class RgbFilter
      extends Object
      implements RgbMatrix

  Provides common color filters.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static RgbFilter` | `createGrayscaleFilter()` | Creates a new grayscale `RgbFilter` instance.
    `static RgbFilter` | `createInvertedFilter()` | Creates a new inverted `RgbFilter` instance.
    `float[]` | `getMatrix​(long presentationTimeUs, boolean useHdr)` | Returns the 4x4 RGB transformation matrix to apply to the color values of each pixel in the frame with the given timestamp.
    `SingleFrameGlTextureProcessor` | `toGlTextureProcessor​(Context context, boolean useHdr)` | Returns a `SingleFrameGlTextureProcessor` that applies the effect.

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

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

- - ### Method Detail

    - #### createGrayscaleFilter

          public static RgbFilter createGrayscaleFilter()

      Creates a new grayscale `RgbFilter` instance.

    - #### createInvertedFilter

          public static RgbFilter createInvertedFilter()

      Creates a new inverted `RgbFilter` instance.

    - #### getMatrix

          public float[] getMatrix​(long presentationTimeUs,
                                   boolean useHdr)

      Description copied from interface: `RgbMatrix`
      Returns the 4x4 RGB transformation matrix to apply to the color values of each pixel in the frame with the given timestamp.
      Specified by:
        `getMatrix` in interface `RgbMatrix`
      Parameters:
        `presentationTimeUs` - The timestamp of the frame to apply the matrix on.
        `useHdr` - If `true`, colors will be in linear RGB BT.2020. If `false`, colors will be in linear RGB BT.709. Must be consistent with `useHdr` in `RgbMatrix.toGlTextureProcessor(Context, boolean)`.
      Returns:
        The `RgbMatrix` to apply to the frame.

    - #### toGlTextureProcessor

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

      Description copied from interface: `GlEffect`
      Returns a `SingleFrameGlTextureProcessor` that applies the effect.
      Specified by:
        `toGlTextureProcessor` in interface `GlEffect`
      Specified by:
        `toGlTextureProcessor` in interface `RgbMatrix`
      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`