Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js canvas implementation with Uint8ClampedArray

To any canvas pros out there–I need help.

I'm using node-canvas and I'm trying to get imageData using it's getImageData method. Unfortunately it returns:

interface ImageData {
    readonly attribute unsigned long width;
    readonly attribute unsigned long height;
    readonly attribute CanvasPixelArray data;
}

CanvasPixelArray is deprecated in favor of Uint8ClampedArray.

My question is:

Is there a way for getImageData to return Uint8ClampedArray or to convert CanvasPixelArray to Uint8ClampedArray?

If that's not the case, maybe someone can point me to some other implementation of canvas in node?

Any help would be greatly appreciated, thank you in advance!

like image 987
Arek Avatar asked Jan 29 '14 15:01

Arek


1 Answers

It does just that since this PR as @ZachB has pointed out. Nowadays just <=0.10 does it the old way, as branched here for example.

like image 80
eljefedelrodeodeljefe Avatar answered Sep 28 '22 09:09

eljefedelrodeodeljefe