Re: Proposal: ImageData constructor

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 UTC