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

icc: Tweak output to look nicer

Align header on the `:`, and make bitmask output more structured.
This commit is contained in:
Nico Weber 2023-01-20 20:24:55 -05:00 committed by Linus Groh
parent 49b30d3013
commit e47e5f5ce0

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Nico Weber <thakis@chromium.org>
* Copyright (c) 2022-2023, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -41,8 +41,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto flags = profile->flags();
outln(" flags: 0x{:08x}", flags.bits());
outln(" embedded in file: {}", flags.is_embedded_in_file() ? "yes" : "no");
outln(" can be used independently of embedded color data: {}", flags.can_be_used_independently_of_embedded_color_data() ? "yes" : "no");
outln(" - {}embedded in file", flags.is_embedded_in_file() ? "" : "not ");
outln(" - can{} be used independently of embedded color data", flags.can_be_used_independently_of_embedded_color_data() ? "" : "not");
if (auto unknown_icc_bits = flags.icc_bits() & ~Gfx::ICC::Flags::KnownBitsMask)
outln(" other unknown ICC bits: 0x{:04x}", unknown_icc_bits);
if (auto color_management_module_bits = flags.color_management_module_bits())
@ -53,10 +53,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto device_attributes = profile->device_attributes();
outln(" device attributes: 0x{:016x}", device_attributes.bits());
outln(" media is {}, {}, {}, {}",
device_attributes.media_reflectivity() == Gfx::ICC::DeviceAttributes::MediaReflectivity::Reflective ? "reflective" : "transparent",
device_attributes.media_glossiness() == Gfx::ICC::DeviceAttributes::MediaGlossiness::Glossy ? "glossy" : "matte",
device_attributes.media_polarity() == Gfx::ICC::DeviceAttributes::MediaPolarity::Positive ? "of positive polarity" : "of negative polarity",
outln(" media is:");
outln(" - {}",
device_attributes.media_reflectivity() == Gfx::ICC::DeviceAttributes::MediaReflectivity::Reflective ? "reflective" : "transparent");
outln(" - {}",
device_attributes.media_glossiness() == Gfx::ICC::DeviceAttributes::MediaGlossiness::Glossy ? "glossy" : "matte");
outln(" - {}",
device_attributes.media_polarity() == Gfx::ICC::DeviceAttributes::MediaPolarity::Positive ? "of positive polarity" : "of negative polarity");
outln(" - {}",
device_attributes.media_color() == Gfx::ICC::DeviceAttributes::MediaColor::Colored ? "colored" : "black and white");
VERIFY((flags.icc_bits() & ~Gfx::ICC::DeviceAttributes::KnownBitsMask) == 0);
if (auto vendor_bits = device_attributes.vendor_bits())