# CameraExtensionCharacteristicsWrappers

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/CameraExtensionCharacteristicsWrapper.kt+class:androidx.camera.common.CameraExtensionCharacteristicsWrappers) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
object CameraExtensionCharacteristicsWrappers
```

<br />

*** ** * ** ***

Helper for constructing and loading `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadAvailableExtensionsFrom(android.hardware.camera2.CameraManager,androidx.camera.common.CameraId)( cameraManager: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html, cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId )` Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadAvailableExtensionsFrom(android.content.Context,androidx.camera.common.CameraId)(context: https://developer.android.com/reference/android/content/Context.html, cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId)` Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper?` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadFrom(android.hardware.camera2.CameraManager,androidx.camera.common.CameraId,kotlin.Int)( cameraManager: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html, cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId, cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper?` | `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadFrom(android.content.Context,androidx.camera.common.CameraId,kotlin.Int)(context: https://developer.android.com/reference/android/content/Context.html, cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId, cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 31) https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrappers#wrap(androidx.camera.common.CameraId,kotlin.Int,android.hardware.camera2.CameraExtensionCharacteristics,kotlin.Boolean)( cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId, cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, extensionCharacteristics: https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html, isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Wraps an existing `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` instance. |

## Public functions

### loadAvailableExtensionsFrom

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun loadAvailableExtensionsFrom(
    cameraManager: CameraManager,
    cameraId: CameraId
): Map<Int, CameraExtensionCharacteristicsWrapper>
```

Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`.

Returns an empty map if the API level is less than 31.

| Parameters |
|---|---|
| `cameraManager: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html` | the system camera manager. |
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | the ID of the camera device. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | a map of `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtension` mode to `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper`. |

### loadAvailableExtensionsFrom

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun loadAvailableExtensionsFrom(context: Context, cameraId: CameraId): Map<Int, CameraExtensionCharacteristicsWrapper>
```

Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/content/Context.html`.

Returns an empty map if the API level is less than 31.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | the application context. |
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | the ID of the camera device. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | a map of `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtension` mode to `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper`. |

### loadFrom

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun loadFrom(
    cameraManager: CameraManager,
    cameraId: CameraId,
    cameraExtension: Int
): CameraExtensionCharacteristicsWrapper?
```

Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`.

Returns `null` if the API level is less than 31 or if the extension is not supported by the camera device.

| Parameters |
|---|---|
| `cameraManager: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html` | the system camera manager. |
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | the ID of the camera device. |
| `cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the camera extension mode. Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper?` | a `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance, or null if unsupported. |

### loadFrom

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun loadFrom(context: Context, cameraId: CameraId, cameraExtension: Int): CameraExtensionCharacteristicsWrapper?
```

Loads and wraps `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/content/Context.html`.

Returns `null` if the API level is less than 31 or if the extension is not supported by the camera device.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | the application context. |
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | the ID of the camera device. |
| `cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the camera extension mode. Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper?` | a `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance, or null if unsupported. |

### wrap

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
@RequiresApi(value = 31)
fun wrap(
    cameraId: CameraId,
    cameraExtension: Int,
    extensionCharacteristics: CameraExtensionCharacteristics,
    isRestricted: Boolean = false
): CameraExtensionCharacteristicsWrapper
```

Wraps an existing `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` instance.

| Parameters |
|---|---|
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | the ID of the camera device. |
| `cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the camera extension mode. Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |
| `extensionCharacteristics: https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | the native camera extension characteristics instance. |
| `isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether access to some characteristics keys is restricted. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | a `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance wrapping the native object. |