1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:57:45 +00:00

LibGfx/ICC: Implement conversion between different connection spaces

If one profile uses PCSXYZ and the other PCSLAB as connection space,
we now do the necessary XYZ/LAB conversion.

With this and the previous commits, we can now convert from profiles
that use PCSLAB with mAB, such as stress.jpeg from
https://littlecms.com/blog/2020/09/09/browser-check/ :

    % Build/lagom/icc --name sRGB --reencode-to serenity-sRGB.icc
    % Build/lagom/bin/image -o out.png \
        --convert-to-color-profile serenity-sRGB.icc \
        ~/src/jpegfiles/stress.jpeg
This commit is contained in:
Nico Weber 2023-12-03 21:40:47 -05:00 committed by Sam Atkins
parent 9f7b33c31f
commit b2a1130556
4 changed files with 40 additions and 10 deletions

View file

@ -213,7 +213,7 @@ public:
// Converts from the profile connection space to an 8-bits-per-channel color.
// The notes on `to_pcs()` apply to this too.
ErrorOr<void> from_pcs(FloatVector3 const&, Bytes) const;
ErrorOr<void> from_pcs(Profile const& source_profile, FloatVector3, Bytes) const;
ErrorOr<CIELAB> to_lab(ReadonlyBytes) const;