Пример #1
0
        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);
            }
        }
Пример #2
0
        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");
            }
        }
Пример #3
0
        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);
                        }
                    }
        }