W3C home > Mailing lists > Public > public-html@w3.org > March 2013

Proposal: ImageData constructor

From: Rik Cabanier <cabanier@adobe.com>
Date: Tue, 12 Mar 2013 21:12:44 -0700
To: HTMLWG WG <public-html@w3.org>
Message-ID: <83F37C1A4497B54589EAEDC750D03A941F07CA5739@nambx09.corp.adobe.com>
All,

Ken Russell proposed the following addition to the 2D canvas:

[Constructor(Uint8ClampedArray data, double sw, double sh)]
  interface ImageData {
    readonly attribute unsigned long width;
    readonly attribute unsigned long height;
    readonly attribute Uint8ClampedArray data;
  };

The new constructor allows you to construct a new ImageData object from an Uint8ClampedArray. The imageData object simply assigns:
- width = sw
- height = sh
- data = data

Before this API, you had to construct the imagedata  with a width and height and then copy the pixels between the arrays manually.

If there are no objections to this, I will add this to the canvas 2d spec.

Rik
Received on Wednesday, 13 March 2013 04:13:12 GMT

This archive was generated by hypermail 2.3.1 : Wednesday, 13 March 2013 04:13:13 GMT