Class SingleColorLut
- java.lang.Object
-
- com.google.android.exoplayer2.effect.SingleColorLut
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 aftertoGlTextureProcessor(Context, boolean)
.void
release()
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.
-
-
-
Method Detail
-
createFromCube
public static SingleColorLut createFromCube(int[][][] lutCube)
Creates a new instance.lutCube
needs to be aN x N x N
cube and each element is an integer representing a color using theBitmap.Config.ARGB_8888
format.
-
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 heightN^2
. Each element must be an integer representing a color using theBitmap.Config.ARGB_8888
format.
-
getLutTextureId
public int getLutTextureId(long presentationTimeUs)
Must be called aftertoGlTextureProcessor(Context, boolean)
.- Specified by:
getLutTextureId
in interfaceColorLut
-
getLength
public int getLength(long presentationTimeUs)
Description copied from interface:ColorLut
Returns the length N of the 3D N x N x N LUT cube with the given timestamp.
-
release
public void release() throws GlUtil.GlException
Description copied from interface:ColorLut
Releases the OpenGL texture of the LUT.- Specified by:
release
in interfaceColorLut
- Throws:
GlUtil.GlException
-
toGlTextureProcessor
public SingleFrameGlTextureProcessor toGlTextureProcessor(Context context, boolean useHdr) throws FrameProcessingException
Description copied from interface:ColorLut
This method must be executed on the same thread as other GL commands.- Specified by:
toGlTextureProcessor
in interfaceColorLut
- Specified by:
toGlTextureProcessor
in interfaceGlEffect
- Parameters:
context
- AContext
.useHdr
- Whether input textures come from an HDR source. Iftrue
, colors will be in linear RGB BT.2020. Iffalse
, colors will be in linear RGB BT.709.- Throws:
FrameProcessingException
-
-