Documentation ¶
Index ¶
- func ColorRow(img *image.RGBA, row, length uint16, xScale, yScale FloatFunction, ...)
- func EscapeIterations(x0, y0 float64, maxIterations int) (iterations int)
- func ExtentFromPoint(x, y, xShift, yShift float64) (xMin, xMax, yMin, yMax float64)
- func HasEscaped(x, y float64) bool
- func NewPalette(maxIterations uint8) []color.Color
- func Scale(inputMin, inputMax, outputMin, outputMax float64) func(a float64) float64
- func WritePng(img *image.RGBA, filename string)
- type Drawer
- type FloatFunction
- type MandelbrotBuilder
- func (bb MandelbrotBuilder) Draw(minX, maxX, minY, maxY float64, colors []color.Color) *image.RGBA
- func (bb MandelbrotBuilder) Gif(frames uint16, x, y, scaleIn float64, colors []color.Color) *gif.GIF
- func (bb *MandelbrotBuilder) SetIterations(maxIterations uint8)
- func (bb *MandelbrotBuilder) SetSize(sizeX, sizeY uint16)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorRow ¶
func ColorRow(img *image.RGBA, row, length uint16, xScale, yScale FloatFunction, colors []color.Color, wg *sync.WaitGroup)
ColorRow fills in one row of Mandelbrot values for an image
func EscapeIterations ¶
EscapeIterations calculates how many iterations it takes for this point to escape Mandelbrot iteration, with a cap of maxIterations
func ExtentFromPoint ¶
ExtentFromPoint converts an x,y point + offsets in x and y into ranges of x and y values
func HasEscaped ¶
HasEscaped tells us whether a point has escaped under Mandelbrot iteration, ie it has length > 2
func NewPalette ¶
NewPalette returns a list of colors to use as a palette
Types ¶
type FloatFunction ¶
FloatFunction is a takes a float64 and returns a float64.
type MandelbrotBuilder ¶
func (MandelbrotBuilder) Draw ¶
Draw draws a Mandelbrot image of a given size with a given domain and range
func (MandelbrotBuilder) Gif ¶
func (bb MandelbrotBuilder) Gif(frames uint16, x, y, scaleIn float64, colors []color.Color) *gif.GIF
Gif returns the gif containing frames and delays for a mandelbrot animation
func (*MandelbrotBuilder) SetIterations ¶
func (bb *MandelbrotBuilder) SetIterations(maxIterations uint8)
func (*MandelbrotBuilder) SetSize ¶
func (bb *MandelbrotBuilder) SetSize(sizeX, sizeY uint16)
Click to show internal directories.
Click to hide internal directories.