-
public interface CameraInterfaceInternal use only.
An interface which defines an API for the camera used with the Gini Capture SDK.
We use this interface with the deprecated Camera API and the new Camera2 API to publish a common API for the required camera features.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCameraInterface.TapToFocusListenerListener for tap to focus.
public interfaceCameraInterface.PreviewCallbackCallback to receive preview images.
public interfaceCameraInterface.PreviewFrameCallbackCallback to receive preview frame related state changes.
-
Method Summary
Modifier and Type Method Description abstract CompletableFuture<Void>open()Opens the first back-facing camera. abstract voidclose()Closes the camera. abstract CompletableFuture<Void>startPreview()Starts the camera preview. abstract voidstopPreview()Stops the camera preview. abstract booleanisPreviewRunning()Get the state of the preview. abstract voidenableTapToFocus(@Nullable() CameraInterface.TapToFocusListener listener)Enables tap-to-focus using the given view by adding touch handling to it and transforming the touch point coordinatesto the camera sensor's coordinate system. abstract voiddisableTapToFocus()Disables tap-to-focus. abstract CompletableFuture<Boolean>focus()Start a focus run. abstract CompletableFuture<Photo>takePicture()Take a picture with the camera. abstract voidsetPreviewCallback(@Nullable() CameraInterface.PreviewCallback previewCallback)Set a callback to recieve preview images from the camera. abstract ViewgetPreviewView(@NonNull() Context context)The view which shows the camera preview. abstract booleanisFlashAvailable()abstract booleanisFlashEnabled()abstract voidsetFlashEnabled(boolean enabled)-
-
Method Detail
-
close
abstract void close()
Closes the camera.
-
startPreview
@NonNull() abstract CompletableFuture<Void> startPreview()
Starts the camera preview.
-
stopPreview
abstract void stopPreview()
Stops the camera preview.
-
isPreviewRunning
abstract boolean isPreviewRunning()
Get the state of the preview.
-
enableTapToFocus
abstract void enableTapToFocus(@Nullable() CameraInterface.TapToFocusListener listener)
Enables tap-to-focus using the given view by adding touch handling to it and transforming the touch point coordinatesto the camera sensor's coordinate system.
Note: the view should have the same size as the camera preview and be above it. You could also set thecamera preview android.view.SurfaceView directly as the tap view..
- Parameters:
listener- the listener for tap to focus events
-
disableTapToFocus
abstract void disableTapToFocus()
Disables tap-to-focus.
-
takePicture
@NonNull() abstract CompletableFuture<Photo> takePicture()
Take a picture with the camera.
-
setPreviewCallback
abstract void setPreviewCallback(@Nullable() CameraInterface.PreviewCallback previewCallback)
Set a callback to recieve preview images from the camera.
- Parameters:
previewCallback- callback implementation
-
getPreviewView
abstract View getPreviewView(@NonNull() Context context)
The view which shows the camera preview.
- Parameters:
context- Android context
-
isFlashAvailable
abstract boolean isFlashAvailable()
-
isFlashEnabled
abstract boolean isFlashEnabled()
-
setFlashEnabled
abstract void setFlashEnabled(boolean enabled)
-
-
-
-