summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-02-17 15:59:26 -0500
committerAndreas Kling <kling@serenityos.org>2023-02-19 00:01:44 +0100
commit9bd704851964503b46a3a8e3368403f78a436198 (patch)
tree31390b97f81cf504440c3e608cda8b3bdd763811
parent026d9ceaf9e9a05beb6248ae0cf2b90ffe6d09aa (diff)
downloadserenity-9bd704851964503b46a3a8e3368403f78a436198.zip
LibGfx: Move ICC TagTableEntry to BinaryFormat.h
-rw-r--r--Userland/Libraries/LibGfx/ICC/BinaryFormat.h8
-rw-r--r--Userland/Libraries/LibGfx/ICC/Profile.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
index c9952a4b62..83fc0a69b8 100644
--- a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
+++ b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
@@ -89,6 +89,14 @@ static_assert(AssertSize<ICCHeader, 128>());
// "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature."
constexpr u32 ProfileFileSignature = 0x61637370;
+// ICC V4, 7.3 Tag table, Table 24 - Tag table structure
+struct TagTableEntry {
+ BigEndian<TagSignature> tag_signature;
+ BigEndian<u32> offset_to_beginning_of_tag_data_element;
+ BigEndian<u32> size_of_tag_data_element;
+};
+static_assert(AssertSize<TagTableEntry, 12>());
+
// Common bits of ICC v4, Table 40 — lut16Type encoding and Table 44 — lut8Type encoding
struct LUTHeader {
u8 number_of_input_channels;
diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp
index 39cc109710..6739d844a4 100644
--- a/Userland/Libraries/LibGfx/ICC/Profile.cpp
+++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp
@@ -629,14 +629,6 @@ static ErrorOr<OrderedHashMap<TagSignature, NonnullRefPtr<TagData>>> read_tag_ta
return Error::from_string_literal("ICC::Profile: Not enough data for tag count");
auto tag_count = *bit_cast<BigEndian<u32> const*>(tag_table_bytes.data());
- // ICC V4, 7.3 Tag table, Table 24 - Tag table structure
- struct TagTableEntry {
- BigEndian<TagSignature> tag_signature;
- BigEndian<u32> offset_to_beginning_of_tag_data_element;
- BigEndian<u32> size_of_tag_data_element;
- };
- static_assert(AssertSize<TagTableEntry, 12>());
-
tag_table_bytes = tag_table_bytes.slice(sizeof(u32));
if (tag_table_bytes.size() < tag_count * sizeof(TagTableEntry))
return Error::from_string_literal("ICC::Profile: Not enough data for tag table entries");