From fb7776feac38b7e04640bac1113968e0de22d035 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 14 Feb 2018 15:27:33 +0100 Subject: [PATCH] PixelArray from ImageData constructor --- lib/Dither.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Dither.dart b/lib/Dither.dart index 7cc3f6c..839fe79 100644 --- a/lib/Dither.dart +++ b/lib/Dither.dart @@ -49,6 +49,8 @@ class PixelArray { } } + PixelArray.fromImageData(ImageData imagedata, int imageWidth): this.fromByteArray(imagedata.data, imageWidth); + Uint8ClampedList toByteArray() { //TODO: look for longest array, or each line separately. Only gets width from line 1 currently. Uint8ClampedList result = new Uint8ClampedList(getHeight()*getWidth()*4);