Module: HexaPDF::Content::RenderingIntent
- Defined in:
- lib/hexapdf/content/graphics_state.rb
Overview
Defines all available rendering intents as constants. For use with e.g. Canvas#rendering_intent.
See: PDF2.0 s8.6.5.8
Constant Summary collapse
- ABSOLUTE_COLORIMETRIC =
Colors should be represented solely with respect to the light source.
:AbsoluteColorimetric
- RELATIVE_COLORIMETRIC =
Colous should be represented with respect to the combination of the light source and the output medium’s white point.
:RelativeColorimetric
- SATURATION =
Colors should be represented in a manner that preserves or emphasizes saturation.
:Saturation
- PERCEPTUAL =
Colous should be represented in a manner that provides a pleasing perceptual appearance.
:Perceptual
Class Method Summary collapse
-
.normalize(intent) ⇒ Object
Returns the argument normalized to a valid rendering intent.
Class Method Details
.normalize(intent) ⇒ Object
Returns the argument normalized to a valid rendering intent.
-
If the argument is a valid symbol, it is just returned.
-
Otherwise an error is raised.
285 286 287 288 289 290 291 292 |
# File 'lib/hexapdf/content/graphics_state.rb', line 285 def self.normalize(intent) case intent when ABSOLUTE_COLORIMETRIC, RELATIVE_COLORIMETRIC, SATURATION, PERCEPTUAL intent else raise ArgumentError, "Invalid rendering intent: #{intent}" end end |