W3C home > Mailing lists > Public > public-html@w3.org > March 2013

Re: Proposal: ImageData constructor

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 13 Mar 2013 13:51:18 -0400
Message-ID: <5140BC96.1080500@mit.edu>
To: public-html@w3.org
On 3/13/13 1:17 PM, Leonard Rosenthol wrote:
> You are constructing an image from an array of pixel data.

Not quite.  This is constructing an ImageData object (which is not the 
same thing as an image), which consists of a width, height, and array of 
pixel data.  And this constructor just takes a reference to the given 
array.  Nothing in here really has much to do with "images"; it's just a 
data container.


> You can't do
> that unless you either hardcode/fix the format of the array (eg. RGB)

Now in practice all consumers of ImageData are defined to treat its data 
as RGBA if they want to treat it as pixel data.  So this is already defined.

-Boris
Received on Wednesday, 13 March 2013 17:51:48 GMT

This archive was generated by hypermail 2.3.1 : Wednesday, 13 March 2013 17:51:48 GMT