[html5] r1165 - /
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 17 18:45:40 PST 2008
Author: ianh
Date: 2008-01-17 18:45:39 -0800 (Thu, 17 Jan 2008)
New Revision: 1165
Modified:
index
source
Log:
[gow] (2) ImageData: make the object handle having new values set. Clarify what it means to call putImageData() (not drawing). Clarify how to handle non-ImageData data. Make the color spaces compatible with CSS; make toDataURL() not include color space information.
Modified: index
===================================================================
--- index 2008-01-18 01:01:47 UTC (rev 1164)
+++ index 2008-01-18 02:45:39 UTC (rev 1165)
@@ -17296,6 +17296,20 @@
representing the 8 bit value for that component. At least one pixel must
be returned.
+ <p>The values of the <code title=dom-imagedata-data><a
+ href="#data1">data</a></code> array may be changed (the length of the
+ array, and the other attributes in <code><a
+ href="#imagedata">ImageData</a></code> objects, are all read-only). On
+ setting, JS <code>undefined</code> values must be converted to zero. Other
+ values must first be converted to numbers using JavaScript's ToNumber
+ algorithm, and if the result is not a number, a
+ <code>TYPE_MISMATCH_ERR</code> exception must be raised. If the result is
+ less than 0, it must be clamped to zero. If the result is more than 255,
+ it must be clamed to 255. If the number is not an integer, it must be
+ rounded to the nearest integer using the IEEE 754r <i>roundTiesToEven</i>
+ rounding mode. <a href="#refsECMA262">[ECMA262]</a> <a
+ href="#refsIEEE754r">[IEEE754R]</a>
+
<p class=note>The width and height (<var title="">w</var> and <var
title="">h</var>) might be different than the <var title="">sw</var> and
<var title="">sh</var> arguments to the function, e.g. if the canvas is
@@ -17313,7 +17327,7 @@
title=dom-context-2d-putImageData><code>putImageData(<var
title="">image</var>, <var title="">dx</var>, <var
title="">dy</var>)</code></dfn> method must take the given <code><a
- href="#imagedata">ImageData</a></code> structure, and draw it at the
+ href="#imagedata">ImageData</a></code> structure, and place it at the
specified location <var title="">dx</var>,<var title="">dy</var> in the
canvas coordinate space, mapping each pixel represented by the <code><a
href="#imagedata">ImageData</a></code> structure into one device pixel.
@@ -17329,7 +17343,9 @@
title=dom-imagedata-width><a href="#width2">width</a></code> and <code
title=dom-imagedata-height><a href="#height2">height</a></code>
attributes with integer values and a <code title=dom-imagedata-data><a
- href="#data1">data</a></code> attribute whose value is an integer array.
+ href="#data1">data</a></code> attribute whose value is an enumerable list
+ of values that are either JS Numbers or the JS value
+ <code>undefined</code>.
<li>The <code><a href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-width><a href="#width2">width</a></code> is greater
@@ -17345,13 +17361,16 @@
href="#height2">height</a></code> multiplied by 4 is equal to the number
of entries in the <code><a href="#imagedata">ImageData</a></code>
object's <code title=dom-imagedata-data><a href="#data1">data</a></code>
- array.
-
- <li>The <code><a href="#imagedata">ImageData</a></code> object's <code
- title=dom-imagedata-data><a href="#data1">data</a></code> array only
- contains entries that are in the range 0 to 255 inclusive.
+ property.
</ul>
+ <p>In the <code title=dom-imagedata-data><a href="#data1">data</a></code>
+ property, undefined values must be treated as zero, any numbers below zero
+ must be clamped to zero, any numbers above 255 must be clamped to 255, and
+ any numbers that are not integers must be rounded to the nearest integer
+ using the IEEE 754r <i>roundTiesToEven</i> rounding mode. <a
+ href="#refsIEEE754r">[IEEE754R]</a>
+
<p>The handling of pixel rounding when the specified coordinates do not
exactly map to the device coordinate space is not defined by this
specification, except that the following must result in no visible changes
@@ -17472,22 +17491,26 @@
<p>The <code><a href="#canvas">canvas</a></code> APIs must perform colour
correction at only two points: when rendering images with their own gamma
- correction information onto the canvas (e.g. using the <code
+ correction information onto the canvas, to convert the image to the color
+ space used by the canvas (e.g. using the <code
title=dom-context-2d-drawImage><a href="#drawimage">drawImage()</a></code>
method with an <code><a
- href="#htmlimageelement">HTMLImageElement</a></code> object, to convert
- the image to the color space used by the canvas), and when rendering the
- actual canvas bitmap to the output device or to an external resource (e.g.
- using the <code title=dom-canvas-toDataURL><a
- href="#todataurl">toDataURL()</a></code> method).
+ href="#htmlimageelement">HTMLImageElement</a></code> object), and when
+ rendering the actual canvas bitmap to the output device.
- <p>Thus, colors used to draw shapes onto the canvas will exactly match
- colors obtained through the <code title=dom-context-2d-getImageData><a
+ <p>Thus, in the 2D context, colors used to draw shapes onto the canvas will
+ exactly match colors obtained through the <code
+ title=dom-context-2d-getImageData><a
href="#getimagedata">getImageData()</a></code> method.
- <p class=big-issue>(is this right?) <!-- XXX --> The canvas must use the
- sRGB color space. <a href="#refsSRGB">[SRGB]</a>
+ <p>The <code title=dom-canvas-toDataURL><a
+ href="#todataurl">toDataURL()</a></code> method must not include color
+ space information in the resource returned.
+ <p>In user agents that support CSS, the color space used by a <code><a
+ href="#canvas">canvas</a></code> element must match the color space used
+ for processing any colors for that element in CSS.
+
<h4 id=the-map><span class=secno>3.14.12. </span>The <dfn
id=map><code>map</code></dfn> element</h4>
Modified: source
===================================================================
--- source 2008-01-18 01:01:47 UTC (rev 1164)
+++ source 2008-01-18 02:45:39 UTC (rev 1165)
@@ -14879,6 +14879,20 @@
in this array must be in the range 0..255, representing the 8 bit
value for that component. At least one pixel must be returned.</p>
+ <p>The values of the <code title="dom-imagedata-data">data</code>
+ array may be changed (the length of the array, and the other
+ attributes in <code>ImageData</code> objects, are all read-only). On
+ setting, JS <code>undefined</code> values must be converted to zero.
+ Other values must first be converted to numbers using JavaScript's
+ ToNumber algorithm, and if the result is not a number, a
+ <code>TYPE_MISMATCH_ERR</code> exception must be raised. If the
+ result is less than 0, it must be clamped to zero. If the result is
+ more than 255, it must be clamed to 255. If the number is not an
+ integer, it must be rounded to the nearest integer using the IEEE
+ 754r <i>roundTiesToEven</i> rounding mode. <a
+ href="#refsECMA262">[ECMA262]</a> <a
+ href="#refsIEEE754r">[IEEE754R]</a></p>
+
<p class="note">The width and height (<var title="">w</var> and <var
title="">h</var>) might be different than the <var title="">sw</var>
and <var title="">sh</var> arguments to the function, e.g. if the
@@ -14896,7 +14910,7 @@
title="dom-context-2d-putImageData"><code>putImageData(<var
title="">image</var>, <var title="">dx</var>, <var
title="">dy</var>)</code></dfn> method must take the given
- <code>ImageData</code> structure, and draw it at the specified
+ <code>ImageData</code> structure, and place it at the specified
location <var title="">dx</var>,<var title="">dy</var> in the canvas
coordinate space, mapping each pixel represented by the
<code>ImageData</code> structure into one device pixel.</p>
@@ -14913,7 +14927,8 @@
title="dom-imagedata-width">width</code> and <code
title="dom-imagedata-height">height</code> attributes with integer
values and a <code title="dom-imagedata-data">data</code> attribute
- whose value is an integer array.</li>
+ whose value is an enumerable list of values that are either JS
+ Numbers or the JS value <code>undefined</code>.</li>
<li>The <code>ImageData</code> object's <code
title="dom-imagedata-width">width</code> is greater than
@@ -14927,14 +14942,17 @@
title="dom-imagedata-width">width</code> multiplied by its <code
title="dom-imagedata-height">height</code> multiplied by 4 is equal
to the number of entries in the <code>ImageData</code> object's
- <code title="dom-imagedata-data">data</code> array.</li>
+ <code title="dom-imagedata-data">data</code> property.</li>
- <li>The <code>ImageData</code> object's <code
- title="dom-imagedata-data">data</code> array only contains entries
- that are in the range 0 to 255 inclusive.</li>
-
</ul>
+ <p>In the <code title="dom-imagedata-data">data</code> property,
+ undefined values must be treated as zero, any numbers below zero
+ must be clamped to zero, any numbers above 255 must be clamped to
+ 255, and any numbers that are not integers must be rounded to the
+ nearest integer using the IEEE 754r <i>roundTiesToEven</i> rounding
+ mode. <a href="#refsIEEE754r">[IEEE754R]</a></p>
+
<p>The handling of pixel rounding when the specified coordinates do
not exactly map to the device coordinate space is not defined by
this specification, except that the following must result in no
@@ -15065,22 +15083,24 @@
<p>The <code>canvas</code> APIs must perform colour correction at
only two points: when rendering images with their own gamma
- correction information onto the canvas (e.g. using the <code
+ correction information onto the canvas, to convert the image to the
+ color space used by the canvas (e.g. using the <code
title="dom-context-2d-drawImage">drawImage()</code> method with an
- <code>HTMLImageElement</code> object, to convert the image to the
- color space used by the canvas), and when rendering the actual
- canvas bitmap to the output device or to an external resource
- (e.g. using the <code
- title="dom-canvas-toDataURL">toDataURL()</code> method).</p>
+ <code>HTMLImageElement</code> object), and when rendering the actual
+ canvas bitmap to the output device.</p>
- <p>Thus, colors used to draw shapes onto the canvas will exactly
- match colors obtained through the <code
+ <p>Thus, in the 2D context, colors used to draw shapes onto the
+ canvas will exactly match colors obtained through the <code
title="dom-context-2d-getImageData">getImageData()</code>
method.</p>
- <p class="big-issue">(is this right?) <!-- XXX --> The canvas must
- use the sRGB color space. <a href="#refsSRGB">[SRGB]</a></p>
+ <p>The <code title="dom-canvas-toDataURL">toDataURL()</code> method
+ must not include color space information in the resource
+ returned.</p>
+ <p>In user agents that support CSS, the color space used by a
+ <code>canvas</code> element must match the color space used for
+ processing any colors for that element in CSS.</p>
More information about the Commit-Watchers
mailing list