The second Android 11 Developer Preview is now available, test it out and share your feedback.

ImageCaptureExtender

abstract class ImageCaptureExtender
kotlin.Any
   ↳ androidx.camera.extensions.ImageCaptureExtender

Class for using an OEM provided extension on image capture.

Summary

Public constructors

Class for using an OEM provided extension on image capture.

Public methods

open Unit
enableExtension(@NonNull cameraSelector: CameraSelector)

Enables the derived image capture extension feature.

open Boolean
isExtensionAvailable(@NonNull cameraSelector: CameraSelector)

Indicates whether extension function can support with the given CameraSelector.

Public constructors

<init>

ImageCaptureExtender()

Class for using an OEM provided extension on image capture.

Public methods

enableExtension

open fun enableExtension(@NonNull cameraSelector: CameraSelector): Unit

Enables the derived image capture extension feature. If the extension can't be applied on any of the cameras specified with the given CameraSelector, it will be no-ops.

Enabling extensions on ImageCapture may limit the number of cameras which can be selected when the ImageCapture is used as a parameter to bindToLifecycle. BindToLifecycle will throw an exception if no cameras are found that support the extension.

Image capture extension has dependence on preview extension. A PREVIEW_EXTENSION_REQUIRED error will be thrown if corresponding preview extension is not enabled together.

Parameters
cameraSelector CameraSelector: The selector used to determine the camera for which to enable extensions.

isExtensionAvailable

open fun isExtensionAvailable(@NonNull cameraSelector: CameraSelector): Boolean

Indicates whether extension function can support with the given CameraSelector.

Parameters
cameraSelector CameraSelector: The selector that determines a camera that will be checked for the availability of extensions.
Return
Boolean True if the specific extension function is supported for the camera device.