public abstract static class CameraDeviceInfo.Characteristics extends Object
Constructor and Description |
---|
Characteristics() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canDisableShutterSound() |
int |
getJpegOrientation(int currentDisplayOrientation) |
int |
getPreviewOrientation(int currentDisplayOrientation) |
Matrix |
getPreviewTransform(int currentDisplayOrientation,
RectF surfaceDimensions) |
Matrix |
getPreviewTransform(int currentDisplayOrientation,
RectF surfaceDimensions,
RectF desiredBounds) |
protected int |
getRelativeImageOrientation(int currentDisplayOrientation,
boolean compensateForMirroring) |
abstract int |
getSensorOrientation() |
abstract boolean |
isFacingBack() |
abstract boolean |
isFacingFront() |
protected static boolean |
orientationIsValid(int angle) |
public abstract boolean isFacingBack()
public abstract boolean isFacingFront()
public abstract int getSensorOrientation()
public int getPreviewOrientation(int currentDisplayOrientation)
currentDisplayOrientation
- The current display orientation, measured counterclockwise
from to the device's natural orientation (in degrees, always
a multiple of 90, and between 0 and 270, inclusive).public int getJpegOrientation(int currentDisplayOrientation)
currentDisplayOrientation
- The current display orientation, measured counterclockwise
from to the device's natural orientation (in degrees, always
a multiple of 90, and between 0 and 270, inclusive).protected int getRelativeImageOrientation(int currentDisplayOrientation, boolean compensateForMirroring)
currentDisplayOrientaiton
- getPreviewOrientation(int)
, getJpegOrientation(int)
compensateForMirroring
- Whether to account for mirroring in the case of front-facing
cameras, which is necessary iff the OS/driver is
automatically reflecting the image.getPreviewOrientation(int)
, getJpegOrientation(int)
android.hardware.Camera.setDisplayOrientation
public Matrix getPreviewTransform(int currentDisplayOrientation, RectF surfaceDimensions)
currentDisplayOrientation
- The current display orientation, measured counterclockwise
from to the device's natural orientation (in degrees, always
a multiple of 90, and between 0 and 270, inclusive).surfaceDimensions
- The dimensions of the Surface
on which
the preview image is being rendered. It usually only makes
sense for the upper-left corner to be at the origin.Surface
in order for the image to
display properly in the device's current orientation.public Matrix getPreviewTransform(int currentDisplayOrientation, RectF surfaceDimensions, RectF desiredBounds)
currentDisplayOrientation
- The current display orientation, measured counterclockwise
from to the device's natural orientation (in degrees, always
a multiple of 90, and between 0 and 270, inclusive).surfaceDimensions
- The dimensions of the Surface
on which
the preview image is being rendered. It usually only makes
sense for the upper-left corner to be at the origin.desiredBounds
- The boundaries within the Surface
where
the final image should appear. These can be used to
translate and scale the output, but note that the image will
be stretched to fit, possibly changing its aspect ratio.Surface
in order for the image to
display properly in the device's current orientation.public abstract boolean canDisableShutterSound()
protected static boolean orientationIsValid(int angle)