Crates.io | txture |
lib.rs | txture |
version | 0.1.1 |
source | src |
created_at | 2019-12-27 15:43:49.911208 |
updated_at | 2019-12-27 16:29:28.961209 |
description | A simple lib to generate cool textures |
homepage | |
repository | https://github.com/ferdinandklr/txture |
max_upload_size | |
id | 192667 |
size | 11,707 |
Ever wanted to simply generate tileable noise textures in rust ? You are at the right place ! This crate allows you to generate perlin noise texture and many more with ease.
Simply add the lib to your Cargo.toml to start playing :
[dependencies]
txture = "*"
To learn more about this library, go check on crates.io or on github !
Please note that some use cases of this lib can be seen in the test folder !
Start by importing the crate where you need it :
use txture::PerlinNoise;
Then create a new PerlinNoise
instance, precising :
u32
u8
(check pictures for a better understanding)bool
The output is of type Result<PerlinNoise, txture::Error>
, so you have to unwrap it. You cant try for exemple :
let perlin_noise = PerlinNoise::new(400, 5, true).unwrap();
Then, to access any pixel in the picture, all you have to do is write :
let gray: u8 = perlin_noise.get_pixel_value(i, j);
This project is under the MIT license (see the LICENSE.md for more details)