[html5] r6559 - [giow] (2) Kill CanvasPixelArray in favour of the Typed Array stuff.

whatwg at whatwg.org whatwg at whatwg.org
Wed Sep 21 15:58:25 PDT 2011


Author: ianh
Date: 2011-09-21 15:58:23 -0700 (Wed, 21 Sep 2011)
New Revision: 6559

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Kill CanvasPixelArray in favour of the Typed Array stuff.

Modified: complete.html
===================================================================
--- complete.html	2011-09-21 22:13:30 UTC (rev 6558)
+++ complete.html	2011-09-21 22:58:23 UTC (rev 6559)
@@ -8964,15 +8964,6 @@
 
      </dd>
 
-     <dt>If <var title="">input</var> is a <code><a href=#imagedata>ImageData</a></code> object</dt>
-
-     <dd><p>Let <var title="">output</var> be a newly constructed <code><a href=#imagedata>ImageData</a></code> object
-     with the same <code title=dom-imagedata-width><a href=#dom-imagedata-width>width</a></code> and
-     <code title=dom-imagedata-height><a href=#dom-imagedata-height>height</a></code> as <var title="">input</var>, and with a newly constructed
-     <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> for its <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute, with the same
-     <code title=dom-canvaspixelarray-length><a href=#dom-canvaspixelarray-length>length</a></code> and pixel
-     values as the <var title="">input</var>'s.</dd>
-
      <dt>If <var title="">input</var> is a <code><a href=#file>File</a></code> object</dt>
 
      <dd><p>Let <var title="">output</var> be a newly constructed <code><a href=#file>File</a></code> object corresponding to the same underlying data.</dd>
@@ -35120,13 +35111,7 @@
 interface <dfn id=imagedata>ImageData</dfn> {
   readonly attribute unsigned long <a href=#dom-imagedata-width title=dom-imagedata-width>width</a>;
   readonly attribute unsigned long <a href=#dom-imagedata-height title=dom-imagedata-height>height</a>;
-  readonly attribute <a href=#canvaspixelarray>CanvasPixelArray</a> <a href=#dom-imagedata-data title=dom-imagedata-data>data</a>;
-};
-
-interface <dfn id=canvaspixelarray>CanvasPixelArray</dfn> {
-  readonly attribute unsigned long <a href=#dom-canvaspixelarray-length title=dom-canvaspixelarray-length>length</a>;
-  <a href=#dom-canvaspixelarray-get title=dom-CanvasPixelArray-get>getter</a> octet (unsigned long index);
-  <a href=#dom-canvaspixelarray-set title=dom-CanvasPixelArray-set>setter</a> void (unsigned long index, [Clamp] octet value);
+  readonly attribute <span>Uint8ClampedArray</span> <a href=#dom-imagedata-data title=dom-imagedata-data>data</a>;
 };</pre>
 
  <!-- ARC-ORDER note (see above):
@@ -37624,42 +37609,24 @@
   pixels per row in the image data, their <dfn id=dom-imagedata-height title=dom-imagedata-height><code>height</code></dfn> attribute is
   set to <var title="">h</var>, the number of rows in the image data,
   and their <dfn id=dom-imagedata-data title=dom-imagedata-data><code>data</code></dfn>
-  attribute is initialized to a <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object
-  holding the image data. At least one pixel's worth of image data
-  must be returned.</p>
+  attribute is initialized to a <code>Uint8ClampedArray</code> object.
+  The <code>Uint8ClampedArray</code> object must use a <a href=#canvas-pixel-arraybuffer>Canvas
+  Pixel <code>ArrayBuffer</code></a> for its storage, and must have
+  a zero start offset and a length equal to the length of its storage,
+  in bytes. The <a href=#canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></a>
+  must contain the image data. At least one pixel's worth of image
+  data must be returned. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
 
-  <p>The <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object provides ordered,
-  indexed access to the color components of each pixel of the image
-  data. The data must be represented in left-to-right order, row by
-  row top to bottom, starting with the top left, with each pixel's
-  red, green, blue, and alpha components being given in that order for
-  each pixel. Each component of each device pixel represented in this
-  array must be in the range 0..255, representing the 8 bit value for
-  that component. The components must be assigned consecutive indices
-  starting with 0 for the top left pixel's red component.</p>
+  <p>A <dfn id=canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></dfn> is an
+  <code><a href=#arraybuffer>ArrayBuffer</a></code> that whose data is represented in
+  left-to-right order, row by row top to bottom, starting with the top
+  left, with each pixel's red, green, blue, and alpha components being
+  given in that order for each pixel. Each component of each device
+  pixel represented in this array must be in the range 0..255,
+  representing the 8 bit value for that component. The components must
+  be assigned consecutive indices starting with 0 for the top left
+  pixel's red component. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
 
-  <p>The <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object thus represents <var title="">h</var>×<var title="">w</var>×4 integers. The
-  <dfn id=dom-canvaspixelarray-length title=dom-canvaspixelarray-length><code>length</code></dfn>
-  attribute of a <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object must return this
-  number.</p>
-
-  <p>The object's <a href=#supported-property-indices>supported property indices</a> are the
-  numbers in the range 0 .. <span title=""><var title="">h</var>×<var title="">w</var>×4-1</span>.</p>
-
-  <p>To <dfn id=dom-canvaspixelarray-get title=dom-CanvasPixelArray-get>determine the value of
-  an indexed property</dfn> <var title="">index</var>, the user agent
-  must return the value of the <var title="">index</var>th component
-  in the array.</p>
-
-  <p>To <dfn id=dom-canvaspixelarray-set title=dom-CanvasPixelArray-set>set the value of an
-  existing indexed property</dfn> <var title="">index</var> to value
-  <var title="">value</var>, the value of the <var title="">index</var>th component in the array must be set to <var title="">value</var>.</p>
-
-  <p class=note>The width and height (<var title="">w</var> and <var title="">h</var>) might be different from the <var title="">sw</var>
-  and <var title="">sh</var> arguments to the above methods, e.g. if
-  the canvas is backed by a high-resolution bitmap, or if the <var title="">sw</var> and <var title="">sh</var> arguments are
-  negative.</p>
-
   <p>The <dfn id=dom-context-2d-putimagedata title=dom-context-2d-putImageData><code>putImageData(<var title="">imagedata</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dirtyX</var>, <var title="">dirtyY</var>, <var title="">dirtyWidth</var>, <var title="">dirtyHeight</var>)</code></dfn> method writes data from
   <code><a href=#imagedata>ImageData</a></code> structures back to the canvas.</p>
 

Modified: index
===================================================================
--- index	2011-09-21 22:13:30 UTC (rev 6558)
+++ index	2011-09-21 22:58:23 UTC (rev 6559)
@@ -8828,15 +8828,6 @@
 
      </dd>
 
-     <dt>If <var title="">input</var> is a <code><a href=#imagedata>ImageData</a></code> object</dt>
-
-     <dd><p>Let <var title="">output</var> be a newly constructed <code><a href=#imagedata>ImageData</a></code> object
-     with the same <code title=dom-imagedata-width><a href=#dom-imagedata-width>width</a></code> and
-     <code title=dom-imagedata-height><a href=#dom-imagedata-height>height</a></code> as <var title="">input</var>, and with a newly constructed
-     <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> for its <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute, with the same
-     <code title=dom-canvaspixelarray-length><a href=#dom-canvaspixelarray-length>length</a></code> and pixel
-     values as the <var title="">input</var>'s.</dd>
-
      <dt>If <var title="">input</var> is a <code><a href=#file>File</a></code> object</dt>
 
      <dd><p>Let <var title="">output</var> be a newly constructed <code><a href=#file>File</a></code> object corresponding to the same underlying data.</dd>
@@ -34987,13 +34978,7 @@
 interface <dfn id=imagedata>ImageData</dfn> {
   readonly attribute unsigned long <a href=#dom-imagedata-width title=dom-imagedata-width>width</a>;
   readonly attribute unsigned long <a href=#dom-imagedata-height title=dom-imagedata-height>height</a>;
-  readonly attribute <a href=#canvaspixelarray>CanvasPixelArray</a> <a href=#dom-imagedata-data title=dom-imagedata-data>data</a>;
-};
-
-interface <dfn id=canvaspixelarray>CanvasPixelArray</dfn> {
-  readonly attribute unsigned long <a href=#dom-canvaspixelarray-length title=dom-canvaspixelarray-length>length</a>;
-  <a href=#dom-canvaspixelarray-get title=dom-CanvasPixelArray-get>getter</a> octet (unsigned long index);
-  <a href=#dom-canvaspixelarray-set title=dom-CanvasPixelArray-set>setter</a> void (unsigned long index, [Clamp] octet value);
+  readonly attribute <span>Uint8ClampedArray</span> <a href=#dom-imagedata-data title=dom-imagedata-data>data</a>;
 };</pre>
 
  <!-- ARC-ORDER note (see above):
@@ -37491,42 +37476,24 @@
   pixels per row in the image data, their <dfn id=dom-imagedata-height title=dom-imagedata-height><code>height</code></dfn> attribute is
   set to <var title="">h</var>, the number of rows in the image data,
   and their <dfn id=dom-imagedata-data title=dom-imagedata-data><code>data</code></dfn>
-  attribute is initialized to a <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object
-  holding the image data. At least one pixel's worth of image data
-  must be returned.</p>
+  attribute is initialized to a <code>Uint8ClampedArray</code> object.
+  The <code>Uint8ClampedArray</code> object must use a <a href=#canvas-pixel-arraybuffer>Canvas
+  Pixel <code>ArrayBuffer</code></a> for its storage, and must have
+  a zero start offset and a length equal to the length of its storage,
+  in bytes. The <a href=#canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></a>
+  must contain the image data. At least one pixel's worth of image
+  data must be returned. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
 
-  <p>The <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object provides ordered,
-  indexed access to the color components of each pixel of the image
-  data. The data must be represented in left-to-right order, row by
-  row top to bottom, starting with the top left, with each pixel's
-  red, green, blue, and alpha components being given in that order for
-  each pixel. Each component of each device pixel represented in this
-  array must be in the range 0..255, representing the 8 bit value for
-  that component. The components must be assigned consecutive indices
-  starting with 0 for the top left pixel's red component.</p>
+  <p>A <dfn id=canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></dfn> is an
+  <code><a href=#arraybuffer>ArrayBuffer</a></code> that whose data is represented in
+  left-to-right order, row by row top to bottom, starting with the top
+  left, with each pixel's red, green, blue, and alpha components being
+  given in that order for each pixel. Each component of each device
+  pixel represented in this array must be in the range 0..255,
+  representing the 8 bit value for that component. The components must
+  be assigned consecutive indices starting with 0 for the top left
+  pixel's red component. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
 
-  <p>The <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object thus represents <var title="">h</var>×<var title="">w</var>×4 integers. The
-  <dfn id=dom-canvaspixelarray-length title=dom-canvaspixelarray-length><code>length</code></dfn>
-  attribute of a <code><a href=#canvaspixelarray>CanvasPixelArray</a></code> object must return this
-  number.</p>
-
-  <p>The object's <a href=#supported-property-indices>supported property indices</a> are the
-  numbers in the range 0 .. <span title=""><var title="">h</var>×<var title="">w</var>×4-1</span>.</p>
-
-  <p>To <dfn id=dom-canvaspixelarray-get title=dom-CanvasPixelArray-get>determine the value of
-  an indexed property</dfn> <var title="">index</var>, the user agent
-  must return the value of the <var title="">index</var>th component
-  in the array.</p>
-
-  <p>To <dfn id=dom-canvaspixelarray-set title=dom-CanvasPixelArray-set>set the value of an
-  existing indexed property</dfn> <var title="">index</var> to value
-  <var title="">value</var>, the value of the <var title="">index</var>th component in the array must be set to <var title="">value</var>.</p>
-
-  <p class=note>The width and height (<var title="">w</var> and <var title="">h</var>) might be different from the <var title="">sw</var>
-  and <var title="">sh</var> arguments to the above methods, e.g. if
-  the canvas is backed by a high-resolution bitmap, or if the <var title="">sw</var> and <var title="">sh</var> arguments are
-  negative.</p>
-
   <p>The <dfn id=dom-context-2d-putimagedata title=dom-context-2d-putImageData><code>putImageData(<var title="">imagedata</var>, <var title="">dx</var>, <var title="">dy</var>, <var title="">dirtyX</var>, <var title="">dirtyY</var>, <var title="">dirtyWidth</var>, <var title="">dirtyHeight</var>)</code></dfn> method writes data from
   <code><a href=#imagedata>ImageData</a></code> structures back to the canvas.</p>
 

Modified: source
===================================================================
--- source	2011-09-21 22:13:30 UTC (rev 6558)
+++ source	2011-09-21 22:58:23 UTC (rev 6559)
@@ -8943,17 +8943,6 @@
 
      </dd>
 
-     <dt>If <var title="">input</var> is a <code>ImageData</code> object</dt>
-
-     <dd><p>Let <var title="">output</var> be a newly constructed <code>ImageData</code> object
-     with the same <code title="dom-imagedata-width">width</code> and
-     <code title="dom-imagedata-height">height</code> as <var
-     title="">input</var>, and with a newly constructed
-     <code>CanvasPixelArray</code> for its <code
-     title="dom-imagedata-data">data</code> attribute, with the same
-     <code title="dom-canvaspixelarray-length">length</code> and pixel
-     values as the <var title="">input</var>'s.</p></dd>
-
      <dt>If <var title="">input</var> is a <code>File</code> object</dt>
 
      <dd><p>Let <var title="">output</var> be a newly constructed <code>File</code> object corresponding to the same underlying data.</p></dd>
@@ -38625,13 +38614,7 @@
 interface <dfn>ImageData</dfn> {
   readonly attribute unsigned long <span title="dom-imagedata-width">width</span>;
   readonly attribute unsigned long <span title="dom-imagedata-height">height</span>;
-  readonly attribute <span>CanvasPixelArray</span> <span title="dom-imagedata-data">data</span>;
-};
-
-interface <dfn>CanvasPixelArray</dfn> {
-  readonly attribute unsigned long <span title="dom-canvaspixelarray-length">length</span>;
-  <span title="dom-CanvasPixelArray-get">getter</span> octet (unsigned long index);
-  <span title="dom-CanvasPixelArray-set">setter</span> void (unsigned long index, [Clamp] octet value);
+  readonly attribute <span>Uint8ClampedArray</span> <span title="dom-imagedata-data">data</span>;
 };</pre>
 
  <!-- ARC-ORDER note (see above):
@@ -41631,48 +41614,24 @@
   title="dom-imagedata-height"><code>height</code></dfn> attribute is
   set to <var title="">h</var>, the number of rows in the image data,
   and their <dfn title="dom-imagedata-data"><code>data</code></dfn>
-  attribute is initialized to a <code>CanvasPixelArray</code> object
-  holding the image data. At least one pixel's worth of image data
-  must be returned.</p>
+  attribute is initialized to a <code>Uint8ClampedArray</code> object.
+  The <code>Uint8ClampedArray</code> object must use a <span>Canvas
+  Pixel <code>ArrayBuffer</code></span> for its storage, and must have
+  a zero start offset and a length equal to the length of its storage,
+  in bytes. The <span>Canvas Pixel <code>ArrayBuffer</code></span>
+  must contain the image data. At least one pixel's worth of image
+  data must be returned. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
 
-  <p>The <code>CanvasPixelArray</code> object provides ordered,
-  indexed access to the color components of each pixel of the image
-  data. The data must be represented in left-to-right order, row by
-  row top to bottom, starting with the top left, with each pixel's
-  red, green, blue, and alpha components being given in that order for
-  each pixel. Each component of each device pixel represented in this
-  array must be in the range 0..255, representing the 8 bit value for
-  that component. The components must be assigned consecutive indices
-  starting with 0 for the top left pixel's red component.</p>
+  <p>A <dfn>Canvas Pixel <code>ArrayBuffer</code></dfn> is an
+  <code>ArrayBuffer</code> that whose data is represented in
+  left-to-right order, row by row top to bottom, starting with the top
+  left, with each pixel's red, green, blue, and alpha components being
+  given in that order for each pixel. Each component of each device
+  pixel represented in this array must be in the range 0..255,
+  representing the 8 bit value for that component. The components must
+  be assigned consecutive indices starting with 0 for the top left
+  pixel's red component. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
 
-  <p>The <code>CanvasPixelArray</code> object thus represents <var
-  title="">h</var>×<var title="">w</var>×4 integers. The
-  <dfn title="dom-canvaspixelarray-length"><code>length</code></dfn>
-  attribute of a <code>CanvasPixelArray</code> object must return this
-  number.</p>
-
-  <p>The object's <span>supported property indices</span> are the
-  numbers in the range 0 .. <span title=""><var
-  title="">h</var>×<var title="">w</var>×4-1</span>.</p>
-
-  <p>To <dfn title="dom-CanvasPixelArray-get">determine the value of
-  an indexed property</dfn> <var title="">index</var>, the user agent
-  must return the value of the <var title="">index</var>th component
-  in the array.</p>
-
-  <p>To <dfn title="dom-CanvasPixelArray-set">set the value of an
-  existing indexed property</dfn> <var title="">index</var> to value
-  <var title="">value</var>, the value of the <var
-  title="">index</var>th component in the array must be set to <var
-  title="">value</var>.</p>
-
-  <p class="note">The width and height (<var title="">w</var> and <var
-  title="">h</var>) might be different from the <var title="">sw</var>
-  and <var title="">sh</var> arguments to the above methods, e.g. if
-  the canvas is backed by a high-resolution bitmap, or if the <var
-  title="">sw</var> and <var title="">sh</var> arguments are
-  negative.</p>
-
   <p>The <dfn
   title="dom-context-2d-putImageData"><code>putImageData(<var
   title="">imagedata</var>, <var title="">dx</var>, <var




More information about the Commit-Watchers mailing list