Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
Coordinate holds real number 'Re', imaginary number 'Im' and corresponding pixel index
type Mandelbrot ¶
type Mandelbrot struct {
Width int
Height int
R float64
MaxIterations int
X float64
Y float64
ImageData *image.RGBA
Colors int
}
Mandelbrot defines the parameters of the set to render
Width & Height define the dimensions of the output image R specifies the "zoom" MaxIterations is upper limit of iterations for the calculation if a pixel is contained in the set or not X & Y define where the center of the complex plane should be from -2..2
func (*Mandelbrot) Render ¶
func (m *Mandelbrot) Render()
Render generates the Mandelbrot set with N CPU number of go routines
func (*Mandelbrot) RenderSequentially ¶
func (m *Mandelbrot) RenderSequentially()
RenderSequentially generates the Mandelbrot set sequentially, without go routines
func (*Mandelbrot) RenderWithBufferedChannel ¶
func (m *Mandelbrot) RenderWithBufferedChannel()
RenderWithBufferedChannel uses a buffered channel for Coordinates The buffer size is tthe number of pixel devided by n CPU. For each CPU one go routine is started, each reading from the buffered Coorindate channel
func (*Mandelbrot) RenderWithMaxRoutines ¶
func (m *Mandelbrot) RenderWithMaxRoutines(maxRoutines int)
RenderWithMaxRoutines limits the number of go routines All go routines read from one Coordinate channel with no buffer set
func (*Mandelbrot) RenderWithUnlimitedRoutines ¶
func (m *Mandelbrot) RenderWithUnlimitedRoutines()
RenderWithUnlimitedRoutines uses one go routine per Coordinate All go routines read from one Coordinate channel with no buffer set