@UnstableApi
interface RgbMatrix : GlEffect

Known direct subclasses
Brightness

Modifies brightness of an input frame.

Contrast

A RgbMatrix to control the contrast of video frames.

RgbAdjustment

Scales the red, green, and blue color channels of a frame.

RgbFilter

Provides common color filters.


Specifies a 4x4 RGB color transformation matrix to apply to each frame in the fragment shader.

Summary

Public functions

FloatArray<Float>!
getMatrix(presentationTimeUs: Long, useHdr: Boolean)

Returns the 4x4 RGB transformation matrix to apply to the color values of each pixel in the frame with the given timestamp.

BaseGlShaderProgram!
toGlShaderProgram(context: Context!, useHdr: Boolean)

Returns a GlShaderProgram that applies the effect.

Inherited functions

From androidx.media3.effect.GlEffect
Boolean
isNoOp(inputWidth: Int, inputHeight: Int)

Returns whether a GlEffect applies no change at every timestamp.

Public functions

getMatrix

fun getMatrix(presentationTimeUs: Long, useHdr: Boolean): FloatArray<Float>!

Returns the 4x4 RGB transformation matrix to apply to the color values of each pixel in the frame with the given timestamp.

Parameters
presentationTimeUs: Long

The timestamp of the frame to apply the matrix on.

useHdr: Boolean

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

Returns
FloatArray<Float>!

The RgbMatrix to apply to the frame.

toGlShaderProgram

fun toGlShaderProgram(context: Context!, useHdr: Boolean): BaseGlShaderProgram!

Returns a GlShaderProgram that applies the effect.

Parameters
context: Context!

A Context.

useHdr: Boolean

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
androidx.media3.common.VideoFrameProcessingException

If an error occurs while creating the .