import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
private List<Map.Entry<String, String>> settings = new ArrayList<>();
public VideoConfiguration video;
public LedConfiguration leds;
private List<Map.Entry<String, String>> settings = new ArrayList<>();
public VideoConfiguration video;
public LedConfiguration leds;
private Configuration(Properties prop) {
video = new VideoConfiguration(prop);
leds = new LedConfiguration(prop);
private Configuration(Properties prop) {
video = new VideoConfiguration(prop);
leds = new LedConfiguration(prop);
width = Integer.parseInt(get(prop, "video.width", "720"));
height = Integer.parseInt(get(prop, "video.height", "576"));
bpp = Integer.parseInt(get(prop, "video.bpp", "2"));
width = Integer.parseInt(get(prop, "video.width", "720"));
height = Integer.parseInt(get(prop, "video.height", "576"));
bpp = Integer.parseInt(get(prop, "video.bpp", "2"));
+ switch (get(prop, "video.format", "").toUpperCase()) {
+ case "YUYV":
+ format = Imgproc.COLOR_YUV2BGR_YUYV;
+ break;
+ case "YVYU":
+ format = Imgproc.COLOR_YUV2BGR_YVYU;
+ break;
+ default:
+ format = Imgproc.COLOR_YUV2BGR_UYVY;
+ }
private LedConfiguration(Properties prop) {
cols = Integer.parseInt(get(prop, "leds.cols"));
rows = Integer.parseInt(get(prop, "leds.rows"));
private LedConfiguration(Properties prop) {
cols = Integer.parseInt(get(prop, "leds.cols"));
rows = Integer.parseInt(get(prop, "leds.rows"));
+ brightness = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.brightness", "31"))));
+ switch (get(prop, "leds.type", "").toUpperCase()) {
+ case "WS2801":
+ type = LedType.WS2801;
+ break;
+ case "APA102":
+ default:
+ type = LedType.APA102;
+ }