@UnstableApi
interface ColorLut : GlEffect

Known direct subclasses
SingleColorLut

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


Specifies color transformations using color lookup tables to apply to each frame in the fragment shader.

Summary

Public functions

Int
getLength(presentationTimeUs: Long)

Returns the length N of the 3D N x N x N LUT cube with the given timestamp.

Int
getLutTextureId(presentationTimeUs: Long)

Returns the OpenGL texture ID of the LUT to apply to the pixels of the frame with the given timestamp.

Unit

Releases the OpenGL texture of the LUT.

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

Returns a GlShaderProgram that applies the effect.

Inherited functions

From androidx.media3.common.Effect
Long

Returns the expected duration of the output stream when the effect is applied given a input durationUs.

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

Returns whether a GlEffect applies no change at every timestamp.

Public functions

getLength

fun getLength(presentationTimeUs: Long): Int

Returns the length N of the 3D N x N x N LUT cube with the given timestamp.

getLutTextureId

fun getLutTextureId(presentationTimeUs: Long): Int

Returns the OpenGL texture ID of the LUT to apply to the pixels of the frame with the given timestamp.

release

fun release(): Unit

Releases the OpenGL texture of the LUT.

toGlShaderProgram

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

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 .