TransformationInfo
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
Public companion properties |
|
|---|---|
TransformationInfo |
A |
Public constructors |
|---|
Public properties |
|
|---|---|
Float |
Bottom offset of the cropRect in pixels |
Float |
Left offset of the cropRect in pixels. |
Float |
Right offset of the cropRect in pixels |
Float |
Top offset of the cropRect in pixels |
Boolean |
Indicates whether the source has been mirrored horizontally. |
Boolean |
Indicates whether the source has been mirrored vertically. |
Int |
Rotation of the source, relative to the device's natural rotation, in degrees. |
Constants
CROP_NONE
const val CROP_NONE: Float
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 companion properties
DEFAULT
val DEFAULT: TransformationInfo
A TransformationInfo with default values.
This transformation info instance has no source rotation, no mirroring, and no crop rectangle.
Public constructors
TransformationInfo
TransformationInfo(
sourceRotation: Int = 0,
isSourceMirroredHorizontally: Boolean = false,
isSourceMirroredVertically: Boolean = false,
cropRectLeft: Float = CROP_NONE,
cropRectTop: Float = CROP_NONE,
cropRectRight: Float = CROP_NONE,
cropRectBottom: Float = CROP_NONE
)
Public functions
Public properties
cropRectBottom
val cropRectBottom: Float
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.
cropRectLeft
val cropRectLeft: Float
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.
cropRectRight
val cropRectRight: Float
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.
cropRectTop
val cropRectTop: Float
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.
isSourceMirroredHorizontally
val isSourceMirroredHorizontally: Boolean
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
val isSourceMirroredVertically: Boolean
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 |
sourceRotation
val sourceRotation: Int
Rotation of the source, relative to the device's natural rotation, in degrees.