Class CameraControllerX
-
- All Implemented Interfaces:
public final class CameraControllerX extends CameraController
-
-
Constructor Summary
Constructors Constructor Description CameraControllerX(Context context, LifecycleOwner lifecycleOwner, CameraConfig preferredCameraConfig)
-
Method Summary
Modifier and Type Method Description Unit
openCameraInBackground()
Open the camera in a background thread, if surface is already created and camera is not opened already. Boolean
openCameraInBackgroundSuccessfully()
Unit
releaseCamera()
Release the camera. Unit
releaseCameraAndPreview()
Release the camera for the landscape to landscape mode. Unit
releaseCameraInBackground()
Release the camera in a background thread. Unit
callAutoFocus()
Call auto focus. Unit
setFocusRegionToCutouts(Context context, List<Rect> cutoutRectList)
Updates the focus and metering region to be the same for all given cutouts. Unit
setFlashOn(Boolean isOn)
Turn the torch flash on or off. Unit
setupZoomHandler(View view)
Set up the zoom for the camera Unit
setFocalLength(Double focalLength)
Set a zoom level through focal length Unit
setMaxFocalLength(Double maxFocalLength)
Set a maximum focal length Unit
setMaxZoomRatio(Double maxZoomRatio)
Set a maximum zoom ratio Double
getZoomRatio()
Get the current zoom ratio Unit
setZoomRatio(Double zoomLevelRatio)
Set a zoom level through zoom Ratio Double
getCurrentFocalLength()
Get the current focal length CameraFeatures.LensFacing
getCameraLensFacing()
CameraController.CameraOrientation
getCameraOrientation()
-
Methods inherited from class io.anyline2.camera.CameraController
getCameraConfig, getCameraFeatures, getFocalLength, getFrameHeight, getFrameToViewScale, getFrameToViewScaleWidth, getFrameWidth, getLastImageWithFullSize, getLastImageWithFullSizeReceiver, getNewImage, getPreferredCameraConfig, getPreviewView, hasNewImage, isPreviewMirrored, removeAllCameraOpenListeners, removeCameraOpenListener, resetAutoFocusTimer, setCameraControllerListener, setCameraOpenListener, setCameraOrientation, setFocusRegionToCutout, setHighResolutionImageListener, setImageListener, setPreferredCameraConfig, setZoomGestureEnabled, takeHighResolutionImage, takeHighResolutionImage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CameraControllerX
CameraControllerX(Context context, LifecycleOwner lifecycleOwner, CameraConfig preferredCameraConfig)
-
-
Method Detail
-
openCameraInBackground
Unit openCameraInBackground()
Open the camera in a background thread, if surface is already created and camera is not opened already. Reports opening or error to the CameraOpenListener set with setCameraOpenListener.
-
openCameraInBackgroundSuccessfully
Boolean openCameraInBackgroundSuccessfully()
-
releaseCamera
Unit releaseCamera()
Release the camera.
ALWAYS call this or releaseCameraInBackground in onPause of your activity!!
-
releaseCameraAndPreview
Unit releaseCameraAndPreview()
Release the camera for the landscape to landscape mode.
-
releaseCameraInBackground
Unit releaseCameraInBackground()
Release the camera in a background thread. Camera releasing may take a bit, so it may interfere with your exit animation. Use this to do it in the background.
ALWAYS call this or releaseCamera in onPause of your activity!!
-
callAutoFocus
Unit callAutoFocus()
Call auto focus.
-
setFocusRegionToCutouts
Unit setFocusRegionToCutouts(Context context, List<Rect> cutoutRectList)
Updates the focus and metering region to be the same for all given cutouts.
-
setFlashOn
Unit setFlashOn(Boolean isOn)
Turn the torch flash on or off.
-
setupZoomHandler
Unit setupZoomHandler(View view)
Set up the zoom for the camera
-
setFocalLength
Unit setFocalLength(Double focalLength)
Set a zoom level through focal length
-
setMaxFocalLength
Unit setMaxFocalLength(Double maxFocalLength)
Set a maximum focal length
-
setMaxZoomRatio
Unit setMaxZoomRatio(Double maxZoomRatio)
Set a maximum zoom ratio
-
getZoomRatio
Double getZoomRatio()
Get the current zoom ratio
-
setZoomRatio
Unit setZoomRatio(Double zoomLevelRatio)
Set a zoom level through zoom Ratio
-
getCurrentFocalLength
Double getCurrentFocalLength()
Get the current focal length
-
getCameraLensFacing
CameraFeatures.LensFacing getCameraLensFacing()
-
getCameraOrientation
CameraController.CameraOrientation getCameraOrientation()
- Returns:
the camera orientation (only available after the camera is opened)
-
-
-
-