mirage library
Generates noise and patterns algorithmically for use in software, textures, and graphics.
Classes
- Checkerboard
- A pattern that outputs a checkerboard pattern.
- Constant
- A pattern that outputs a constant value.
- NoiseHasher
- An interface for computing a hash value for a list of integers.
- NoiseTable
- A seed table used for noise hashing.
- Pattern2d
- An interface for a generator of a 2-dimensional pattern.
- Perlin
- A perlin noise generator.
- ScalarField
- A fixed-size association of a 2D point to a value.
- ScalarFieldComparison
- A comparison of two noise maps.
- Simplex
- A simplex noise generator.
- Value
- A value noise generator.
- White
- A white noise function.
- Worley
- A worley noise generator.
Extension Types
Functions
-
buildFlatPlane(
int width, int height, double generator(double x, double y), {(double, double) xBounds = (-1.0, 1.0), (double, double) yBounds = (-1.0, 1.0), bool seamless = false}) → ScalarField -
Creates a ScalarField that represents a flat plane of
width
byheight
. -
cubicInterpolate(
double a, double b, double c, double d, double t) → double - Cubic interpolation between two values bound between two other values.
-
gradient2d(
int index) → Vec2 -
Returns the 2-dimensuonal gradient vector at
index
, between 0 and 7. -
linearInterpolate(
double a, double b, double t) → double - Linear interpolation between two values.
-
quinticEase(
double t) → double Math - Quintic easing function.
-
reinterpretAsDouble(
int bits) → double - Reinterprets a 32-bit integer as a double.
-
reinterpretAsInt(
double value) → int - Reinterprets a double as a 32-bit integer.