public static void GetMandelbrotData(CoordinateSystem cordSys, MandelbrotPixel[] pointTable, Quadrant quadrant) { for (int index = quadrant.StartIndex; index < quadrant.StopIndex; index++) { int _iterCount = GetIterCount(Compute.ComplexCoordinates[index], ComplexPlane); pointTable[index] = new MandelbrotPixel(BitmapPixels[index], _iterCount); } }
public void Setup() { _expected = new MandelbrotPixel { Finished = false, Iterations = 1, Position = new Complex(0.5m, 0.2m), Z = new Complex(0.5m, 0.2m) }; _sut = new MandelbrotPixel { Finished = false, Iterations = 0, Position = new Complex(0.5m, 0.2m), Z = new Complex(0, 0) }; _sut.Iterate(); }
public void Setup() { _expected = new MandelbrotPixel { Finished = true, Iterations = 2, Position = new Complex(2, 2), Z = new Complex(2, -6) }; _sut = new MandelbrotPixel { Finished = false, Iterations = 1, Position = new Complex(2, 2), Z = new Complex(-2, 2) }; _sut.Iterate(); }
public static MandelbrotPixel[] CalculateSequential(CoordinateSystem coordinateSystem, Priorities threadPriority) { Thread.CurrentThread.Priority = PriorityManager(threadPriority, false)[0]; // Set chosen priority /* Calculate the Mandelbrot Pixels sequentially and return a struct that shall be visualized */ Point[] _bitmapPixels = GetBasicCoordinates(coordinateSystem); Complex[] _complexCoordinates = GetMappedCoordinates(coordinateSystem); MandelbrotPixel[] _mandelbrotPixel = new MandelbrotPixel[_bitmapPixels.Length]; int idx = 0; foreach (var cpoint in _complexCoordinates) { int _iterCount = GetIterCount(cpoint, coordinateSystem); /* Return the corresponding bitmap pixel and iteration count based on complex points iteration */ _mandelbrotPixel[idx] = new MandelbrotPixel(_bitmapPixels[idx], _iterCount); idx++; } return(_mandelbrotPixel); }