Crop
@UnstableApi
public final class Crop 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.
Summary
Public constructors |
|---|
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. |
Public methods |
|
|---|---|
Size |
configure(int inputWidth, int inputHeight)Configures the input and output dimensions. |
Matrix |
getMatrix(long presentationTimeUs)Returns the 3x3 transformation |
boolean |
isNoOp(int inputWidth, int inputHeight)Returns whether a |
Inherited methods |
||||
|---|---|---|---|---|
|
||||
|
||||
|
||||
|
Public constructors
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.
left and bottom default to -1, and right and top default 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 | |
|---|---|
float left |
The left edge of the output frame, in NDC. Must be less than |
float right |
The right edge of the output frame, in NDC. Must be greater than |
float bottom |
The bottom edge of the output frame, in NDC. Must be less than |
float top |
The top edge of the output frame, in NDC. Must be greater than |
Public methods
configure
public Size configure(int inputWidth, int inputHeight)
Configures the input and output dimensions.
Must be called before getGlMatrixArray.
| Parameters | |
|---|---|
int inputWidth |
The input frame width, in pixels. |
int inputHeight |
The input frame height, in pixels. |
| Returns | |
|---|---|
Size |
The output frame width and height, in pixels. |