1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

LibGfx: Move ICC ProfileFileSignature into a constant in BinaryFormat.h

...so that it can be used by ICC writing code too.
This commit is contained in:
Nico Weber 2023-02-17 13:11:23 -05:00 committed by Andrew Kaster
parent 78d849bce2
commit 0ca620a286
2 changed files with 5 additions and 2 deletions

View file

@ -75,6 +75,10 @@ struct ICCHeader {
}; };
static_assert(AssertSize<ICCHeader, 128>()); static_assert(AssertSize<ICCHeader, 128>());
// ICC v4, 7.2.9 Profile file signature field
// "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature."
constexpr u32 ProfileFileSignature = 0x61637370;
// 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;

View file

@ -179,8 +179,7 @@ ErrorOr<time_t> parse_creation_date_time(ICCHeader const& header)
ErrorOr<void> parse_file_signature(ICCHeader const& header) ErrorOr<void> parse_file_signature(ICCHeader const& header)
{ {
// ICC v4, 7.2.9 Profile file signature field // ICC v4, 7.2.9 Profile file signature field
// "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature." if (header.profile_file_signature != ProfileFileSignature)
if (header.profile_file_signature != 0x61637370)
return Error::from_string_literal("ICC::Profile: profile file signature not 'acsp'"); return Error::from_string_literal("ICC::Profile: profile file signature not 'acsp'");
return {}; return {};
} }