mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:47:35 +00:00
LibGfx: Make ICCHeader use RenderingIntent enum
No behavior change.
This commit is contained in:
parent
429467f46c
commit
78d849bce2
3 changed files with 11 additions and 14 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue