@UnstableApi
public interface ColorLut extends 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 methods

abstract int
getLength(long presentationTimeUs)

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

abstract int
getLutTextureId(long presentationTimeUs)

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

abstract void

Releases the OpenGL texture of the LUT.

default GlShaderProgram
toGlShaderProgram(Context context, boolean useHdr)

Returns a GlShaderProgram that applies the effect.

Inherited methods

From androidx.media3.common.Effect
default long

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

From androidx.media3.effect.GlEffect
default boolean
isNoOp(int inputWidth, int inputHeight)

Returns whether a GlEffect applies no change at every timestamp.

Public methods

getLength

abstract int getLength(long presentationTimeUs)

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

getLutTextureId

abstract int getLutTextureId(long presentationTimeUs)

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

release

abstract void release()

Releases the OpenGL texture of the LUT.

toGlShaderProgram

default GlShaderProgram toGlShaderProgram(Context context, boolean useHdr)

Returns a GlShaderProgram that applies the effect.

Parameters
Context context

A Context.

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

If an error occurs while creating the .