Stay organized with collections Save and categorize content based on your preferences.

SingleColorLut

@UnstableApi
public class SingleColorLut implements ColorLut


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

Summary

Public methods

static SingleColorLut

Creates a new instance.

static SingleColorLut
createFromCube(int[][][] lutCube)

Creates a new instance.

int
getLength(long presentationTimeUs)

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

int
getLutTextureId(long presentationTimeUs)

Must be called after toGlTextureProcessor.

void

Releases the OpenGL texture of the LUT.

SingleFrameGlTextureProcessor
toGlTextureProcessor(Context context, boolean useHdr)

This method must be executed on the same thread as other GL commands.

Inherited methods

From androidx.media3.effect.GlEffect
abstract GlTextureProcessor
toGlTextureProcessor(Context context, boolean useHdr)

Returns a SingleFrameGlTextureProcessor that applies the effect.

Public methods

createFromBitmap

public static SingleColorLut createFromBitmap(Bitmap lut)

Creates a new instance.

LUT needs to be a Bitmap of a flattened HALD image of width N and height N^2. Each element must be an integer representing a color using the ARGB_8888 format.

createFromCube

public static SingleColorLut createFromCube(int[][][] lutCube)

Creates a new instance.

lutCube needs to be a N x N x N cube and each element is an integer representing a color using the ARGB_8888 format.

getLength

public int getLength(long presentationTimeUs)

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

getLutTextureId

public int getLutTextureId(long presentationTimeUs)

Must be called after toGlTextureProcessor.

release

public void release()

Releases the OpenGL texture of the LUT.

Throws
androidx.media3.common.util.GlUtil.GlException androidx.media3.common.util.GlUtil.GlException

toGlTextureProcessor

public SingleFrameGlTextureProcessor toGlTextureProcessor(Context context, boolean useHdr)

This method must be executed on the same thread as other GL commands.

Throws
androidx.media3.common.FrameProcessingException androidx.media3.common.FrameProcessingException