skcms_Transform: Add HLG OOTF

The full transform for HLG applies an opt-optical transfer function, and
reaches a peak value of 1000/203. This was avoided in the past due to
complexity.

Add this step. Unlike the formulation in SkColorSpace, perform this step
in the XYZD50 linear space, and fuse it with the scaling. This greatly
simplifies the pipeline (and SkColorSpace will probably be changed to
match this).

Add tests (using test pixel values from a WPT test) to verify the
transformation between sRGB, Rec2100PQ, and Rec2100HLG all perform
appropriately.

Bug: skia:420956739
Change-Id: Iafd6f19317b8c210bbac51c8ea2cdedaac7c4a78
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/1046556
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: 303f0defa401832a661d3449781e44fec057a832
  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