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 |
BIT_DEPTH_10_BIT = 10Ten-bit bit depth. |
const Int |
BIT_DEPTH_8_BIT = 8Eight-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 |
ENCODING_HDR10 = 4HDR10 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 |
ENCODING_HLG = 3Hybrid Log Gamma (HLG) dynamic range encoding. |
const Int |
ENCODING_SDR = 1Standard 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 |
|
Int |
Returns the bit depth used by this dynamic range configuration. |
Int |
Returns the dynamic range encoding. |
Int |
hashCode() |
String |
toString() |
Constants
BIT_DEPTH_UNSPECIFIED
const val BIT_DEPTH_UNSPECIFIED = 0: Int
Bit depth is unspecified and may be determined automatically by the device.
DOLBY_VISION_10_BIT
const val DOLBY_VISION_10_BIT: DynamicRange
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
const val DOLBY_VISION_8_BIT: DynamicRange
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
const val ENCODING_DOLBY_VISION = 6: Int
Dolby Vision dynamic range encoding.
ENCODING_HDR10_PLUS
const val ENCODING_HDR10_PLUS = 5: Int
HDR10+ dynamic range encoding.
ENCODING_HDR_UNSPECIFIED
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
const val ENCODING_HLG = 3: Int
Hybrid Log Gamma (HLG) dynamic range encoding.
ENCODING_UNSPECIFIED
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
const val HDR10_10_BIT: DynamicRange
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
const val HDR10_PLUS_10_BIT: DynamicRange
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
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:
Encoding: ENCODING_HDR_UNSPECIFIED Bit Depth: BIT_DEPTH_10_BIT
HLG_10_BIT
const val HLG_10_BIT: DynamicRange
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
const val SDR: DynamicRange
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
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:
Encoding: ENCODING_UNSPECIFIED Bit Depth: BIT_DEPTH_UNSPECIFIED
Public constructors
DynamicRange
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.
Public functions
getBitDepth
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 |
getEncoding
fun getEncoding(): Int
Returns the dynamic range encoding.
| Returns | |
|---|---|
Int |
The dynamic range encoding. Possible values are |