static void CreateDensityBrot() { var conf = GetNormalFractalConfig(); DensityMatrix matrix = null; try { if (Options.CreateMatrix) { matrix = DoCreateMatrix(conf); } else { matrix = LoadMatrix(); } if (Options.CreateImage) { DoCreateImage(matrix); } } finally { if (matrix != null) { matrix.Dispose(); } } }
private static DensityMatrix LoadMatrix(string name = null) { DensityMatrix matrix; string a = EnsureEndsWith(name ?? Options.FileName, ".dm"); Logger.PrintInfo("loading matrix file [" + a + "]"); matrix = new DensityMatrix(a); Options.Width = matrix.Width; Options.Height = matrix.Height; return(matrix); }
static DensityMatrix DoCreateMatrix(FractalConfig conf, string name = null) { DensityMatrix matrix = new DensityMatrix(Options.Width, Options.Height); var builder = new FractalBuilder(matrix, conf); string n = EnsureEndsWith(name ?? Options.FileName, ".dm"); Logger.PrintInfo("building matrix [" + n + "]"); builder.Build(); Logger.PrintInfo("saving matrix file [" + n + "]"); matrix.SaveToFile(n); return(matrix); }
static IDensityMatrix CreateNebulaBrotMatrix(string suffix, int iters, ColorComponent comp) { var conf = GetNormalFractalConfig(); conf.IterMax = iters; DensityMatrix matrix = null; string mname = Path.Combine( Path.GetDirectoryName(Options.FileName), Path.GetFileNameWithoutExtension(Options.FileName) + suffix + ".dm" ); if (Options.CreateMatrix) { matrix = DoCreateMatrix(conf, mname); } else { matrix = LoadMatrix(mname); } return(matrix); }