# FakeDynamicRangeProfiles

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

*** ** * ** ***


```
class FakeDynamicRangeProfiles : DynamicRangeProfilesWrapper
```

<br />

*** ** * ** ***

A fake implementation of `https://developer.android.com/reference/kotlin/androidx/camera/common/DynamicRangeProfilesWrapper` for testing.

This class allows setting mock values for supported profiles, capture request constraints, and extra latency profiles.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeDynamicRangeProfiles#FakeDynamicRangeProfiles(kotlin.collections.Set,kotlin.collections.Map,kotlin.collections.Set)( supportedProfiles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>, compatibleProfiles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>>, extraLatencyProfiles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html> )` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeDynamicRangeProfiles#getCompatibleProfiles(kotlin.Long)(profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns a set of supported dynamic range profiles that can be referenced in a single capture request along with the given profile. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeDynamicRangeProfiles#hasExtraLatency(kotlin.Long)(profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Checks whether a given dynamic range profile incurs extra latency. |
| `open T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeDynamicRangeProfiles#unwrapAs(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<T>)` Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeDynamicRangeProfiles#supportedProfiles()` Returns a set of supported dynamic range profiles. |

## Public constructors

### FakeDynamicRangeProfiles

```
FakeDynamicRangeProfiles(
    supportedProfiles: Set<Long> = setOf(DynamicRangeProfilesWrapper.STANDARD),
    compatibleProfiles: Map<Long, Set<Long>> = emptyMap(),
    extraLatencyProfiles: Set<Long> = emptySet()
)
```

## Public functions

### getCompatibleProfiles

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

```
open fun getCompatibleProfiles(profile: Long): Set<Long>
```

Returns a set of supported dynamic range profiles that can be referenced in a single capture request along with the given profile.

A profile is always compatible with itself, and is included in the returned set.

| Parameters |
|---|---|
| `profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The dynamic range profile to query compatibility for. Value is one of the following: - `1` - `2` - `4` - `8` - `16` - `32` - `64` - `128` - `256` - `512` - `1024` - `2048` - `4096` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | An unmodifiable set of supported dynamic range profiles. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles.html#getProfileCaptureRequestConstraints(long)` |   |

### hasExtraLatency

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

```
open fun hasExtraLatency(profile: Long): Boolean
```

Checks whether a given dynamic range profile incurs extra latency.

Profiles that incur extra latency may not be suitable for latency-sensitive use cases, such as real-time previews.

| Parameters |
|---|---|
| `profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The dynamic range profile to check. Value is one of the following: - `1` - `2` - `4` - `8` - `16` - `32` - `64` - `128` - `256` - `512` - `1024` - `2048` - `4096` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the profile incurs extra latency, `false` otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles.html#isExtraLatencyPresent(long)` |   |

### unwrapAs

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

```
open fun <T : Any> unwrapAs(type: Class<T>): T?
```

Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`.

Callers should use this method to retrieve the wrapped platform object.

### Implementation Notes

- If the requested `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)` is not supported by this wrapper, this method must return `null`.

- Implementations designed for testing (e.g., fakes, mocks, or no-op wrappers) should return `null` to signal that no real underlying object is available.

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | The expected type of the underlying object. |
| `type: https://developer.android.com/reference/java/lang/Class.html<T>` | The `https://developer.android.com/reference/java/lang/Class.html` representing the expected type of the underlying object. |

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

## Public properties

### supportedProfiles

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

```
open val supportedProfiles: Set<Long>
```

Returns a set of supported dynamic range profiles.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | An unmodifiable set of supported dynamic range profiles. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles.html#getSupportedProfiles()` |   |