+ byte[] buff = new byte[(int) (converted.total() * converted.channels())];
+ converted.get(0, 0, buff);
+ return buff;
+ }
+
+ public Mat getColImage() {
+ return colImage;
+ }
+
+ public Mat getRowImage() {
+ return rowImage;
+ }
+
+ public Mat getConvertedImage() {
+ return converted;
+ }
+
+ /**
+ * Creates a LED frame going clockwise from the bottom-left corner, sans the corners.
+ */
+ public LedFrame getLedFrame() {
+ LedFrame frame = LedFrame.from(config);
+ int led = 0;
+ for (int i = config.leds.rows - 1; i >= 0; i--) frame.setLedColor(led++, getLedColor(ListPosition.LEFT, i));
+ for (int i = 0; i < config.leds.cols; i++) frame.setLedColor(led++, getLedColor(ListPosition.TOP, i));
+ for (int i = 0; i < config.leds.rows; i++) frame.setLedColor(led++, getLedColor(ListPosition.RIGHT, i));
+ for (int i = config.leds.cols - 1; i >= 0; i--) frame.setLedColor(led++, getLedColor(ListPosition.BOTTOM, i));
+ return frame;