W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2013

Re: [whatwg] proposal: Add support for masking to canvas

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 29 Jan 2013 21:03:07 -0800
Message-ID: <CAAWBYDA4uO6C1qDStm8WcD33y6KMVf8n1GX6zZFW8-2USnFgJA@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: whatwg <whatwg@lists.whatwg.org>, Jatinder Mann <jmann@microsoft.com>, "public-canvas-api@w3.org" <public-canvas-api@w3.org>
On Tue, Jan 29, 2013 at 8:37 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> So the API could be as follows:
>
> enum CanvasMaskType { luminosity, alpha};
> dictionary maskOptions {
>
> CanvasImageSource image;
> unrestricted double? sx;
> unrestricted double? sy;
> unrestricted double? sw;
> unrestricted double? sh;
> unrestricted double dx;
> unrestricted double dy;
> unrestricted double? dw;
> unrestricted double? dh;
> CanvasMaskType? maskType = "luminosity";
> boolean? invert = false;
> boolean? clipToMask = true;
>
> }
>
> void maskImage(maskOptions options);
> void resetMask();
>
> If not specified, the dw and dh arguments must default to the values of sw
> and sh, interpreted such that one CSS pixel in the image is treated as one
> unit in thescratch bitmap's coordinate space. If the sx, sy, sw, and sh
> arguments are omitted, they must default to 0, 0, the image's intrinsic
> width in image pixels, and the image's intrinsic height in image pixels,
> respectively.

Yeah, looks good to me.

~TJ
Received on Wednesday, 30 January 2013 05:03:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:12 GMT