pub enum Primaries {
Srgb,
DisplayP3,
Bt2020,
Custom {
r: [f64; 2],
g: [f64; 2],
b: [f64; 2],
w: [f64; 2],
},
}Expand description
The primaries (and white) of an encoding.
Variants§
Srgb
BT.709 / sRGB.
DisplayP3
Bt2020
BT.2020 (and BT.2100).
Custom
Chromaticities [x, y] of red, green, blue and white.
Implementations§
Source§impl Primaries
impl Primaries
Sourcepub fn chromaticities(&self) -> [[f64; 2]; 4]
pub fn chromaticities(&self) -> [[f64; 2]; 4]
Red, green, blue and white chromaticities [x, y].
Sourcepub fn to_xyz(&self) -> [[f64; 3]; 3]
pub fn to_xyz(&self) -> [[f64; 3]; 3]
Linear RGB in these primaries to CIE XYZ (white at Y = 1).
Sourcepub fn conversion(from: Primaries, to: Primaries) -> [[f32; 3]; 3]
pub fn conversion(from: Primaries, to: Primaries) -> [[f32; 3]; 3]
The matrix from linear RGB in from to linear RGB in to (no
chromatic adaptation: the named primaries share D65).
Sourcepub fn rank(&self) -> u8
pub fn rank(&self) -> u8
How wide the gamut is, to compare the named ones (sRGB 0, Display P3 1, BT.2020 2); custom primaries count as BT.2020.
pub fn name(&self) -> &'static str
Trait Implementations§
impl Copy for Primaries
impl StructuralPartialEq for Primaries
Auto Trait Implementations§
impl Freeze for Primaries
impl RefUnwindSafe for Primaries
impl Send for Primaries
impl Sync for Primaries
impl Unpin for Primaries
impl UnsafeUnpin for Primaries
impl UnwindSafe for Primaries
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.§fn as_any(&self) -> &(dyn Any + 'static)
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.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.