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

LibGfx: Move ICC ViewingConditionsHeader to BinaryFormat.h

This commit is contained in:
Nico Weber 2023-02-17 22:20:59 -05:00 committed by Sam Atkins
parent 841e359341
commit 933002ae5a
2 changed files with 8 additions and 8 deletions

View file

@ -149,4 +149,12 @@ struct MultiLocalizedUnicodeRawRecord {
}; };
static_assert(AssertSize<MultiLocalizedUnicodeRawRecord, 12>()); static_assert(AssertSize<MultiLocalizedUnicodeRawRecord, 12>());
// Table 84 — viewingConditionsType encoding
struct ViewingConditionsHeader {
XYZNumber unnormalized_ciexyz_values_for_illuminant; // "(in which Y is in cd/m2)"
XYZNumber unnormalized_ciexyz_values_for_surround; // "(in which Y is in cd/m2)"
BigEndian<MeasurementTagData::StandardIlluminant> illuminant_type;
};
static_assert(AssertSize<ViewingConditionsHeader, 28>());
} }

View file

@ -1175,14 +1175,6 @@ ErrorOr<NonnullRefPtr<ViewingConditionsTagData>> ViewingConditionsTagData::from_
VERIFY(tag_type(bytes) == Type); VERIFY(tag_type(bytes) == Type);
TRY(check_reserved(bytes)); TRY(check_reserved(bytes));
// Table 84 — viewingConditionsType encoding
struct ViewingConditionsHeader {
XYZNumber unnormalized_ciexyz_values_for_illuminant; // "(in which Y is in cd/m2)"
XYZNumber unnormalized_ciexyz_values_for_surround; // "(in which Y is in cd/m2)"
BigEndian<MeasurementTagData::StandardIlluminant> illuminant_type;
};
static_assert(AssertSize<ViewingConditionsHeader, 28>());
if (bytes.size() < 2 * sizeof(u32) + sizeof(ViewingConditionsHeader)) if (bytes.size() < 2 * sizeof(u32) + sizeof(ViewingConditionsHeader))
return Error::from_string_literal("ICC::Profile: viewingConditionsType has not enough data"); return Error::from_string_literal("ICC::Profile: viewingConditionsType has not enough data");