attractor

package
v0.0.0-...-5564bc9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRenderConfigFilename = "render_config.json"

Variables

View Source
var DefaultRenderConfig = RenderConfig{
	ImageFilename: "attractor.png",
	ImageSize:     "512x512",
	TotalPoints:   10_000_000,
	RadiusFactor:  0.9,
	FillBG:        true,
	ColorBG:       "#fff",
	ColorFG:       "#000",
	Smooth:        true,
	ToneFactor:    15,
}

Functions

func MakeDefaultRenderConfigFile

func MakeDefaultRenderConfigFile(p *RenderConfig) error

func MakeRegularPoints

func MakeRegularPoints(n int) []Point2f

func RandPointInRadius

func RandPointInRadius(r *rand.Rand, radius float64) Point2f

func RegularPoints

func RegularPoints(n int, radius float64, phase float64) []Point2f

func Render

func Render(rc RenderConfig, nr Nexter) (image.Image, error)

Types

type CornerpointSelector

type CornerpointSelector int
const (
	CornerpointRandom CornerpointSelector = iota
	CornerpointNotTwice
	CornerpointNotDirectNeighbors
)

func ParseCornerpointSelector

func ParseCornerpointSelector(s string) (CornerpointSelector, error)

type CorrectFunc

type CorrectFunc func(inputValue float64) (outputValue float64)

func GammaCorrectionFunc

func GammaCorrectionFunc(gamma float64) CorrectFunc

func ToneCorrectionFunc

func ToneCorrectionFunc(toneFactor float64) CorrectFunc

shade

type Feeder

type Feeder interface {
	Feed(Point2f) Point2f
}

func MultiFeeder

func MultiFeeder(fs ...Feeder) Feeder

type Nexter

type Nexter interface {
	Next() Point2f
}

func MakeNexter

func MakeNexter(f Feeder, p Point2f) Nexter

type PsFeeder

type PsFeeder struct {
	// contains filtered or unexported fields
}

------------------------------------------------------------------------------

func NewPsFeeder

func NewPsFeeder(ps []Point2f, t float64, cps CornerpointSelector) *PsFeeder

func (*PsFeeder) Feed

func (p *PsFeeder) Feed(a Point2f) Point2f

type RenderConfig

type RenderConfig struct {
	ImageFilename string  `json:"image_filename"`
	ImageSize     string  `json:"image_size"`
	TotalPoints   int     `json:"total_points"`
	RadiusFactor  float64 `json:"radius_factor"`
	FillBG        bool    `json:"fill_bg"`
	ColorBG       string  `json:"color_bg"`
	ColorFG       string  `json:"color_fg"`
	Smooth        bool    `json:"smooth"`
	ToneFactor    float64 `json:"tone_factor"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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