/// <summary> /// Shows data of the given pixel (and of the HDR & LDR images). /// </summary> /// <param name="x">X-coordinate inside the raster image.</param> /// <param name="y">Y-coordinate inside the raster image.</param> private void showPixel(int x, int y) { if (inputImage == null) { setWindowTitle(null); return; } StringBuilder sb = new StringBuilder(); sb.AppendFormat(" {0} x {1}", inputImage.Width, inputImage.Height); if (x >= 0 && x < inputImage.Width && y >= 0 && y < inputImage.Height) { sb.AppendFormat(": [{0},{1}] ->", x, y); float[] pix = new float[3]; if (inputImage.GetPixel(x, y, pix)) { sb.AppendFormat(CultureInfo.InvariantCulture, " [{0},{1},{2}]", pix[0], pix[1], pix[2]); } if (outputImage != null && outputImage.Width == inputImage.Width && outputImage.Height == inputImage.Height) { Color c = outputImage.GetPixel(x, y); sb.AppendFormat(" [{0},{1},{2}]", c.R, c.G, c.B); } } setWindowTitle(sb.ToString()); }