TransformationInfo
public final class TransformationInfo
Transformation information associated with the preview output.
This information can be used to transform the Surface of a Viewfinder to be suitable to be displayed.
Summary
Constants |
|
|---|---|
static final float |
A crop value specifying no crop should be applied. |
Public fields |
|
|---|---|
static final @NonNull TransformationInfo |
A |
Public constructors |
|---|
TransformationInfo( |
Public methods |
|
|---|---|
boolean |
|
final float |
Bottom offset of the cropRect in pixels |
final float |
Left offset of the cropRect in pixels. |
final float |
Right offset of the cropRect in pixels |
final float |
Top offset of the cropRect in pixels |
final int |
Rotation of the source, relative to the device's natural rotation, in degrees. |
int |
hashCode() |
final boolean |
Indicates whether the source has been mirrored horizontally. |
final boolean |
Indicates whether the source has been mirrored vertically. |
@NonNull String |
toString() |
Constants
CROP_NONE
public static final float CROP_NONE
A crop value specifying no crop should be applied.
When used as a value for TransformationInfo.cropRectLeft, TransformationInfo.cropRectTop, TransformationInfo.cropRectRight, or TransformationInfo.cropRectBottom, the crop rect dimension will be equivalent to the resolution of the untransformed surface.
Public fields
DEFAULT
public static final @NonNull TransformationInfo DEFAULT
A TransformationInfo with default values.
This transformation info instance has no source rotation, no mirroring, and no crop rectangle.
Public constructors
TransformationInfo
public TransformationInfo(
int sourceRotation,
boolean isSourceMirroredHorizontally,
boolean isSourceMirroredVertically,
float cropRectLeft,
float cropRectTop,
float cropRectRight,
float cropRectBottom
)
Public methods
getCropRectBottom
public final float getCropRectBottom()
Bottom offset of the cropRect in pixels
The offset is in the coordinates of the original surface, before rotation or mirroring.
If not set, this value will default to CROP_NONE, which is equivalent to an offset of the height of the surface.
getCropRectLeft
public final float getCropRectLeft()
Left offset of the cropRect in pixels.
The offset is in the coordinates of the original surface, before rotation or mirroring.
If not set, this value will default to CROP_NONE, which is equivalent to an offset of 0.
getCropRectRight
public final float getCropRectRight()
Right offset of the cropRect in pixels
The offset is in the coordinates of the original surface, before rotation or mirroring.
If not set, this value will default to CROP_NONE, which is equivalent to an offset of the width of the surface.
getCropRectTop
public final float getCropRectTop()
Top offset of the cropRect in pixels
The offset is in the coordinates of the original surface, before rotation or mirroring.
If not set, this value will default to CROP_NONE, which is equivalent to an offset of 0.
getSourceRotation
public final int getSourceRotation()
Rotation of the source, relative to the device's natural rotation, in degrees.
isSourceMirroredHorizontally
public final boolean isSourceMirroredHorizontally()
Indicates whether the source has been mirrored horizontally.
This is common if the source comes from a camera that is front-facing.
It is not common for both isSourceMirroredHorizontally and isSourceMirroredVertically to be set to true. This is equivalent to sourceRotation being rotated by an additional 180 degrees.
| See also | |
|---|---|
MIRROR_MODE_AUTO |
|
MIRROR_MODE_H |
|
isMirroring |
isSourceMirroredVertically
public final boolean isSourceMirroredVertically()
Indicates whether the source has been mirrored vertically.
It is not common for a camera source to be mirror vertically, and typically isSourceMirroredHorizontally will be the appropriate property.
It is not common for both isSourceMirroredHorizontally and isSourceMirroredVertically to be set to true. This is equivalent to sourceRotation being rotated by an additional 180 degrees.
| See also | |
|---|---|
MIRROR_MODE_V |