LibGfx: Move ICC TagTableEntry to BinaryFormat.h

This commit is contained in:
Nico Weber 2023-02-17 15:59:26 -05:00 committed by Andreas Kling
parent 026d9ceaf9
commit 9bd7048519
2 changed files with 8 additions and 8 deletions

View file

@ -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;

View file

@ -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");