Class Crop
- java.lang.Object
-
- com.google.android.exoplayer2.effect.Crop
-
- All Implemented Interfaces:
GlEffect,GlMatrixTransformation,MatrixTransformation,Effect
public final class Crop extends Object implements MatrixTransformation
Specifies a crop to apply in the vertex shader.The background color of the output frame will be black, with alpha = 0 if applicable.
-
-
Constructor Summary
Constructors Constructor Description Crop(float left, float right, float bottom, float top)Crops a smaller (or larger) frame, per normalized device coordinates (NDC), where the input frame corresponds to the square ranging from -1 to 1 on the x and y axes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair<Integer,Integer>configure(int inputWidth, int inputHeight)Configures the input and output dimensions.MatrixgetMatrix(long presentationTimeUs)Returns the 3x3 transformationMatrixto apply to the frame with the given timestamp.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.effect.GlMatrixTransformation
toGlTextureProcessor
-
Methods inherited from interface com.google.android.exoplayer2.effect.MatrixTransformation
getGlMatrixArray
-
-
-
-
Constructor Detail
-
Crop
public Crop(float left, float right, float bottom, float top)Crops a smaller (or larger) frame, per normalized device coordinates (NDC), where the input frame corresponds to the square ranging from -1 to 1 on the x and y axes.leftandbottomdefault to -1, andrightandtopdefault to 1, which corresponds to not applying any crop. To crop to a smaller subset of the input frame, use values between -1 and 1. To crop to a larger frame, use values below -1 and above 1.- Parameters:
left- The left edge of the output frame, in NDC. Must be less thanright.right- The right edge of the output frame, in NDC. Must be greater thanleft.bottom- The bottom edge of the output frame, in NDC. Must be less thantop.top- The top edge of the output frame, in NDC. Must be greater thanbottom.
-
-
Method Detail
-
configure
public Pair<Integer,Integer> configure(int inputWidth, int inputHeight)
Description copied from interface:GlMatrixTransformationConfigures the input and output dimensions.Must be called before
GlMatrixTransformation.getGlMatrixArray(long).- Specified by:
configurein interfaceGlMatrixTransformation- Parameters:
inputWidth- The input frame width, in pixels.inputHeight- The input frame height, in pixels.- Returns:
- The output frame width and height, in pixels.
-
getMatrix
public Matrix getMatrix(long presentationTimeUs)
Description copied from interface:MatrixTransformationReturns the 3x3 transformationMatrixto apply to the frame with the given timestamp.- Specified by:
getMatrixin interfaceMatrixTransformation
-
-