From 68b51fcf5b928905c8910bb8fbb69f8f5bdd1806 Mon Sep 17 00:00:00 2001
From: Christopher Cameron The Color spaces and color space
conversion
-
+ enum PredefinedColorSpace { "srgb", "display-p3" };
enum PredefinedColorSpace {
+ "srgb",
+ "display-p3"
+};
+
+enum CanvasToneMappingMode {
+ "standard",
+ "extended",
+};
+
+dictionary CanvasToneMapping {
+ CanvasToneMappingMode mode = "standard";
+};
PredefinedColorSpace
enumeration is used to specify the color space of the canvas's backing store.
The CanvasToneMappingMode
enumeration specifies the tone mapping
+ to perform when rendering the context's output bitmap to the screen.
The "standard
" value indicates that
+ color values within the standard dynamic range of the screen shall be unchanged, and
+ all other color values shall be projected to the standard dynamic range of the screen.
This projection is often accomplished by clamping color values in the color + space of the screen to the [0, 1] interval.
+ +Suppose that the value (1.035, -0.175, -0.140) is written to an output bitmap + with color space 'srgb'.
+ +If this is presented to a screen that natively uses the 'srgb' color space, then + this value will be converted to 'srgb' (which is a no-op), then projected to the + [0, 1] cubed volume in that space. Using component-wise clamping, this would result in the + 'srgb' value (1.0, 0.0, 0.0).
+ +If this is presented to a screen that natively uses the 'display-p3' color space, + then this will be converted to the value (0.948, 0.106, 0.01) in the 'display-p3' + color space, and no clamping will be needed.
+The "extended
" value indicates that
+ color values within the extended dynamic range of the screen shall be unchanged, and
+ all other color values shall be projected to the extended dynamic range of the screen.
This projection is often accomplished by clamping color values in the color + space of the screen to the interval of values that the screen is capable of displaying, + which can include values greater than 1.
+ +Suppose that the value (2.5, -0.15, -0.15) is written to an output bitmap + with color space 'srgb'.
+ +If this is presented to a screen that natively uses the 'srgb' color space and + is capable of displaying values in the [0, 4] interval in that color space, then this value will be + converted to 'srgb' (which is a no-op), then projected to the [0, 4] cubed volume in + that space. Using component-wise clamping, this would result in the 'srgb' value + (2.5, 0.0, 0.0).
+ +If this is presented to a screen that natively uses the 'display-p3' color space + and is capable of displaying values in the [0, 2] interval in that color space, then this value + will be converted to the value (2.3, 0.545, 0.01) in the 'display-p3' color space, + and then projected to the [0, 2] cubed volume in that space. Using component-wise clamping, this + would result in the 'display-p3' value (2.0, 0.545, 0.386).
+context = canvas.getContext('2d' [, { [ alpha: true ] [, desynchronized: false ] [, colorSpace: 'srgb'] [, willReadFrequently: false ]} ])
context = canvas.getContext('2d' [, { [ alpha: true ] [, desynchronized: false ] [, colorSpace: 'srgb'] [, toneMapping: {}] [, willReadFrequently: false ]} ])
Returns a CanvasRenderingContext2D
object that is permanently bound to a
particular canvas
element.
The toneMapping
member
+ specifies the tone mapping of the rendering
+ context.
The colorType
member
specifies the color type of the rendering
context.
toneMapping
member is
+ a dictionary indicating the context's tone mapping
+ behavior.colorType
member is
a string indicating the context's color
type.The CanvasSettings
object also has a tone mapping setting of type
+ CanvasToneMapping
. The CanvasSettings
object's tone mapping indicates the tone mapping behavior
+ of the output bitmap.
The CanvasSettings
object also has a color type setting of type
CanvasColorType
. The CanvasSettings
object's
settings["colorSpace
"].
Set context's tone mapping to
+ settings["toneMapping
"].
Set context's color type to
settings["colorType
"].
colorSpace
" → this's
color space, "toneMapping
" → this's
+ tone mapping, "colorType
" → this's
color type, "willReadFrequently
" →
@@ -75551,15 +75572,6 @@ dictionary CanvasToneMapping {
data-x="dom-PredefinedColorSpace-display-p3">display-p3" value indicates the
'display-p3' color space.
- Color space conversion must be applied to the canvas's - backing store when rendering the canvas to the output device.
- -The algorithm for converting between color spaces can be found in the
- Converting Colors section of CSS Color. This color space conversion is
- identical to the color space conversion that would be applied to an img
element with
- a color profile that specifies the same color
- space as the canvas's backing store. CSSCOLOR
The CanvasToneMappingMode
enumeration specifies the tone mapping
to perform when rendering the context's output bitmap to the screen.
Color space conversion must be applied to the canvas's + backing store when rendering the canvas to the output device.
+ +The algorithm for converting between color spaces can be found in the
+ Converting Colors section of CSS Color. This color space conversion is
+ identical to the color space conversion that would be applied to an img
element with
+ a color profile that specifies the same color
+ space as the canvas's backing store. CSSCOLOR