FlashMode

class FlashMode
androidx.camera.core.FlashMode

The flash mode options when taking a picture using ImageCapture.

Applications can check if there is a flash unit via CameraInfo#hasFlashUnit() and update UI component if necessary. If there is no flash unit, then the FlashMode set to ImageCapture#setFlashMode(int) will take no effect for the subsequent photo capture requests and they will act like FlashMode#OFF.

When the torch is enabled via CameraControl#enableTorch(boolean), the torch will remain enabled during photo capture regardless of flash mode setting. When the torch is disabled, flash will function as specified by ImageCapture#setFlashMode(int).

Summary

Constants

static Int

Auto flash.

static Int

No flash.

static Int

Always flash.

Public constructors

The flash mode options when taking a picture using ImageCapture.

Constants

AUTO

static val AUTO: Int

Auto flash. The flash will be used according to the camera system's determination when taking a picture.

Value: 0

OFF

static val OFF: Int

No flash. The flash will never be used when taking a picture.

Value: 2

ON

static val ON: Int

Always flash. The flash will always be used when taking a picture.

Value: 1

Public constructors

<init>

FlashMode()

The flash mode options when taking a picture using ImageCapture.

Applications can check if there is a flash unit via CameraInfo#hasFlashUnit() and update UI component if necessary. If there is no flash unit, then the FlashMode set to ImageCapture#setFlashMode(int) will take no effect for the subsequent photo capture requests and they will act like FlashMode#OFF.

When the torch is enabled via CameraControl#enableTorch(boolean), the torch will remain enabled during photo capture regardless of flash mode setting. When the torch is disabled, flash will function as specified by ImageCapture#setFlashMode(int).