Пример #1
0
        public ImageMosaicResponse Generate(string id, IList <ImageFileIndexStructure> tiles, ImageFileIndexStructure master, bool random, int width, int height, bool colourBlended, bool enhanced, int enhancedThreshold, bool edgeDetection, List <PixelCoordinates> edges)
        {
            var request = new ImageMosaicRequest()
            {
                Id       = id, Master = master, Random = random, TileWidth = width, TileHeight = height, ColourBlended = colourBlended,
                Enhanced = enhanced, EnhancedThreshold = enhancedThreshold, EdgeDetection = edgeDetection
            };

            request.Tiles.AddRange(tiles);
            request.Edges.AddRange(edges);
            var response = new ImageMosaicService.ImageMosaic().Generate(request);

            return(response);
        }
Пример #2
0
        public ImageMosaicResponse Generate(ImageMosaicRequest request)
        {
            var tilesPath       = request.Tiles.Select(x => x.FilePath).ToList();
            var mosaicGenerator = new MosaicGenerator();
            var mosaic          = mosaicGenerator.Generate(request.Master.FilePath, request.Tiles.ToList(), request.Random, request.TileWidth, request.TileHeight,
                                                           request.ColourBlended, request.Enhanced, request.EnhancedThreshold, request.EdgeDetection, request.Edges.ToList());
            var location = string.Format("C:\\Users\\Tom_m\\OneDrive\\Pictures\\MosaicImageTests\\{0}.jpg", request.Id);

            mosaic.Image.Save(location);
            mosaic.Image.Dispose();
            return(new ImageMosaicResponse()
            {
                Location = location
            });
        }