I'd like to be able to make an empty PixelArray to compare with output from node-canvas from within JavaScript.
For example:
var cleanData = new PixelArray ( 20 );
Is this possible? Am I on the wrong version of Node.js? (0.8.3)
I'd like to be able to make an empty PixelArray to compare with output from node-canvas from within JavaScript.
For example:
var cleanData = new PixelArray ( 20 );
Is this possible? Am I on the wrong version of Node.js? (0.8.3)
Uint8ClampedArrayは動作します。
var cleanData = new Uint8ClampedArray( width * height * 4 );
背景:
http://www.khronos.org/registry/typedarray/specs/latest/#7.1 CanvasPixelArray を置き換えるために Uint8ClampedArray が定義されています。セッターとコンストラクターが受信数値を変換するときにモジュロ演算ではなくクランプ [WEBIDL] を使用することを除いて、他の型付き配列ビューと同じように動作します。