namespace UglyToad.Pdf.Graphics
{
internal enum RenderingIntent
{
///
/// No correction for the output medium's white point. Colors
/// only represented relative to the light source.
///
AbsoluteColorimetric = 0,
///
/// Combines light source and output medium's white point.
///
RelativeColorimetric = 1,
///
/// Emphasises saturation rather than colorimetric accuracy.
///
Saturation = 2,
///
/// Modifies from colorimetric values to provide a "pleasing perceptual appearance".
///
Perceptual = 3
}
internal static class RenderingIntentExtensions
{
public static RenderingIntent ToRenderingIntent(this string s)
{
switch (s)
{
case "AbsoluteColorimetric":
return RenderingIntent.AbsoluteColorimetric;
case "RelativeColorimetric":
return RenderingIntent.RelativeColorimetric;
case "Saturation":
return RenderingIntent.Saturation;
case "Perceptual":
return RenderingIntent.Perceptual;
default:
// If the application does not recognise the name it uses RelativeColorimetric by default.
return RenderingIntent.RelativeColorimetric;
}
}
}
}