From 7ad11fa59a8d2e55ab3ecdaa9ef7cd6b2f05926c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 19 Feb 2023 09:41:51 -0500 Subject: [PATCH] LibGfx: Mark a few ICC:NamedColor2TagData methods as const --- Userland/Libraries/LibGfx/ICC/TagTypes.cpp | 2 +- Userland/Libraries/LibGfx/ICC/TagTypes.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICC/TagTypes.cpp b/Userland/Libraries/LibGfx/ICC/TagTypes.cpp index 8bdc4cf658..fa587c4ed3 100644 --- a/Userland/Libraries/LibGfx/ICC/TagTypes.cpp +++ b/Userland/Libraries/LibGfx/ICC/TagTypes.cpp @@ -776,7 +776,7 @@ ErrorOr> NamedColor2TagData::from_bytes(Readon move(prefix), move(suffix), move(root_names), move(pcs_coordinates), move(device_coordinates)); } -ErrorOr NamedColor2TagData::color_name(u32 index) +ErrorOr NamedColor2TagData::color_name(u32 index) const { StringBuilder builder; builder.append(prefix()); diff --git a/Userland/Libraries/LibGfx/ICC/TagTypes.h b/Userland/Libraries/LibGfx/ICC/TagTypes.h index 9599c80d9c..7ee6149592 100644 --- a/Userland/Libraries/LibGfx/ICC/TagTypes.h +++ b/Userland/Libraries/LibGfx/ICC/TagTypes.h @@ -545,7 +545,7 @@ public: // "If this field is 0, device coordinates are not provided." u32 number_of_device_coordinates() const { return m_number_of_device_coordinates; } - u32 size() { return m_root_names.size(); } + u32 size() const { return m_root_names.size(); } // "In order to maintain maximum portability, it is strongly recommended that // special characters of the 7-bit ASCII set not be used." @@ -554,13 +554,13 @@ public: String const& root_name(u32 index) const { return m_root_names[index]; } // "7-bit ASCII" // Returns 7-bit ASCII. - ErrorOr color_name(u32 index); + ErrorOr color_name(u32 index) const; // "The PCS representation corresponds to the header’s PCS field." - XYZOrLAB const& pcs_coordinates(u32 index) { return m_pcs_coordinates[index]; } + XYZOrLAB const& pcs_coordinates(u32 index) const { return m_pcs_coordinates[index]; } // "The device representation corresponds to the header’s “data colour space” field." - u16 const* device_coordinates(u32 index) + u16 const* device_coordinates(u32 index) const { VERIFY((index + 1) * m_number_of_device_coordinates <= m_device_coordinates.size()); return m_device_coordinates.data() + index * m_number_of_device_coordinates;