From 8ab6e0d3a5755dc282ad93e1373932af7a25d061 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 29 Apr 2023 22:19:59 -0400 Subject: [PATCH] ICC: Mark Profile::to_pcs() and to_lab() const --- Userland/Libraries/LibGfx/ICC/Profile.cpp | 4 ++-- Userland/Libraries/LibGfx/ICC/Profile.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp index 4a76a00fde..a05a2ad30e 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.cpp +++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp @@ -1373,7 +1373,7 @@ static TagSignature tag_for_rendering_intent(RenderingIntent rendering_intent) VERIFY_NOT_REACHED(); } -ErrorOr Profile::to_pcs(ReadonlyBytes color) +ErrorOr Profile::to_pcs(ReadonlyBytes color) const { if (color.size() != number_of_components_in_color_space(data_color_space())) return Error::from_string_literal("ICC::Profile: input color doesn't match color space size"); @@ -1471,7 +1471,7 @@ ErrorOr Profile::to_pcs(ReadonlyBytes color) VERIFY_NOT_REACHED(); } -ErrorOr Profile::to_lab(ReadonlyBytes color) +ErrorOr Profile::to_lab(ReadonlyBytes color) const { auto pcs = TRY(to_pcs(color)); if (connection_space() == ColorSpace::PCSLAB) diff --git a/Userland/Libraries/LibGfx/ICC/Profile.h b/Userland/Libraries/LibGfx/ICC/Profile.h index b54b147877..9566d7f342 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.h +++ b/Userland/Libraries/LibGfx/ICC/Profile.h @@ -265,9 +265,9 @@ public: // The color's number of channels must match number_of_components_in_color_space(data_color_space()). // Do not call for DeviceLink or NamedColor profiles. (XXX others?) // Call connection_space() to find out the space the result is in. - ErrorOr to_pcs(ReadonlyBytes); + ErrorOr to_pcs(ReadonlyBytes) const; - ErrorOr to_lab(ReadonlyBytes); + ErrorOr to_lab(ReadonlyBytes) const; // Only call these if you know that this is an RGB matrix-based profile. XYZ const& red_matrix_column() const;