pub struct Gamma(/* private fields */);Expand description
Full re-export of zenpixels core types (zero module name collisions!).
Validated pure power decoding gamma (L = v^gamma, OETF v^(1/gamma)).
Unambiguously stores the decoding (EOTF) exponent (e.g. 2.2 for standard
gamma 2.2, 2.6 for DCI-P3 theater, 1.8 for legacy ProPhoto/Apple).
Stored internally as NonZeroU32 IEEE 754 bit pattern so Option<Gamma> fits in 4 bytes.
Implementations§
Source§impl Gamma
impl Gamma
Sourcepub const DCI_2_6: Gamma
pub const DCI_2_6: Gamma
Pure power decoding gamma 2.6 (distinct from H.273 TC=17 Transfer::DciCinema,
which scales encoded cinema white by 48 / 52.37).
Sourcepub const fn new(exponent: f32) -> Option<Gamma>
pub const fn new(exponent: f32) -> Option<Gamma>
Construct a validated decoding gamma (0.0 < exponent <= 100.0, finite).
Sourcepub const fn from_encoding_gamma(encoding_gamma: f32) -> Option<Gamma>
pub const fn from_encoding_gamma(encoding_gamma: f32) -> Option<Gamma>
Construct from an encoding gamma (e.g. JPEG XL gamma / PNG gAMA, v = L^enc_gamma),
storing the reciprocal decoding exponent 1.0 / enc_gamma.
Trait Implementations§
impl Copy for Gamma
impl Eq for Gamma
impl StructuralPartialEq for Gamma
Auto Trait Implementations§
impl Freeze for Gamma
impl RefUnwindSafe for Gamma
impl Send for Gamma
impl Sync for Gamma
impl Unpin for Gamma
impl UnsafeUnpin for Gamma
impl UnwindSafe for Gamma
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