[whatwg] ImageData constructor questions
Dirk Schulze
dschulze at adobe.com
Sat Mar 22 23:31:49 PDT 2014
Hi,
I was reading the spec part about ImageData [1].
1)
I noticed that createImageData() is explicit that it represent a transparent black rectangle. The constructor for ImageData is not that explicit.
2)
The last step of the 2nd constructor that takes an Uint8ClampedArray says:
" • Return a new ImageData object whose width is sw, whose height is height, and whose data is source.”
Is data a reference to the original source or a copy of source? For the former, there might be two ImageData objects referencing the same ByteArray. How would that be useful?
Greetings,
Dirk
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dfnReturnLink-7 (4.12.4.2.16 Pixel manipulation)
More information about the whatwg
mailing list