Skip to content

Commit

Permalink
[giow] (1) Allow UAs to use algorithms other than nearest-neighbour w…
Browse files Browse the repository at this point in the history
…hen scaling images down.

Affected topics: Canvas

git-svn-id: http://svn.whatwg.org/webapps@8132 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 6, 2013
1 parent fa201f6 commit 5854cb0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
17 changes: 9 additions & 8 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -36338,11 +36338,12 @@ <h6 id=fill-and-stroke-styles><span class=secno>4.8.11.2.10 </span>Fill and stro
behavior is "<code title="">repeat-y</code>", or in all four directions all over the bitmap, if
the repetition behavior is "<code title="">repeat</code>".</p>

<!--CLEANUP-->
<p>If the original image data is a bitmap image, the value painted at a point in the area of the
repetitions is computed by filtering the original image data. 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 may use any filtering algorithm (for example bilinear interpolation or
nearest-neighbor). If the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> attribute is set to
false, the image must be rendered using nearest-neighbor interpolation. When such a filtering
repetitions is computed by filtering the original image data. When scaling up, if the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> attribute is set to
true, the image must be rendered using nearest-neighbor interpolation. Otherwise, the user agent
may use any filtering algorithm (for example bilinear interpolation or nearest-neighbor). When
such a filtering
algorithm requires a pixel value from outside the original image data, it must instead use the
value from wrapping the pixel's coordinates to the original image's dimensions. (That is, the
filter uses 'repeat' behavior, regardless of the value of the pattern's repetition behavior.)</p>
Expand Down Expand Up @@ -37314,13 +37315,13 @@ <h6 id=drawing-images><span class=secno>4.8.11.2.14 </span>Drawing images</h6>
negative. <!-- note: that last sentence has several times been needed to correct people who
suggested that 5,5,-2,-2 was different than 3,3,2,2 --></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
<p>When scaling up, if the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
attribute is set to true, 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>
image down, or when scaling an image up 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 <code><a href=#the-canvas-element>canvas</a></code> or <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is
Expand Down Expand Up @@ -38484,7 +38485,7 @@ <h6 id=image-smoothing><span class=secno>4.8.11.2.18 </span>Image smoothing</h6>
<dd>

<p>Returns whether pattern fills and the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method will attempt to smooth images if
their pixels don't line up exactly with the display.</p>
their pixels don't line up exactly with the display, when scaling images up.</p>

<p>Can be set, to change whether images are smoothed (true) or not (false).</p>

Expand Down
17 changes: 9 additions & 8 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -36338,11 +36338,12 @@ try {
behavior is "<code title="">repeat-y</code>", or in all four directions all over the bitmap, if
the repetition behavior is "<code title="">repeat</code>".</p>

<!--CLEANUP-->
<p>If the original image data is a bitmap image, the value painted at a point in the area of the
repetitions is computed by filtering the original image data. 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 may use any filtering algorithm (for example bilinear interpolation or
nearest-neighbor). If the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> attribute is set to
false, the image must be rendered using nearest-neighbor interpolation. When such a filtering
repetitions is computed by filtering the original image data. When scaling up, if the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code> attribute is set to
true, the image must be rendered using nearest-neighbor interpolation. Otherwise, the user agent
may use any filtering algorithm (for example bilinear interpolation or nearest-neighbor). When
such a filtering
algorithm requires a pixel value from outside the original image data, it must instead use the
value from wrapping the pixel's coordinates to the original image's dimensions. (That is, the
filter uses 'repeat' behavior, regardless of the value of the pattern's repetition behavior.)</p>
Expand Down Expand Up @@ -37314,13 +37315,13 @@ v6DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
negative. <!-- note: that last sentence has several times been needed to correct people who
suggested that 5,5,-2,-2 was different than 3,3,2,2 --></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
<p>When scaling up, if the <code title=dom-context-2d-imageSmoothingEnabled><a href=#dom-context-2d-imagesmoothingenabled>imageSmoothingEnabled</a></code>
attribute is set to true, 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>
image down, or when scaling an image up 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 <code><a href=#the-canvas-element>canvas</a></code> or <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object is
Expand Down Expand Up @@ -38484,7 +38485,7 @@ function AddCloud(data, x, y) { ... }</pre>
<dd>

<p>Returns whether pattern fills and the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method will attempt to smooth images if
their pixels don't line up exactly with the display.</p>
their pixels don't line up exactly with the display, when scaling images up.</p>

<p>Can be set, to change whether images are smoothed (true) or not (false).</p>

Expand Down
18 changes: 9 additions & 9 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -39570,13 +39570,13 @@ try {
behavior is "<code title="">repeat-y</code>", or in all four directions all over the bitmap, if
the repetition behavior is "<code title="">repeat</code>".</p>

<!--CLEANUP-->
<p>If the original image data is a bitmap image, the value painted at a point in the area of the
repetitions is computed by filtering the original image data. If the <code
title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code> attribute is set to
true, then the user agent may use any filtering algorithm (for example bilinear interpolation or
nearest-neighbor). If the <code
repetitions is computed by filtering the original image data. When scaling up, if the <code
title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code> attribute is set to
false, the image must be rendered using nearest-neighbor interpolation. When such a filtering
true, the image must be rendered using nearest-neighbor interpolation. Otherwise, the user agent
may use any filtering algorithm (for example bilinear interpolation or nearest-neighbor). When
such a filtering
algorithm requires a pixel value from outside the original image data, it must instead use the
value from wrapping the pixel's coordinates to the original image's dimensions. (That is, the
filter uses 'repeat' behavior, regardless of the value of the pattern's repetition behavior.)</p>
Expand Down Expand Up @@ -40708,13 +40708,13 @@ v6DVT (also check for '- -' bits in the part above) -->
negative. <!-- note: that last sentence has several times been needed to correct people who
suggested that 5,5,-2,-2 was different than 3,3,2,2 --></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
<p>When scaling up, if the <code title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
attribute is set to true, 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>
image down, or when scaling an image up when the <code title="dom-context-2d-imageSmoothingEnabled">imageSmoothingEnabled</code>
attribute is set to true.</p>

<p class="note">When a <code>canvas</code> or <code>CanvasRenderingContext2D</code> object is
Expand Down Expand Up @@ -42117,7 +42117,7 @@ function AddCloud(data, x, y) { ... }</pre>

<p>Returns whether pattern fills and the <code
title="dom-context-2d-drawImage">drawImage()</code> method will attempt to smooth images if
their pixels don't line up exactly with the display.</p>
their pixels don't line up exactly with the display, when scaling images up.</p>

<p>Can be set, to change whether images are smoothed (true) or not (false).</p>

Expand Down

0 comments on commit 5854cb0

Please sign in to comment.