JFLib

img_core/icc_bi.rs#

Source: lib/img_core/icc_bi.rs

icc_bi -- the built-in ICC profiles and the profile description of icc_xform
                                                                  [src/img/icc_xform.s]

  icc_builtin(id) -> profile bytes | None     ICC_BI_SRGB / _A98 / _P3 / _ROMM /
                                              _GRAY22  [icc_builtin]
  icc_describe(icc, buf) -> bytes             the 'desc' tag as UTF-8 (v2 desc; v4 mluc:
                                              German, else English, else the first
                                              record), NUL-terminated in buf; 0 = none
                                              (buf[0] = 0)  [icc_describe]

Built-in profiles (bi_make; own numbers, no copied files): ICC v4.3, class mntr, PCS XYZ,
D50 wtpt, desc / cprt as mluc, chad (Bradford from the space's white), colorants as
s15.16, TRC as para.  The assembly writes them into static buffers on the first call;
here the same function runs at compile time (const fn), so the bytes are static from the
start and every thread may ask for them.
  • fn icc_builtin(id: u32) -> Option<&'static [u8]> the bytes of built-in profile id (ICC_BI_*), None for an unknown id [icc_builtin]

  • fn icc_describe(icc: &[u8], buf: &mut [u8]) -> usize the 'desc' tag of a profile as UTF-8 into buf (cap = buf.len(), NUL-terminated) -> text bytes (0 = none) [icc_describe]

Source: docs/API.md in the JFLib repository.