|
|
@ -469,15 +469,20 @@ Context2d.prototype.getImageData = function(x, y, width, height){ |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Create `ImageData` with the given dimensions. |
|
|
|
* Create `ImageData` with the given dimensions or |
|
|
|
* `ImageData` instance for dimensions. |
|
|
|
* |
|
|
|
* @param {Number} width |
|
|
|
* @param {Number|ImageData} width |
|
|
|
* @param {Number} height |
|
|
|
* @return {ImageData} |
|
|
|
* @api public |
|
|
|
*/ |
|
|
|
|
|
|
|
Context2d.prototype.createImageData = function(width, height){ |
|
|
|
if (width instanceof ImageData) { |
|
|
|
height = width.height; |
|
|
|
width = width.width; |
|
|
|
} |
|
|
|
var arr = new PixelArray(width, height); |
|
|
|
return new ImageData(arr); |
|
|
|
}; |