Re: Image Capture Proposal, second version

On Feb 22, 2013, at 11:30 PM, Mandyam, Giridhar wrote:
>     // Create new ImageObject with the modified pixel values
>     var canvas = document.createElement('canvas');
>     ctx = canvas.getContext("2d");
>     newImg = ctx.createImageData(width,height);

The HTML Living Standard now have a constructor for the CanvasRenderingContext2d:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d

It was checked in first here: https://github.com/w3c/html/commit/35cb29a, 
but is still not in the W3C recommendation here http://www.w3.org/TR/2012/CR-2dcontext-20121217/


Which means we should be able to do this in stead:

ctx = new CanvasRenderingContext2d();
newImg = cxt.createImageDate(width, height);


This means we're not dependent on the DOM any more, and can transfer the ImageData to a Worker. 

Which poses the question: Should the WorkerNavigator implement the NavigatorUserMedia (http://www.w3.org/TR/workers/#workernavigator) and should the ImageCapture object be visible when the global scope is DedicatedWorkerGlobalScope or SharedWorkerGlobalScope?

That way the MediaStreamTrack can be opened and frames can be captured directly in the worker. Otherwise ImageData must be transferred through the message port.




-Johannes

Received on Thursday, 28 February 2013 19:51:11 UTC