Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ReflectionX is reflection along the x axis. ReflectionX = iota // ReflectionY is reflection along the y axis. ReflectionY )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageShuttle ¶
type ImageShuttle struct {
ImageShuttleOptions
// contains filtered or unexported fields
}
ImageShuttle is a silk shuttle that can be used to generate images.
func NewImageShuttle ¶
func NewImageShuttle(img image.Image, opts ImageShuttleOptions) *ImageShuttle
NewImageShuttle initializes a new image shuttle.
func (*ImageShuttle) Directions ¶
func (s *ImageShuttle) Directions() [][]int
Directions returns the directions used by the shuttle.
func (*ImageShuttle) ObservationHeuristic ¶
func (s *ImageShuttle) ObservationHeuristic() silk.ObservationHeuristic
ObservationHeuristic returns the min entropy heuristic.
func (*ImageShuttle) Propogator ¶
func (s *ImageShuttle) Propogator(d, t int) []int
Propogator returns the propogator used by the shuttle.
func (*ImageShuttle) Weave ¶
func (s *ImageShuttle) Weave(coefficients [][]bool, done bool) error
Weave implements the silk shuttle interface.
func (*ImageShuttle) Weights ¶
func (s *ImageShuttle) Weights() []float64
Weights returns the weights for each pattern.
type ImageShuttleOptions ¶
type ImageShuttleOptions struct {
// N is the size of the patterns. The default is 3.
N int
// W is the width of the output image. The default is 128.
W int
// H is the height of the output image. The default is 128.
H int
// OutputDir is the directory for file outputs. The default is the current working directory.
OutputDir string
// DumpPatterns indicates whether to save each pattern to a file in a folder called "patterns" in the output directory.
DumpPatterns bool
// Animation indicates whether to save the entire collapse process as a gif.
Animation bool
// KeepEveryNFrames indicates how many frames to keep when saving the animation. The default is 1.
KeepEveryNFrames int
// Reflections are the reflections to use for the shuttle. The default is no reflections.
Reflections []int
}
ImageShuttleOptions are options for the image shuttle.
Click to show internal directories.
Click to hide internal directories.