#[non_exhaustive]pub enum ColorTransfer {
Bt709,
Bt2020_10,
Bt2020_12,
Hlg,
Pq,
Linear,
Unknown,
}Expand description
Color transfer characteristic (opto-electronic transfer function).
The transfer characteristic defines how scene luminance maps to the signal level stored in the video bitstream. Different HDR and SDR standards use different curves.
§Common Usage
Bt709: Standard SDR video (HD television)Pq: HDR10 and Dolby Vision (SMPTE ST 2084 / Perceptual Quantizer)Hlg: Hybrid Log-Gamma — broadcast-compatible HDR (ARIB STD-B67)Bt2020_10/Bt2020_12: BT.2020 SDR at 10/12-bit depthLinear: Linear light, no gamma applied
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bt709
ITU-R BT.709 transfer characteristic (standard SDR)
Bt2020_10
ITU-R BT.2020 for 10-bit content
Bt2020_12
ITU-R BT.2020 for 12-bit content
Hlg
Hybrid Log-Gamma (ARIB STD-B67) — broadcast HDR
Pq
Perceptual Quantizer / SMPTE ST 2084 — HDR10
Linear
Linear light transfer (no gamma)
Unknown
Transfer characteristic is not specified or unknown
Implementations§
Source§impl ColorTransfer
impl ColorTransfer
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
Returns the name of the color transfer characteristic as a string.
§Examples
use ff_format::color::ColorTransfer;
assert_eq!(ColorTransfer::Bt709.name(), "bt709");
assert_eq!(ColorTransfer::Hlg.name(), "hlg");
assert_eq!(ColorTransfer::Pq.name(), "pq");Sourcepub const fn is_hdr(&self) -> bool
pub const fn is_hdr(&self) -> bool
Returns true if this is an HDR transfer characteristic (Pq or Hlg).
§Examples
use ff_format::color::ColorTransfer;
assert!(ColorTransfer::Pq.is_hdr());
assert!(ColorTransfer::Hlg.is_hdr());
assert!(!ColorTransfer::Bt709.is_hdr());Sourcepub const fn is_hlg(&self) -> bool
pub const fn is_hlg(&self) -> bool
Returns true if this is Hybrid Log-Gamma (HLG).
§Examples
use ff_format::color::ColorTransfer;
assert!(ColorTransfer::Hlg.is_hlg());
assert!(!ColorTransfer::Pq.is_hlg());Sourcepub const fn is_pq(&self) -> bool
pub const fn is_pq(&self) -> bool
Returns true if this is Perceptual Quantizer / SMPTE ST 2084 (PQ).
§Examples
use ff_format::color::ColorTransfer;
assert!(ColorTransfer::Pq.is_pq());
assert!(!ColorTransfer::Hlg.is_pq());Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if the transfer characteristic is unknown.
§Examples
use ff_format::color::ColorTransfer;
assert!(ColorTransfer::Unknown.is_unknown());
assert!(!ColorTransfer::Bt709.is_unknown());Trait Implementations§
Source§impl Clone for ColorTransfer
impl Clone for ColorTransfer
Source§fn clone(&self) -> ColorTransfer
fn clone(&self) -> ColorTransfer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more