mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:17:34 +00:00
LibGfx+icc: Add ICCProfile support for textDescriptionType and print it
This is used in v2 profiles for the required 'desc' tag. In v2 profiles, it's also used by the 'dmnd', 'dmdd', 'scrd', 'vued' tags. In v4 profiles, these all use 'mluc' instead (except for 'scrd', which is no longer part of the spec in v4).
This commit is contained in:
parent
8272cfc9f3
commit
e7eccf4ac8
3 changed files with 186 additions and 1 deletions
|
@ -282,6 +282,39 @@ private:
|
|||
Vector<Record> m_records;
|
||||
};
|
||||
|
||||
// ICC v2, 6.5.17 textDescriptionType
|
||||
class TextDescriptionTagData : public TagData {
|
||||
public:
|
||||
static constexpr TagTypeSignature Type { 0x64657363 }; // 'desc'
|
||||
|
||||
static ErrorOr<NonnullRefPtr<TextDescriptionTagData>> from_bytes(ReadonlyBytes, u32 offset, u32 size);
|
||||
|
||||
TextDescriptionTagData(u32 offset, u32 size, String ascii_description, u32 unicode_language_code, Optional<String> unicode_description, Optional<String> macintosh_description)
|
||||
: TagData(offset, size, Type)
|
||||
, m_ascii_description(move(ascii_description))
|
||||
, m_unicode_language_code(unicode_language_code)
|
||||
, m_unicode_description(move(unicode_description))
|
||||
, m_macintosh_description(move(macintosh_description))
|
||||
{
|
||||
}
|
||||
|
||||
// Guaranteed to be 7-bit ASCII.
|
||||
String const& ascii_description() const { return m_ascii_description; }
|
||||
|
||||
u32 unicode_language_code() const { return m_unicode_language_code; }
|
||||
Optional<String> const& unicode_description() const { return m_unicode_description; }
|
||||
|
||||
Optional<String> const& macintosh_description() const { return m_macintosh_description; }
|
||||
|
||||
private:
|
||||
String m_ascii_description;
|
||||
|
||||
u32 m_unicode_language_code { 0 };
|
||||
Optional<String> m_unicode_description;
|
||||
|
||||
Optional<String> m_macintosh_description;
|
||||
};
|
||||
|
||||
// ICC v4, 10.24 textType
|
||||
class TextTagData : public TagData {
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue