Beispiel #1
0
 private void equalizeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!backgroundWorkerCip.IsBusy)
     {
         ImageFilter filter = new Cip.Filters.HistogramEqualization();
         backgroundWorkerCip.RunWorkerAsync(filter);
         this.CalculateHistogram();
     }
 }
Beispiel #2
0
 public void ReDraw()
 {
     switch (this.mode)
     {
         case HistogramMode.Equalize:
             {
                 HistogramEqualization filter = new HistogramEqualization();
                 Raster result = filter.ProcessWithoutWorker(this.raster);
                 result.ShowFilter(this.pBoxPreview);
                 break;
             }
         case HistogramMode.Normalize:
             {
                 HistogramNormalize filter = new HistogramNormalize();
                 Raster result = filter.ProcessWithoutWorker(this.raster);
                 if(result!=null)
                     result.ShowFilter(this.pBoxPreview);
                 break;
             }
         default:
             { 
                 int modeNum;
                 if (this.mode == HistogramMode.StretchLuminance)
                     modeNum = 0;
                 else if(this.mode == HistogramMode.StretchLinkedChannels)
                         modeNum = 1;
                      else
                         modeNum = 2;
                 HistogramStretch filter = new HistogramStretch(modeNum, this.level);
                 Raster result = filter.ProcessWithoutWorker(this.raster);
                 if (result != null)
                     result.ShowFilter(this.pBoxPreview);
                 break;
             }
     }
 }