mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-03 06:35:20 +00:00
LibGfx: Move ICC TagTableEntry to BinaryFormat.h
This commit is contained in:
parent
026d9ceaf9
commit
9bd7048519
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue