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 UnitopenCameraInBackground()Open the camera in a background thread, if surface is already created and camera is not opened already. BooleanopenCameraInBackgroundSuccessfully()UnitreleaseCamera()Release the camera. UnitreleaseCameraAndPreview()Release the camera for the landscape to landscape mode. UnitreleaseCameraInBackground()Release the camera in a background thread. UnitcallAutoFocus()Call auto focus. UnitsetFocusRegionToCutouts(Context context, List<Rect> cutoutRectList)Updates the focus and metering region to be the same for all given cutouts. UnitsetFlashOn(Boolean isOn)Turn the torch flash on or off. UnitsetupZoomHandler(View view)Set up the zoom for the camera UnitsetFocalLength(Double focalLength)Set a zoom level through focal length UnitsetMaxFocalLength(Double maxFocalLength)Set a maximum focal length UnitsetMaxZoomRatio(Double maxZoomRatio)Set a maximum zoom ratio DoublegetZoomRatio()Get the current zoom ratio UnitsetZoomRatio(Double zoomLevelRatio)Set a zoom level through zoom Ratio DoublegetCurrentFocalLength()Get the current focal length CameraFeatures.LensFacinggetCameraLensFacing()CameraController.CameraOrientationgetCameraOrientation()-
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)
-
-
-
-