public int height;
public int bpp;
public int format;
+ public double saturation;
public CropConfiguration crop;
public ListConfiguration list;
default:
format = Imgproc.COLOR_YUV2BGR_UYVY;
}
+ saturation = Double.parseDouble(get(prop, "video.saturation", "0.5"));
crop = new CropConfiguration(prop);
list = new ListConfiguration(prop);
}
private Color wrappedGetLedColor(ListPosition listPosition, int xy) {
Color c = getLedColor(listPosition, xy);
double[] hsv = c.toHSV();
- return Color.hsv(hsv[0], 1, 1);
+ double saturation = config.video.saturation >= 0.5
+ ? hsv[1] + (config.video.saturation - 0.5) * 2 * (1 - hsv[1])
+ : hsv[1] - (1 - config.video.saturation * 2) * hsv[1];
+ return Color.hsv(hsv[0], saturation, hsv[2]);
}
private Color getLedColor(ListPosition listPosition, int xy) {