SingleColorLut
@UnstableApi
public final 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 |
createFromBitmap(Bitmap lut)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 toGlShaderProgram. |
void |
release()Releases the OpenGL texture of the LUT. |
BaseGlShaderProgram |
toGlShaderProgram(Context context, boolean useHdr)Returns a |
Inherited methods |
||
|---|---|---|
|
||
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 toGlShaderProgram.
toGlShaderProgram
public BaseGlShaderProgram toGlShaderProgram(Context context, boolean useHdr)
Returns a GlShaderProgram that applies the effect.
| Parameters | |
|---|---|
Context context |
A |
boolean useHdr |
Whether input textures come from an HDR source. If |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while creating the |