Skip to content
Permalink
Browse files
[giow] (2) <canvas> drawImage() and pattern filtering issue
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10799

git-svn-id: http://svn.whatwg.org/webapps@5708 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 7, 2010
1 parent f586880 commit f37d45ea5069149b9d193555426038e203c8b56e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 12 deletions.
@@ -32033,6 +32033,17 @@ <h6 id=colors-and-styles><span class=secno>4.8.11.1.4 </span>Colors and styles</
stroking or filling effect requires that they be drawn, and are
affected by the current transformation matrix.</p>

<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. The user agent may use any filtering
algorithm (for example bilinear interpolation or nearest-neighbor).
When the 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
<var title="">repetition</var>.)
<!-- drawImage() has a similar paragraph with different rules -->

<p>When the <code title=dom-context-2d-createPattern><a href=#dom-context-2d-createpattern>createPattern()</a></code> method
is passed an animated image as its <var title="">image</var>
argument, the user agent must use the poster frame of the animation,
@@ -33509,10 +33520,6 @@ <h6 id=images><span class=secno>4.8.11.1.11 </span>Images</h6>
arguments is zero, the implementation must raise an
<code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception.</p>

<p>Pixels of the source rectangle that are not entirely within the
source image must be treated as transparent black.</p> <!-- see
CORE-32111 http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737 -->

<p>The destination rectangle is the rectangle whose corners are the
four points (<var title="">dx</var>, <var title="">dy</var>),
(<span title=""><var title="">dx</var>+<var title="">dw</var></span>, <var title="">dy</var>), (<span title=""><var title="">dx</var>+<var title="">dw</var></span>, <span title=""><var title="">dy</var>+<var title="">dh</var></span>), (<var title="">dx</var>, <span title=""><var title="">dy</var>+<var title="">dh</var></span>).</p>
@@ -33539,6 +33546,19 @@ <h6 id=images><span class=secno>4.8.11.1.11 </span>Images</h6>
back onto the canvas, so it is possible to copy parts of a canvas
onto overlapping parts of itself.</p>

<p>If the original image data is a bitmap image, the value painted
at a point in the destination rectangle is computed by filtering the
original image data. The user agent may use any filtering algorithm
(for example bilinear interpolation or nearest-neighbor). When the
filtering algorithm requires a pixel value from outside the original
image data, it must instead use the value from the nearest edge
pixel. (That is, the filter uses 'clamp-to-edge' behavior.)</p>
<!-- see CORE-32111 and:
http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10799#c11
-->
<!-- createPattern() has a similar paragraph with different rules -->

<p>When the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method
is passed an animated image as its <var title="">image</var>
argument, the user agent must use the poster frame of the animation,
28 index
@@ -32014,6 +32014,17 @@ idea from Mihai:
stroking or filling effect requires that they be drawn, and are
affected by the current transformation matrix.</p>

<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. The user agent may use any filtering
algorithm (for example bilinear interpolation or nearest-neighbor).
When the 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
<var title="">repetition</var>.)
<!-- drawImage() has a similar paragraph with different rules -->

<p>When the <code title=dom-context-2d-createPattern><a href=#dom-context-2d-createpattern>createPattern()</a></code> method
is passed an animated image as its <var title="">image</var>
argument, the user agent must use the poster frame of the animation,
@@ -33490,10 +33501,6 @@ v5DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
arguments is zero, the implementation must raise an
<code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception.</p>

<p>Pixels of the source rectangle that are not entirely within the
source image must be treated as transparent black.</p> <!-- see
CORE-32111 http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737 -->

<p>The destination rectangle is the rectangle whose corners are the
four points (<var title="">dx</var>, <var title="">dy</var>),
(<span title=""><var title="">dx</var>+<var title="">dw</var></span>, <var title="">dy</var>), (<span title=""><var title="">dx</var>+<var title="">dw</var></span>, <span title=""><var title="">dy</var>+<var title="">dh</var></span>), (<var title="">dx</var>, <span title=""><var title="">dy</var>+<var title="">dh</var></span>).</p>
@@ -33520,6 +33527,19 @@ v5DVT (also check for '- -' bits in the part above) --><p>The <dfn id=dom-contex
back onto the canvas, so it is possible to copy parts of a canvas
onto overlapping parts of itself.</p>

<p>If the original image data is a bitmap image, the value painted
at a point in the destination rectangle is computed by filtering the
original image data. The user agent may use any filtering algorithm
(for example bilinear interpolation or nearest-neighbor). When the
filtering algorithm requires a pixel value from outside the original
image data, it must instead use the value from the nearest edge
pixel. (That is, the filter uses 'clamp-to-edge' behavior.)</p>
<!-- see CORE-32111 and:
http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10799#c11
-->
<!-- createPattern() has a similar paragraph with different rules -->

<p>When the <code title=dom-context-2d-drawImage><a href=#dom-context-2d-drawimage>drawImage()</a></code> method
is passed an animated image as its <var title="">image</var>
argument, the user agent must use the poster frame of the animation,
28 source
@@ -35254,6 +35254,17 @@ idea from Mihai:
stroking or filling effect requires that they be drawn, and are
affected by the current transformation matrix.</p>

<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. The user agent may use any filtering
algorithm (for example bilinear interpolation or nearest-neighbor).
When the 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
<var title="">repetition</var>.)
<!-- drawImage() has a similar paragraph with different rules -->

<p>When the <code
title="dom-context-2d-createPattern">createPattern()</code> method
is passed an animated image as its <var title="">image</var>
@@ -37009,10 +37020,6 @@ v5DVT (also check for '- -' bits in the part above) -->
arguments is zero, the implementation must raise an
<code>INDEX_SIZE_ERR</code> exception.</p>

<p>Pixels of the source rectangle that are not entirely within the
source image must be treated as transparent black.</p> <!-- see
CORE-32111 http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737 -->

<p>The destination rectangle is the rectangle whose corners are the
four points (<var title="">dx</var>, <var title="">dy</var>),
(<span title=""><var title="">dx</var>+<var title="">dw</var></span>, <var
@@ -37046,6 +37053,19 @@ v5DVT (also check for '- -' bits in the part above) -->
back onto the canvas, so it is possible to copy parts of a canvas
onto overlapping parts of itself.</p>

<p>If the original image data is a bitmap image, the value painted
at a point in the destination rectangle is computed by filtering the
original image data. The user agent may use any filtering algorithm
(for example bilinear interpolation or nearest-neighbor). When the
filtering algorithm requires a pixel value from outside the original
image data, it must instead use the value from the nearest edge
pixel. (That is, the filter uses 'clamp-to-edge' behavior.)</p>
<!-- see CORE-32111 and:
http://krijnhoetmer.nl/irc-logs/whatwg/20100818#l-737
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10799#c11
-->
<!-- createPattern() has a similar paragraph with different rules -->

<p>When the <code
title="dom-context-2d-drawImage">drawImage()</code> method
is passed an animated image as its <var title="">image</var>

0 comments on commit f37d45e

Please sign in to comment.