W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Need clarification on DOM exceptions thrown by canvas 2D drawImage

From: Jeff Muizelaar <jmuizelaar@mozilla.com>
Date: Tue, 9 Aug 2011 17:00:55 -0400
Message-ID: <26C13991-9AA4-412C-9153-58253CF541F2@mozilla.com>

On 2011-08-09, at 8:47 AM, Philip Taylor wrote:

> Does the clamp-to-edge behaviour work fine when the source rectangle
> is entirely inside the image? e.g. the image
> 
> 8800
> 8800
> 0088
> 0088
> 
> (where each digit is a pixel) drawn at 2x scale with bilinear
> filtering should give
> 
> 88862000
> 88862000
> 88862000
> 66653222
> 22235666
> 00026888
> 00026888
> 00026888
> 
> because of the filtering requirements. If CoreGraphics can't do that
> then it's broken (per the spec) regardless of how source rectangles
> are handled. Or is it able to do clamp-to-edge fine up to the edge of
> the source image, just not extend that beyond the image when the
> source rectangle is expanded further?

Afaict, it is able to do clamp-to-edge fine up to the edge of the source image

For example, I get something like the following in CoreGraphics:

88871000
88871000
88871000
77761111
11116777
00017888
00017888
00017888

I can't explain the 7/1 vs. 6/2 but it does the right thing as far as edge padding goes.

-Jeff
Received on Tuesday, 9 August 2011 14:00:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC