+ 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;
+ }
+ saturation = inRange(Double.parseDouble(get(prop, "video.saturation", "0.5")), 0, 1);
+ crop = new CropConfiguration(prop);
+ list = new ListConfiguration(prop);
+ }
+
+ public class CropConfiguration {
+ public int left, right, top, bottom;
+
+ private CropConfiguration(Properties prop) {
+ left = Integer.parseInt(get(prop, "video.crop.left", "0"));
+ right = Integer.parseInt(get(prop, "video.crop.right", "0"));
+ top = Integer.parseInt(get(prop, "video.crop.top", "0"));
+ 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");
+ }