# androidx.camera.common

*** ** * ** ***

CameraX Common is a collection of well documented common types, interfaces, wrappers, math and utilities designed to enable library and application developers to build on a shared set of types regardless of CameraX or Camera2 usage. This library is intentionally designed to be lightweight to ensure that libraries or applications that depend on it have minimal impact to their library and code size.

Library developers that can consume media content from a camera are encouraged to use these interfaces and types as part of their permanent public API surface instead of library-specific subtypes when possible. Developers that expose or develop camera libraries or applications that utilize Camera2 directly are encouraged to depend on and supply instances of these public API types directly.

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata` | An interface that provides compatibility-focused, read-only query access to `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrapper` | Wrapper interface providing compatibility-focused access to `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | Compatibility wrapper around `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureRequestMetadata` | An interface that provides compatibility-focused, read-only query access to the settings applied to a camera capture request. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureRequestWrapper` | A wrapper interface representing the settings applied to a specific camera capture request. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureResultMetadata` | An interface that provides compatibility-focused, read-only query access to the results of a single image capture. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureResultWrapper` | A wrapper interface providing compatibility-focused access to `https://developer.android.com/reference/android/hardware/camera2/CaptureResult.html` and custom metadata. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/ColorSpaceProfilesWrapper` | A compatibility wrapper for color space profiles. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/DynamicRangeProfilesWrapper` | Provides compatibility-focused access to `https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/ImagePlane` | A wrapper interface that mirrors `https://developer.android.com/reference/android/media/Image.Plane.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper` | A wrapper interface that mirrors the primary read-only properties of `https://developer.android.com/reference/android/media/Image.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata` | A read-only, map-like interface for accessing unified camera metadata. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper` | A mutable extension of `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper` that allows modifying properties of the image. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/StreamConfigurationMapWrapper` | A compatibility wrapper for `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper` | An interface for wrapper objects that hide underlying platform or implementation-specific types. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraFrameNumber` | A strongly typed identifier for a camera frame. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | A type-safe identifier for a camera device. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/DiscreteRotation` | A value class representing a rotation constrained to 90-degree increments (0, 90, 180, or 270 degrees). |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key` | A type-safe key used to identify and retrieve values from a `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata` container. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrapper.Keys` | Custom `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key` definitions for querying library-defined camera characteristics on a `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrapper`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrappers` | Custom metadata keys for `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrapper`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraColorSpaces` | Constants and utility functions for `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraColorSpace`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers` | Helper for constructing and loading `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraMath` | Utility functions for doing common transformations of camera and sensor coordinate spaces. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureRequestWrappers` | Helper utilities for constructing and wrapping `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureRequestWrapper` instances. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureResultWrappers` | Helper utilities for constructing and wrapping `https://developer.android.com/reference/kotlin/androidx/camera/common/CaptureResultWrapper` instances. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrappers` | Utility methods for `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper`. |

## Extension functions summary

|---|---|
| `inline T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper.https://developer.android.com/reference/kotlin/androidx/camera/common/package-summary#(androidx.camera.common.UnsafeWrapper).unwrapAs()()` Inline extension function to attempt to unwrap this object into the reified type `https://developer.android.com/reference/kotlin/androidx/camera/common/package-summary#(androidx.camera.common.UnsafeWrapper).unwrapAs()`. |

## Extension functions

### UnsafeWrapper.unwrapAs

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

```
inline fun <T : Any> UnsafeWrapper.unwrapAs(): T?
```

Inline extension function to attempt to unwrap this object into the reified type `https://developer.android.com/reference/kotlin/androidx/camera/common/package-summary#(androidx.camera.common.UnsafeWrapper).unwrapAs()`.

This is a Kotlin-friendly helper for `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`.

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | The expected type of the underlying object. |

| Returns |
|---|---|
| `T?` | The underlying object cast to `https://developer.android.com/reference/kotlin/androidx/camera/common/package-summary#(androidx.camera.common.UnsafeWrapper).unwrapAs()`, or `null` if the object cannot be unwrapped. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)` |   |