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, }
Available on crate feature 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
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

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

source§

fn clone(&self) -> DataSpaceRange

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 DataSpaceRange

source§

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

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

impl From<DataSpaceRange> for i32

source§

fn from(enum_value: DataSpaceRange) -> Self

Converts to this type from the input type.
source§

impl From<i32> for DataSpaceRange

source§

fn from(number: i32) -> Self

Converts to this type from the input type.
source§

impl FromPrimitive for DataSpaceRange

§

type Primitive = i32

source§

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

source§

impl Hash for DataSpaceRange

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 DataSpaceRange

source§

fn eq(&self, other: &DataSpaceRange) -> 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 DataSpaceRange

source§

impl Eq for DataSpaceRange

source§

impl StructuralPartialEq for DataSpaceRange

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.