예제 #1
0
 public Renderer(Fractal fractal, Graphics graphics, Rectangle renderRectangle)
 {
     this.fractal = fractal;
     this.graphics = graphics;
     this.renderRectangle = renderRectangle;
     this.bitmapCache = new BitmapCache(this);
 }
예제 #2
0
 public OpenGlRenderer(Fractal fractal, Graphics graphics, Rectangle renderRectangle)
     : base(fractal, graphics, renderRectangle)
 {
     i = this;
 }
예제 #3
0
 public GuiRenderer(Fractal fractal, Graphics graphics, Rectangle renderRectangle)
     : base(fractal, graphics, renderRectangle)
 {
 }
예제 #4
0
 public void SetColorIndexes(Fractal fractal, double X, double Y, double size)
 {
     if (!done) {
         for(int y = 0; y < Fragment.FragmentSize; y += 1) {
             for(int x = 0; x < Fragment.FragmentSize; x += 1) {
                 ColorIndex index = fractal.Equation.GetColorIndex(X + x * size, Y + y * size);
                 SetColorIndex(x, y, index);
             }
         }
         maxColorDifference = GetMaxColorDifference(fractal.ColorMap);
         done = true;
     }
 }
예제 #5
0
파일: Form1.cs 프로젝트: lightfaith/NAVY
        //
        // -------------------------- LOAD -------------------------------------
        //
        private void Form1_Load(object sender, EventArgs e)
        {
            tabControl.SelectedTab = tabControl.TabPages[2];
            tabControlFractals.SelectedTab = tabControlFractals.TabPages[0];

            functionlist = new Dictionary<String, TransferFunction>();
            functionlist.Add("Linear", new Linear());
            functionlist.Add("Binary Unipolar", new BinaryUnipolar());
            functionlist.Add("Binary Bipolar", new BinaryBipolar());
            functionlist.Add("Logistic", new Logistic());
            functionlist.Add("Hyperbolic Tangent", new HyperbolicTangent());
            functionlist.Add("Gaussian", new Gaussian());
            columnFunction.DataSource = functionlist.Keys.ToList<String>();

            //add default row
            AddNewLayer();

            //clear charts
            chartLSP.ChartAreas.Clear();
            chartLSP.Series.Clear();
            chartStatus.Series.Clear();
            chartStatus.ChartAreas.Clear();

            // hopfield stuff
            for (int i = 0; i < hop.Width * hop.Height; i++)
                hopimage.Add(0);

            cmbHopfieldSymbols.DataSource = Hopfield.Symbols.Keys.ToList<char>();
            btnHopfieldClear_Click(sender, e);

            // fractal stuff
            /*cmbFractalExamples.DataSource = Fractal.Examples.Keys.ToList<String>();
            cmbFractalExamples.SelectedIndex = 1;
            */
            fractal = new Fractal(/*Fractals.Configuration.IFSTree(Fractal.Width, Fractal.Height)*/);
            DrawFractal(picFractalsPicture, fractal);
            UpdateFractalGrid();

            // CA stuff
            gol = new GOL(picCAWorld.Width, picCAWorld.Height, (int)numCAPixel.Value);
            picCAWorld.Image = new Bitmap(picCAWorld.Width, picCAWorld.Height);
            using (Graphics g = Graphics.FromImage(picCAWorld.Image))
                g.Clear(Color.Black);
            cellstochange = new List<Tuple<int, int>>();
        }
예제 #6
0
파일: Form1.cs 프로젝트: lightfaith/NAVY
        private void DrawFractal(PictureBox pic, Fractal f)
        {
            if (pic.Image == null)
                pic.Image = new Bitmap(pic.Width, pic.Height);

            Random r = new Random();

            pic.Image = fractal.Picture;
            pic.Invalidate();
        }