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

Public constructors

TransformationInfo(
    int sourceRotation,
    boolean isSourceMirroredHorizontally,
    boolean isSourceMirroredVertically,
    int cropRectLeft,
    int cropRectTop,
    int cropRectRight,
    int cropRectBottom
)

Public methods

boolean
equals(Object other)
final int

Bottom offset of the cropRect in pixels

final int

Left offset of the cropRect in pixels

final int

Right offset of the cropRect in pixels

final int

Top offset of the cropRect in pixels

final int

Rotation of the source, relative to the device's natural rotation.

int
final boolean

Indicates whether the source has been mirrored horizontally.

final boolean

Indicates whether the source has been mirrored vertically.

Public constructors

TransformationInfo

Added in 1.4.0-alpha08
public TransformationInfo(
    int sourceRotation,
    boolean isSourceMirroredHorizontally,
    boolean isSourceMirroredVertically,
    int cropRectLeft,
    int cropRectTop,
    int cropRectRight,
    int cropRectBottom
)

Public methods

equals

public boolean equals(Object other)

getCropRectBottom

Added in 1.4.0-alpha08
public final int getCropRectBottom()

Bottom offset of the cropRect in pixels

getCropRectLeft

Added in 1.4.0-alpha08
public final int getCropRectLeft()

Left offset of the cropRect in pixels

getCropRectRight

Added in 1.4.0-alpha08
public final int getCropRectRight()

Right offset of the cropRect in pixels

getCropRectTop

Added in 1.4.0-alpha08
public final int getCropRectTop()

Top offset of the cropRect in pixels

getSourceRotation

Added in 1.4.0-alpha08
public final int getSourceRotation()

Rotation of the source, relative to the device's natural rotation.

hashCode

public int hashCode()

isSourceMirroredHorizontally

Added in 1.4.0-alpha08
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.

isSourceMirroredVertically

Added in 1.4.0-alpha08
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