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<DeviceManufacturer> device_manufacturer;
|
||||||
BigEndian<DeviceModel> device_model;
|
BigEndian<DeviceModel> device_model;
|
||||||
BigEndian<u64> device_attributes;
|
BigEndian<u64> device_attributes;
|
||||||
BigEndian<u32> rendering_intent;
|
BigEndian<RenderingIntent> rendering_intent;
|
||||||
|
|
||||||
XYZNumber pcs_illuminant;
|
XYZNumber pcs_illuminant;
|
||||||
|
|
||||||
|
|
|
@ -249,14 +249,11 @@ ErrorOr<RenderingIntent> parse_rendering_intent(ICCHeader const& header)
|
||||||
{
|
{
|
||||||
// ICC v4, 7.2.15 Rendering intent field
|
// ICC v4, 7.2.15 Rendering intent field
|
||||||
switch (header.rendering_intent) {
|
switch (header.rendering_intent) {
|
||||||
case 0:
|
case RenderingIntent::Perceptual:
|
||||||
return RenderingIntent::Perceptual;
|
case RenderingIntent::MediaRelativeColorimetric:
|
||||||
case 1:
|
case RenderingIntent::Saturation:
|
||||||
return RenderingIntent::MediaRelativeColorimetric;
|
case RenderingIntent::ICCAbsoluteColorimetric:
|
||||||
case 2:
|
return header.rendering_intent;
|
||||||
return RenderingIntent::Saturation;
|
|
||||||
case 3:
|
|
||||||
return RenderingIntent::ICCAbsoluteColorimetric;
|
|
||||||
}
|
}
|
||||||
return Error::from_string_literal("ICC::Profile: Invalid 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);
|
StringView primary_platform_name(PrimaryPlatform);
|
||||||
|
|
||||||
// ICC v4, 7.2.15 Rendering intent field
|
// ICC v4, 7.2.15 Rendering intent field
|
||||||
enum class RenderingIntent {
|
enum class RenderingIntent : u32 {
|
||||||
Perceptual,
|
Perceptual = 0,
|
||||||
MediaRelativeColorimetric,
|
MediaRelativeColorimetric = 1,
|
||||||
Saturation,
|
Saturation = 2,
|
||||||
ICCAbsoluteColorimetric,
|
ICCAbsoluteColorimetric = 3,
|
||||||
};
|
};
|
||||||
StringView rendering_intent_name(RenderingIntent);
|
StringView rendering_intent_name(RenderingIntent);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue