ImageAnalysisConfig

@RequiresApi(21) class ImageAnalysisConfig : UseCaseConfig<ImageAnalysis!>, ImageOutputConfig, ThreadConfig
kotlin.Any
   ↳ androidx.camera.core.impl.ImageAnalysisConfig

Configuration for an image analysis use case.

Summary

Inherited constants
Public constructors

Public methods
Int
getBackpressureStrategy(valueIfMissing: Int)

Retrieves the backpressure strategy applied to the image producer to deal with scenarios where images may be produced faster than they can be analyzed.

Int

Returns the mode that the image is acquired from ImageReader.

Config

Int
getImageQueueDepth(valueIfMissing: Int)

Returns the number of images available to the camera pipeline.

Int

Returns the number of images available to the camera pipeline.

Int

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

Int
getOutputImageFormat(valueIfMissing: Int)

Returns the output image format for image analysis.

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

static Config.Option<Int!>!

static Config.Option<ImageReaderProxyProvider!>!

static Config.Option<Boolean!>!

static Config.Option<Int!>!

static Config.Option<Boolean!>!

Inherited properties

Public constructors

ImageAnalysisConfig

ImageAnalysisConfig(@NonNull config: OptionsBundle)

Public methods

getBackpressureStrategy

fun getBackpressureStrategy(valueIfMissing: Int): Int

Retrieves the backpressure strategy applied to the image producer to deal with scenarios where images may be produced faster than they can be analyzed.

The available values are BackpressureStrategy#STRATEGY_BLOCK_PRODUCER and BackpressureStrategy#STRATEGY_KEEP_ONLY_LATEST.

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.

getBackpressureStrategy

fun getBackpressureStrategy(): Int

Returns the mode that the image is acquired from ImageReader.

The available values are BackpressureStrategy#STRATEGY_BLOCK_PRODUCER and BackpressureStrategy#STRATEGY_KEEP_ONLY_LATEST.

Return
Int 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

getImageQueueDepth

fun getImageQueueDepth(valueIfMissing: Int): Int

Returns the number of images available to the camera pipeline.

The image queue depth is the total number of images, including the image being analyzed, available to the camera pipeline. If analysis takes long enough, the image queue may become full and stall the camera pipeline.

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.

getImageQueueDepth

fun getImageQueueDepth(): Int

Returns the number of images available to the camera pipeline.

The image queue depth is the total number of images, including the image being analyzed, available to the camera pipeline. If analysis takes long enough, the image queue may become full and stall the camera pipeline.

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 always be YUV_420_888 for ImageAnalysis.

getOutputImageFormat

fun getOutputImageFormat(valueIfMissing: Int): Int

Returns the output image format for image analysis.

The supported output image format is ImageAnalysis.OutputImageFormat#OUTPUT_IMAGE_FORMAT_YUV_420_888 and ImageAnalysis.OutputImageFormat#OUTPUT_IMAGE_FORMAT_RGBA_8888.

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.

Properties

OPTION_BACKPRESSURE_STRATEGY

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

OPTION_IMAGE_QUEUE_DEPTH

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

OPTION_IMAGE_READER_PROXY_PROVIDER

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

OPTION_ONE_PIXEL_SHIFT_ENABLED

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

OPTION_OUTPUT_IMAGE_FORMAT

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

OPTION_OUTPUT_IMAGE_ROTATION_ENABLED

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