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

LibGfx+icc: Print pcs illuminant

This commit is contained in:
Nico Weber 2023-01-01 07:09:38 -05:00 committed by Andreas Kling
parent 3df2eb66be
commit 79badfd650
3 changed files with 47 additions and 3 deletions

View file

@ -115,6 +115,12 @@ private:
u32 m_bits = 0;
};
struct XYZ {
double x { 0 };
double y { 0 };
double z { 0 };
};
class Profile : public RefCounted<Profile> {
public:
static ErrorOr<NonnullRefPtr<Profile>> try_load_from_externally_owned_memory(ReadonlyBytes bytes);
@ -129,6 +135,7 @@ public:
time_t creation_timestamp() const { return m_creation_timestamp; }
Flags flags() const { return m_flags; }
RenderingIntent rendering_intent() const { return m_rendering_intent; }
const XYZ& pcs_illuminant() const { return m_pcs_illuminant; }
private:
Version m_version;
@ -138,6 +145,7 @@ private:
time_t m_creation_timestamp;
Flags m_flags;
RenderingIntent m_rendering_intent;
XYZ m_pcs_illuminant;
};
}
@ -150,4 +158,12 @@ struct Formatter<Gfx::ICC::Version> : Formatter<FormatString> {
return Formatter<FormatString>::format(builder, "{}.{}.{}"sv, version.major_version(), version.minor_version(), version.bugfix_version());
}
};
template<>
struct Formatter<Gfx::ICC::XYZ> : Formatter<FormatString> {
ErrorOr<void> format(FormatBuilder& builder, Gfx::ICC::XYZ const& xyz)
{
return Formatter<FormatString>::format(builder, "X = {}, Y = {}, Z = {}"sv, xyz.x, xyz.y, xyz.z);
}
};
}