protected void Exposure(string param) { if (inputImage == null) { return; } Dictionary <string, string> p = Util.ParseKeyValueList(param); double gamma = 0.0; if (p.Count > 0) { // gamma=<float-number> Util.TryParse(p, "gamma", ref gamma); // exp=<float-number> // must not change the value if the 'exp' key is not present Util.TryParse(p, "exp", ref exposure); // sub=<sub-factor> if (Util.TryParse(p, "sub", ref subFactor)) { if (subFactor < 1) { subFactor = 1; } if (subFactor == 1) { if (inputImage != origInputImage) { inputImage = origInputImage; } } else if (inputImage.Width * subFactor != origInputImage.Width) { inputImage = new FloatImage(origInputImage); inputImage.Resize(subFactor); } } } sw.Restart(); outputImage = inputImage.Exposure(outputImage, exposure, gamma); sw.Stop(); labelStatus.Text = string.Format(CultureInfo.InvariantCulture, "{0:f1} EV, exp: {1} ms", contrast, sw.ElapsedMilliseconds); setImage(ref outputImage, outputImage); }