Documentation ¶
Index ¶
- Variables
- func NewImageRGBA(size image.Point) *image.RGBA
- func RenderImageRGBA(m *image.RGBA, config Config, progress func(percent int))
- func SaveImageJPEG(filename string, m image.Image) error
- func SaveImagePNG(filename string, m image.Image) error
- func TraceOrbit(t Orbit, n int) (int, bool)
- type AntiAliasing
- type Calculation
- type Config
- type FactoryBurningShip
- type FactoryBurningShipIm
- type FactoryJuliaSet
- type FactoryMandelbrot
- type FactoryMandelbrotPow3
- type FactoryMandelbrotPow4
- type FactoryMandelbrotPow5
- type FactoryMandelbrotPow6
- type FactoryPhoenix
- type FactorySpider
- type FactoryTricorn
- type Formula
- type FractalInfo
- type Location
- type Orbit
- type OrbitFactory
- type Palette
- type Palette1
- type Size
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ ImageSize: Size{ Width: 512, Height: 512, }, FractalInfo: FractalInfo{ Formula: FormulaMandelbrot, Location: Location{ Center: Complex{ Re: 0, Im: 0, }, Radius: 2, AngleDeg: 0, }, Parameters: nil, }, Calculation: Calculation{ Iterations: 100, AntiAliasing: AA_NONE, }, Palette: DefaultPalette, }
View Source
var DefaultPalette = Palette{ Params: palgen.Params{ A: palgen.Vec3{0.5, 0.5, 0.5}, B: palgen.Vec3{0.5, 0.5, 0.5}, C: palgen.Vec3{1.0, 1.0, 1.0}, D: palgen.Vec3{0.0, 0.0, 0.0}, }, SpaceColor: fcolor.RGB{R: 0, G: 0, B: 0}, Period: 30, Shift: 0, }
View Source
var DefaultPalette1 = Palette1{ Colors: []fcolor.RGB{ fcolor.RGB{R: 1, G: 1, B: 1}, fcolor.RGB{R: 0, G: 0, B: 0}, }, SpaceColor: fcolor.RGB{R: 0, G: 0, B: 0}, Period: 30, }
View Source
var JuliaSetDefaultConst = Complex{
Re: -0.74543,
Im: 0.11301,
}
View Source
var PhoenixDefaultConst = Complex{
Re: 0.56667,
Im: -0.5,
}
Functions ¶
func RenderImageRGBA ¶
Types ¶
type AntiAliasing ¶
type AntiAliasing int
const ( AA_NONE AntiAliasing = iota AA_4X // 4 samples per pixel AA_9X // 9 samples per pixel AA_16X // 16 samples per pixel AA_25X // 25 samples per pixel )
func ParseAntiAliasing ¶
func ParseAntiAliasing(s string) (AntiAliasing, error)
func (AntiAliasing) MarshalJSON ¶
func (aa AntiAliasing) MarshalJSON() ([]byte, error)
func (AntiAliasing) String ¶
func (aa AntiAliasing) String() string
func (*AntiAliasing) UnmarshalJSON ¶
func (aa *AntiAliasing) UnmarshalJSON(data []byte) error
type Calculation ¶
type Calculation struct { Iterations int `json:"iterations"` AntiAliasing AntiAliasing `json:"anti_aliasing"` }
type Config ¶
type Config struct { ImageSize Size `json:"image_size"` FractalInfo FractalInfo `json:"fractal_info"` Calculation Calculation `json:"calculation"` Palette Palette `json:"palette"` }
func (*Config) MoveRelativeLocation ¶
relative value range: [-1 ... +1]
type FactoryBurningShip ¶
type FactoryBurningShip struct{}
func (FactoryBurningShip) NewOrbit ¶
func (FactoryBurningShip) NewOrbit(Z Complex) Orbit
type FactoryBurningShipIm ¶
type FactoryBurningShipIm struct{}
func (FactoryBurningShipIm) NewOrbit ¶
func (f FactoryBurningShipIm) NewOrbit(Z Complex) Orbit
type FactoryJuliaSet ¶
type FactoryJuliaSet struct {
C Complex
}
func (FactoryJuliaSet) NewOrbit ¶
func (f FactoryJuliaSet) NewOrbit(Z Complex) Orbit
type FactoryMandelbrot ¶
type FactoryMandelbrot struct{}
func (FactoryMandelbrot) NewOrbit ¶
func (FactoryMandelbrot) NewOrbit(Z Complex) Orbit
type FactoryMandelbrotPow3 ¶
type FactoryMandelbrotPow3 struct{}
func (FactoryMandelbrotPow3) NewOrbit ¶
func (FactoryMandelbrotPow3) NewOrbit(Z Complex) Orbit
type FactoryMandelbrotPow4 ¶
type FactoryMandelbrotPow4 struct{}
func (FactoryMandelbrotPow4) NewOrbit ¶
func (FactoryMandelbrotPow4) NewOrbit(Z Complex) Orbit
type FactoryMandelbrotPow5 ¶
type FactoryMandelbrotPow5 struct{}
func (FactoryMandelbrotPow5) NewOrbit ¶
func (FactoryMandelbrotPow5) NewOrbit(Z Complex) Orbit
type FactoryMandelbrotPow6 ¶
type FactoryMandelbrotPow6 struct{}
func (FactoryMandelbrotPow6) NewOrbit ¶
func (FactoryMandelbrotPow6) NewOrbit(Z Complex) Orbit
type FactoryPhoenix ¶
type FactoryPhoenix struct {
C Complex
}
func (FactoryPhoenix) NewOrbit ¶
func (f FactoryPhoenix) NewOrbit(Z Complex) Orbit
type FactorySpider ¶
type FactorySpider struct{}
func (FactorySpider) NewOrbit ¶
func (FactorySpider) NewOrbit(Z Complex) Orbit
type FactoryTricorn ¶
type FactoryTricorn struct{}
func (FactoryTricorn) NewOrbit ¶
func (f FactoryTricorn) NewOrbit(Z Complex) Orbit
type Formula ¶
type Formula int
func ParseFormula ¶
func (Formula) MarshalText ¶
func (*Formula) UnmarshalText ¶
type FractalInfo ¶
type OrbitFactory ¶
type OrbitFactory interface {
NewOrbit(Complex) Orbit
}
type Palette ¶
type Palette struct { Params palgen.Params `json:"params"` SpaceColor fcolor.RGB `json:"space_color"` Period float64 `json:"period"` Shift float64 `json:"shift"` }
------------------------------------------------------------------------------
Source Files ¶
Click to show internal directories.
Click to hide internal directories.