# FakeColorSpaceProfiles

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

*** ** * ** ***


```
public final class FakeColorSpaceProfiles implements ColorSpaceProfilesWrapper
```

<br />

*** ** * ** ***

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

Allows mock values to be configured for supported color spaces, image formats, and dynamic range profiles.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#FakeColorSpaceProfiles(kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>> supportedColorSpaces, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>> supportedImageFormats, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>> supportedDynamicRangeProfiles, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>> supportedColorSpacesForDynamicRange )` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#getSupportedColorSpaces(kotlin.Int)(int imageFormat)` Get the supported color spaces for a given image format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#getSupportedColorSpacesForDynamicRange(kotlin.Int,kotlin.Long)( int imageFormat, long dynamicRangeProfile )` Get the supported color spaces for a given image format and dynamic range profile. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#getSupportedDynamicRangeProfiles(kotlin.String,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraColorSpace, int imageFormat )` Get the supported dynamic range profiles for a given color space and image format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#getSupportedImageFormatsForColorSpace(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraColorSpace)` Get the supported image formats for a given color space. |
| `T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/testing/FakeColorSpaceProfiles#unwrapAs(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> type)` Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |

## Public constructors

### FakeColorSpaceProfiles

```
public FakeColorSpaceProfiles(
    @NonNull Map<@NonNull Integer, @NonNull Set<@NonNull String>> supportedColorSpaces,
    @NonNull Map<@NonNull String, @NonNull Set<@NonNull Integer>> supportedImageFormats,
    @NonNull Map<@NonNull Pair<@NonNull String, @NonNull Integer>, @NonNull Set<@NonNull Long>> supportedDynamicRangeProfiles,
    @NonNull Map<@NonNull Pair<@NonNull Integer, @NonNull Long>, @NonNull Set<@NonNull String>> supportedColorSpacesForDynamicRange
)
```

## Public methods

### getSupportedColorSpaces

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

```
public @NonNull Set<@NonNull String> getSupportedColorSpaces(int imageFormat)
```

Get the supported color spaces for a given image format.

| Parameters |
|---|---|
| `int imageFormat` | The image format to query. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | The set of supported `https://developer.android.com/reference/androidx/camera/common/CameraColorSpace`s. |

### getSupportedColorSpacesForDynamicRange

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

```
public @NonNull Set<@NonNull String> getSupportedColorSpacesForDynamicRange(
    int imageFormat,
    long dynamicRangeProfile
)
```

Get the supported color spaces for a given image format and dynamic range profile.

| Parameters |
|---|---|
| `int imageFormat` | The image format to query. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |
| `long dynamicRangeProfile` | The dynamic range profile to query. Value is one of the following: - `1` - `2` - `4` - `8` - `16` - `32` - `64` - `128` - `256` - `512` - `1024` - `2048` - `4096` <br /> |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | The set of supported `https://developer.android.com/reference/androidx/camera/common/CameraColorSpace`s. |

### getSupportedDynamicRangeProfiles

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

```
public @NonNull Set<@NonNull Long> getSupportedDynamicRangeProfiles(
    @NonNull String cameraColorSpace,
    int imageFormat
)
```

Get the supported dynamic range profiles for a given color space and image format.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraColorSpace` | The `https://developer.android.com/reference/androidx/camera/common/CameraColorSpace` to query. Value is one of the following: - `UNKNOWN` - `SRGB` - `LINEAR_SRGB` - `EXTENDED_SRGB` - `LINEAR_EXTENDED_SRGB` - `BT709` - `BT2020` - `DCI_P3` - `DISPLAY_P3` - `NTSC_1953` - `SMPTE_C` - `ADOBE_RGB` - `PRO_PHOTO_RGB` - `ACES` - `ACESCG` - `CIE_XYZ` - `CIE_LAB` - `BT2020_HLG` - `BT2020_PQ` <br /> |
| `int imageFormat` | The image format to query. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>` | A set of framework dynamic range profiles (e.g., `https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles.html#HDR10`) |

### getSupportedImageFormatsForColorSpace

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

```
public @NonNull Set<@NonNull Integer> getSupportedImageFormatsForColorSpace(@NonNull String cameraColorSpace)
```

Get the supported image formats for a given color space.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraColorSpace` | The `https://developer.android.com/reference/androidx/camera/common/CameraColorSpace` to query. Value is one of the following: - `UNKNOWN` - `SRGB` - `LINEAR_SRGB` - `EXTENDED_SRGB` - `LINEAR_EXTENDED_SRGB` - `BT709` - `BT2020` - `DCI_P3` - `DISPLAY_P3` - `NTSC_1953` - `SMPTE_C` - `ADOBE_RGB` - `PRO_PHOTO_RGB` - `ACES` - `ACESCG` - `CIE_XYZ` - `CIE_LAB` - `BT2020_HLG` - `BT2020_PQ` <br /> |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>` | The set of supported image formats. |

### unwrapAs

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

```
public T <T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)
```

Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/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/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 extends https://developer.android.com/reference/java/lang/Object.html>` | The expected type of the underlying object. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> type` | 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/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`, or `null` if the object cannot be unwrapped into the requested `https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |