Struct Sub

Source
pub struct Sub<A, B> {
    pub lhs: A,
    pub rhs: B,
}
Expand description

Subtracts one output value from the other.

Fields§

§lhs: A§rhs: B

Trait Implementations§

Source§

impl<A: Clone, B: Clone> Clone for Sub<A, B>

Source§

fn clone(&self) -> Sub<A, B>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Debug, B: Debug> Debug for Sub<A, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: Hash, B: Hash> Hash for Sub<A, B>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<A, B> Noise for Sub<A, B>

Source§

fn sample2<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<2>, Point: Into<[f32; 2]>,

Samples the noise in 2D.
Source§

fn sample3<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<3>, Point: Into<[f32; 3]>,

Samples the noise in 3D.
Source§

fn sample4<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<4>, Point: Into<[f32; 4]>,

Samples the noise in 3D.
Source§

fn sample2a<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<2, f32x2>, Point: Into<f32x2>,

Available on crate feature nightly-simd only.
Samples the noise in 2D.
Source§

fn sample3a<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<3, f32x4>, Point: Into<f32x4>,

Available on crate feature nightly-simd only.
Samples the noise in 3D.
Source§

fn sample4a<Point>(&self, point: Point) -> f32
where Self: Sized + Sample<4, f32x4>, Point: Into<f32x4>,

Available on crate feature nightly-simd only.
Samples the noise in 4D.
Source§

fn seed(self, seed: i32) -> Seeded<Self>
where Self: Sized,

Overwrites the seed to be sampled with. Read more
Source§

fn add_seed(self, value: i32) -> AddSeed<Self>
where Self: Sized,

Adds value to the seed.
Source§

fn mul_seed(self, value: i32) -> MulSeed<Self>
where Self: Sized,

Multiplies the seed by value.
Source§

fn frequency<F>(self, frequency: F) -> Frequency<Self, F::Noise>
where Self: Sized, F: ValueOrNoise,

Modifies a noise with a frequency multiplier. Read more
Source§

fn fbm(self, octaves: u32, gain: f32, lacunarity: f32) -> Fbm<Self>
where Self: Sized,

Creates a fractal from this noise with the provided octaves, gain and lacunarity. Read more
Source§

fn ridged(self) -> Ridged<Self>
where Self: Sized,

Modifies a noise to create a peak at 0. Read more
Source§

fn triangle_wave<F>(self, frequency: F) -> TriangleWave<Self, F::Noise>
where Self: Sized, F: ValueOrNoise,

Applies a triangle wave to the output of a noise function. Read more
Source§

fn tileable(self, width: f32, height: f32) -> Tileable<Self>
where Self: Sized,

Creates a tileable 2D noise from a 4D noise. Read more
Source§

fn translate_x<X>(self, x: X) -> TranslateX<Self, X::Noise>
where Self: Sized, X: ValueOrNoise,

Translates the point before it is used to sample self.
Source§

fn translate_xy<X, Y>(self, x: X, y: Y) -> TranslateXy<Self, X::Noise, Y::Noise>
where Self: Sized, X: ValueOrNoise, Y: ValueOrNoise,

Translates the point before it is used to sample self.
Source§

fn translate_xyz<X, Y, Z>( self, x: X, y: Y, z: Z, ) -> TranslateXyz<Self, X::Noise, Y::Noise, Z::Noise>
where Self: Sized, X: ValueOrNoise, Y: ValueOrNoise, Z: ValueOrNoise,

Translates the point before it is used to sample self.
Source§

fn translate_xyzw<X, Y, Z, W>( self, x: X, y: Y, z: Z, w: W, ) -> TranslateXyzw<Self, X::Noise, Y::Noise, Z::Noise, W::Noise>

Translates the point before it is used to sample self.
Source§

fn add<Rhs>(self, rhs: Rhs) -> Add<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Adds the output values.
Source§

fn sub<Rhs>(self, rhs: Rhs) -> Sub<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Subtracts one output value from the other.
Source§

fn mul<Rhs>(self, rhs: Rhs) -> Mul<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Multiplies the output values.
Source§

fn div<Rhs>(self, rhs: Rhs) -> Div<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Divides one output value by the other.
Source§

fn rem<Rhs>(self, rhs: Rhs) -> Rem<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Calculates the remainder from dividing one output value by the other.
Source§

fn min<Rhs>(self, rhs: Rhs) -> Min<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Computes the minimum of the two output values.
Source§

fn max<Rhs>(self, rhs: Rhs) -> Max<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Computes the maximum of the two output values.
Source§

fn clamp<Min, Max>( self, min: Min, max: Max, ) -> Clamp<Self, Min::Noise, Max::Noise>
where Self: Sized, Min: ValueOrNoise, Max: ValueOrNoise,

Returns max if value is greater than max and min if value is less than min. Otherwise this will return value. Read more
Source§

fn lerp<B, T>(self, b: B, t: T) -> Lerp<Self, B::Noise, T::Noise>
where Self: Sized, B: ValueOrNoise, T: ValueOrNoise,

Linearly interpolates between self and b.
Source§

fn pow<Rhs>(self, rhs: Rhs) -> Pow<Self, Rhs::Noise>
where Self: Sized, Rhs: ValueOrNoise,

Raises the output value to a power.
Source§

fn neg(self) -> Neg<Self>
where Self: Sized,

Performs negation on the output value.
Source§

fn abs(self) -> Abs<Self>
where Self: Sized,

Computes the absolute value of the output value.
Source§

fn sqrt(self) -> Sqrt<Self>
where Self: Sized,

Returns the square root of a number. Read more
Source§

fn floor(self) -> Floor<Self>
where Self: Sized,

Computes the largest integer less than or equal to the output value.
Source§

fn ceil(self) -> Ceil<Self>
where Self: Sized,

Computes the smallest integer greater than or equal to self.
Source§

fn round(self) -> Round<Self>
where Self: Sized,

Computes the nearest integer to the output value. If a value is half-way between two integers, round away from 0.0.
Source§

fn sin(self) -> Sin<Self>
where Self: Sized,

Computes the sine of the output value (in radians).
Source§

fn cos(self) -> Cos<Self>
where Self: Sized,

Computes the cosine of the output value (in radians).
Source§

fn tan(self) -> Tan<Self>
where Self: Sized,

Computes the tangent of the output value (in radians).
Source§

fn map<F>(self, f: F) -> Map<Self, F>
where Self: Sized, F: Fn(f32) -> f32,

Maps the output value.
Source§

fn by_ref(&self) -> &Self
where Self: Sized,

Returns the Noise by reference. Read more
Source§

impl<A: PartialEq, B: PartialEq> PartialEq for Sub<A, B>

Source§

fn eq(&self, other: &Sub<A, B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const DIM: usize, A, B> Sample<DIM> for Sub<A, B>
where A: Sample<DIM>, B: Sample<DIM>,

Source§

fn sample_with_seed(&self, point: [f32; DIM], seed: i32) -> f32

Source§

impl<const DIM: usize, const LANES: usize, A, B> Sample<DIM, Simd<f32, LANES>> for Sub<A, B>
where A: Sample<DIM, Simd<f32, LANES>>, B: Sample<DIM, Simd<f32, LANES>>, LaneCount<LANES>: SupportedLaneCount,

Available on crate feature nightly-simd only.
Source§

fn sample_with_seed(&self, point: Simd<f32, LANES>, seed: i32) -> f32

Source§

impl<A: Copy, B: Copy> Copy for Sub<A, B>

Source§

impl<A: Eq, B: Eq> Eq for Sub<A, B>

Source§

impl<A, B> StructuralPartialEq for Sub<A, B>

Auto Trait Implementations§

§

impl<A, B> Freeze for Sub<A, B>
where A: Freeze, B: Freeze,

§

impl<A, B> RefUnwindSafe for Sub<A, B>

§

impl<A, B> Send for Sub<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for Sub<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for Sub<A, B>
where A: Unpin, B: Unpin,

§

impl<A, B> UnwindSafe for Sub<A, B>
where A: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<N> ValueOrNoise for N
where N: Noise,