wfc-cr
wfc-cr
Crystal C-Bindings for krychu/wfc to create random images using wave function collapse
Installation
Linux
- Run
sh ./rsrc/install.sh
- Add
wfc-cr
to yourshard.yml
dependencies like so:
dependencies:
wfc-cr:
github: D-Shwagginz/wfc-cr
Windows
- Follow the instructions at https://github.com/neatorobito/scoop-crystal to add the crystal-preview bucket to scoop
- Install crystal with
scoop install crystal
- Run
.\rsrc\install.ps1
in powershell - Run in powershell
$env:LIB="${env:LIB};C:\wfc"
$env:PATH="${env:PATH};C:\wfc"
OR
Run in cmd
set PATH=%PATH%;C:\wfc
set LIB=%LIB%;C:\wfc
Usage
Quick example:
require "wfc-cr"
input_image = WFC.image_load("Path/To/Image.png")
wfc = WFC.overlapping(128, 128, input_image, 3, 3, 1, 1, 1, 1)
WFC.run(wfc, -1)
output_image = WFC.output_image(wfc)
WFC.image_save(output_image, "Path/To/MyNewImage.png")
WFC.image_destroy(input_image)
WFC.image_destroy(output_image)
WFC.destroy(wfc)
Contributing
- Fork it (https://github.com/D-Shwagginz/wfc-cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- D. Shwagginz - creator and maintainer
- Sol-vin - provided the install scripts
Repository
wfc-cr
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- about 1 year ago
- September 12, 2023
License
MIT License
Links
Synced at
Sun, 22 Dec 2024 18:32:00 GMT
Languages