pub enum Transfer {
SrgbPiecewise,
Gamma22,
ExtLinear,
ExtSrgb,
Pq,
Hlg,
}Expand description
The transfer the shader applies before writing.
Variants§
SrgbPiecewise
The sRGB piecewise curve.
Gamma22
A pure 2.2 power.
ExtLinear
Linear, extended range (scRGB): negatives carry the gamut, values above 1.0 the headroom.
ExtSrgb
The sRGB curve continued past 1.0 and mirrored below 0.0 (the extended sRGB colour spaces).
Pq
SMPTE ST 2084 (PQ): absolute luminance, 1.0 the signal of 10 000 nits.
Hlg
BT.2100 hybrid log-gamma, with SDR white at 75 % of the signal (BT.2408).
Implementations§
Source§impl Transfer
impl Transfer
Sourcepub fn encode(self, v: f32) -> f32
pub fn encode(self, v: f32) -> f32
Encodes a linear value (1.0 is SDR white), SDR white at
HDR_REFERENCE_WHITE nits for PQ.
Sourcepub fn encode_at(self, v: f32, white_nits: f32) -> f32
pub fn encode_at(self, v: f32, white_nits: f32) -> f32
Encodes a linear value, SDR white at white_nits (used by PQ
only, which is absolute).
Sourcepub fn decode(self, v: f32) -> f32
pub fn decode(self, v: f32) -> f32
Decodes a signal back to linear (1.0 is SDR white), SDR white at
HDR_REFERENCE_WHITE nits for PQ.
Sourcepub fn decode_at(self, v: f32, white_nits: f32) -> f32
pub fn decode_at(self, v: f32, white_nits: f32) -> f32
Decodes a signal back to linear, SDR white at white_nits.
Sourcepub fn is_extended(self) -> bool
pub fn is_extended(self) -> bool
Whether negatives are carried (any gamut through any primaries).
Sourcepub fn max_headroom(self, white_nits: f32) -> f32
pub fn max_headroom(self, white_nits: f32) -> f32
The highest headroom the transfer carries (relative to SDR white).
pub fn name(self) -> &'static str
Trait Implementations§
impl Copy for Transfer
impl Eq for Transfer
impl StructuralPartialEq for Transfer
Auto Trait Implementations§
impl Freeze for Transfer
impl RefUnwindSafe for Transfer
impl Send for Transfer
impl Sync for Transfer
impl Unpin for Transfer
impl UnsafeUnpin for Transfer
impl UnwindSafe for Transfer
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
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>
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>
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)
&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)
&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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
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>
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
T, using the provided data to resolve any offsets.