mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +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:
parent
9f7b33c31f
commit
b2a1130556
4 changed files with 40 additions and 10 deletions
|
@ -506,7 +506,7 @@ PDFErrorOr<Color> ICCBasedColorSpace::color(ReadonlySpan<Value> arguments) const
|
|||
|
||||
auto pcs = TRY(m_profile->to_pcs(bytes));
|
||||
Array<u8, 3> output;
|
||||
TRY(s_srgb_profile->from_pcs(pcs, output.span()));
|
||||
TRY(s_srgb_profile->from_pcs(m_profile, pcs, output.span()));
|
||||
|
||||
return Color(output[0], output[1], output[2]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue