ImageCaptureConfig

@RequiresApi(21) class ImageCaptureConfig : UseCaseConfig<ImageCapture!>, ImageOutputConfig, IoConfig
kotlin.Any
   ↳ androidx.camera.core.impl.ImageCaptureConfig

Configuration for an image capture use case.

Summary

Inherited constants
Public constructors

Creates a new configuration instance.

Public methods
Int?
getBufferFormat(@Nullable valueIfMissing: Int?)

Returns the ImageFormat of the capture in memory.

Int

Returns the ImageFormat of the capture in memory.

CaptureBundle?
getCaptureBundle(@Nullable valueIfMissing: CaptureBundle?)

Returns the CaptureBundle.

CaptureBundle

Returns the CaptureBundle.

Int

Returns the CaptureMode.

CaptureProcessor?
getCaptureProcessor(@Nullable valueIfMissing: CaptureProcessor?)

Returns the CaptureProcessor.

CaptureProcessor

Returns the CaptureProcessor.

Config

Int
getFlashMode(valueIfMissing: Int)

Returns the ImageCapture.FlashMode.

Int

Returns the ImageCapture.FlashMode.

Int
getFlashType(valueIfMissing: Int)

Returns the ImageCapture.FlashType.

Int

Returns the ImageCapture.FlashType.

Int

Retrieves the format of the image that is fed as input.

Executor?
getIoExecutor(@Nullable valueIfMissing: Executor?)

Returns the executor that will be used for IO tasks.

Executor

Returns the executor that will be used for IO tasks.

Int
getJpegQuality(@IntRange(1, 100) valueIfMissing: Int)

Returns the JPEG compression quality setting.

Int

Returns the JPEG compression quality setting.

Int
getMaxCaptureStages(valueIfMissing: Int)

Returns the max number of CaptureStage.

Int

Returns the max number of CaptureStage.

Boolean

Returns whether a CaptureMode option has been set in this configuration.

Inherited functions
Properties
static Config.Option<Int!>!

static Config.Option<CaptureBundle!>!

static Config.Option<CaptureProcessor!>!

static Config.Option<Int!>!

static Config.Option<Int!>!

static Config.Option<Int!>!

static Config.Option<ImageReaderProxyProvider!>!

static Config.Option<Int!>!

static Config.Option<Int!>!

static Config.Option<Boolean!>!

Inherited properties

Public constructors

ImageCaptureConfig

ImageCaptureConfig(@NonNull config: OptionsBundle)

Creates a new configuration instance.

Public methods

getBufferFormat

@Nullable fun getBufferFormat(@Nullable valueIfMissing: Int?): Int?

Returns the ImageFormat of the capture in memory.

Parameters
valueIfMissing Int?: The value to return if this configuration option has not been set.
Return
Int? The stored value or ValueIfMissing if the value does not exist in this configuration.

getBufferFormat

@NonNull fun getBufferFormat(): Int

Returns the ImageFormat of the capture in memory.

Return
Int The stored value, if it exists in the configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getCaptureBundle

@Nullable fun getCaptureBundle(@Nullable valueIfMissing: CaptureBundle?): CaptureBundle?

Returns the CaptureBundle.

Parameters
valueIfMissing CaptureBundle?: The value to return if this configuration option has not been set.
Return
CaptureBundle? The stored value or valueIfMissing if the value does not exist in this configuration.

getCaptureBundle

@NonNull fun getCaptureBundle(): CaptureBundle

Returns the CaptureBundle.

Return
CaptureBundle The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getCaptureMode

fun getCaptureMode(): Int

Returns the CaptureMode.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getCaptureProcessor

@Nullable fun getCaptureProcessor(@Nullable valueIfMissing: CaptureProcessor?): CaptureProcessor?

Returns the CaptureProcessor.

Parameters
valueIfMissing CaptureProcessor?: The value to return if this configuration option has not been set.
Return
CaptureProcessor? The stored value or valueIfMissing if the value does not exist in this configuration.

getCaptureProcessor

@NonNull fun getCaptureProcessor(): CaptureProcessor

Returns the CaptureProcessor.

Return
CaptureProcessor The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getConfig

@NonNull fun getConfig(): Config

getFlashMode

fun getFlashMode(valueIfMissing: Int): Int

Returns the ImageCapture.FlashMode.

Parameters
valueIfMissing Int: The value to return if this configuration option has not been set.
Return
Int The stored value, if it exists in this configuration.

getFlashMode

fun getFlashMode(): Int

Returns the ImageCapture.FlashMode.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getFlashType

fun getFlashType(valueIfMissing: Int): Int

Returns the ImageCapture.FlashType.

Parameters
valueIfMissing Int: The value to return if this configuration option has not been set.
Return
Int The stored value, if it exists in this configuration.

getFlashType

fun getFlashType(): Int

Returns the ImageCapture.FlashType.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getInputFormat

fun getInputFormat(): Int

Retrieves the format of the image that is fed as input.

This should be YUV_420_888, when processing is run on the image. Otherwise it is JPEG.

getIoExecutor

@Nullable fun getIoExecutor(@Nullable valueIfMissing: Executor?): Executor?

Returns the executor that will be used for IO tasks.

This executor will be used for any IO tasks specifically for ImageCapture, such as ImageCapture#takePicture(ImageCapture.OutputFileOptions, Executor, * ImageCapture.OnImageSavedCallback). If no executor is set, then a default Executor specifically for IO will be used instead.

Parameters
valueIfMissing Executor?: The value to return if this configuration option has not been set.
Return
Executor? The stored value or valueIfMissing if the value does not exist in this configuration.

getIoExecutor

@NonNull fun getIoExecutor(): Executor

Returns the executor that will be used for IO tasks.

This executor will be used for any IO tasks specifically for ImageCapture, such as ImageCapture#takePicture(ImageCapture.OutputFileOptions, Executor, * ImageCapture.OnImageSavedCallback). If no executor is set, then a default Executor specifically for IO will be used instead.

Return
Executor The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getJpegQuality

@IntRange(1, 100) fun getJpegQuality(@IntRange(1, 100) valueIfMissing: Int): Int

Returns the JPEG compression quality setting.

Parameters
valueIfMissing Int: The value to return if this configuration option has not been set.
Return
Int The stored value or valueIfMissing if the value does not exist in this configuration.

getJpegQuality

@IntRange(1, 100) fun getJpegQuality(): Int

Returns the JPEG compression quality setting.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getMaxCaptureStages

fun getMaxCaptureStages(valueIfMissing: Int): Int

Returns the max number of CaptureStage.

Parameters
valueIfMissing Int: The value to return if this configuration option has not been set.
Return
Int The stored value or valueIfMissing if the value does not exist in this configuration.

getMaxCaptureStages

fun getMaxCaptureStages(): Int

Returns the max number of CaptureStage.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

hasCaptureMode

fun hasCaptureMode(): Boolean

Returns whether a CaptureMode option has been set in this configuration.

Return
Boolean true if a CaptureMode option has been set in this configuration, false otherwise.

Properties

OPTION_BUFFER_FORMAT

static val OPTION_BUFFER_FORMAT: Config.Option<Int!>!

OPTION_CAPTURE_BUNDLE

static val OPTION_CAPTURE_BUNDLE: Config.Option<CaptureBundle!>!

OPTION_CAPTURE_PROCESSOR

static val OPTION_CAPTURE_PROCESSOR: Config.Option<CaptureProcessor!>!

OPTION_FLASH_MODE

static val OPTION_FLASH_MODE: Config.Option<Int!>!

OPTION_FLASH_TYPE

static val OPTION_FLASH_TYPE: Config.Option<Int!>!

OPTION_IMAGE_CAPTURE_MODE

static val OPTION_IMAGE_CAPTURE_MODE: Config.Option<Int!>!

OPTION_IMAGE_READER_PROXY_PROVIDER

static val OPTION_IMAGE_READER_PROXY_PROVIDER: Config.Option<ImageReaderProxyProvider!>!

OPTION_JPEG_COMPRESSION_QUALITY

static val OPTION_JPEG_COMPRESSION_QUALITY: Config.Option<Int!>!

OPTION_MAX_CAPTURE_STAGES

static val OPTION_MAX_CAPTURE_STAGES: Config.Option<Int!>!

OPTION_USE_SOFTWARE_JPEG_ENCODER

static val OPTION_USE_SOFTWARE_JPEG_ENCODER: Config.Option<Boolean!>!