1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:48:12 +00:00
Commit graph

33 commits

Author SHA1 Message Date
Nico Weber
fa00d94e82 LibGfx+icc: Add ICCProfile support for parametricCurveType and print it
With this, we can parse all types required in v4
"Three-component matrix-based Input profiles".
2023-01-23 23:37:33 +00:00
Nico Weber
67f718aa3f LibGfx+icc: Add ICCProfile support for curveType and print it 2023-01-23 18:20:55 +00:00
Nico Weber
9756842734 LibGfx+icc: Add ICCProfile support for s15Fixed16ArrayType and print it
This is the type of the chromaticAdaptationTag, which is a required tag
in v4 profiles for all non-DeviceLink profiles.
2023-01-23 18:09:23 +00:00
Nico Weber
6cfb057430 LibGfx+icc: Add ICCProfile support for XYZType and print it 2023-01-23 12:08:25 +00:00
Nico Weber
e7eccf4ac8 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).
2023-01-23 10:09:01 +00:00
Nico Weber
19ce63babf icc: Print MultiLocalizedUnicodeTagData contents 2023-01-22 15:25:58 +00:00
Nico Weber
ec7a2058a2 LibGfx: Add ICCProfile support for multiLocalizedUnicodeType
This is used in v4 profiles for the required 'cprt' and 'desc' tags.
2023-01-22 15:25:58 +00:00
Nico Weber
3dfb012a1a LibGfx: Add ICCProfile support for textType
This is used in v2 profiles for the required 'cprt' tag.
2023-01-22 15:25:58 +00:00
Nico Weber
b56a145a67 LibGfx+icc: Make device manufacturer and device model clickable 2023-01-21 22:16:38 -05:00
Nico Weber
f28b052590 LibGfx: Add scaffolding for reading ICC tag table
The idea is that we'll have one type for each tag type.
For now, this treats all tag types as unknown, but it puts most
of the infrastructure for reading tags in place.
2023-01-20 21:44:36 +00:00
Nico Weber
5017d8fdcb LibGfx: Extract Profile::read_header() function 2023-01-20 21:44:36 +00:00
Nico Weber
e5234f582d LibGfx: Make ICCHeader use FourCC types for fourcc fields
No behavior change. Arguably more expressive.
2023-01-20 21:44:36 +00:00
Nico Weber
046c79b468 LibGfx: Make DistinctFourCC compatible with BigEndian 2023-01-20 21:44:36 +00:00
Nico Weber
b8bfefd130 LibGfx: Add initializer for ICC::DistinctFourCC
These are currently only used in Optional<>s, so this is no effective
behavior change.
2023-01-08 23:41:14 +01:00
Nico Weber
db02cf2aa8 LibGfx: Add initializers for ICCProfile enum class fields 2023-01-08 23:41:14 +01:00
Nico Weber
1a907aa305 LibGfx: Add initializer for ICCProfile::m_creation_timestamp 2023-01-08 23:41:14 +01:00
Nico Weber
7ae97c9fc4 LibGfx+icc: Look at profile_size field
This trims the input bytes to the profile size stored in the file.
Alternatively, we could reject files where the stored size doesn't
match the handed in size. But ICC profiles can be embedded in other
files, and those could conceivably pad the ICC profile data some.
2023-01-08 23:41:14 +01:00
Nico Weber
aee7c44064 LibGfx+icc: Print primary platform
There's a small, old-timey list of platforms in the spec, but as far
as I can tell nobody is using additional platforms on Linux or Android
or what. So let's try going with an enum class instead of the FourCC
machinery for now.
2023-01-08 09:56:07 +00:00
Nico Weber
fdbe501d3e LibGfx+icc: Print fields that are fourccs registered with the ICC
Namely:
- preferred CMM type
- device manufacturer
- device model
- profile creator

These all have in common that they can take arbitrary values, so I added
a FourCC class to deal with them, instead of using an enum class.
I made distinct types for each of them, so that they aren't accidentally
mixed up.
2023-01-07 13:41:41 +00:00
Nico Weber
d223477bc6 LibGfx+icc: Print device attribute flags
These flags are always 0 in practice in all profiles I've seen so far,
but hey, probably nice to dump them anyways.

And hey, it's just 86 lines to print 4 bits.
2023-01-06 21:33:46 +01:00
Nico Weber
915cc5d4e3 LibGfx: Fix incorrect bitmask in Gfx::ICC::Flags 2023-01-06 21:33:46 +01:00
Nico Weber
68f678f566 LibGfx+icc: Print if profile id is valid 2023-01-05 10:54:35 +01:00
Nico Weber
7080aac84f LibGfx: Remove useless name from try_load_from_externally_owned_memory() 2023-01-05 10:54:35 +01:00
Nico Weber
34a21efef6 LibGfx: East-const-ify ICCProfile::pcs_illuminant() 2023-01-05 10:54:35 +01:00
Nico Weber
d5c8c90ff0 LibGfx: Store profile id MD5 in ICCProfile 2023-01-05 10:54:35 +01:00
Nico Weber
79badfd650 LibGfx+icc: Print pcs illuminant 2023-01-02 15:20:51 +01:00
Nico Weber
47f29170b3 LibGfx+icc: Add profile connection space printing
This is a bit messy: The spec says that PCSXYZ and PCSLAB are the only
valid profile connection spaces -- except for DeviceLink profles, where
all data color spaces are valid.

So this uses the existing ColorSpace enum for profile connection spaces
instead of adding a dedicated enum, to not duplicate all the color space
parsing and printing code.  That matches what the spec does, too.
This saves about 100 lines of code, at the expense of less type
safety -- but further down the line we probably want to be able to
compare data color spaces and profile connection spaces, so the type
safety would likely get in the way then. (But if not, we can change
things around once we get to that point.)
2022-12-31 23:18:35 +01:00
Nico Weber
0b46e572b5 LibGfx+icc: Print profile flags
These flags are always 0 in practice in all profiles I've seen so far,
but hey, probably nice to dump them anyways.
2022-12-31 23:17:48 +01:00
Nico Weber
a8ee5dd9cd LibGfx: Make ICC name converters return StringView 2022-12-31 12:59:22 -05:00
Nico Weber
743e9fc786 LibGfx: Read rendering intent from ICCProfile header 2022-12-30 17:21:57 +01:00
Nico Weber
eaf1f67bb1 LibGfx: Read data color space from ICCProfile header 2022-12-30 10:14:22 -05:00
Nico Weber
782ab0a11f LibGfx: Read profile creation time from ICCProfile header 2022-12-27 15:58:39 -08:00
Nico Weber
d8867f8077 LibGfx: Start adding a class for handling ICC color profiles
For now, this checks the magic number and reads file version and
device class.
2022-12-27 07:44:37 -07:00