1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibGfx: Move NamedColorHeader to BinaryFormat.h

This commit is contained in:
Nico Weber 2023-02-19 09:41:21 -05:00 committed by Andreas Kling
parent 04d519f1f1
commit 47cfcf5dca
2 changed files with 10 additions and 10 deletions

View file

@ -149,6 +149,16 @@ struct MultiLocalizedUnicodeRawRecord {
};
static_assert(AssertSize<MultiLocalizedUnicodeRawRecord, 12>());
// Table 66 — namedColor2Type encoding
struct NamedColorHeader {
BigEndian<u32> vendor_specific_flag;
BigEndian<u32> count_of_named_colors;
BigEndian<u32> 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<NamedColorHeader, 76>());
// Table 84 — viewingConditionsType encoding
struct ViewingConditionsHeader {
XYZNumber unnormalized_ciexyz_values_for_illuminant; // "(in which Y is in cd/m2)"

View file

@ -732,16 +732,6 @@ ErrorOr<NonnullRefPtr<NamedColor2TagData>> NamedColor2TagData::from_bytes(Readon
VERIFY(tag_type(bytes) == Type);
TRY(check_reserved(bytes));
// Table 66 — namedColor2Type encoding
struct NamedColorHeader {
BigEndian<u32> vendor_specific_flag;
BigEndian<u32> count_of_named_colors;
BigEndian<u32> 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<NamedColorHeader, 76>());
if (bytes.size() < 2 * sizeof(u32) + sizeof(NamedColorHeader))
return Error::from_string_literal("ICC::Profile: namedColor2Type has not enough data");