#[non_exhaustive]pub enum Transfer {
}Expand description
Electro-optical transfer function (non-linear curve between stored values and light).
Covers all 16 standardized ITU-T H.273 Table 3 TransferCharacteristics codes losslessly
(Transfer::from_cicp(tc)?.to_cicp() == Some(tc)), plus Adobe RGB (563/256) and
arbitrary validated pure-power Gamma.
Distinct variants that share an identical mathematical curve (e.g. Self::Bt709,
Self::Bt601, Self::Iec61966_2_4, Self::Bt2020_10bit, Self::Bt2020_12bit)
preserve their exact H.273 code on round-trip while reporting true from
Transfer::same_curve.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Linear
Linear light (L = v, CICP 8).
Srgb
IEC 61966-2-1 sRGB curve (CICP 13).
Bt709
ITU-R BT.709-6 camera curve (CICP 1).
Gamma22
Pure power curve v^2.2 (ITU-R BT.470-6 System M, CICP 4).
Distinct from Self::AdobeRgb (v^(563/256) = 2.19921875).
Gamma28
Pure power curve v^2.8 (ITU-R BT.470-6 System B, G, CICP 5).
Bt601
ITU-R BT.601-7 / SMPTE 170M curve (CICP 6; identical curve to Self::Bt709, distinct code).
Smpte240M
SMPTE 240M curve (α = 1.1115, slope 4.0, CICP 7).
Log100
Logarithmic transfer (100:1 dynamic range, CICP 9).
Log100Sqrt10
Logarithmic transfer (100 * sqrt(10):1 dynamic range, CICP 10).
Iec61966_2_4
IEC 61966-2-4 extended xvYCC curve (CICP 11; odd-symmetric BT.709).
Bt1361
ITU-R BT.1361-0 extended colour gamut system (CICP 12).
Bt2020_10bit
ITU-R BT.2020-2 10-bit curve (CICP 14; identical curve to Self::Bt709, distinct code).
Bt2020_12bit
ITU-R BT.2020-2 12-bit curve (CICP 15; identical curve to Self::Bt709, distinct code).
AdobeRgb
Adobe RGB (1998) pure power curve v^(563/256) (2.19921875, no exact H.273 code).
DciCinema
SMPTE ST 428-1 digital cinema transfer (CICP 17: L = (52.37 / 48.0) * v^2.6,
where L = 1.0 = 48 cd/m² theater white encodes to (48 / 52.37)^(1/2.6) ≈ 0.967043).
Distinct from pure power Self::Gamma(Gamma::DCI_2_6) (L = v^2.6).
Gamma(Gamma)
Explicit validated pure decoding gamma L = v^gamma (JXL, pure 2.6, PNG gAMA).
Pq
SMPTE ST 2084 Perceptual Quantizer (absolute 0..=10,000 cd/m², CICP 16).
Hlg(HlgMode)
ARIB STD-B67 / ITU-R BT.2100 Hybrid Log-Gamma (CICP 18).
Unknown
Unspecified / unknown transfer curve.
Implementations§
Source§impl Transfer
impl Transfer
Sourcepub const fn is_bt709_curve(self) -> bool
pub const fn is_bt709_curve(self) -> bool
Whether this transfer uses the exact BT.709 / BT.601 / BT.2020 / xvYCC transfer equation.
Sourcepub const fn same_curve(self, other: Transfer) -> bool
pub const fn same_curve(self, other: Transfer) -> bool
Whether self and other evaluate the exact same mathematical transfer curve
(for instance Self::Bt709, Self::Bt601, Self::Iec61966_2_4,
Self::Bt2020_10bit, and Self::Bt2020_12bit, or Self::Gamma matching a named
pure-power curve bit-for-bit).
Sourcepub const fn from_cicp(code: u8) -> Option<Transfer>
pub const fn from_cicp(code: u8) -> Option<Transfer>
Map an ITU-T H.273 Table 3 TransferCharacteristics code to Transfer.
Lossless bijection across all 16 standardized codes
(1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18).
Sourcepub const fn to_cicp(self) -> Option<u8>
pub const fn to_cicp(self) -> Option<u8>
Map Transfer to an ITU-T H.273 Table 3 TransferCharacteristics code, when standardized.
Note: Self::AdobeRgb (563/256) and pure Self::Gamma return None so they
are never silently relabeled as H.273 TC=4 (2.2) or TC=17 (SMPTE ST 428-1).