[html5] r7031 - [giow] (0) Provide a switch to disable drawImage()'s smoothing. Affected topics: [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Mar 27 15:06:10 PDT 2012


Author: ianh
Date: 2012-03-27 15:06:08 -0700 (Tue, 27 Mar 2012)
New Revision: 7031

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Provide a switch to disable drawImage()'s smoothing.
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2012-03-26 22:57:41 UTC (rev 7030)
+++ complete.html	2012-03-27 22:06:08 UTC (rev 7031)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 26 March 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 27 March 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -34958,6 +34958,7 @@
   <a href=#textmetrics>TextMetrics</a> <a href=#dom-context-2d-measuretext title=dom-context-2d-measureText>measureText</a>(DOMString text);
 
   // drawing images
+           attribute boolean <a href=#dom-context-2d-imagesmoothingenabled title=dom-context-2d-imageSmoothingEnabled>imageSmoothingEnabled</a>; // (default true)
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy, double dw, double dh);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
@@ -38065,6 +38066,19 @@
 
    </dd>
 
+   <dt><var title="">context</var> . <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> [ = <var title="">value</var> ]</dt>
+
+   <dd>
+
+    <p>Returns whether the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method will
+    attempt to smooth the image if it has to rescale it (as opposed to
+    just rendering the image with "big pixels").</p>
+
+    <p>Can be set, to change whether images are smoothed (true) or not
+    (false).</p>
+
+   </dd>
+
   </dl><div class=impl>
 
   <p>If not specified, the <var title="">dw</var> and <var title="">dh</var> arguments must default to the values of <var title="">sw</var> and <var title="">sh</var>, interpreted such that
@@ -38128,9 +38142,16 @@
   suggested that 5,5,-2,-2 was different than 3,3,2,2; this is trying
   to clarify that this is no the case. --></p>
 
-  <p class=note>This specification does not define the algorithm to
-  use when scaling the image, if necessary.</p>
+  <p>If the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
+  attribute is set to true, then the user agent should attempt to
+  apply a smoothing algorithm to the image data when it is scaled.
+  Otherwise, the image must be rendered using nearest-neighbor
+  interpolation.</p>
 
+  <p class=note>This specification does not define the precise
+  algorithm to use when scaling an image when the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
+  attribute is set to true.</p>
+
   <p class=note>When a canvas is drawn onto itself, the <a href=#drawing-model>drawing
   model</a> requires the source to be copied before the image is drawn
   back onto the canvas, so it is possible to copy parts of a canvas
@@ -38169,6 +38190,12 @@
   subject to <a href=#shadows title=shadows>shadow effects</a>, <a href=#dom-context-2d-globalalpha title=dom-context-2d-globalAlpha>global alpha</a>, the <a href=#clipping-region title="clipping region">clipping region</a>, and <a href=#dom-context-2d-globalcompositeoperation title=dom-context-2d-globalCompositeOperation>global composition
   operators</a>.</p>
 
+  <p>The <dfn id=dom-context-2d-imagesmoothingenabled title=dom-context-2d-imageSmoothingEnabled><code>imageSmoothingEnabled</code></dfn>
+  attribute, on getting, must return the last value it was set to. On
+  setting, it must be set to the new value. When the
+  <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is create, the
+  attribute must be set to true.</p>
+
   </div>
 
 

Modified: index
===================================================================
--- index	2012-03-26 22:57:41 UTC (rev 7030)
+++ index	2012-03-27 22:06:08 UTC (rev 7031)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 26 March 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 27 March 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -34958,6 +34958,7 @@
   <a href=#textmetrics>TextMetrics</a> <a href=#dom-context-2d-measuretext title=dom-context-2d-measureText>measureText</a>(DOMString text);
 
   // drawing images
+           attribute boolean <a href=#dom-context-2d-imagesmoothingenabled title=dom-context-2d-imageSmoothingEnabled>imageSmoothingEnabled</a>; // (default true)
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy, double dw, double dh);
   void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
@@ -38065,6 +38066,19 @@
 
    </dd>
 
+   <dt><var title="">context</var> . <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> [ = <var title="">value</var> ]</dt>
+
+   <dd>
+
+    <p>Returns whether the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method will
+    attempt to smooth the image if it has to rescale it (as opposed to
+    just rendering the image with "big pixels").</p>
+
+    <p>Can be set, to change whether images are smoothed (true) or not
+    (false).</p>
+
+   </dd>
+
   </dl><div class=impl>
 
   <p>If not specified, the <var title="">dw</var> and <var title="">dh</var> arguments must default to the values of <var title="">sw</var> and <var title="">sh</var>, interpreted such that
@@ -38128,9 +38142,16 @@
   suggested that 5,5,-2,-2 was different than 3,3,2,2; this is trying
   to clarify that this is no the case. --></p>
 
-  <p class=note>This specification does not define the algorithm to
-  use when scaling the image, if necessary.</p>
+  <p>If the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
+  attribute is set to true, then the user agent should attempt to
+  apply a smoothing algorithm to the image data when it is scaled.
+  Otherwise, the image must be rendered using nearest-neighbor
+  interpolation.</p>
 
+  <p class=note>This specification does not define the precise
+  algorithm to use when scaling an image when the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
+  attribute is set to true.</p>
+
   <p class=note>When a canvas is drawn onto itself, the <a href=#drawing-model>drawing
   model</a> requires the source to be copied before the image is drawn
   back onto the canvas, so it is possible to copy parts of a canvas
@@ -38169,6 +38190,12 @@
   subject to <a href=#shadows title=shadows>shadow effects</a>, <a href=#dom-context-2d-globalalpha title=dom-context-2d-globalAlpha>global alpha</a>, the <a href=#clipping-region title="clipping region">clipping region</a>, and <a href=#dom-context-2d-globalcompositeoperation title=dom-context-2d-globalCompositeOperation>global composition
   operators</a>.</p>
 
+  <p>The <dfn id=dom-context-2d-imagesmoothingenabled title=dom-context-2d-imageSmoothingEnabled><code>imageSmoothingEnabled</code></dfn>
+  attribute, on getting, must return the last value it was set to. On
+  setting, it must be set to the new value. When the
+  <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is create, the
+  attribute must be set to true.</p>
+
   </div>
 
 

Modified: source
===================================================================
--- source	2012-03-26 22:57:41 UTC (rev 7030)
+++ source	2012-03-27 22:06:08 UTC (rev 7031)
@@ -40640,6 +40640,7 @@
   <span>TextMetrics</span> <span title="dom-context-2d-measureText">measureText</span>(DOMString text);
 
   // drawing images
+           attribute boolean <span title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</span>; // (default true)
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double dx, double dy);
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double dx, double dy, double dw, double dh);
   void <span title="dom-context-2d-drawImage">drawImage</span>((<span>HTMLImageElement</span> or <span>HTMLCanvasElement</span> or <span>HTMLVideoElement</span>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
@@ -44340,6 +44341,20 @@
 
    </dd>
 
+   <dt><var title="">context</var> . <code title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code> [ = <var title="">value</var> ]</dt>
+
+   <dd>
+
+    <p>Returns whether the <code
+    title="dom-context-2d-drawImage">drawImage()</code> method will
+    attempt to smooth the image if it has to rescale it (as opposed to
+    just rendering the image with "big pixels").</p>
+
+    <p>Can be set, to change whether images are smoothed (true) or not
+    (false).</p>
+
+   </dd>
+
   </dl>
 
   <div class="impl">
@@ -44427,9 +44442,18 @@
   suggested that 5,5,-2,-2 was different than 3,3,2,2; this is trying
   to clarify that this is no the case. --></p>
 
-  <p class="note">This specification does not define the algorithm to
-  use when scaling the image, if necessary.</p>
+  <p>If the <code
+  title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
+  attribute is set to true, then the user agent should attempt to
+  apply a smoothing algorithm to the image data when it is scaled.
+  Otherwise, the image must be rendered using nearest-neighbor
+  interpolation.</p>
 
+  <p class="note">This specification does not define the precise
+  algorithm to use when scaling an image when the <code
+  title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
+  attribute is set to true.</p>
+
   <p class="note">When a canvas is drawn onto itself, the <span>drawing
   model</span> requires the source to be copied before the image is drawn
   back onto the canvas, so it is possible to copy parts of a canvas
@@ -44473,6 +44497,13 @@
   title="dom-context-2d-globalCompositeOperation">global composition
   operators</span>.</p>
 
+  <p>The <dfn
+  title="dom-context-2d-imageSmoothingEnabled"><code>imageSmoothingEnabled</code></dfn>
+  attribute, on getting, must return the last value it was set to. On
+  setting, it must be set to the new value. When the
+  <code>CanvasRenderingContext2D</code> object is create, the
+  attribute must be set to true.</p>
+
   </div>
 
 




More information about the Commit-Watchers mailing list