docs.rs failed to build wfc-rs-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
wfc-rs-0.6.1
WFC
The wfc-rs crate is a wrapper for the krychu/wfc implementation of Wave Function Collapse.
The wfc library is manually wrapped with extern functions, and a small, more ideomatic Rust wrapper is provided.
Note that this is an early, but working version.
Usage
Once the crate has been added to Cargo.toml as:
wfc_rs = "0.5"
create a WfcImage with from_vec or from_file:
let image = from_image?;
This creates an optional NonNull, which contains a pointer to the underlying WfcImage structure. This structure is a repr(C) struct that matches the 'wfc.h' structure 'wfc_image'.
and then a Wfc structure from this image, as well as the configuration settings:
let mut wfc = overlapping?;
With this Wfc, you can run an interation with 'run'
wfc.run;
and either export an input:
wfc.export;
or get the raw pixel data as a Vec:
let bytes = wfc.vec;