I need to manage pixels from a webcam in js. I need them in Uint8ClampedArray format. So far I do
this.imageCapture.grabFrame()
.then(imageBitmap => {
this.context2d.drawImage(imageBitmap, 0, 0,imageBitmap.width, imageBitmap.height);
})
and then later I get pixels with
this.context2d.getImageData(0,0,this._videoCanvas.width,this._videoCanvas.height);
and then I format imageData
I was thinking that there may be way to get data from ImageBitMap without using a canvas ? But could not find any workaround so far. Someone has clever answer to this dumb question ?
Thanks !