static void DoCreateImage(IDensityMatrix matrix) { Logger.PrintInfo("matrix = [" + matrix.Width + "x" + matrix.Height + " " + matrix.Maximum + "]"); IColorMap cm = GetColorMap(out string _); using (var img = new MagicCanvas(Options.Width, Options.Height)) { Logger.PrintInfo("building image"); PaintImageData(matrix, cm, img); SaveCanvas(img); } }
static void CreateColorMapTest() { IColorMap cmap = GetColorMap(out string name); using (var img = new MagicCanvas(Options.Width, Options.Height)) { for (int x = 0; x < Options.Width; x++) { ColorD c = cmap.GetColor(x, Options.Width); img.DrawLine(c, x, 0, x, Options.Height - 1); } img.SavePng("ColorMapTest-" + name + ".png"); } }
static void CreateNebulaBrot() { using (var matrixR = CreateNebulaBrotMatrix("-r", Options.NebulaRIter, ColorComponent.R)) using (var matrixG = CreateNebulaBrotMatrix("-g", Options.NebulaGIter, ColorComponent.G)) using (var matrixB = CreateNebulaBrotMatrix("-b", Options.NebulaBIter, ColorComponent.B)) { if (!Options.CreateImage) { return; } using (var canvas = new MagicCanvas(Options.Width, Options.Height, true)) { DrawToImageComponent(canvas, matrixR, ColorComponent.R); DrawToImageComponent(canvas, matrixG, ColorComponent.G); DrawToImageComponent(canvas, matrixB, ColorComponent.B); SaveCanvas(canvas); } } }