[whatwg] several messages

Ian Hickson ian at hixie.ch
Wed Jun 3 12:51:06 PDT 2009


On Tue, 7 Apr 2009, Jeff Creamer wrote:
>
> Hi.  Since March of '06, Opera 9 has supported a custom extension to the 
> canvas context called "opera-2dgame." Importantly, their extension adds 
> these methods:
> 
> getPixel(x, y)
> Returns the pixel value (colour, opacity) at (x, y). Returned in the 
> form #rrggbb if fully opaque and rgba(r, g, b, a) if it has some alpha 
> transparency.
> 
> setPixel (x, y, color)
> Allows you to set the colour of the pixel at (x, y). The third argument 
> should be a CSS color - you could provide a string such as `red', a HTML 
> colour code or even a rgba() value.
> 
> I don't see any recent discussion of this.  And I am also aware that the 
> canvas drawing model is not pixel-oriented.  Nonetheless, mightn't these 
> functions be extremely useful?  As the Opera folk point out, they bless 
> game developers, and it occurs to me that they could be used for other 
> neat, useful things, such as giving JavaScript a rudimentary RAM drive.  
> Description including several demo programs and a discussion of security 
> issues is available here.
> 
> Why not make getPixel () and setPixel() a standard?

On Tue, 7 Apr 2009, Oliver Hunt wrote:
>
> The ImageData APIs already provide the ability to do this and are 
> already supported by Firefox, Opera and Safari.

Given the ImageData APIs, and given that they are generally more efficient 
at the typical use cases for getPixel/setPixel, I haven't added getPixel/ 
setPixel to the spec.

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list