fractals

package
v0.0.0-...-a6f644f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFractal

func LoadFractal(f *Fractal, filename string)

LoadFractal is YAML parser and loader

Types

type ColorDef

type ColorDef struct {
	Pos   float64 `yaml:"pos"`
	Color string  `yaml:"color"`
}

ColorDef is used to represent a gradient colour postion in YAML

type ComplexPair

type ComplexPair struct {
	R float64 `yaml:"r"`
	I float64 `yaml:"i"`
}

ComplexPair is used to represent complex number in YAML

type Fractal

type Fractal struct {
	FractType    string      `yaml:"type"`
	MagFactor    float64     `yaml:"zoom"`
	MaxIter      float64     `yaml:"maxIter"`
	W            float64     `yaml:"width"`
	H            float64     `yaml:"height"`
	ImgWidth     int         `yaml:"imageWidth"`
	Center       ComplexPair `yaml:"center"`
	JuliaSeed    ComplexPair `yaml:"juliaSeed"`
	Colors       []ColorDef  `yaml:"colors"`
	ColorRepeats int         `yaml:"colorRepeats"`
	InnerColor   string      `yaml:"innerColor"`
	FullScreen   bool        `yaml:"fullScreen"`
}

Fractal is our main object

func (Fractal) Render

func (f Fractal) Render(img *image.RGBA, palette colors.GradientTable) float64

Render the fractal into the given image using the given palette

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL