6

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!

4

1 回答 1

1

自从@ZachB 指出的这个PR以来,它就是这样做的。现在只是 <=0.10 以旧方式进行,例如此处的分支。

于 2015-09-14T00:59:33.173 回答