PixelArray from ImageData constructor

This commit is contained in:
Unknown 2018-02-14 15:27:33 +01:00
parent d6503bb613
commit fb7776feac

View file

@ -49,6 +49,8 @@ class PixelArray {
} }
} }
PixelArray.fromImageData(ImageData imagedata, int imageWidth): this.fromByteArray(imagedata.data, imageWidth);
Uint8ClampedList toByteArray() { Uint8ClampedList toByteArray() {
//TODO: look for longest array, or each line separately. Only gets width from line 1 currently. //TODO: look for longest array, or each line separately. Only gets width from line 1 currently.
Uint8ClampedList result = new Uint8ClampedList(getHeight()*getWidth()*4); Uint8ClampedList result = new Uint8ClampedList(getHeight()*getWidth()*4);