Crate billow

Source
Expand description

Implementation of the wave function collapse algorithm based on Oskar Stålberg’s.

The wave function collapse algorithm is a recursive algorithm that picks a random tile for a slot on the output image and removes impossible neighbors until only a single possibility remains

Modules§

image
Support for the image crate.

Structs§

ConnectorID
A connector is a unique identifier for a specific image and direction.
Wave
Wave holds the state of a wave collapse function.

Enums§

Direction
Represents each of the sides of the image.

Traits§

Image

Functions§

get_constraint_fn
Returns the default constraint function. The constraint function is used to calculate the connectorID for a slot. Only modules that have the same connector as the slot’s module are considered possible. The default constraint function checks pixel equality. Use the sample_size to control the number of pixels to compare on each side of the slot.

Type Aliases§

ConstraintFn
PossibleFn