public int bpp;
public int format;
public CropConfiguration crop;
+ public ListConfiguration list;
private VideoConfiguration(Properties prop) {
width = Integer.parseInt(get(prop, "video.width", "720"));
format = Imgproc.COLOR_YUV2BGR_UYVY;
}
crop = new CropConfiguration(prop);
+ list = new ListConfiguration(prop);
}
public class CropConfiguration {
bottom = Integer.parseInt(get(prop, "video.crop.bottom", "0"));
}
}
+
+ public class ListConfiguration {
+ public boolean top, bottom, left, right;
+
+ private ListConfiguration(Properties prop) {
+ top = get(prop, "video.list.top", "on").equals("on");
+ bottom = get(prop, "video.list.bottom", "on").equals("on");
+ left = get(prop, "video.list.left", "on").equals("on");
+ right = get(prop, "video.list.right", "on").equals("on");
+ }
+ }
}
public class LedConfiguration {
public LedFrame getLedFrame() {
LedFrame frame = LedFrame.from(config);
int led = 0;
- for (int i = 0; i < config.leds.cols; i++) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.BOTTOM, i));
- for (int i = config.leds.rows - 1; i >= 0; i--) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.RIGHT, i));
- for (int i = config.leds.cols - 1; i >= 0; i--) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.TOP, i));
- for (int i = 0; i < config.leds.rows; i++) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.LEFT, i));
+ if (config.video.list.bottom) for (int i = 0; i < config.leds.cols; i++) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.BOTTOM, i));
+ if (config.video.list.right) for (int i = config.leds.rows - 1; i >= 0; i--) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.RIGHT, i));
+ if (config.video.list.top) for (int i = config.leds.cols - 1; i >= 0; i--) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.TOP, i));
+ if (config.video.list.left) for (int i = 0; i < config.leds.rows; i++) frame.setLedColor(led++, wrappedGetLedColor(ListPosition.LEFT, i));
return frame;
}
}