com.craftar
Class CraftARCamera
- java.lang.Object
-
- com.craftar.CraftARCamera
public abstract class CraftARCamera extends java.lang.Object
Class that allows basic control of the device's camera
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
CraftARCamera.CraftARCameraCallbacks
-
Constructor Summary
Constructors Constructor and Description CraftARCamera()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract CraftARCamera.CraftARCameraCallbacks
getCameraHandler()
Get the handler that will receive the events from the camera.abstract java.util.List<java.lang.String>
getSupportedFlashModes()
Returns a list with the supported flash modes if the camera has been initialized (call startCapture first), null otherwiseabstract java.util.List<Camera.Size>
getSupportedPictureSizes()
Returns a list of picture resolutions supported by the device's camera.abstract void
restartCapture()
Restart the camera preview.abstract void
setAutoFocusOnTouch(boolean doAutoFocus)
Trigger autofocus when the camera view has been touched.abstract void
setCameraHandler(CraftARCamera.CraftARCameraCallbacks hanlder)
Set the handler that will receive the events from the camera.abstract boolean
setFlashMode(java.lang.String mode)
Sets current flash modeabstract void
setPictureSize(Camera.Size cameraSize)
Sets the default picture size to be produced by the camera when a picture is taken (Single shot).abstract void
stopCapture()
Stop the camera video capture.abstract void
takePicture()
Take a picture.abstract void
triggerAutoFocus()
Triggers the camera's autofocus feature
-
-
-
Method Detail
-
stopCapture
public abstract void stopCapture()
Stop the camera video capture. The camera will stop generating frames.
-
restartCapture
public abstract void restartCapture()
Restart the camera preview.
-
takePicture
public abstract void takePicture()
Take a picture. The camera will take a picture and callCraftARCameraCallbacks.onPictureTaken(CraftARQueryImage)
if the picture was taken successfully.
-
setCameraHandler
public abstract void setCameraHandler(CraftARCamera.CraftARCameraCallbacks hanlder)
Set the handler that will receive the events from the camera.- Parameters:
hanlder
-
-
getCameraHandler
public abstract CraftARCamera.CraftARCameraCallbacks getCameraHandler()
Get the handler that will receive the events from the camera. This method is useful if you want to take a picture and restore the old handler.- Returns:
- Object currently assigned to receive the events from the camera.
-
setAutoFocusOnTouch
public abstract void setAutoFocusOnTouch(boolean doAutoFocus)
Trigger autofocus when the camera view has been touched.- Parameters:
doAutoFocus
- enable/disable the autofocus on touch.
-
triggerAutoFocus
public abstract void triggerAutoFocus()
Triggers the camera's autofocus feature
-
setFlashMode
public abstract boolean setFlashMode(java.lang.String mode)
Sets current flash mode
-
getSupportedFlashModes
public abstract java.util.List<java.lang.String> getSupportedFlashModes()
Returns a list with the supported flash modes if the camera has been initialized (call startCapture first), null otherwise
-
getSupportedPictureSizes
public abstract java.util.List<Camera.Size> getSupportedPictureSizes()
Returns a list of picture resolutions supported by the device's camera. Call this after the camera capture has started.
-
setPictureSize
public abstract void setPictureSize(Camera.Size cameraSize)
Sets the default picture size to be produced by the camera when a picture is taken (Single shot). Call always after the camera capture has started.
-
-
Comments
0 comments
Article is closed for comments.