1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibGfx+icc: Add profile connection space printing

This is a bit messy: The spec says that PCSXYZ and PCSLAB are the only
valid profile connection spaces -- except for DeviceLink profles, where
all data color spaces are valid.

So this uses the existing ColorSpace enum for profile connection spaces
instead of adding a dedicated enum, to not duplicate all the color space
parsing and printing code.  That matches what the spec does, too.
This saves about 100 lines of code, at the expense of less type
safety -- but further down the line we probably want to be able to
compare data color spaces and profile connection spaces, so the type
safety would likely get in the way then. (But if not, we can change
things around once we get to that point.)
This commit is contained in:
Nico Weber 2022-12-30 11:07:38 -05:00 committed by Andreas Kling
parent 0b46e572b5
commit 47f29170b3
3 changed files with 51 additions and 11 deletions

View file

@ -23,7 +23,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
outln("version: {}", profile->version());
outln("device class: {}", Gfx::ICC::device_class_name(profile->device_class()));
outln("data color space: {}", Gfx::ICC::color_space_name(profile->data_color_space()));
outln("data color space: {}", Gfx::ICC::data_color_space_name(profile->data_color_space()));
outln("connection space: {}", Gfx::ICC::profile_connection_space_name(profile->connection_space()));
outln("creation date and time: {}", Core::DateTime::from_timestamp(profile->creation_timestamp()).to_deprecated_string());
auto flags = profile->flags();