Пример #1
0
 public Bitmap ProcessImage(Bitmap original, IEnumerable<Bitmap> libraryBase, int blockHeight, int blockWidth)
 {
     IBlockGenerator generator = new BasicBlockGenerator(new BlockSize(blockWidth, blockHeight));
     var library = LoadLibrary(libraryBase, generator).ToList();
     var decomposedOriginal = generator.GenerateBlocks(original);
     IBlockFinder finder = new HexColourBlockFinder(library);
     var newBlocks = decomposedOriginal.Select(originalBlock => finder.Find(originalBlock));
     IBlockStitcher stitcher = new BlockStitcher();
     return stitcher.Stitch(newBlocks);
 }
Пример #2
0
        public void TestGenAndStitch()
        {
            var testImage = Image.FromFile(@"C:\dev\Code\raci\Tests\testbmp.bmp") as Bitmap;

            BasicBlockGenerator generator = new BasicBlockGenerator(new BlockSize(30,30));

            var blocks = generator.GenerateBlocks(testImage);

            var blockStitcher = new BlockStitcher();
            var newImage = blockStitcher.Stitch(blocks);
            newImage.Save("c:\\testOut.bmp", ImageFormat.Bmp);
        }