summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-02-17 11:15:21 -0500
committerAndrew Kaster <andrewdkaster@gmail.com>2023-02-17 20:05:50 -0700
commit78d849bce227479b5773607562dbc3c3df0f6b01 (patch)
tree31f2da91e2bca4d2641fd168504dbb1842d599ea
parent429467f46cb30d5cc9b099f8f561d7c20d73f50f (diff)
downloadserenity-78d849bce227479b5773607562dbc3c3df0f6b01.zip
LibGfx: Make ICCHeader use RenderingIntent enum
No behavior change.
-rw-r--r--Userland/Libraries/LibGfx/ICC/BinaryFormat.h2
-rw-r--r--Userland/Libraries/LibGfx/ICC/Profile.cpp13
-rw-r--r--Userland/Libraries/LibGfx/ICC/Profile.h10
3 files changed, 11 insertions, 14 deletions
diff --git a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
index 4e6771b67c..0eb5956c00 100644
--- a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
+++ b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h
@@ -64,7 +64,7 @@ struct ICCHeader {
BigEndian<DeviceManufacturer> device_manufacturer;
BigEndian<DeviceModel> device_model;
BigEndian<u64> device_attributes;
- BigEndian<u32> rendering_intent;
+ BigEndian<RenderingIntent> rendering_intent;
XYZNumber pcs_illuminant;
diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp
index 993b96484a..dc2f52c81e 100644
--- a/Userland/Libraries/LibGfx/ICC/Profile.cpp
+++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp
@@ -249,14 +249,11 @@ ErrorOr<RenderingIntent> parse_rendering_intent(ICCHeader const& header)
{
// ICC v4, 7.2.15 Rendering intent field
switch (header.rendering_intent) {
- case 0:
- return RenderingIntent::Perceptual;
- case 1:
- return RenderingIntent::MediaRelativeColorimetric;
- case 2:
- return RenderingIntent::Saturation;
- case 3:
- return RenderingIntent::ICCAbsoluteColorimetric;
+ case RenderingIntent::Perceptual:
+ case RenderingIntent::MediaRelativeColorimetric:
+ case RenderingIntent::Saturation:
+ case RenderingIntent::ICCAbsoluteColorimetric:
+ return header.rendering_intent;
}
return Error::from_string_literal("ICC::Profile: Invalid rendering intent");
}
diff --git a/Userland/Libraries/LibGfx/ICC/Profile.h b/Userland/Libraries/LibGfx/ICC/Profile.h
index 7767512dd9..df922e6070 100644
--- a/Userland/Libraries/LibGfx/ICC/Profile.h
+++ b/Userland/Libraries/LibGfx/ICC/Profile.h
@@ -96,11 +96,11 @@ enum class PrimaryPlatform : u32 {
StringView primary_platform_name(PrimaryPlatform);
// ICC v4, 7.2.15 Rendering intent field
-enum class RenderingIntent {
- Perceptual,
- MediaRelativeColorimetric,
- Saturation,
- ICCAbsoluteColorimetric,
+enum class RenderingIntent : u32 {
+ Perceptual = 0,
+ MediaRelativeColorimetric = 1,
+ Saturation = 2,
+ ICCAbsoluteColorimetric = 3,
};
StringView rendering_intent_name(RenderingIntent);