public BasicStats GetStats(BitmapAdapter bitmap, ImageManipulationInfo manipulationInfo)
        {
            // Console.WriteLine(manipulationInfo.ToString());
            var fast = new FastBitmap.FastBitmap(bitmap.GetSegment(manipulationInfo));

            return(GetBasicStats(fast, new Rectangle(0, 0, fast.Width, fast.Height)));
        }
Exemple #2
0
        public Bitmap LoadSourceImage(string path)
        {
            Bitmap        bmp     = _loader.LoadImageAsBitmap(path);
            BitmapAdapter adapter = new BitmapAdapter(bmp);
            var           rects   = _statsGenerator
                                    .GetChunks(new Rectangle(0, 0, bmp.Width, bmp.Height))
                                    .Select(r => new ImageManipulationInfo(r.X, r.Y, r.Width, r.Height));


            _sourceImageStats = new ImageAndStats(new PhysicalImage(path),
                                                  rects
                                                  .Select(r => new SegmentAndStats(r, _statsGenerator.GetStats(adapter, r)))
                                                  .ToArray()
                                                  );

            return(bmp);
        }
Exemple #3
0
 public Bitmap GetBitmap(PhysicalImage physicalImage, ImageManipulationInfo manipulationInfo)
 {
     return(BitmapAdapter.FromPath(physicalImage.ImagePath, _loader)
            .GetSegment(manipulationInfo));
 }