Beispiel #1
0
 public PreviewFeature(string name, CWatchZone watchZone, CWatcher watcher, CWatchImage watchImage)
 {
     Name       = name;
     WatchZone  = watchZone;
     Watcher    = watcher;
     WatchImage = watchImage;
 }
 private static void CropScan(
     ref double[] deltas,
     ref double[] benchmarks,
     DateTime now,
     Bitmap fileImageBase,
     Bitmap prevFileImageBase,
     CWatchZone cWatchZone)
 {
     if (!cWatchZone.IsPaused(now))
     {
         using (var fileImageCropped = fileImageBase.Clone(cWatchZone.Rectangle, PixelFormat.Format24bppRgb))
             using (var prevFileImageCropped = cWatchZone.UsesDupeCheck(now) ?
                                               prevFileImageBase?.Clone(cWatchZone.Rectangle, PixelFormat.Format24bppRgb) : null)
             {
                 foreach (var cWatcher in cWatchZone.CWatches)
                 {
                     ComposeScan(ref deltas, ref benchmarks, now, fileImageCropped, prevFileImageCropped, cWatcher);
                 }
             }
     }
     else
     {
         foreach (var cWatcher in cWatchZone.CWatches)
         {
             foreach (var cWatchImage in cWatcher.CWatchImages)
             {
                 deltas[cWatchImage.Index]     = double.NaN;
                 benchmarks[cWatchImage.Index] = 0;
             }
         }
     }
 }