1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:17:46 +00:00

ICC: Implement some of Profile::from_pcs()

This implements conversion from profile connection space to the
device-dependent color for matrix-based profiles.

It only does the inverse color transform but does not yet do the
inverse tone reproduction curve transform -- i.e. it doesn't
implement many cases (LUT transforms), and it does the one thing
it does implement incorrectly. But to vindicate the commit a bit,
it also does the incorrect thing very inefficiently.
This commit is contained in:
Nico Weber 2023-05-01 08:24:13 -04:00 committed by Sam Atkins
parent 2319b2ffb5
commit 4169c94ebe
3 changed files with 167 additions and 0 deletions

View file

@ -267,6 +267,10 @@ public:
// Call connection_space() to find out the space the result is in.
ErrorOr<FloatVector3> to_pcs(ReadonlyBytes) const;
// 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<CIELAB> to_lab(ReadonlyBytes) const;
// Only call these if you know that this is an RGB matrix-based profile.