public override void OnDo(IBitmapCore hdp) { BrightnessStageOperationParameters pm = (BrightnessStageOperationParameters)Parameters; Console.WriteLine("Calculating current median..."); double median = hdp.AmplitudeFindMedian(); Console.WriteLine("Setting brightness..."); if (pm.Normalize) { hdp.AmplitudeMultiply(pm.Brightness * 0.5 / median, delegate (double progress) { return OnReportProgress(progress); } ); } else { hdp.AmplitudeMultiply(pm.Brightness, delegate (double progress) { return OnReportProgress(progress); } ); } }
public override void AnalyzeImage(IBitmapCore image) { double median = image.AmplitudeFindMedian(); Application.Invoke(delegate { median_label.Text = median.ToString("0.00"); }); }
public override void OnDo(IBitmapCore hdp) { BrightnessStageOperationParameters pm = (BrightnessStageOperationParameters)Parameters; Console.WriteLine("Calculating current median..."); double median = hdp.AmplitudeFindMedian(); Console.WriteLine("Setting brightness..."); if (pm.Normalize) { hdp.AmplitudeMultiply(pm.Brightness * 0.5 / median, delegate(double progress) { return(OnReportProgress(progress)); } ); } else { hdp.AmplitudeMultiply(pm.Brightness, delegate(double progress) { return(OnReportProgress(progress)); } ); } }