W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2009

[whatwg] several messages

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 3 Jun 2009 19:51:06 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0906031950130.1648@hixie.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 3 June 2009 12:51:06 UTC

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