From 47cfcf5dca6c2e46ed6ab1eb143a69b7732aa00e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 19 Feb 2023 09:41:21 -0500 Subject: [PATCH] LibGfx: Move NamedColorHeader to BinaryFormat.h --- Userland/Libraries/LibGfx/ICC/BinaryFormat.h | 10 ++++++++++ Userland/Libraries/LibGfx/ICC/TagTypes.cpp | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h index 15fd82256e..18b5402caa 100644 --- a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h +++ b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h @@ -149,6 +149,16 @@ struct MultiLocalizedUnicodeRawRecord { }; static_assert(AssertSize()); +// Table 66 — namedColor2Type encoding +struct NamedColorHeader { + BigEndian vendor_specific_flag; + BigEndian count_of_named_colors; + BigEndian number_of_device_coordinates_of_each_named_color; + u8 prefix_for_each_color_name[32]; // null-terminated + u8 suffix_for_each_color_name[32]; // null-terminated +}; +static_assert(AssertSize()); + // Table 84 — viewingConditionsType encoding struct ViewingConditionsHeader { XYZNumber unnormalized_ciexyz_values_for_illuminant; // "(in which Y is in cd/m2)" diff --git a/Userland/Libraries/LibGfx/ICC/TagTypes.cpp b/Userland/Libraries/LibGfx/ICC/TagTypes.cpp index bf03366f9a..8bdc4cf658 100644 --- a/Userland/Libraries/LibGfx/ICC/TagTypes.cpp +++ b/Userland/Libraries/LibGfx/ICC/TagTypes.cpp @@ -732,16 +732,6 @@ ErrorOr> NamedColor2TagData::from_bytes(Readon VERIFY(tag_type(bytes) == Type); TRY(check_reserved(bytes)); - // Table 66 — namedColor2Type encoding - struct NamedColorHeader { - BigEndian vendor_specific_flag; - BigEndian count_of_named_colors; - BigEndian number_of_device_coordinates_of_each_named_color; - u8 prefix_for_each_color_name[32]; // null-terminated - u8 suffix_for_each_color_name[32]; // null-terminated - }; - static_assert(AssertSize()); - if (bytes.size() < 2 * sizeof(u32) + sizeof(NamedColorHeader)) return Error::from_string_literal("ICC::Profile: namedColor2Type has not enough data");