CameraController
A CameraController controls a CameraDevice connected to a CameraSession: zoom, torch, exposure, focus…
One CameraController is returned per CameraSessionConnection by CameraSession.configure.
Properties
The CameraDevice this controller controls.
The current exposure bias, in EV units.
The current exposure duration, in seconds, or 0 if the device does not support exposure locking.
The current ExposureMode.
Whether the device is currently connected and usable.
Whether distortion correction is currently enabled.
Whether low-light boost is currently enabled.
Whether smooth auto-focus is currently enabled.
Whether the device is currently suspended (e.g. a lens cover is closed).
Whether the device is currently used by another app.
The current lens position, from 0.0 (closest) to 1.0 (furthest), or 0 if the device does not support CameraDevice.supportsFocusLocking.
The maximum exposure duration for setExposureLocked, in seconds, or 0 if not supported.
The maximum ISO for setExposureLocked, or 0 if not supported.
The minimum exposure duration for setExposureLocked, in seconds, or 0 if not supported.
The minimum ISO for setExposureLocked, or 0 if not supported.
The current torch strength.
The current white balance gains, or (0, 0, 0) if the device does not support CameraDevice.supportsWhiteBalanceLocking.
The current WhiteBalanceMode.
Functions
Adds a listener called every time the subject area substantially changes, e.g. when the user pans away from a scene previously in focus. Useful to resetFocus after locking focus.
Cancels any zoom animation started with startZoomAnimation.
Configures this controller with the given config. null values are left unchanged.
Converts the given temperature and tint values to WhiteBalanceGains. Only supported on iOS.
Turns the torch on at the given strength, between CameraDevice.minTorchStrength and CameraDevice.maxTorchStrength. Turn it off again with setTorchMode.
Focuses the Camera pipeline to the given point, using the MeteringModes of options (by default, every mode the device supports, ideally 3A: AE, AF and AWB).
Locks the current exposure (exposureDuration and iso) until resetFocus is called. Requires CameraDevice.supportsExposureLocking. Only supported on iOS.
Locks the current focus (lensPosition) until resetFocus is called. Requires CameraDevice.supportsFocusLocking. Only supported on iOS.
Locks the current white balance (whiteBalanceGains) until resetFocus is called. Requires CameraDevice.supportsWhiteBalanceLocking. Only supported on iOS.
Cancels any focus operation from focusTo, resets every 3A mode back to continuous auto mode if it was locked (e.g. via setFocusLocked or lockCurrentFocus), and resets the point of interest to the center.
Biases the auto-exposure by the given value in EV units. Requires CameraDevice.supportsExposureBias.
Locks the exposure at the given duration (in seconds, between minExposureDuration and maxExposureDuration) and iso (between minISO and maxISO). Requires CameraDevice.supportsExposureLocking. Only supported on iOS.
Locks the focus at the given lensPosition, from 0.0 (closest) to 1.0 (furthest). Requires CameraDevice.supportsFocusLocking. Only supported on iOS.
Sets the torch to the given mode, at the system default level. Requires CameraDevice.hasTorch.
Locks the white balance at the given whiteBalanceGains, each channel between 1 and CameraDevice.maxWhiteBalanceGain. Requires CameraDevice.supportsWhiteBalanceLocking. Only supported on iOS.
Starts animating the zoom to the given value, at the given rate (in doublings of the zoom factor per second).