diff options
author | Nico Weber <thakis@chromium.org> | 2023-02-12 11:12:16 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-13 00:15:02 +0000 |
commit | ed8bd3a7927ef6ca037e0571b545af59b39a1d03 (patch) | |
tree | 320b89d7ca9aec7ceacda61faa1f00abc3f82b51 | |
parent | 6f95ec58215a3b49c839ec8c1ff10974d6e78ed3 (diff) | |
download | serenity-ed8bd3a7927ef6ca037e0571b545af59b39a1d03.zip |
icc: Dump more information about curves in lutAToBType and lutAToBType
-rw-r--r-- | Userland/Utilities/icc.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Userland/Utilities/icc.cpp b/Userland/Utilities/icc.cpp index ccc325514a..51ecc2886c 100644 --- a/Userland/Utilities/icc.cpp +++ b/Userland/Utilities/icc.cpp @@ -30,6 +30,14 @@ static void out_optional(char const* label, Optional<T> const& optional) outln("(not set)"); } +static void out_curves(Vector<Gfx::ICC::LutCurveType> const& curves) +{ + for (auto const& curve : curves) { + VERIFY(curve->type() == Gfx::ICC::CurveTagData::Type || curve->type() == Gfx::ICC::ParametricCurveTagData::Type); + outln(" type {}, relative offset {}, size {}", curve->type(), curve->offset(), curve->size()); + } +} + ErrorOr<int> serenity_main(Main::Arguments arguments) { Core::ArgsParser args_parser; @@ -176,7 +184,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) outln(" {} input channels, {} output channels", a_to_b.number_of_input_channels(), a_to_b.number_of_output_channels()); if (auto const& optional_a_curves = a_to_b.a_curves(); optional_a_curves.has_value()) { - outln(" a curves: {} curves", optional_a_curves->size()); // FIXME: Dump more + outln(" a curves: {} curves", optional_a_curves->size()); + out_curves(optional_a_curves.value()); } else { outln(" a curves: (not set)"); } @@ -193,7 +202,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } if (auto const& optional_m_curves = a_to_b.m_curves(); optional_m_curves.has_value()) { - outln(" m curves: {} curves", optional_m_curves->size()); // FIXME: Dump more + outln(" m curves: {} curves", optional_m_curves->size()); + out_curves(optional_m_curves.value()); } else { outln(" m curves: (not set)"); } @@ -207,12 +217,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) outln(" e = (not set)"); } - outln(" b curves: {} curves", a_to_b.b_curves().size()); // FIXME: Dump more + outln(" b curves: {} curves", a_to_b.b_curves().size()); + out_curves(a_to_b.b_curves()); } else if (tag_data->type() == Gfx::ICC::LutBToATagData::Type) { auto& b_to_a = static_cast<Gfx::ICC::LutBToATagData&>(*tag_data); outln(" {} input channels, {} output channels", b_to_a.number_of_input_channels(), b_to_a.number_of_output_channels()); - outln(" b curves: {} curves", b_to_a.b_curves().size()); // FIXME: Dump more + outln(" b curves: {} curves", b_to_a.b_curves().size()); + out_curves(b_to_a.b_curves()); if (auto const& optional_e = b_to_a.e_matrix(); optional_e.has_value()) { auto const& e = optional_e.value(); @@ -224,7 +236,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } if (auto const& optional_m_curves = b_to_a.m_curves(); optional_m_curves.has_value()) { - outln(" m curves: {} curves", optional_m_curves->size()); // FIXME: Dump more + outln(" m curves: {} curves", optional_m_curves->size()); + out_curves(optional_m_curves.value()); } else { outln(" m curves: (not set)"); } @@ -241,7 +254,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } if (auto const& optional_a_curves = b_to_a.a_curves(); optional_a_curves.has_value()) { - outln(" a curves: {} curves", optional_a_curves->size()); // FIXME: Dump more + outln(" a curves: {} curves", optional_a_curves->size()); + out_curves(optional_a_curves.value()); } else { outln(" a curves: (not set)"); } |