Documentation ¶
Index ¶
- Variables
- func AverageImageColor(im image.Image) color.NRGBA
- func LoadImage(path string) (image.Image, error)
- func Log(level int, format string, a ...interface{})
- func NumberString(x float64) string
- func PreAnneal(state Annealable, iterations int) float64
- func SaveFile(path, contents string) error
- func SaveGIF(path string, frames []image.Image, delay, lastDelay int) error
- func SaveGIFImageMagick(path string, frames []image.Image, delay, lastDelay int) error
- func SaveJPG(path string, im image.Image, quality int) error
- func SavePNG(path string, im image.Image) error
- type Annealable
- type Color
- type Ellipse
- type Heatmap
- type Model
- type Polygon
- type Quadratic
- type Rectangle
- type RotatedEllipse
- type RotatedRectangle
- type Scanline
- type Shape
- type ShapeType
- type State
- type Triangle
- type Worker
- func (worker *Worker) BestHillClimbState(t ShapeType, a, n, age, m int) *State
- func (worker *Worker) BestRandomState(t ShapeType, a, n int) *State
- func (worker *Worker) Energy(shape Shape, alpha int) float64
- func (worker *Worker) Init(current *image.RGBA, score float64)
- func (worker *Worker) RandomState(t ShapeType, a int) *State
Constants ¶
This section is empty.
Variables ¶
View Source
var LogLevel int
Functions ¶
func NumberString ¶
func PreAnneal ¶
func PreAnneal(state Annealable, iterations int) float64
func SaveGIFImageMagick ¶
Types ¶
type Annealable ¶
type Annealable interface { Energy() float64 DoMove() interface{} UndoMove(interface{}) Copy() Annealable }
func Anneal ¶
func Anneal(state Annealable, maxTemp, minTemp float64, steps int) Annealable
func HillClimb ¶
func HillClimb(state Annealable, maxAge int) Annealable
type Model ¶
type Quadratic ¶
func NewRandomQuadratic ¶
type Rectangle ¶
func NewRandomRectangle ¶
type RotatedEllipse ¶
func NewRandomRotatedEllipse ¶
func NewRandomRotatedEllipse(worker *Worker) *RotatedEllipse
func (*RotatedEllipse) Copy ¶
func (c *RotatedEllipse) Copy() Shape
func (*RotatedEllipse) Mutate ¶
func (c *RotatedEllipse) Mutate()
func (*RotatedEllipse) Rasterize ¶
func (c *RotatedEllipse) Rasterize() []Scanline
func (*RotatedEllipse) SVG ¶
func (c *RotatedEllipse) SVG(attrs string) string
type RotatedRectangle ¶
func NewRandomRotatedRectangle ¶
func NewRandomRotatedRectangle(worker *Worker) *RotatedRectangle
func (*RotatedRectangle) Copy ¶
func (r *RotatedRectangle) Copy() Shape
func (*RotatedRectangle) Mutate ¶
func (r *RotatedRectangle) Mutate()
func (*RotatedRectangle) Rasterize ¶
func (r *RotatedRectangle) Rasterize() []Scanline
func (*RotatedRectangle) SVG ¶
func (r *RotatedRectangle) SVG(attrs string) string
func (*RotatedRectangle) Valid ¶
func (r *RotatedRectangle) Valid() bool
type Triangle ¶
func NewRandomTriangle ¶
Click to show internal directories.
Click to hide internal directories.