Enum ndk::data_space::DataSpaceRange
source · #[non_exhaustive]#[repr(i32)]pub enum DataSpaceRange {
Unspecified = 0,
Full = 134_217_728,
Limited = 268_435_456,
Extended = 402_653_184,
}
api-level-28
only.Expand description
Range aspect.
Defines the range of values corresponding to the unit range of 0-1
. This is defined for
YCbCr
only, but can be expanded to RGB
space.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unspecified = 0
Range is unknown or are determined by the application. Implementations shall use the following suggested ranges:
- All YCbCr formats: limited range.
- All RGB or RGBA formats (including RAW and Bayer): full range.
- All Y formats: full range
For all other formats range is undefined, and implementations should use an appropriate range for the data represented.
Full = 134_217_728
Full range uses all values for Y
, Cb
and Cr
from 0
to 2^b-1
, where b
is the bit
depth of the color format.
Limited = 268_435_456
Limited range uses values 16/256*2^b
to 235/256*2^b
for Y
, and 1/16*2^b
to
15/16*2^b
for Cb
, Cr
, R
, G
and B
, where b
is the bit depth of the color
format.
E.g. For 8-bit-depth formats: Luma (Y
) samples should range from 16
to 235
, inclusive
Chroma (Cb, Cr)
samples should range from 16
to 240
, inclusive.
For 10-bit-depth formats: Luma (Y
) samples should range from 64
to 940
, inclusive
Chroma (Cb, Cr)
samples should range from 64
to 960
, inclusive.
Extended = 402_653_184
Extended range is used for scRGB
.
Intended for use with floating point pixel formats. [0.0 - 1.0]
is the standard sRGB
space. Values outside the range 0.0 - 1.0
can encode color outside the sRGB
gamut. Used
to blend / merge multiple dataspaces on a single display.
Trait Implementations§
source§impl Clone for DataSpaceRange
impl Clone for DataSpaceRange
source§fn clone(&self) -> DataSpaceRange
fn clone(&self) -> DataSpaceRange
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DataSpaceRange
impl Debug for DataSpaceRange
source§impl From<DataSpaceRange> for i32
impl From<DataSpaceRange> for i32
source§fn from(enum_value: DataSpaceRange) -> Self
fn from(enum_value: DataSpaceRange) -> Self
source§impl From<i32> for DataSpaceRange
impl From<i32> for DataSpaceRange
source§impl FromPrimitive for DataSpaceRange
impl FromPrimitive for DataSpaceRange
source§impl Hash for DataSpaceRange
impl Hash for DataSpaceRange
source§impl PartialEq for DataSpaceRange
impl PartialEq for DataSpaceRange
source§fn eq(&self, other: &DataSpaceRange) -> bool
fn eq(&self, other: &DataSpaceRange) -> bool
self
and other
values to be equal, and is used
by ==
.