mod fbm;
mod modifiers;
mod perlin;
mod ridged;
mod simplex;
mod value;
mod worley;
pub use fbm::Fbm;
pub use modifiers::*;
pub use perlin::Perlin;
pub use ridged::Ridged;
pub use simplex::Simplex;
pub use value::Value;
pub use worley::Worley;
pub trait NoiseSource {
fn sample(&self, x: f64, y: f64) -> f64;
}
pub trait NoiseExt: NoiseSource + Sized {
fn scale(self, factor: f64) -> Scale<Self> {
Scale {
source: self,
factor,
}
}
fn offset(self, amount: f64) -> Offset<Self> {
Offset {
source: self,
amount,
}
}
fn clamp(self, min: f64, max: f64) -> Clamp<Self> {
Clamp {
source: self,
min,
max,
}
}
fn abs(self) -> Abs<Self> {
Abs { source: self }
}
fn fbm(self, octaves: u32, lacunarity: f64, persistence: f64) -> Fbm<Self> {
Fbm::new(self, octaves, lacunarity, persistence)
}
fn blend<B: NoiseSource, C: NoiseSource>(self, other: B, control: C) -> Blend<Self, B, C> {
Blend::new(self, other, control)
}
}
impl<T: NoiseSource> NoiseExt for T {}