# DynamicRange

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/DynamicRange.java+class:androidx.camera.core.DynamicRange) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

*** ** * ** ***


```
class DynamicRange
```

<br />

*** ** * ** ***

A representation of the dynamic range of an image.

The dynamic range specifies an encoding for how pixels will be displayed on screen along with the number of bits used to encode each pixel. In general, the encoding represents a set of operations applied to each pixel to expand the range of light and dark pixels on a specific screen. The bit depth represents the discrete number of steps those pixels can assume between the lightest and darkest pixels.

A category of dynamic ranges called high-dynamic range (HDR) are able to encode brighter highlights, darker shadows, and richer color. This class contains constants for specific HDR dynamic ranges, such as `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HLG_10_BIT()`, but also unspecified HDR dynamic ranges, such as `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HDR_UNSPECIFIED_10_BIT()`. When used with a camera API, such as `https://developer.android.com/reference/kotlin/androidx/camera/video/VideoCapture.Builder#setDynamicRange(androidx.camera.core.DynamicRange)`, these unspecified dynamic ranges will use device defaults as the HDR encoding.

The legacy behavior of most devices is to capture in standard dynamic range (SDR), which is represented by `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#SDR()`. This will be the default dynamic range encoding for most APIs taking dynamic range unless otherwise specified.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/video/VideoCapture.Builder#setDynamicRange(androidx.camera.core.DynamicRange)` |   |

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_10_BIT() = 10` Ten-bit bit depth. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_8_BIT() = 8` Eight-bit bit depth. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_UNSPECIFIED() = 0` Bit depth is unspecified and may be determined automatically by the device. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#DOLBY_VISION_10_BIT()` A 10-bit high-dynamic range with Dolby Vision encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#DOLBY_VISION_8_BIT()` An 8-bit high-dynamic range with Dolby Vision encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_DOLBY_VISION() = 6` Dolby Vision dynamic range encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR10() = 4` HDR10 dynamic range encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR10_PLUS() = 5` HDR10+ dynamic range encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR_UNSPECIFIED() = 2` An unspecified dynamic range encoding which allows the device to determine the underlying dynamic range encoding, limited to High Dynamic Range (HDR) encodings. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HLG() = 3` Hybrid Log Gamma (HLG) dynamic range encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_SDR() = 1` Standard Dynamic Range (SDR) encoding. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_UNSPECIFIED() = 0` An unspecified dynamic range encoding which allows the device to determine the underlying dynamic range encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HDR10_10_BIT()` A 10-bit high-dynamic range with HDR10 encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HDR10_PLUS_10_BIT()` A 10-bit high-dynamic range with HDR10+ encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HDR_UNSPECIFIED_10_BIT()` A dynamic range representing 10-bit high dynamic range (HDR) with unspecified encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#HLG_10_BIT()` A 10-bit high-dynamic range with HLG encoding. |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#SDR()` A dynamic range representing 8-bit standard dynamic range (SDR). |
| `const https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#UNSPECIFIED()` A dynamic range with unspecified encoding and bit depth. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#DynamicRange(int,int)(encoding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bitDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a dynamic range representation from a encoding and bit depth. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#getBitDepth()()` Returns the bit depth used by this dynamic range configuration. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#getEncoding()()` Returns the dynamic range encoding. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#toString()()` |

## Constants

### BIT_DEPTH_10_BIT

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

```
const val BIT_DEPTH_10_BIT = 10: Int
```

Ten-bit bit depth.

### BIT_DEPTH_8_BIT

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

```
const val BIT_DEPTH_8_BIT = 8: Int
```

Eight-bit bit depth.

### BIT_DEPTH_UNSPECIFIED

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

```
const val BIT_DEPTH_UNSPECIFIED = 0: Int
```

Bit depth is unspecified and may be determined automatically by the device.

### DOLBY_VISION_10_BIT

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

```
const val DOLBY_VISION_10_BIT: DynamicRange
```

A 10-bit high-dynamic range with Dolby Vision encoding.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_DOLBY_VISION
  Bit Depth: BIT_DEPTH_10_BIT
```

### DOLBY_VISION_8_BIT

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

```
const val DOLBY_VISION_8_BIT: DynamicRange
```

An 8-bit high-dynamic range with Dolby Vision encoding.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_DOLBY_VISION
  Bit Depth: BIT_DEPTH_8_BIT
```

### ENCODING_DOLBY_VISION

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

```
const val ENCODING_DOLBY_VISION = 6: Int
```

Dolby Vision dynamic range encoding.

### ENCODING_HDR10

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

```
const val ENCODING_HDR10 = 4: Int
```

HDR10 dynamic range encoding.

### ENCODING_HDR10_PLUS

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

```
const val ENCODING_HDR10_PLUS = 5: Int
```

HDR10+ dynamic range encoding.

### ENCODING_HDR_UNSPECIFIED

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

```
const val ENCODING_HDR_UNSPECIFIED = 2: Int
```

An unspecified dynamic range encoding which allows the device to determine the underlying dynamic range encoding, limited to High Dynamic Range (HDR) encodings.

### ENCODING_HLG

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

```
const val ENCODING_HLG = 3: Int
```

Hybrid Log Gamma (HLG) dynamic range encoding.

### ENCODING_SDR

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

```
const val ENCODING_SDR = 1: Int
```

Standard Dynamic Range (SDR) encoding.

### ENCODING_UNSPECIFIED

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

```
const val ENCODING_UNSPECIFIED = 0: Int
```

An unspecified dynamic range encoding which allows the device to determine the underlying dynamic range encoding.

### HDR10_10_BIT

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

```
const val HDR10_10_BIT: DynamicRange
```

A 10-bit high-dynamic range with HDR10 encoding.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_HDR10
  Bit Depth: BIT_DEPTH_10_BIT
```

### HDR10_PLUS_10_BIT

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

```
const val HDR10_PLUS_10_BIT: DynamicRange
```

A 10-bit high-dynamic range with HDR10+ encoding.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_HDR10_PLUS
  Bit Depth: BIT_DEPTH_10_BIT
```

### HDR_UNSPECIFIED_10_BIT

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

```
const val HDR_UNSPECIFIED_10_BIT: DynamicRange
```

A dynamic range representing 10-bit high dynamic range (HDR) with unspecified encoding.

The HDR encoding is unspecified, and may defer to device defaults when used to select a dynamic range. In this case, the dynamic range will be limited to 10-bit high dynamic ranges.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_HDR_UNSPECIFIED
  Bit Depth: BIT_DEPTH_10_BIT
```

### HLG_10_BIT

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

```
const val HLG_10_BIT: DynamicRange
```

A 10-bit high-dynamic range with HLG encoding.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_HLG
  Bit Depth: BIT_DEPTH_10_BIT
```

### SDR

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

```
const val SDR: DynamicRange
```

A dynamic range representing 8-bit standard dynamic range (SDR).

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_SDR
  Bit Depth: BIT_DEPTH_8_BIT
```

### UNSPECIFIED

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

```
const val UNSPECIFIED: DynamicRange
```

A dynamic range with unspecified encoding and bit depth.

The dynamic range is unspecified and may defer to device defaults when used to select a dynamic range.

This dynamic range is composed of:

```kotlin
  Encoding: ENCODING_UNSPECIFIED
  Bit Depth: BIT_DEPTH_UNSPECIFIED
```

## Public constructors

### DynamicRange

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

```
DynamicRange(encoding: Int, bitDepth: Int)
```

Creates a dynamic range representation from a encoding and bit depth.

This constructor is left public for testing purposes. It does not do any verification that the provided arguments are a valid combination of encoding and bit depth.

| Parameters |
|---|---|
| `encoding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The dynamic range encoding. |
| `bitDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The bit depth. |

## Public functions

### equals

```
fun equals(o: Any!): Boolean
```

### getBitDepth

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

```
fun getBitDepth(): Int
```

Returns the bit depth used by this dynamic range configuration.

Common values are `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_8_BIT()`, such as for `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_SDR()` or `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_10_BIT()`, such as for `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR10()`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The bit depth. Possible values are `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_8_BIT()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_10_BIT()`, or `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#BIT_DEPTH_UNSPECIFIED()`. |

### getEncoding

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

```
fun getEncoding(): Int
```

Returns the dynamic range encoding.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The dynamic range encoding. Possible values are `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_SDR()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HLG()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR10()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_HDR10_PLUS()`, or `https://developer.android.com/reference/kotlin/androidx/camera/core/DynamicRange#ENCODING_DOLBY_VISION()`. |

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```