Crop
@UnstableApi
class Crop : 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 |
|---|
|
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 functions |
|
|---|---|
Size! |
Configures the input and output dimensions. |
Matrix! |
Returns the 3x3 transformation |
Boolean |
Returns whether a |
Inherited functions |
||||
|---|---|---|---|---|
|
||||
|
||||
|
||||
|
Public constructors
Crop
Crop(left: Float, right: Float, bottom: Float, top: Float)
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 | |
|---|---|
left: Float |
The left edge of the output frame, in NDC. Must be less than |
right: Float |
The right edge of the output frame, in NDC. Must be greater than |
bottom: Float |
The bottom edge of the output frame, in NDC. Must be less than |
top: Float |
The top edge of the output frame, in NDC. Must be greater than |
Public functions
configure
fun configure(inputWidth: Int, inputHeight: Int): Size!
Configures the input and output dimensions.
Must be called before getGlMatrixArray.
| Parameters | |
|---|---|
inputWidth: Int |
The input frame width, in pixels. |
inputHeight: Int |
The input frame height, in pixels. |
| Returns | |
|---|---|
Size! |
The output frame width and height, in pixels. |