fractx

package module
v0.0.0-...-05d84cd Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

README

fractx

Build Status

z2 + c and beyond..

Documentation

Index

Constants

View Source
const DefaultMaxI = 100

Variables

View Source
var (
	DefaultSize   = Size{700, 400}
	DefaultBounds = Rect{-2.5, -1, 1, 1}
)
View Source
var (
	Colorset1 = Colorset{
		{70, "white"},
		{40, "yellow"},
		{24, "orange"},
		{12, "red"},
		{7, "purple"},
		{3, "darkblue"},
		{0, "blue"},
	}
)
View Source
var ImageBuilders = map[string]ImageBuilder{
	"bw":   NewBWImage,
	"gray": NewGrayImage,
	"col1": partial(NewPalettedImage, Colorset1),
}

Functions

func ImageBuilderNames

func ImageBuilderNames() (ss []string)

Types

type Colorset

type Colorset []struct {
	IterPercent uint
	Color       string
}

func (Colorset) Len

func (a Colorset) Len() int

func (Colorset) Less

func (a Colorset) Less(i, j int) bool

func (Colorset) Swap

func (a Colorset) Swap(i, j int)

type Fractal

type Fractal struct {
	Size   Size
	Bounds Rect
	MaxI   uint
}

func (*Fractal) Fill

func (f *Fractal) Fill(image Image)

type Image

type Image interface {
	image.Image
	// contains filtered or unexported methods
}

func NewBWImage

func NewBWImage(f *Fractal) Image

func NewGrayImage

func NewGrayImage(f *Fractal) Image

func NewPalettedImage

func NewPalettedImage(cs Colorset, f *Fractal) Image

type ImageBuilder

type ImageBuilder func(*Fractal) Image

type Rect

type Rect struct {
	X0, Y0, X1, Y1 float64
}

func (*Rect) Set

func (r *Rect) Set(input string) (err error)

func (*Rect) String

func (r *Rect) String() string

func (*Rect) Type

func (*Rect) Type() string

type Size

type Size struct {
	W, H int
}

func (*Size) Set

func (s *Size) Set(input string) (err error)

func (*Size) String

func (s *Size) String() string

func (*Size) Type

func (*Size) Type() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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