[html5] r3046 - [gow] (2) createImageData() now also takes a single ImageData argument, so that [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Apr 30 16:01:07 PDT 2009
Author: ianh
Date: 2009-04-30 16:01:06 -0700 (Thu, 30 Apr 2009)
New Revision: 3046
Modified:
index
source
Log:
[gow] (2) createImageData() now also takes a single ImageData argument, so that you can get new ImageData objects of the same dimensions, for filters that need that kind of thing.
Modified: index
===================================================================
--- index 2009-04-30 22:53:52 UTC (rev 3045)
+++ index 2009-04-30 23:01:06 UTC (rev 3046)
@@ -22634,6 +22634,7 @@
// pixel manipulation
<a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(in float sw, in float sh);
+ <a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(in <a href=#imagedata>ImageData</a> imagedata);
<a href=#imagedata>ImageData</a> <a href=#dom-context-2d-getimagedata title=dom-context-2d-getImageData>getImageData</a>(in float sx, in float sy, in float sw, in float sh);
void <a href=#dom-context-2d-putimagedata title=dom-context-2d-putImageData>putImageData</a>(in <a href=#imagedata>ImageData</a> imagedata, in float dx, in float dy, [Optional] in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight);
};
@@ -24728,6 +24729,19 @@
</dd>
+ <dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData</a></code>(<var title="">imagedata</var>)</dt>
+
+ <dd>
+
+ <p>Returns an <code><a href=#imagedata>ImageData</a></code> object with the same
+ dimensions as the argument. All the pixels in the returned object
+ are transparent black.</p>
+
+ <p>Throws a <code><a href=#not_supported_err>NOT_SUPPORTED_ERR</a></code> exception if the
+ argument is null.</p>
+
+ </dd>
+
<dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-getImageData><a href=#dom-context-2d-getimagedata>getImageData</a></code>(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</dt>
<dd>
@@ -24776,11 +24790,16 @@
</dl><div class=impl>
- <p>The <dfn id=dom-context-2d-createimagedata title=dom-context-2d-createImageData><code>createImageData(<var title="">sw</var>, <var title="">sh</var>)</code></dfn> method must
- return an <code><a href=#imagedata>ImageData</a></code> object representing a rectangle
- with a width in CSS pixels equal to the absolute magnitude of <var title="">sw</var> and a height in CSS pixels equal to the absolute
- magnitude of <var title="">sh</var>, filled with transparent
- black.</p>
+ <p>The <dfn id=dom-context-2d-createimagedata title=dom-context-2d-createImageData><code>createImageData()</code></dfn>
+ method is used to instantiate new blank <code><a href=#imagedata>ImageData</a></code>
+ objects. When the method is invoked with two arguments <var title="">sw</var> and <var title="">sh</var>, it must return an
+ <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width
+ in CSS pixels equal to the absolute magnitude of <var title="">sw</var> and a height in CSS pixels equal to the absolute
+ magnitude of <var title="">sh</var>. When invoked with a single <var title="">imagedata</var> argument, it must return an
+ <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with the same
+ dimensions as the <code><a href=#imagedata>ImageData</a></code> object passed as the
+ argument. The <code><a href=#imagedata>ImageData</a></code> object return must be filled
+ with transparent black.</p>
<p>The <dfn id=dom-context-2d-getimagedata title=dom-context-2d-getImageData><code>getImageData(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>,
<var title="">sh</var>)</code></dfn> method must return an
@@ -24794,10 +24813,11 @@
<p>If any of the arguments to <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData()</a></code> or
<code title=dom-context-2d-getImageData><a href=#dom-context-2d-getimagedata>getImageData()</a></code> are
- infinite or NaN, the method must instead raise a
- <code><a href=#not_supported_err>NOT_SUPPORTED_ERR</a></code> exception. If either the <var title="">sw</var> or <var title="">sh</var> arguments are zero, the
- method must instead raise an <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code>
- exception.</p>
+ infinite or NaN, or if the <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData()</a></code>
+ method is invoked with only one argument but that argument is null,
+ the method must instead raise a <code><a href=#not_supported_err>NOT_SUPPORTED_ERR</a></code>
+ exception. If either the <var title="">sw</var> or <var title="">sh</var> arguments are zero, the method must instead raise
+ an <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception.</p>
<p><code><a href=#imagedata>ImageData</a></code> objects must be initialized so that their
<dfn id=dom-imagedata-width title=dom-imagedata-width><code>width</code></dfn> attribute
Modified: source
===================================================================
--- source 2009-04-30 22:53:52 UTC (rev 3045)
+++ source 2009-04-30 23:01:06 UTC (rev 3046)
@@ -24684,6 +24684,7 @@
// pixel manipulation
<span>ImageData</span> <span title="dom-context-2d-createImageData">createImageData</span>(in float sw, in float sh);
+ <span>ImageData</span> <span title="dom-context-2d-createImageData">createImageData</span>(in <span>ImageData</span> imagedata);
<span>ImageData</span> <span title="dom-context-2d-getImageData">getImageData</span>(in float sx, in float sy, in float sw, in float sh);
void <span title="dom-context-2d-putImageData">putImageData</span>(in <span>ImageData</span> imagedata, in float dx, in float dy, [Optional] in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight);
};
@@ -27197,6 +27198,19 @@
</dd>
+ <dt><var title="">imagedata</var> = <var title="">context</var> . <code title="dom-context-2d-createImageData">createImageData</code>(<var title="">imagedata</var>)</dt>
+
+ <dd>
+
+ <p>Returns an <code>ImageData</code> object with the same
+ dimensions as the argument. All the pixels in the returned object
+ are transparent black.</p>
+
+ <p>Throws a <code>NOT_SUPPORTED_ERR</code> exception if the
+ argument is null.</p>
+
+ </dd>
+
<dt><var title="">imagedata</var> = <var title="">context</var> . <code title="dom-context-2d-getImageData">getImageData</code>(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</dt>
<dd>
@@ -27248,13 +27262,19 @@
<div class="impl">
<p>The <dfn
- title="dom-context-2d-createImageData"><code>createImageData(<var
- title="">sw</var>, <var title="">sh</var>)</code></dfn> method must
- return an <code>ImageData</code> object representing a rectangle
- with a width in CSS pixels equal to the absolute magnitude of <var
+ title="dom-context-2d-createImageData"><code>createImageData()</code></dfn>
+ method is used to instantiate new blank <code>ImageData</code>
+ objects. When the method is invoked with two arguments <var
+ title="">sw</var> and <var title="">sh</var>, it must return an
+ <code>ImageData</code> object representing a rectangle with a width
+ in CSS pixels equal to the absolute magnitude of <var
title="">sw</var> and a height in CSS pixels equal to the absolute
- magnitude of <var title="">sh</var>, filled with transparent
- black.</p>
+ magnitude of <var title="">sh</var>. When invoked with a single <var
+ title="">imagedata</var> argument, it must return an
+ <code>ImageData</code> object representing a rectangle with the same
+ dimensions as the <code>ImageData</code> object passed as the
+ argument. The <code>ImageData</code> object return must be filled
+ with transparent black.</p>
<p>The <dfn
title="dom-context-2d-getImageData"><code>getImageData(<var
@@ -27275,11 +27295,13 @@
<p>If any of the arguments to <code
title="dom-context-2d-createImageData">createImageData()</code> or
<code title="dom-context-2d-getImageData">getImageData()</code> are
- infinite or NaN, the method must instead raise a
- <code>NOT_SUPPORTED_ERR</code> exception. If either the <var
- title="">sw</var> or <var title="">sh</var> arguments are zero, the
- method must instead raise an <code>INDEX_SIZE_ERR</code>
- exception.</p>
+ infinite or NaN, or if the <code
+ title="dom-context-2d-createImageData">createImageData()</code>
+ method is invoked with only one argument but that argument is null,
+ the method must instead raise a <code>NOT_SUPPORTED_ERR</code>
+ exception. If either the <var title="">sw</var> or <var
+ title="">sh</var> arguments are zero, the method must instead raise
+ an <code>INDEX_SIZE_ERR</code> exception.</p>
<p><code>ImageData</code> objects must be initialized so that their
<dfn title="dom-imagedata-width"><code>width</code></dfn> attribute
More information about the Commit-Watchers
mailing list