ImageCaptureConfig

class ImageCaptureConfig : UseCaseConfig<ImageCapture!>, ImageOutputConfig, CameraDeviceConfig, ThreadConfig
kotlin.Any
   ↳ androidx.camera.core.ImageCaptureConfig

Configuration for an image capture use case.

Summary

Nested classes

Builder for a ImageCaptureConfig.

Public methods

Executor?
getBackgroundExecutor(@Nullable valueIfMissing: Executor?)

Returns the executor that will be used for background tasks.

Executor

Returns the executor that will be used for background tasks.

Handler?
getCallbackHandler(@Nullable valueIfMissing: Handler?)

Returns the default handler that will be used for callbacks.

Handler!

Returns the default handler that will be used for callbacks.

ImageCapture.CaptureMode?
getCaptureMode(@Nullable valueIfMissing: ImageCapture.CaptureMode?)

Returns the CaptureMode.

ImageCapture.CaptureMode!

Returns the CaptureMode.

FlashMode?
getFlashMode(@Nullable valueIfMissing: FlashMode?)

Returns the FlashMode.

FlashMode!

Returns the FlashMode.

CameraX.LensFacing?
getLensFacing(@Nullable valueIfMissing: CameraX.LensFacing?)

Returns the lens-facing direction of the camera being configured.

CameraX.LensFacing

Retrieves the lens facing direction for the primary camera to be configured.

Rational?
getTargetAspectRatio(@Nullable valueIfMissing: Rational?)

Retrieves the aspect ratio of the target intending to use images from this configuration.

Rational!

Retrieves the aspect ratio of the target intending to use images from this configuration.

String?
getTargetName(@Nullable valueIfMissing: String?)

Retrieves the name of the target object being configured.

String!

Retrieves the name of the target object being configured.

Size!
getTargetResolution(valueIfMissing: Size!)

Retrieves the resolution of the target intending to use from this configuration.

Size!

Retrieves the resolution of the target intending to use from this configuration.

Int
getTargetRotation(valueIfMissing: Int)

Retrieves the rotation of the target intending to use images from this configuration.

Int

Retrieves the rotation of the target intending to use images from this configuration.

Public methods

getBackgroundExecutor

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

Returns the executor that will be used for background tasks.

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.

getBackgroundExecutor

@NonNull fun getBackgroundExecutor(): Executor

Returns the executor that will be used for background tasks.

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

getCallbackHandler

@Nullable fun getCallbackHandler(@Nullable valueIfMissing: Handler?): Handler?

Returns the default handler that will be used for callbacks.

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

getCallbackHandler

fun getCallbackHandler(): Handler!

Returns the default handler that will be used for callbacks.

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

getCaptureMode

@Nullable fun getCaptureMode(@Nullable valueIfMissing: ImageCapture.CaptureMode?): ImageCapture.CaptureMode?

Returns the CaptureMode.

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

getCaptureMode

fun getCaptureMode(): ImageCapture.CaptureMode!

Returns the CaptureMode.

Return
ImageCapture.CaptureMode!: The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getFlashMode

@Nullable fun getFlashMode(@Nullable valueIfMissing: FlashMode?): FlashMode?

Returns the FlashMode.

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

getFlashMode

fun getFlashMode(): FlashMode!

Returns the FlashMode.

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

getLensFacing

@Nullable fun getLensFacing(@Nullable valueIfMissing: CameraX.LensFacing?): CameraX.LensFacing?

Returns the lens-facing direction of the camera being configured.

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

getLensFacing

@NonNull fun getLensFacing(): CameraX.LensFacing

Retrieves the lens facing direction for the primary camera to be configured.

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

getTargetAspectRatio

@Nullable fun getTargetAspectRatio(@Nullable valueIfMissing: Rational?): Rational?

Retrieves the aspect ratio of the target intending to use images from this configuration.

This is the ratio of the target's width to the image's height, where the numerator of the provided Rational corresponds to the width, and the denominator corresponds to the height.

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

getTargetAspectRatio

fun getTargetAspectRatio(): Rational!

Retrieves the aspect ratio of the target intending to use images from this configuration.

This is the ratio of the target's width to the image's height, where the numerator of the provided Rational corresponds to the width, and the denominator corresponds to the height.

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

getTargetName

@Nullable fun getTargetName(@Nullable valueIfMissing: String?): String?

Retrieves the name of the target object being configured.

The name should be a value that can uniquely identify an instance of the object being configured.

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

getTargetName

fun getTargetName(): String!

Retrieves the name of the target object being configured.

The name should be a value that can uniquely identify an instance of the object being configured.

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

getTargetResolution

fun getTargetResolution(valueIfMissing: Size!): Size!

Retrieves the resolution of the target intending to use from this configuration.

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

getTargetResolution

fun getTargetResolution(): Size!

Retrieves the resolution of the target intending to use from this configuration.

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

getTargetRotation

fun getTargetRotation(valueIfMissing: Int): Int

Retrieves the rotation of the target intending to use images from this configuration.

This is one of four valid values: Surface#ROTATION_0, Surface#ROTATION_90, Surface#ROTATION_180, Surface#ROTATION_270. Rotation values are relative to the device's "natural" rotation, Surface#ROTATION_0.

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.

getTargetRotation

fun getTargetRotation(): Int

Retrieves the rotation of the target intending to use images from this configuration.

This is one of four valid values: Surface#ROTATION_0, Surface#ROTATION_90, Surface#ROTATION_180, Surface#ROTATION_270. Rotation values are relative to the device's "natural" rotation, Surface#ROTATION_0.

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