Skip to main content

bundled_icc_profile

Function bundled_icc_profile 

Source
pub const fn bundled_icc_profile(
    primaries: Primaries,
    transfer: Transfer,
) -> Option<&'static [u8]>
Expand description

Get a bundled &'static ICC profile whose tone curve is exactly the requested transfer function on exactly the requested primaries.

This accessor matches against the TRC encoded in each bundled profile, so (Bt2020, Bt709) gets the Rec. 2020 profile while (Bt2020, Srgb) and (Bt2020, Pq) get None. sRGB and BT.709 are different curves (at linear 0.18 they encode 0.461 and 0.409, 13 code values apart at 8 bits), so neither stands in for the other.

§Currently bundled combinations

PrimariesTransferReturned profile
Primaries::Bt709Transfer::SrgbNone — sRGB is the assumed default
Primaries::DisplayP3Transfer::Srgb or Transfer::Bt709compact generated export
Primaries::Bt2020Transfer::Bt709REC2020_V4
Primaries::AdobeRgbTransfer::AdobeRgbADOBE_RGB

§Not bundled (returns None)

  • HDR transfers (Transfer::Pq, Transfer::Hlg) on any primaries. Ultra HDR / HDR10 / HLG broadcast workflows that need a PQ- or HLG-tagged profile should either generate one via a CMS crate (e.g., moxcms::ColorProfile::new_bt2020_pq().encode()) or signal color via CICP instead of ICC.
  • Transfer::Linear on any primaries. Linear-light working spaces are typically expressed with CICP transfer code 8 rather than an ICC profile.
  • Adobe RGB with any transfer other than Transfer::AdobeRgb (563/256).
  • Display P3 with any transfer other than Srgb or Bt709, and BT.2020 with any transfer other than Bt709.

SynthesizedIcc::for_cicp serves every assigned pair (these included) from the icc-db blob; this table is its fallback without that feature.