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

LibGfx: Move ICC::Profile towards "Fallible Constructors" pattern

Not quite there yet due to check_required_tags() / check_tag_types(),
but getting closer :^)
This commit is contained in:
Nico Weber 2023-02-14 13:09:43 -05:00 committed by Andreas Kling
parent db614b47dd
commit 9ba3c8e36d
2 changed files with 11 additions and 4 deletions

View file

@ -210,6 +210,12 @@ class Profile : public RefCounted<Profile> {
public:
static ErrorOr<NonnullRefPtr<Profile>> try_load_from_externally_owned_memory(ReadonlyBytes);
Profile(ProfileHeader const& header, OrderedHashMap<TagSignature, NonnullRefPtr<TagData>> tag_table)
: m_header(header)
, m_tag_table(move(tag_table))
{
}
Optional<PreferredCMMType> preferred_cmm_type() const { return m_header.preferred_cmm_type; }
Version version() const { return m_header.version; }
DeviceClass device_class() const { return m_header.device_class; }