private void HandleHotPixelDefinitionClick(MouseEventArgs e) { var pixels = frmFullSizePreview.CurrFrame.GetPixelsArea(e.X, e.Y, 35); PSFFit fit = new PSFFit(e.X, e.Y); fit.Fit(pixels); if (fit.IsSolved && fit.Certainty > 1 && fit.IMax > frmFullSizePreview.CurrFrame.MaxSignalValue / 2.0) { var sample = frmFullSizePreview.CurrFrame.GetPixelsArea((int)Math.Round(fit.XCenter), (int)Math.Round(fit.YCenter), 7); HotPixelCorrector.RegisterHotPixelSample(sample, frmFullSizePreview.CurrFrame.Pixelmap.MaxSignalValue); m_ExpectHotPixelDefinition = false; FrameAdjustmentsPreview.Instance.ExpectHotPixelClick(false, true); pnlHotPixelControls.Enabled = true; HotPixelCorrector.LocateHotPixels(frmFullSizePreview.CurrFrame, Math.Max(0, tbDepth.Value)); FrameAdjustmentsPreview.Instance.Update(); } else { MessageBox.Show( ParentForm, "The location you clicked doesn't appear to contain a hot pixel. Please try again.\r\n\r\nIf necessary adjust the brightness and contrast of the image first.", "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tbDepth_Scroll(object sender, EventArgs e) { int depth = tbDepth.Value; if (depth > 0) { lblDepthValue.Text = depth.ToString(); HotPixelCorrector.LocateHotPixels(frmFullSizePreview.CurrFrame, depth); FrameAdjustmentsPreview.Instance.Update(); } }