Back to Exoplayer

RgbFilter (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/effect/RgbFilter.html

latest5.0 KB
Original Source

Package com.google.android.exoplayer2.effect

Class RgbFilter

  • java.lang.Object

    • com.google.android.exoplayer2.effect.RgbFilter
  • All Implemented Interfaces:GlEffect, RgbMatrix, Effect


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classRgbFilterextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[RgbMatrix](RgbMatrix.html "interface in com.google.android.exoplayer2.effect")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Provides common color filters.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static RgbFilter | createGrayscaleFilter() | Deprecated.

Creates a new grayscale RgbFilter instance. | | static RgbFilter | createInvertedFilter() | Deprecated.

Creates a new inverted RgbFilter instance. | | float[] | getMatrix​(long presentationTimeUs, boolean useHdr) | Deprecated.

Returns the 4x4 RGB transformation matrix to apply to the color values of each pixel in the frame with the given timestamp. | | SingleFrameGlShaderProgram | toGlShaderProgram​(Context context, boolean useHdr) | Deprecated.

Returns a GlShaderProgram that applies the effect. |

- 

Methods inherited from class java.lang.Object

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

- 

Methods inherited from interface com.google.android.exoplayer2.effect.GlEffect

isNoOp

Method Detail

- 

createGrayscaleFilter

public static[RgbFilter](RgbFilter.html "class in com.google.android.exoplayer2.effect")createGrayscaleFilter()

Deprecated.

Creates a new grayscale RgbFilter instance.

- 

createInvertedFilter

public static[RgbFilter](RgbFilter.html "class in com.google.android.exoplayer2.effect")createInvertedFilter()

Deprecated.

Creates a new inverted RgbFilter instance.

- 

getMatrix

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

Deprecated.

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 RgbMatrixParameters: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.toGlShaderProgram(Context, boolean).Returns:The RgbMatrix to apply to the frame.

- 

toGlShaderProgram

public[SingleFrameGlShaderProgram](SingleFrameGlShaderProgram.html "class in com.google.android.exoplayer2.effect")toGlShaderProgram​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,
                                                    boolean useHdr)
                                             throws[VideoFrameProcessingException](../util/VideoFrameProcessingException.html "class in com.google.android.exoplayer2.util")

Deprecated.

Description copied from interface: GlEffect

Returns a GlShaderProgram that applies the effect. Specified by:toGlShaderProgram in interface GlEffectSpecified by:toGlShaderProgram in interface RgbMatrixParameters: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:VideoFrameProcessingException - If an error occurs while creating the GlShaderProgram.