public async Task SaveLayers() { Blur b = new Blur(); var dr = new BallDrainageSimulator(); var vl = new VisualLogger(); var file = "SavedFiles/rvrnw.bmp"; var i = Image.FromFile(file); var bitmap = new Bitmap(i); var layer = new LayerConverter().LoadLayer(bitmap); ILayer blured = new Layer2DObject(layer.Resolution); //b.Process(layer, blured, 3); blured = layer; vl.Log(blured, "base"); var drainagemap = dr.GetDrainageMap(blured, 10); //logger shit drainagemap[0, 0] = 0; vl.Log(drainagemap, "drainage"); }
public async Task SaveLayers() { var file = "SavedFiles/test.bmp"; var i = Image.FromFile(file); var bitmap = new Bitmap(i); var conerted = new LayerConverter().LoadLayer(bitmap); var h = new BasicHydraulicErosion(); var vl = new VisualLogger(); vl.Log(conerted, "baseNoEro"); h.Erode(conerted, new HydroErosionParams() { Strenght = 50 }); vl.Log(conerted, "baseWithEro"); }
private static void printVoronoi(int countOfCells, ISegmendDivider sd) { var l = new Layer2DObject(res); // TODO change rand approach var rnd = new Rand(seed); var c = new VoronoiConverter(sd); var g = new VoronoiGenerator(c); var gg = new VoronoiAreaGenerator(g, rnd); var vd = new VoronoiAreaDrawer(); var areas = gg.GenerateAreas(res, res * .5f, countOfCells); vd.PrintToLayer(l, areas, new Vector2()); var vl = new VisualLogger(); vl.Log(l, "profile"); }