pub struct ColorEncoding {
pub primaries: Primaries,
pub transfer: TransferFunction,
pub matrix: MatrixCoefficients,
pub full_range: bool,
}Expand description
CICP-style colour encoding: the primaries + transfer + matrix the image is
authored in, plus the sample range. Drives both the HEIF colr (nclx) box and
the HEVC VUI signalling.
Fields§
§primaries: Primaries§transfer: TransferFunction§matrix: MatrixCoefficients§full_range: boolImplementations§
Source§impl ColorEncoding
impl ColorEncoding
Sourcepub const fn srgb() -> Self
pub const fn srgb() -> Self
sRGB: BT.709 primaries, sRGB transfer, BT.709 matrix, full range. This is the encoder’s working colour space (full-range BT.709 RGB→YCbCr).
Sourcepub const fn bt2020_pq() -> Self
pub const fn bt2020_pq() -> Self
BT.2020 PQ (HDR10): BT.2020 primaries, PQ transfer, BT.2020 NCL matrix.
Sourcepub fn nclx_payload(&self) -> Vec<u8> ⓘ
pub fn nclx_payload(&self) -> Vec<u8> ⓘ
The nclx payload for a HEIF colr box (without the box header):
colour_type (‘nclx’) + the four CICP fields. The full_range_flag occupies
the top bit of the final byte; the low 7 bits are reserved zero.
Trait Implementations§
Source§impl Clone for ColorEncoding
impl Clone for ColorEncoding
Source§fn clone(&self) -> ColorEncoding
fn clone(&self) -> ColorEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColorEncoding
Source§impl Debug for ColorEncoding
impl Debug for ColorEncoding
Source§impl Default for ColorEncoding
impl Default for ColorEncoding
impl Eq for ColorEncoding
Source§impl PartialEq for ColorEncoding
impl PartialEq for ColorEncoding
Source§fn eq(&self, other: &ColorEncoding) -> bool
fn eq(&self, other: &ColorEncoding) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ColorEncoding
Auto Trait Implementations§
impl Freeze for ColorEncoding
impl RefUnwindSafe for ColorEncoding
impl Send for ColorEncoding
impl Sync for ColorEncoding
impl Unpin for ColorEncoding
impl UnsafeUnpin for ColorEncoding
impl UnwindSafe for ColorEncoding
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