W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > July 2011

[Bug 12586] Suggest using Typed Array for ImageData pixels. Add a new 'buffer' attribute that references ArrayBuffer of the pixel data. Convert 'data' (CanvasPixelArray) to Uint8Array view of 'buffer'.

From: <bugzilla@jessica.w3.org>
Date: Fri, 29 Jul 2011 02:29:15 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1Qmcp9-0003mq-He@jessica.w3.org>

--- Comment #4 from Boris Zbarsky <bzbarsky@mit.edu> 2011-07-29 02:29:14 UTC ---
> bz: Is the TypedArrayness of CanvasPixelArray in Gecko visible to JS in any
> way?

Yep.  The CanvasPixelArray is just a typed array, and you can do all the normal
typed array stuff to it from JS: get the underlying ArrayBuffer, create other
views on the data, construct subarrays, etc.  In fact, there is no
CanvasPixelArray interface in Gecko at all at the moment; if you ask the .data
of an imageData whether it's instanceof Uint8ClampedArrays you should get back

Furthermore, you can create Uint8ClampedArrays using the normal typed array
constructors and then work with them.  And since the .data of imagedata is not
readonly in Gecko at the moment you can assign one of those (or some other
typed array, or a regular array) to it.

I'm not sure all of this necessarily makes sense from a spec point of view;
just describing what Gecko does right now.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 29 July 2011 02:29:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:56 UTC