public class Camera
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Camera.AutoFocusCallback |
class |
Camera.CameraState
Current Camera state object
|
static interface |
Camera.OnStateChangeListener
Camera state change Interface
|
static class |
Camera.PictureCallback
Abstract picture callback
|
class |
Camera.Size
Size model
|
Modifier and Type | Field and Description |
---|---|
static android.hardware.Camera.PreviewCallback |
previewCallback |
Modifier and Type | Method and Description |
---|---|
int |
getCameraAngleCorrection() |
CameraFacing |
getCameraFacing()
Get the current camera facing.
|
int |
getCameraOrientation()
Get camera cameraOrientation
|
int |
getCurrentExifOrientation() |
FlashMode |
getFlashMode()
Get the current FlashMode
|
static Camera |
getInstance()
Get a singleton Camera Instance.
|
Camera.Size |
getPreviewSize()
Get Preview Size
|
Camera.CameraState |
getState()
Get the State of the current Camera getSettingsModel.
|
boolean |
hasSceneMode(java.lang.String mode)
Check if the current state has scene mode is available.
|
static boolean |
isAvailable()
Check if min. 1 Camera is available.
|
boolean |
isFront()
Check if Camera is Front Camera
|
boolean |
isPreviewFlipped() |
void |
setAutoFocusCallback(Camera.AutoFocusCallback autoFocusCallback) |
CameraFacing |
setCameraFacing(CameraFacing cameraFacing)
Try to set a Camera Facing.
|
FlashMode |
setFlashMode(FlashMode mode)
Try to set a flash mode and take a fallback mode if not supported by current Camera.
|
void |
setFocus(java.util.List<android.hardware.Camera.Area> focusAreas)
* Set Camera FOCUS.
|
void |
setLocationProvider(GPSLocationProvider locationProvider) |
void |
setOnStateChangeListener(Camera.OnStateChangeListener onStateChangeListener)
Set a listener to catch any getSettingsModel state changes.
|
SceneMode |
setSceneMode(SceneMode mode)
Try to set a Scene mode and take a fallback mode if not supported by current Camera.
|
void |
setSurface(android.graphics.SurfaceTexture surfaceTexture)
Set Preview Texture
|
void |
startPreview()
Start the Camera Preview, this is async and will begin if the surface are set.
|
void |
stopPreview(boolean release)
Stop the Camera Preview and release the surface.
|
void |
takePicture(CameraView.CaptureCallback callback,
java.lang.String outputPath)
* Take a Picture
|
public int getCameraAngleCorrection()
public CameraFacing getCameraFacing()
public int getCameraOrientation()
public int getCurrentExifOrientation()
public FlashMode getFlashMode()
public static Camera getInstance()
@Nullable public Camera.Size getPreviewSize()
@NonNull public Camera.CameraState getState()
@Nullable public boolean hasSceneMode(java.lang.String mode)
mode
- scene mode.public static boolean isAvailable()
public boolean isFront()
public boolean isPreviewFlipped()
public void setAutoFocusCallback(Camera.AutoFocusCallback autoFocusCallback)
public CameraFacing setCameraFacing(CameraFacing cameraFacing)
cameraFacing
- camera facing.@Nullable public FlashMode setFlashMode(FlashMode mode)
mode
- flash mode.public void setFocus(java.util.List<android.hardware.Camera.Area> focusAreas)
focusAreas
- list of focus areaspublic void setLocationProvider(GPSLocationProvider locationProvider)
public void setOnStateChangeListener(Camera.OnStateChangeListener onStateChangeListener)
onStateChangeListener
- state change callback.@Nullable public SceneMode setSceneMode(SceneMode mode)
mode
- scene mode.public void setSurface(@NonNull android.graphics.SurfaceTexture surfaceTexture)
surfaceTexture
- SurfaceTexture that should receive the Camera imagepublic void startPreview()
public void stopPreview(boolean release)
public void takePicture(CameraView.CaptureCallback callback, java.lang.String outputPath)
callback
- Callback that fired after image will saved as jpg.outputPath
- the output path for saving the image