diff --git a/source b/source index 904af003371..c0df94fa436 100644 --- a/source +++ b/source @@ -2907,6 +2907,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
DOMString
double
Float16Array
Function
long
object
imageData = new ImageData(data, sw [, sh [, settings ] ])
Returns an ImageData
object using the data provided in the Uint8ClampedArray
argument, interpreted using the given
- dimensions and the color space indicated by settings.
Returns an ImageData
object using the data provided in the ImageDataArray
+ argument, interpreted using the given dimensions and the color space indicated by settings.
As each pixel in the data is represented by four numbers, the length of the data needs to be a multiple of four times the given width. If the height is provided as well, then the length @@ -70491,7 +70497,7 @@ try { constructor steps are:
Let length be the number of bytes in data.
Let length be the length of data.
If length is not a nonzero integral multiple of four, then throw an
"InvalidStateError
" DOMException
.
This step does not set this's data to a copy of data.
- It sets it to the actual Uint8ClampedArray
object
- passed as data.
ImageDataArray
object passed as data.
To initialize an ImageData
object imageData, given a
- positive integer number of rows rows, a positive integer number of pixels per row
- pixelsPerRow, an optional ImageDataSettings
settings, an optional Uint8ClampedArray
source, and an optional
- PredefinedColorSpace
pixelsPerRow, a positive integer number
+ of rows rows, an optional ImageDataSettings
settings, an optional
+ ImageDataArray
source,
+ and an optional PredefinedColorSpace
defaultColorSpace:
If source was given, then initialize the data
attribute of imageData to
- source.
If source was given then:
+If settings was given and
+ settings["pixelFormat
"]
+ equals "rgba-unorm8" and
+ source is not of type Uint8ClampedArray
+ then throw an "InvalidStateError
" DOMException
.
Otherwise (source was not given), initialize the data
attribute of imageData to a new Uint8ClampedArray
object. The Uint8ClampedArray
object must use a new Canvas
- Pixel ArrayBuffer
for its storage, and must have a
- zero start offset and a length equal to the length of its storage, in bytes. The Canvas
- Pixel ArrayBuffer
must have the correct size to
- store rows × pixelsPerRow pixels.
If settings was given and
+ settings["pixelFormat
"]
+ equals "rgba-float16" and
+ source is not of type Float16Array
+ then throw an "InvalidStateError
" DOMException
.
If the Canvas Pixel ArrayBuffer
cannot be
- allocated, then rethrow the RangeError
thrown by JavaScript,
- and return.
Initialize the data
attribute of imageData to
+ source.
Otherwise (source was not given):
+If settings was given and
+ settings["pixelFormat
"]
+ equals "rgba-unorm8", or if
+ settings was not given, then
+ initialize the data
attribute of imageData to a new
+ Uint8ClampedArray
object.
+ The Uint8ClampedArray
object
+ must have a length of 4 × rows × pixelsPerRow elements,
+ must use a new ArrayBuffer
for its storage,
+ must have a byte offset of zero bytes,
+ and must have a byte length of 4 × rows × pixelsPerRow bytes.
+ If the ArrayBuffer
could not be allocated, then rethrow the
+ RangeError
thrown by JavaScript, and return.
If settings was given and
+ settings["pixelFormat
"]
+ equals "rgba-float16", then
+ initialize the data
attribute of imageData to a new
+ Float16Array
object.
+ The Float16Array
object
+ must have a length of 4 × rows × pixelsPerRow elements,
+ must use a new ArrayBuffer
for its storage,
+ must have a byte offset of zero bytes,
+ and must have a byte length of 8 × rows × pixelsPerRow bytes.
+ If the ArrayBuffer
could not be allocated, then rethrow the
+ RangeError
thrown by JavaScript, and return.
Initialize the height
attribute of imageData to
rows.
If settings was given, then initialize the
+ pixelFormat
+ attribute of imageData to
+ settings["pixelFormat
"].
Otherwise, initialize the pixelFormat
+ attribute of imageData to
+ "rgba-unorm8".
If settings was given and settings["colorSpace
"] exists, then initialize the serialized.[[ColorSpace]].
A Canvas Pixel ArrayBuffer
is an ArrayBuffer
whose data is represented in left-to-right order, row
- by row top to bottom, starting with the top left, with each pixel's red, green, blue, and alpha
- components being given in that order for each pixel. Each component of each pixel represented in
- this array must be in the range 0..255, representing the 8 bit value for that component. The
- components must be assigned consecutive indices starting with 0 for the top left pixel's red
- component.
The ImageDataPixelFormat
enumeration is used to specify type of the
+ data
attribute of an ImageData
+ and the arrangement and numerical representation of the color components for each pixel.
The "rgba-unorm8
" value indicates that the
+ data
attribute of an ImageData
must be of type
+ Uint8ClampedArray.
+ The color components of each pixel must be stored in four sequential elements in the order of red, green, blue, and then alpha.
+ Each element represents the 8-bit unsigned normalized value for that component.
The "rgba-float16
" value indicates that the
+ data
attribute of an ImageData
must be of type
+ Float16Array.
+ The color components of each pixel must be stored in four sequential elements in the order of red, green, blue, and then alpha.
+ Each element represents the value for that component.
An ImageData
object represents a rectanglar bitmap
+ with width equal to the width
attribute
+ and height equal to the height
attribute.
+ The pixel values of this bitmap are stored in the data
attribute
+ in left-to-right order, row by row from top to bottom, starting with 0 for the top left pixel,
+ with the order and numerical representation of the color components of each
+ pixel determined by the pixelFormat
attribute.
+ The color space of the pixel values of the bitmap is determined by the
+ colorSpace
attribute.
The putImageData(imageData,
@@ -70777,7 +70843,7 @@ try {
set the pixel with coordinate (dx+x,
dy+y) in bitmap to the color of the pixel at coordinate
(x, y) in the imageData data structure's
- Canvas Pixel
ArrayBuffer
,
+ bitmap,
converted from imageData's colorSpace
to the color space of bitmap
using 'relative-colorimetric' rendering intent.