mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:57:35 +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:
parent
78d849bce2
commit
0ca620a286
2 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
|
@ -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 {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue