ScaleAndRotateTransformation
@UnstableApi
public final class ScaleAndRotateTransformation implements MatrixTransformation
Specifies a simple rotation and/or scale to apply in the vertex shader.
All input frames' pixels will be preserved and copied into an output frame, potentially changing the width and height of the frame by scaling dimensions to fit.
The background color of the output frame will be black, with alpha = 0 if applicable.
Summary
Nested types |
|---|
public final class ScaleAndRotateTransformation.BuilderA builder for |
Public fields |
|
|---|---|
final float |
The counterclockwise rotation, in degrees. |
final float |
The multiplier by which the frame will scale horizontally, along the x-axis. |
final float |
The multiplier by which the frame will scale vertically, along the y-axis. |
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 fields
rotationDegrees
public final float rotationDegrees
The counterclockwise rotation, in degrees. The value should always be between 0 (included) and 360 degrees (excluded).
scaleX
public final float scaleX
The multiplier by which the frame will scale horizontally, along the x-axis.
scaleY
public final float scaleY
The multiplier by which the frame will scale vertically, along the y-axis.
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. |