Versions in this module Expand all Collapse all v1 v1.0.0 Aug 27, 2018 Changes in this version + const MaxPolygonPoints + const MinPolygonPoints + const MutationAddOrDeletePoint + const MutationAlpha + const MutationColor + const MutationPoint + const MutationZOrder + const MutationsPerIteration + const PointMutationMaxDistance + const PopulationCount + var Mutations = []int + func Asset(name string) ([]byte, error) + func AssetDir(name string) ([]string, error) + func AssetInfo(name string) (os.FileInfo, error) + func AssetNames() []string + func Compare(img1, img2 image.Image) (int64, error) + func ConvertToRGBA(img image.Image) (result *image.RGBA) + func DeriveCheckpointFile(sourceFile, cpArg string, polyCount int) string + func FastCompare(img1, img2 *image.RGBA) (uint64, error) + func MustAsset(name string) []byte + func MustReadImage(file string) image.Image + func RandomBool() bool + func RandomInt(min, max int) int + func RestoreAsset(dir, name string) error + func RestoreAssets(dir, name string) error + func Serve(hostPort string, refImg image.Image, previews []*SafeImage) + func SplitPath(path string) []string + type ByFitness []*Candidate + func (cds ByFitness) Len() int + func (cds ByFitness) Less(i, j int) bool + func (cds ByFitness) Swap(i, j int) + type Candidate struct + Fitness uint64 + H int + Polygons []*Polygon + W int + type Checkpoint struct + Generation int + GenerationsSinceChange int + MostFit *Candidate + type Evolver struct + func NewEvolver(refImg image.Image, dstImageFile string, checkPointFile string) (*Evolver, error) + func (e *Evolver) Run(maxGen, polyCount int, previews []*SafeImage) + type Page struct + type Point struct + X int + Y int + type Polygon struct + Points []Point + type SafeImage struct + func NewSafeImage(img image.Image) *SafeImage + func (s *SafeImage) Update(img image.Image) + func (s *SafeImage) Value() image.Image + type Stats struct + func NewStats() *Stats + func (s *Stats) Increment(count int) + func (s *Stats) Print(best, worst *Candidate, generation, generationsSinceChange int)