skcms_Transform: Respect PQ and HLG indicated in CICP

If an image indicates that it is PQ or HLG via its CICP tags, this is
ignored by skcms_Transform. As a result, lots of code has been stuffing
the PQ-ish and HLG-ish skcms_TransferFunctions into the skcms_ICCProfile
structure, which is not ideal.

Change skcms_Transform to detect PQ and HLG CICP values, and to prefer
them over A2B and B2A transforms.

The specific HLG transform being used is not the usual 1,000 nit peak
reference transform, but rather is the SDR version. This will be updated
in follow-on patches.

Bug: skia:420956739
Change-Id: I7ecba5fbbd31232d2c139eafdb565b6dccfe816c
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/1045656
Reviewed-by: Kaylee Lubick <kjlubick@google.com>
Reviewed-by: Christopher Cameron <ccameron@google.com>
Commit-Queue: Christopher Cameron <ccameron@google.com>
5 files changed
tree: 19e3c02d5a369a7bd5c32abcbbcb0caf1bfae0ea
  1. bazel/
  2. fuzz/
  3. infra/
  4. ninja/
  5. profiles/
  6. src/
  7. toolchain/
  8. .bazelrc
  9. .bazelversion
  10. .gitignore
  11. BAZEL.md
  12. bench.c
  13. BUILD.bazel
  14. build.ninja
  15. codereview.settings
  16. iccdump.c
  17. LICENSE
  18. msvs.ninja
  19. OWNERS
  20. README.chromium
  21. README.md
  22. skcms.cc
  23. skcms.gni
  24. skcms.h
  25. test_only.c
  26. test_only.h
  27. tests.c
  28. whitespace.txt
  29. WORKSPACE.bazel
README.md

To build with ninja, simply run ninja from the root directory. This will produce a library in /out.

There are also Bazel rules, outlined in BAZEL.md