-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds wide-gamut support #3882
Adds wide-gamut support #3882
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59318,6 +59318,17 @@ dictionary <dfn>AssignedNodesOptions</dfn> { | |
<dd w-nodev> | ||
<pre><code class="idl" data-x="">typedef (<span>CanvasRenderingContext2D</span> or <span>ImageBitmapRenderingContext</span> or <span>WebGLRenderingContext</span>) <dfn>RenderingContext</dfn>; | ||
|
||
enum <dfn>CanvasPixelFormat</dfn> { | ||
"8-8-8-8", // default | ||
"float16", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No trailing comma |
||
}; | ||
|
||
dictionary <dfn>ImageEncodeOptions</dfn> { | ||
DOMString <span data-x="image-encode-options-type">type</span> = "image/png"; | ||
unrestricted double <span data-x="image-encode-options-quality">quality</span> = 1.0; | ||
CanvasPixelFormat <span data-x="image-encode-options-pixelformat">pixelFormat</span> = "8-8-8-8"; | ||
}; | ||
|
||
[Exposed=Window, | ||
<span>HTMLConstructor</span>] | ||
interface <dfn>HTMLCanvasElement</dfn> : <span>HTMLElement</span> { | ||
|
@@ -59817,6 +59828,7 @@ enum <dfn>CanvasFillRule</dfn> { "<span data-x="dom-context-2d-fillRule-nonzero" | |
|
||
dictionary <dfn>CanvasRenderingContext2DSettings</dfn> { | ||
boolean <span data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</span> = true; | ||
<span>CanvasPixelFormat</span> <span data-x="dom-CanvasRenderingContext2DSettings-pixelFormat">pixelFormat</span> = "8-8-8-8"; | ||
}; | ||
|
||
enum <dfn>ImageSmoothingQuality</dfn> { "<span data-x="dom-context-2d-imageSmoothingQuality-low">low</span>", "<span data-x="dom-context-2d-imageSmoothingQuality-medium">medium</span>", "<span data-x="dom-context-2d-imageSmoothingQuality-high">high</span>" }; | ||
|
@@ -60080,6 +60092,15 @@ interface <dfn>Path2D</dfn> { | |
|
||
</dd> | ||
|
||
<dt><var>context</var> = <var>canvas</var> . <code data-x="dom-canvas-getContext">getContext</code>('2d' [, { [ <code data-x="dom-CanvasRenderingContext2DSettings-pixelFormat">pixelFormat</code>: "float16" ] } ] )</dt> | ||
|
||
<dd> | ||
|
||
<p>Returns a <code>CanvasRenderingContext2D</code> object backed by a 16-bit | ||
float backing.</p> | ||
|
||
</dd> | ||
|
||
<dt><var>context</var> . <code subdfn data-x="dom-context-2d-canvas">canvas</code></dt> | ||
|
||
<dd> | ||
|
@@ -60183,6 +60204,16 @@ interface <dfn>Path2D</dfn> { | |
<dd>If false, then set <var>context</var>'s <span data-x="concept-canvas-alpha">alpha</span> | ||
flag to false.</dd> | ||
</dl> | ||
|
||
<dl> | ||
<dt><dfn><code data-x="dom-CanvasRenderingContext2DSettings-pixelFormat">pixelFormat</code></dfn></dt> | ||
<dd>Decides the backing storage for the <code data-x="dom-context-2d-canvas">canvas</code>'s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a description, but doesn't make any statements requiring the user agent to do anything. Some questions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
context. Support for "8-8-8-8" is mandatory. All other formats are optional. When using "8-8-8-8", | ||
one byte is used for each color channel and 1 byte used for alpha. When using float | ||
formats, values outside of [0, 1] range can be used to represent colors outside of the color | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This requires the transfer function to be fully specified outside [0,1]. Could I have a pointer to where that is defined? |
||
gamut, depending on the capabilities of the device and output display.</dd> | ||
</dl> | ||
|
||
</li> | ||
|
||
<li><p>Return <var>context</var>.</p></li> | ||
|
@@ -65041,11 +65072,6 @@ dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> { | |
<pre><code class="idl" data-x="">typedef (<span>OffscreenCanvasRenderingContext2D</span> or | ||
<span>WebGLRenderingContext</span>) <dfn>OffscreenRenderingContext</dfn>; | ||
|
||
dictionary <dfn>ImageEncodeOptions</dfn> { | ||
DOMString <span data-x="image-encode-options-type">type</span> = "image/png"; | ||
unrestricted double <span data-x="image-encode-options-quality">quality</span> = 1.0; | ||
}; | ||
|
||
enum <dfn>OffscreenRenderingContextId</dfn> { "<span data-x="offscreen-context-type-2d">2d</span>", "<span data-x="offscreen-context-type-webgl">webgl</span>" }; | ||
|
||
[<span data-x="dom-OffscreenCanvas">Constructor</span>([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height), Exposed=(Window,Worker), <span>Transferable</span>] | ||
|
@@ -65352,8 +65378,9 @@ interface <dfn>OffscreenCanvas</dfn> : <span>EventTarget</span> { | |
|
||
<ol> | ||
<li><p>Let <var>file</var> be <span data-x="a serialization of the bitmap as a file">a | ||
serialization of <var>bitmap</var> as a file</span>, with <var>options</var>'s <dfn><code | ||
data-x="image-encode-options-type">type</code></dfn> and <dfn><code | ||
serialization of the <code>Canvas</code>'s bitmap as a file</span>, with <var>options</var>'s | ||
<dfn><code data-x="image-encode-options-type">type</code></dfn>, <dfn><code | ||
data-x="image-encode-options-pixelformat">pixelFormat</code></dfn> and <dfn><code | ||
data-x="image-encode-options-quality">quality</code></dfn>.</p></li> | ||
|
||
<li> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume you're using this pattern (which looks kinda odd to me, and doesn't match the structure of the other option) instead of something like
int8
because we want to be open to things like10-10-10-2
or whatever in the future?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly.