mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:17:44 +00:00
LibGfx: Move ICC TagTableEntry to BinaryFormat.h
This commit is contained in:
parent
026d9ceaf9
commit
9bd7048519
2 changed files with 8 additions and 8 deletions
|
@ -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."
|
// "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature."
|
||||||
constexpr u32 ProfileFileSignature = 0x61637370;
|
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
|
// Common bits of ICC v4, Table 40 — lut16Type encoding and Table 44 — lut8Type encoding
|
||||||
struct LUTHeader {
|
struct LUTHeader {
|
||||||
u8 number_of_input_channels;
|
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");
|
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());
|
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));
|
tag_table_bytes = tag_table_bytes.slice(sizeof(u32));
|
||||||
if (tag_table_bytes.size() < tag_count * sizeof(TagTableEntry))
|
if (tag_table_bytes.size() < tag_count * sizeof(TagTableEntry))
|
||||||
return Error::from_string_literal("ICC::Profile: Not enough data for tag table entries");
|
return Error::from_string_literal("ICC::Profile: Not enough data for tag table entries");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue