From da7bef43fc02577bf25293b0cda7e7fca01f26ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Sun, 23 Apr 2017 19:24:11 +0200 Subject: [PATCH] Changed the direction of the LEDs + changed color format from RGB->BGR --- src/kaka/cakelight/Configuration.java | 6 +++--- src/kaka/cakelight/Frame.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/kaka/cakelight/Configuration.java b/src/kaka/cakelight/Configuration.java index d91bfb6..2932c01 100644 --- a/src/kaka/cakelight/Configuration.java +++ b/src/kaka/cakelight/Configuration.java @@ -70,13 +70,13 @@ public class Configuration { bpp = Integer.parseInt(get(prop, "video.bpp", "2")); switch (get(prop, "video.format", "").toUpperCase()) { case "YUYV": - format = Imgproc.COLOR_YUV2RGB_YUYV; + format = Imgproc.COLOR_YUV2BGR_YUYV; break; case "YVYU": - format = Imgproc.COLOR_YUV2RGB_YVYU; + format = Imgproc.COLOR_YUV2BGR_YVYU; break; default: - format = Imgproc.COLOR_YUV2RGB_UYVY; + format = Imgproc.COLOR_YUV2BGR_UYVY; } crop = new CropConfiguration(prop); } diff --git a/src/kaka/cakelight/Frame.java b/src/kaka/cakelight/Frame.java index 7b94eb9..c0bc76c 100644 --- a/src/kaka/cakelight/Frame.java +++ b/src/kaka/cakelight/Frame.java @@ -134,15 +134,15 @@ public class Frame { } /** - * Creates a LED frame going clockwise from the bottom-left corner, sans the corners. + * Creates a LED frame going counter-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)); + for (int i = 0; i < config.leds.cols; i++) frame.setLedColor(led++, getLedColor(ListPosition.BOTTOM, i)); + for (int i = config.leds.rows - 1; i >= 0; i--) frame.setLedColor(led++, getLedColor(ListPosition.RIGHT, i)); + for (int i = config.leds.cols - 1; i >= 0; i--) frame.setLedColor(led++, getLedColor(ListPosition.TOP, i)); + for (int i = 0; i < config.leds.rows; i++) frame.setLedColor(led++, getLedColor(ListPosition.LEFT, i)); return frame; } } -- 2.11.0