Primaries

#[non_exhaustive]
#[repr(u32)]
pub enum Primaries { Srgb = 1, PalM = 2, Pal = 3, Ntsc = 4, GenericFilm = 5, Bt2020 = 6, Cie1931Xyz = 7, DciP3 = 8, DisplayP3 = 9, AdobeRgb = 10, }
Expand description

named color primaries

Named color primaries used to encode well-known sets of primaries. H.273 is the authority, when it comes to the exact values of primaries and authoritative specifications, where an equivalent code point exists.

A value of 0 is invalid and will never be present in the list of enums.

Descriptions do list the specifications for convenience.

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.
§

Srgb = 1

Color primaries for the sRGB color space as defined by the BT.709 standard

Color primaries as defined by

  • Rec. ITU-R BT.709-6
  • Rec. ITU-R BT.1361-0 conventional colour gamut system and extended colour gamut system (historical)
  • IEC 61966-2-1 sRGB or sYCC
  • IEC 61966-2-4
  • Society of Motion Picture and Television Engineers (SMPTE) RP 177 (1993) Annex B Equivalent to H.273 ColourPrimaries code point 1.
§

PalM = 2

Color primaries for PAL-M as defined by the BT.470 standard

Color primaries as defined by

  • Rec. ITU-R BT.470-6 System M (historical)
  • United States National Television System Committee 1953 Recommendation for transmission standards for color television
  • United States Federal Communications Commission (2003) Title 47 Code of Federal Regulations 73.682 (a)(20) Equivalent to H.273 ColourPrimaries code point 4.
§

Pal = 3

Color primaries for PAL as defined by the BT.601 standard

Color primaries as defined by

  • Rec. ITU-R BT.470-6 System B, G (historical)
  • Rec. ITU-R BT.601-7 625
  • Rec. ITU-R BT.1358-0 625 (historical)
  • Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM Equivalent to H.273 ColourPrimaries code point 5.
§

Ntsc = 4

Color primaries for NTSC as defined by the BT.601 standard

Color primaries as defined by

  • Rec. ITU-R BT.601-7 525
  • Rec. ITU-R BT.1358-1 525 or 625 (historical)
  • Rec. ITU-R BT.1700-0 NTSC
  • SMPTE 170M (2004)
  • SMPTE 240M (1999) (historical) Equivalent to H.273 ColourPrimaries code point 6 and 7.
§

GenericFilm = 5

Generic film with colour filters using Illuminant C

Color primaries as defined by H.273 for generic film. Equivalent to H.273 ColourPrimaries code point 8.

§

Bt2020 = 6

Color primaries as defined by the BT.2020 and BT.2100 standard

Color primaries as defined by

  • Rec. ITU-R BT.2020-2
  • Rec. ITU-R BT.2100-0 Equivalent to H.273 ColourPrimaries code point 9.
§

Cie1931Xyz = 7

Color primaries of the full CIE 1931 XYZ color space

Color primaries as defined as the maximum of the CIE 1931 XYZ color space by

  • SMPTE ST 428-1
  • (CIE 1931 XYZ as in ISO 11664-1) Equivalent to H.273 ColourPrimaries code point 10.
§

DciP3 = 8

Color primaries of the DCI P3 color space as defined by the SMPTE RP 431 standard

Color primaries as defined by Digital Cinema System and published in SMPTE RP 431-2 (2011). Equivalent to H.273 ColourPrimaries code point 11.

§

DisplayP3 = 9

Color primaries of Display P3 variant of the DCI-P3 color space as defined by the SMPTE EG 432 standard

Color primaries as defined by Digital Cinema System and published in SMPTE EG 432-1 (2010). Equivalent to H.273 ColourPrimaries code point 12.

§

AdobeRgb = 10

Color primaries of the Adobe RGB color space as defined by the ISO 12640 standard

Color primaries as defined by Adobe as “Adobe RGB” and later published by ISO 12640-4 (2011).

Trait Implementations§

Source§

impl Clone for Primaries

Source§

fn clone(&self) -> Primaries

Returns a duplicate 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 Primaries

Source§

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

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

impl From<Primaries> for u32

Source§

fn from(val: Primaries) -> u32

Converts to this type from the input type.
Source§

impl Hash for Primaries

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 Ord for Primaries

Source§

fn cmp(&self, other: &Primaries) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Primaries

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Primaries

Source§

fn partial_cmp(&self, other: &Primaries) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<u32> for Primaries

Source§

type Error = ()

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

fn try_from(val: u32) -> Result<Primaries, ()>

Performs the conversion.
Source§

impl Copy for Primaries

Source§

impl Eq for Primaries

Source§

impl StructuralPartialEq for Primaries

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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,

Source§

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>,

Source§

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>,

Source§

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.