DynamicRange


class DynamicRange


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 HLG_10_BIT, but also unspecified HDR dynamic ranges, such as HDR_UNSPECIFIED_10_BIT. When used with a camera API, such as setDynamicRange, 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 SDR. This will be the default dynamic range encoding for most APIs taking dynamic range unless otherwise specified.

See also
setDynamicRange

Summary

Constants

const Int

Ten-bit bit depth.

const Int

Eight-bit bit depth.

const Int

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

const DynamicRange

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

const DynamicRange

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

const Int

Dolby Vision dynamic range encoding.

const Int

HDR10 dynamic range encoding.

const Int

HDR10+ dynamic range encoding.

const Int

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

const Int

Hybrid Log Gamma (HLG) dynamic range encoding.

const Int

Standard Dynamic Range (SDR) encoding.

const Int

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

const DynamicRange

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

const DynamicRange

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

const DynamicRange

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

const DynamicRange

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

const DynamicRange

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

const DynamicRange

A dynamic range with unspecified encoding and bit depth.

Public constructors

DynamicRange(encoding: Int, bitDepth: Int)

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

Public functions

Boolean
equals(o: Any!)
Int

Returns the bit depth used by this dynamic range configuration.

Int

Returns the dynamic range encoding.

Int
String

Constants

BIT_DEPTH_10_BIT

Added in 1.3.0
const val BIT_DEPTH_10_BIT = 10: Int

Ten-bit bit depth.

BIT_DEPTH_8_BIT

Added in 1.3.0
const val BIT_DEPTH_8_BIT = 8: Int

Eight-bit bit depth.

BIT_DEPTH_UNSPECIFIED

Added in 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
const val DOLBY_VISION_10_BITDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_DOLBY_VISION
  Bit Depth: BIT_DEPTH_10_BIT

DOLBY_VISION_8_BIT

Added in 1.3.0
const val DOLBY_VISION_8_BITDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_DOLBY_VISION
  Bit Depth: BIT_DEPTH_8_BIT

ENCODING_DOLBY_VISION

Added in 1.3.0
const val ENCODING_DOLBY_VISION = 6: Int

Dolby Vision dynamic range encoding.

ENCODING_HDR10

Added in 1.3.0
const val ENCODING_HDR10 = 4: Int

HDR10 dynamic range encoding.

ENCODING_HDR10_PLUS

Added in 1.3.0
const val ENCODING_HDR10_PLUS = 5: Int

HDR10+ dynamic range encoding.

ENCODING_HDR_UNSPECIFIED

Added in 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
const val ENCODING_HLG = 3: Int

Hybrid Log Gamma (HLG) dynamic range encoding.

ENCODING_SDR

Added in 1.3.0
const val ENCODING_SDR = 1: Int

Standard Dynamic Range (SDR) encoding.

ENCODING_UNSPECIFIED

Added in 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
const val HDR10_10_BITDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_HDR10
  Bit Depth: BIT_DEPTH_10_BIT

HDR10_PLUS_10_BIT

Added in 1.3.0
const val HDR10_PLUS_10_BITDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_HDR10_PLUS
  Bit Depth: BIT_DEPTH_10_BIT

HDR_UNSPECIFIED_10_BIT

Added in 1.3.0
const val HDR_UNSPECIFIED_10_BITDynamicRange

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:

  Encoding: ENCODING_HDR_UNSPECIFIED
  Bit Depth: BIT_DEPTH_10_BIT

HLG_10_BIT

Added in 1.3.0
const val HLG_10_BITDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_HLG
  Bit Depth: BIT_DEPTH_10_BIT

SDR

Added in 1.3.0
const val SDRDynamicRange

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

This dynamic range is composed of:

  Encoding: ENCODING_SDR
  Bit Depth: BIT_DEPTH_8_BIT

UNSPECIFIED

Added in 1.3.0
const val UNSPECIFIEDDynamicRange

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:

  Encoding: ENCODING_UNSPECIFIED
  Bit Depth: BIT_DEPTH_UNSPECIFIED

Public constructors

DynamicRange

Added in 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: Int

The dynamic range encoding.

bitDepth: Int

The bit depth.

Public functions

equals

fun equals(o: Any!): Boolean

getBitDepth

Added in 1.3.0
fun getBitDepth(): Int

Returns the bit depth used by this dynamic range configuration.

Common values are BIT_DEPTH_8_BIT, such as for ENCODING_SDR or BIT_DEPTH_10_BIT, such as for ENCODING_HDR10.

Returns
Int

The bit depth. Possible values are BIT_DEPTH_8_BIT, BIT_DEPTH_10_BIT, or BIT_DEPTH_UNSPECIFIED.

getEncoding

Added in 1.3.0
fun getEncoding(): Int

Returns the dynamic range encoding.

Returns
Int

The dynamic range encoding. Possible values are ENCODING_SDR, ENCODING_HLG, ENCODING_HDR10, ENCODING_HDR10_PLUS, or ENCODING_DOLBY_VISION.

hashCode

fun hashCode(): Int

toString

fun toString(): String