Enum ndk::data_space::DataSpaceStandard

source ·
#[non_exhaustive]
#[repr(i32)]
pub enum DataSpaceStandard { Unspecified = 0, Bt709 = 65_536, Bt601_625 = 131_072, Bt601_625Unadjusted = 196_608, Bt601_525 = 262_144, Bt601_525Unadjusted = 327_680, Bt2020 = 393_216, Bt2020ConstantLuminance = 458_752, Bt470M = 524_288, Film = 589_824, DciP3 = 655_360, AdobeRgb = 720_896, }
Available on crate feature api-level-28 only.
Expand description

Color-description aspects.

The following aspects define various characteristics of the color specification. These represent bitfields, so that a data space value can specify each of them independently. Standard aspect defines the chromaticity coordinates of the source primaries in terms of the CIE 1931 definition of x and y specified in ISO 11664-1.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unspecified = 0

Chromacity coordinates are unknown or are determined by the application. Implementations shall use the following suggested standards:

All YCbCr formats: BT.709 if size is 720p or larger (since most video content is letterboxed this corresponds to width is 1280 or greater, or height is 720 or greater). BT.601_625 if size is smaller than 720p or is JPEG. All RGB formats: BT.709.

For all other formats the standard is undefined, and implementations should use an appropriate standard for the data represented.

§

Bt709 = 65_536

Primariesxy
green0.3000.600
blue0.1500.060
red0.6400.330
white (D65)0.31270.3290

Use the unadjusted KR = 0.2126, KB = 0.0722 luminance interpretation for RGB conversion.

§

Bt601_625 = 131_072

Primariesxy
green0.2900.600
blue0.1500.060
red0.6400.330
white (D65)0.31270.3290

KR = 0.299, KB = 0.114. This adjusts the luminance interpretation for RGB conversion from the one purely determined by the primaries to minimize the color shift into RGB space that uses BT.709 primaries.

§

Bt601_625Unadjusted = 196_608

Primariesxy
green0.2900.600
blue0.1500.060
red0.6400.330
white (D65)0.31270.3290

Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation for RGB conversion.

§

Bt601_525 = 262_144

Primariesxy
green0.3100.595
blue0.1550.070
red0.6300.340
white (D65)0.31270.3290

KR = 0.299, KB = 0.114. This adjusts the luminance interpretation for RGB conversion from the one purely determined by the primaries to minimize the color shift into RGB space that uses BT.709 primaries.

§

Bt601_525Unadjusted = 327_680

Primariesxy
green0.3100.595
blue0.1550.070
red0.6300.340
white (D65)0.31270.3290

Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation for RGB conversion (as in SMPTE 240M).

§

Bt2020 = 393_216

Primariesxy
green0.1700.797
blue0.1310.046
red0.7080.292
white (D65)0.31270.3290

Use the unadjusted KR = 0.2627, KB = 0.0593 luminance interpretation for RGB conversion.

§

Bt2020ConstantLuminance = 458_752

Primariesxy
green0.1700.797
blue0.1310.046
red0.7080.292
white (D65)0.31270.3290

Use the unadjusted KR = 0.2627, KB = 0.0593 luminance interpretation for RGB conversion using the linear domain.

§

Bt470M = 524_288

Primariesxy
green0.210.71
blue0.140.08
red0.670.33
white (C)0.3100.316

Use the unadjusted KR = 0.30, KB = 0.11 luminance interpretation for RGB conversion.

§

Film = 589_824

Primariesxy
green0.2430.692
blue0.1450.049
red0.6810.319
white (C)0.3100.316

Use the unadjusted KR = 0.254, KB = 0.068 luminance interpretation for RGB conversion.

§

DciP3 = 655_360

SMPTE EG 432-1 and SMPTE RP 431-2. (DCI-P3)

Primariesxy
green0.2650.690
blue0.1500.060
red0.6800.320
white (D65)0.31270.3290
§

AdobeRgb = 720_896

Adobe RGB

Primariesxy
green0.2100.710
blue0.1500.060
red0.6400.330
white (D65)0.31270.3290

Trait Implementations§

source§

impl Clone for DataSpaceStandard

source§

fn clone(&self) -> DataSpaceStandard

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DataSpaceStandard

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<DataSpaceStandard> for i32

source§

fn from(enum_value: DataSpaceStandard) -> Self

Converts to this type from the input type.
source§

impl From<i32> for DataSpaceStandard

source§

fn from(number: i32) -> Self

Converts to this type from the input type.
source§

impl FromPrimitive for DataSpaceStandard

§

type Primitive = i32

source§

fn from_primitive(number: Self::Primitive) -> Self

source§

impl Hash for DataSpaceStandard

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for DataSpaceStandard

source§

fn eq(&self, other: &DataSpaceStandard) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for DataSpaceStandard

source§

impl Eq for DataSpaceStandard

source§

impl StructuralPartialEq for DataSpaceStandard

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.