# androidx.camera.core

*** ** * ** ***

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/Camera` | The camera interface is used to control the flow of data to use cases, control the camera via the `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl`, and publish the state of the camera via `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfo`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl` | The `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl` provides various asynchronous operations like zoom, focus and metering which affects output of all `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase`s currently bound to that camera. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraFilter` | An interface for filtering cameras. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfo` | An interface for retrieving camera information. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraPresenceListener` | A listener for changes in camera presence, indicating when cameras are added to or removed from the set of devices that are recognized by the system and usable by CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraProvider` | A `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraProvider` provides basic access to a set of cameras such as querying for camera existence or information. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Provider` | An interface which can be implemented to provide the configuration for CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExposureState` | An interface which contains the camera exposure related information. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExtendableBuilder` | Extendable builders are used to add externally defined options that can be passed to the implementation being built. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis.Analyzer` | Interface for analyzing images. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysisCapabilities` | ImageAnalysisCapabilities is used to query `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` use case capabilities on the device. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageSavedCallback` | Listener containing callbacks for image file I/O events. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.ScreenFlash` | Interface to do the application changes required for screen flash operations. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.ScreenFlashListener` | Callback listener for discovering when the application has completed its changes for a screen flash image capture. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureCapabilities` | ImageCaptureCapabilities is used to query `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` use case capabilities on the device. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageInfo` | Metadata for an image. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProcessor` | Post-processing effect for images. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProcessor.Request` | A request for processing one or multiple `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProcessor.Response` | A response for returning a processed `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` to CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` | An image proxy which has a similar interface as `https://developer.android.com/reference/android/media/Image.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy.PlaneProxy` | A plane proxy which has an analogous interface as `https://developer.android.com/reference/android/media/Image.Plane.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/InteropConfigurableScope` | Scope for CameraX DSL builders that supports applying interoperability options. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/InteropConfigurator` | Configures interoperability options on a configurable target. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview.SurfaceProvider` | A interface implemented by the application to provide a `https://developer.android.com/reference/android/view/Surface.html` for `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/PreviewCapabilities` | PreviewCapabilities is used to query `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` use case capabilities on the device. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` | Defines a strategy for retrying upon initialization failures of the `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraProvider`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy.ExecutionState` | Provides insights into the current execution state of the camera initialization process. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceOutput` | A `https://developer.android.com/reference/android/view/Surface.html` for drawing processed camera frames. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceProcessor` | Interface to implement a GPU-based post-processing effect. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest.TransformationInfoListener` | Listener that receives updates of the `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest.TransformationInfo` associated with the `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase.InteropConfigurable` | Applies camera-backend-specific options. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ZoomState` | An interface which contains the zoom related information from a camera. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/AspectRatio` | The aspect ratio of the use case. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraEffect` | An effect for one or multiple camera outputs. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraIdentifier` | An opaque, stable identifier for a camera device recognized by CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector` | A set of requirements and priorities used to select a camera or return a filtered set of cameras. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector.Builder` | Builder for a `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraState` | Represents the different states the camera can be in. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraState.StateError` | Error that the camera has encountered. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig` | A configuration for adding implementation and user-specific behavior to CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder` | A builder for generating `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig` objects. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CompositionSettings` | Composition settings for dual concurrent camera. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CompositionSettings.Builder` | A builder for `https://developer.android.com/reference/kotlin/androidx/camera/core/CompositionSettings` instances. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ConcurrentCamera` | Concurrent camera is a new feature introduced from Android 11, which supports simultaneous streaming of camera devices, for example, it allows a device to have both the front and back cameras operating at the same time. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ConcurrentCamera.SingleCameraConfig` | Configuration for a single camera in concurrent camera mode, including `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector`, `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner` and `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCaseGroup`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/DisplayOrientedMeteringPointFactory` | A `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPointFactory` that can convert a `https://developer.android.com/reference/android/view/View.html` (x, y) into a `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPoint` which can then be used to construct a `https://developer.android.com/reference/kotlin/androidx/camera/core/FocusMeteringAction` to start a focus and metering action. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | A representation of the dynamic range of an image. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FocusMeteringAction` | A configuration used to trigger a focus and/or metering action. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FocusMeteringAction.Builder` | The builder used to create the `https://developer.android.com/reference/kotlin/androidx/camera/core/FocusMeteringAction`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FocusMeteringResult` | Result of the `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl#startFocusAndMetering(androidx.camera.core.FocusMeteringAction)`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` | A use case providing CPU accessible images for an app to perform image analysis on. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis.Builder` | Builder for a `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysisScope` | Scope class for `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` configuration DSL. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` | A use case for taking a picture. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.Builder` | Builder for an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.Metadata` | Holder class for metadata that will be saved with captured images. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageCapturedCallback` | Callback for image capture events. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileOptions` | Options for saving newly captured image. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileOptions.Builder` | Builder class for `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileOptions`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileResults` | Info about the saved image file. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureLatencyEstimate` | An immutable representation of the estimated duration an image capture will take capturing and processing the current scene according to the scene's lighting condition and/or camera configuration. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureScope` | Scope class for `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` configuration DSL. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/LowLightBoostState` | Defines the valid states for Low Light Boost, as returned by `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfo#getLowLightBoostState()`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPoint` | A `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPoint` is used to specify a region which can then be converted to sensor coordinate system for focus and metering purpose. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPointFactory` | A factory to create a `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPoint`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/MirrorMode` | The mirror mode. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/NightModeIndicator` | Defines the valid states for Night Mode Indicator, as returned by `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfo#getNightModeIndicator()`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` | A use case that provides a camera preview stream for displaying on-screen. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview.Builder` | Builder for a `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/PreviewScope` | Scope class for `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` configuration DSL. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ResolutionInfo` | A `https://developer.android.com/reference/kotlin/androidx/camera/core/ResolutionInfo` allows the application to know the resolution information of a specific use case. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy.Builder` | A builder class for customizing RetryPolicy behavior. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy.RetryConfig` | Represents the outcome of a `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` decision. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy.RetryConfig.Builder` | A builder class for creating and customizing `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy.RetryConfig` objects. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` | Represents the configuration for establishing and managing a camera session within CameraX. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig.Builder` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope` | Scope class for `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` configuration DSL. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceOrientedMeteringPointFactory` | A `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPointFactory` that can create `https://developer.android.com/reference/kotlin/androidx/camera/core/MeteringPoint` by surface oriented x, y on an area defined by (0, 0) - (width, height). |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceOutput.Event` | Events of the `https://developer.android.com/reference/android/view/Surface.html` retrieved from `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceOutput#getSurface(java.util.concurrent.Executor,androidx.core.util.Consumer<androidx.camera.core.SurfaceOutput.Event>)`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest` | A completable, single-use request of a `https://developer.android.com/reference/android/view/Surface.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest.Result` | Result of providing a surface to a `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest` via `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest#provideSurface(android.view.Surface,java.util.concurrent.Executor,androidx.core.util.Consumer<androidx.camera.core.SurfaceRequest.Result>)`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SurfaceRequest.TransformationInfo` | Transformation associated the preview output. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/TorchState` | The camera flash torch state. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase` | The use case which all other use cases are built on top of. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCaseGroup` | Represents a collection of `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCaseGroup.Builder` | A builder for generating `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCaseGroup`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort` | The field of view of one or many `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase`s. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort.Builder` | Builder for `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort`. |

## Exceptions

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl.OperationCanceledException` | An exception representing a failure that the operation is canceled which might be caused by a new value is set or camera is closed. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfoUnavailableException` | An exception thrown when unable to retrieve information about a camera. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraUnavailableException` | `CameraUnavailableException` is thrown when a camera device could not be queried or opened or if the connection to an opened camera device is no longer valid. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureException` | An exception thrown to indicate an error has occurred during image capture or while saving the captured image. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/InitializationException` | `InitializationException` is thrown when a failure occurs during an initialization process. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ProcessingException` | Exception throw when effects post-processing fails. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState` | The camera flash state values represent the state of the physical flash unit of a camera. |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXDsl` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalGetImage` | Denotes that the annotated method uses the experimental `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy#getImage()` method. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalLensFacing` | Denotes that the annotated API is designed to be used with a lens facing that its behavior hasn't been verified thoroughly. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalRetryPolicy` | Indicates that the annotated API uses the experimental `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` feature for CameraX initialization. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalUseCaseApi` | Denotes that the methods on use cases and use case builders are experimental and may change in a future release |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalZeroShutterLag` | Denotes that the annotated API uses the experimental zero-shutter lag capture mode in `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` and related querying function in `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraInfo`. |

## Enums

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraState.ErrorType` | Types of errors the camera can encounter. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraState.Type` | States the camera can be in. |

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` | `https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#imageAnalysis(kotlin.Function1)(block: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysisScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` using a Kotlin DSL block. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` | `https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#imageCapture(kotlin.Function1)(block: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` using a Kotlin DSL block. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` | `https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#preview(kotlin.Function1)(block: https://developer.android.com/reference/kotlin/androidx/camera/core/PreviewScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` using a Kotlin DSL block. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` | `https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#sessionConfig(kotlin.collections.List,kotlin.Function1)(useCases: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase>, block: https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` using a Kotlin DSL. |

## Extension functions summary

|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#(androidx.camera.core.ImageCapture).takePicture(kotlin.Function0,kotlin.Function1,kotlin.Function1)( onCaptureStarted: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, onCaptureProcessProgressed: ((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, onPostviewBitmapAvailable: ((https://developer.android.com/reference/android/graphics/Bitmap.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` Captures a new still image for in memory access. |
| `suspend https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileResults` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.https://developer.android.com/reference/kotlin/androidx/camera/core/package-summary#(androidx.camera.core.ImageCapture).takePicture(androidx.camera.core.ImageCapture.OutputFileOptions,kotlin.Function0,kotlin.Function1,kotlin.Function1)( outputFileOptions: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileOptions, onCaptureStarted: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, onCaptureProcessProgressed: ((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, onPostviewBitmapAvailable: ((https://developer.android.com/reference/android/graphics/Bitmap.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` Captures a new still image and saves to a file along with application specified metadata. |

## Top-level functions

### imageAnalysis

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/CameraXDsl.kt+function:imageAnalysis) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun imageAnalysis(block: ImageAnalysisScope.() -> Unit): ImageAnalysis
```

Creates an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis` using a Kotlin DSL block.

```kotlin
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.ImageCapture
import androidx.camera.core.imageAnalysis
import androidx.camera.core.imageCapture
import androidx.camera.core.preview
import androidx.camera.core.resolutionselector.ResolutionSelector

// 1. Using the new Kotlin DSL to configure UseCases in a clean and idiomatic way
val previewUseCase = preview {
    targetName = "preview_dsl"
    targetRotation = Surface.ROTATION_90
    resolutionSelector = ResolutionSelector.Builder().build()
    isPreviewStabilizationEnabled = true
    targetFrameRate = Range(30, 30)
}

val imageCaptureUseCase = imageCapture {
    targetName = "capture_dsl"
    captureMode = ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY
    flashMode = ImageCapture.FLASH_MODE_AUTO
    jpegQuality = 95
}

val imageAnalysisUseCase = imageAnalysis {
    targetName = "analysis_dsl"
    backpressureStrategy = ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST
    imageQueueDepth = 5
}
```

| Parameters |
|---|---|
| `block: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysisScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | A receiver lambda on `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysisScope` to configure the image analysis. |

### imageCapture

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/CameraXDsl.kt+function:imageCapture) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun imageCapture(block: ImageCaptureScope.() -> Unit): ImageCapture
```

Creates an `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture` using a Kotlin DSL block.

```kotlin
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.ImageCapture
import androidx.camera.core.imageAnalysis
import androidx.camera.core.imageCapture
import androidx.camera.core.preview
import androidx.camera.core.resolutionselector.ResolutionSelector

// 1. Using the new Kotlin DSL to configure UseCases in a clean and idiomatic way
val previewUseCase = preview {
    targetName = "preview_dsl"
    targetRotation = Surface.ROTATION_90
    resolutionSelector = ResolutionSelector.Builder().build()
    isPreviewStabilizationEnabled = true
    targetFrameRate = Range(30, 30)
}

val imageCaptureUseCase = imageCapture {
    targetName = "capture_dsl"
    captureMode = ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY
    flashMode = ImageCapture.FLASH_MODE_AUTO
    jpegQuality = 95
}

val imageAnalysisUseCase = imageAnalysis {
    targetName = "analysis_dsl"
    backpressureStrategy = ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST
    imageQueueDepth = 5
}
```

| Parameters |
|---|---|
| `block: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | A receiver lambda on `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCaptureScope` to configure the image capture. |

### preview

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/CameraXDsl.kt+function:preview) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun preview(block: PreviewScope.() -> Unit): Preview
```

Creates a `https://developer.android.com/reference/kotlin/androidx/camera/core/Preview` using a Kotlin DSL block.

```kotlin
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.ImageCapture
import androidx.camera.core.imageAnalysis
import androidx.camera.core.imageCapture
import androidx.camera.core.preview
import androidx.camera.core.resolutionselector.ResolutionSelector

// 1. Using the new Kotlin DSL to configure UseCases in a clean and idiomatic way
val previewUseCase = preview {
    targetName = "preview_dsl"
    targetRotation = Surface.ROTATION_90
    resolutionSelector = ResolutionSelector.Builder().build()
    isPreviewStabilizationEnabled = true
    targetFrameRate = Range(30, 30)
}

val imageCaptureUseCase = imageCapture {
    targetName = "capture_dsl"
    captureMode = ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY
    flashMode = ImageCapture.FLASH_MODE_AUTO
    jpegQuality = 95
}

val imageAnalysisUseCase = imageAnalysis {
    targetName = "analysis_dsl"
    backpressureStrategy = ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST
    imageQueueDepth = 5
}
```

| Parameters |
|---|---|
| `block: https://developer.android.com/reference/kotlin/androidx/camera/core/PreviewScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | A receiver lambda on `https://developer.android.com/reference/kotlin/androidx/camera/core/PreviewScope` to configure the preview. |

### sessionConfig

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/SessionConfig.kt+function:sessionConfig)

```
fun sessionConfig(useCases: List<UseCase>, block: SessionConfigScope.() -> Unit): SessionConfig
```

Creates a `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` using a Kotlin DSL.

Example usage:

```kotlin
val sessionConfig = sessionConfig(useCases) {
    isAutoRotationEnabled = true
    viewPort = viewPort
}
```

| Parameters |
|---|---|
| `useCases: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase>` | The list of `https://developer.android.com/reference/kotlin/androidx/camera/core/UseCase` to be attached to the camera. |
| `block: https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | A lambda to configure the `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope`. |

## Extension functions

### ImageCapture.takePicture

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureExt.kt+function:takePicture)

```
suspend fun ImageCapture.takePicture(
    onCaptureStarted: (() -> Unit)? = null,
    onCaptureProcessProgressed: ((Int) -> Unit)? = null,
    onPostviewBitmapAvailable: ((Bitmap) -> Unit)? = null
): ImageProxy
```

Captures a new still image for in memory access.

The caller is responsible for calling `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy#close()` on the returned image.

| Parameters |
|---|---|
| `onCaptureStarted: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback for when the camera has started exposing the frame. |
| `onCaptureProcessProgressed: ((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback to report the progress of the capture's processing. |
| `onPostviewBitmapAvailable: ((https://developer.android.com/reference/android/graphics/Bitmap.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback to notify that the postview bitmap is available. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#takePicture(java.util.concurrent.Executor,androidx.camera.core.ImageCapture.OnImageCapturedCallback)` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageCapturedCallback` |   |

### ImageCapture.takePicture

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureExt.kt+function:takePicture)

```
suspend fun ImageCapture.takePicture(
    outputFileOptions: ImageCapture.OutputFileOptions,
    onCaptureStarted: (() -> Unit)? = null,
    onCaptureProcessProgressed: ((Int) -> Unit)? = null,
    onPostviewBitmapAvailable: ((Bitmap) -> Unit)? = null
): ImageCapture.OutputFileResults
```

Captures a new still image and saves to a file along with application specified metadata.

| Parameters |
|---|---|
| `outputFileOptions: https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OutputFileOptions` | Options to store the output image file. |
| `onCaptureStarted: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback for when the camera has started exposing the frame. |
| `onCaptureProcessProgressed: ((https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback to report the progress of the capture's processing. |
| `onPostviewBitmapAvailable: ((https://developer.android.com/reference/android/graphics/Bitmap.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | Callback to notify that the postview bitmap is available. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#takePicture(java.util.concurrent.Executor,androidx.camera.core.ImageCapture.OnImageCapturedCallback)` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageSavedCallback` |   |