ttypt/noise.h(3)chaff

NAME

ttypt/noise.h - Standalone generic N-dimensional wrapping procedural noise engine, dense matrix stepper, point sampler, and multi-octave cascade API.

SYNOPSIS

#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

Data Structures

struct octave_t

Single octave descriptor for dense matrix stepping (edge shift and value shift).

struct noise_wcache_t
struct chaff_coord_t
struct chaff_layer_t
struct chaff_field_t
struct noise_octave_t
struct noise_cascade_t
struct noise_scanline_t

Reusable scanline evaluation context holding per-octave corner caches.

Macros

#define NOISE_FAST_XXH32_4B 0

Set to 1 when the inlined 4-byte XXH32 fast path is active.

#define NOISE_MAX ((uint32_t) -1)

Maximum unsigned 32-bit raw noise value (UINT32_MAX).

#define NOISE_MAX_DIM 4u

Maximum supported spatial dimensionality for noise queries (4).

#define NOISE_DEFAULT_VSHIFT 8u

Default value right-shift applied to raw 32-bit hash samples (8).

#define COORDMASK_LSHIFT(x)

Bitmask aligning an int16 coordinate to a 2^x feature quad boundary.

#define NOISE_FADE 1u
#define NOISE_FADE5 2u

Interpolation flag selecting C2 quintic smoothstep fade (6t^5 - 15t^4 + 10t^3).

#define CHAFF_MAX NOISE_MAX
#define CHAFF_FADE NOISE_FADE

Alias for NOISE_FADE (cubic smoothstep interpolation flag).

#define CHAFF_MODE_SET 0u

Layer combine mode: overwrite accumulator.

#define CHAFF_MODE_ADD 1u

Layer combine mode: add to accumulator.

#define CHAFF_SEED_SHARED 0u /***< One seed for all layers */

Seed mode: share one base seed across all layers.

#define CHAFF_FLAG_FADE5 2u

Interpolation flag selecting C2 quintic fade.

#define CHAFF_FLAG_LINEAR 0x80u

Interpolation flag selecting pure linear interpolation.

#define NOISE_CONTRAST_IDENTITY 256u
#define CHAFF_SEED_PRIME 0x85EBCA77u
#define NOISE_MAX_OCTAVES 16
#define NOISE_CASCADE_LINEAR 0x80u

Typedefs

typedef octave_t chaff_oct_t

Alias for octave_t.

typedef noise_wcache_t chaff_wcache_t

Alias for noise_wcache_t.

typedef noise_wcache_t noise_cache_t
typedef noise_octave_t chaff_octave_t
typedef noise_cascade_t chaff_cascade_t

Alias for noise_cascade_t.

typedef noise_cache_t chaff_cache_t

Alias for noise_cache_t.

typedef noise_scanline_t chaff_scanline_t

Alias for noise_scanline_t.

Functions

static uint32_t ttypt_noise_mix32 (const void *key, size_t len, uint32_t seed)

Portable 32-bit fallback hash mixer used when xxhash.h is unavailable.

static int noise_fdiv (int a, int b)
static uint32_t noise_pack2 (int16_t p0, int16_t p1)
static uint32_t noise_hash2_1 (int16_t p0, int16_t p1, uint32_t seed)
static void noise_hash2_4x (const uint32_t packed[4], uint32_t seed, unsigned w, uint32_t out[4])
static uint32_t noise_r (int16_t *p, unsigned seed, unsigned w, uint8_t dim)
static void noise_get_v (uint32_t *v, int16_t *s, uint16_t x, unsigned w, unsigned seed, uint8_t dim)
static void noise_get_v_periodic (uint32_t *v, const int16_t *s, uint16_t x, unsigned w, unsigned seed, uint8_t dim, uint8_t period_shift)
static void noise_calc_steps (int32_t *st, uint32_t *v, uint16_t z, uint16_t vl, unsigned y)

Compute linear interpolation step increments along one dimension of a feature quad.

static void noise_step (uint32_t *v, int32_t *st, uint16_t vl, uint16_t mul)

Advance hypercube interpolation values by mul steps.

static void noise_quad (uint32_t *c, uint32_t *vc, unsigned z, unsigned cy, uint8_t dim)
static void noise_fix_v (uint32_t *v, int16_t *qs, int16_t *ms, unsigned x, unsigned cy, uint8_t dim)

Clip and rebase feature-quad corner values onto the target matrix origin.

static void noise_get_s (int16_t *s, int16_t *p, uint16_t mask, uint8_t dim)

Compute aligned feature-quad origin coordinates from input point p and mask.

static void noise_m (uint32_t *mat, int16_t *ms, unsigned x, unsigned w, unsigned seed, unsigned cy, uint8_t dim)
static void noise_oct (uint32_t *m, int16_t *s, size_t oct_n, octave_t *oct, unsigned seed, unsigned cy, uint8_t dim)
static int noise_point_n_ex (const int16_t *p, uint32_t seed, uint8_t shift, uint8_t dim, uint8_t vshift)
static int noise_point_n (const int16_t *p, uint32_t seed, uint8_t shift, uint8_t dim)
static uint32_t noise_wfade (uint32_t f, unsigned x)
static uint32_t noise_wfade5 (uint32_t f, unsigned x)
static uint32_t noise_wstep (uint32_t v0, uint32_t v1, uint32_t f, unsigned x)
static int32_t noise_wstep_slope (uint32_t v0, uint32_t v1, unsigned x)
static void noise_wreduce (uint32_t *v, const uint32_t *f, unsigned x, unsigned levels, uint8_t dim, unsigned flags)
static void noise_wcell (int16_t *s, uint32_t *f, const int16_t *p, unsigned x, unsigned flags, uint8_t dim)
static uint32_t noise_wpoint_n (const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags)
static uint32_t noise_wpoint_n_periodic (const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, uint8_t period_shift)
static uint32_t noise_wpoint_2d (int16_t x0, int16_t x1, unsigned x, unsigned w, unsigned seed, unsigned flags)

Convenience 2D wrapper around noise_wpoint_n().

static uint32_t noise_wpoint_3d (int16_t x0, int16_t x1, int16_t x2, unsigned x, unsigned w, unsigned seed, unsigned flags)

Convenience 3D wrapper around noise_wpoint_n().

static void noise_wcache_init (noise_wcache_t *c)

Initialize a wrapping noise corner cache to the empty state.

static const uint32_t * noise_wcorners (noise_wcache_t *c, int16_t *s, unsigned x, unsigned w, unsigned seed, uint8_t dim)
static const uint32_t * noise_wcorners_periodic (noise_wcache_t *c, const int16_t *s, unsigned x, unsigned w, unsigned seed, uint8_t dim, uint8_t period_shift)
static uint32_t noise_wpoint_c (noise_wcache_t *c, const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags)
static uint32_t noise_wpoint_c_periodic (noise_wcache_t *c, const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, uint8_t period_shift)
static void noise_wfade5_4x (const uint32_t f[4], unsigned x, uint32_t out[4])
static void noise_wstep_4x (const uint32_t v0[4], const uint32_t v1[4], const uint32_t f[4], unsigned x, uint32_t out[4])
static void noise_wpoint_2d_4x (noise_wcache_t *c, const int16_t py[4], const int16_t px[4], unsigned x, unsigned w, unsigned seed, unsigned flags, uint32_t out[4])
static void noise_wrow (uint32_t *out, unsigned n, const int16_t *p0, int16_t dstep, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t *c)
static void noise_wplane (uint32_t *out, unsigned n, unsigned rows, size_t stride, const int16_t *p0, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t *c)
static int noise_point_1d (int16_t x, uint32_t seed, uint8_t shift)
static int noise_point_2d (int16_t x, int16_t y, uint32_t seed, uint8_t shift)

O(1) zero-allocation 2D point noise query.

static int noise_point_3d (int16_t x, int16_t y, int16_t z, uint32_t seed, uint8_t shift)

O(1) zero-allocation 3D point noise query.

static int noise_point_4d (int16_t x, int16_t y, int16_t z, int16_t w, uint32_t seed, uint8_t shift)

O(1) zero-allocation 4D point noise query.

static int chaff_point_1d (int16_t x, uint32_t seed, uint8_t shift)

1D point noise query (chaff namespace alias).

static int chaff_point_2d (int16_t x, int16_t y, uint32_t seed, uint8_t shift)

2D point noise query (chaff namespace alias).

static int chaff_point_3d (int16_t x, int16_t y, int16_t z, uint32_t seed, uint8_t shift)

3D point noise query (chaff namespace alias).

static int chaff_point_4d (int16_t x, int16_t y, int16_t z, int16_t w, uint32_t seed, uint8_t shift)

4D point noise query (chaff namespace alias).

static int chaff_point_n (const int16_t *p, uint32_t seed, uint8_t shift, uint8_t dim)

N-dimensional point noise query (chaff namespace alias).

static int chaff_point_n_ex (const int16_t *p, uint32_t seed, uint8_t shift, uint8_t dim, uint8_t vshift)

Extended N-dimensional point noise query with explicit value shift.

static void chaff_oct (uint32_t *m, int16_t *s, size_t oct_n, octave_t *oct, unsigned seed, unsigned cy, uint8_t dim)

Multi-octave dense matrix stepper (chaff namespace alias).

static uint32_t chaff_wpoint_n (const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags)

Wrapping N-dimensional point query (chaff namespace alias).

static uint32_t chaff_wpoint_c (noise_wcache_t *c, const int16_t *p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags)

Cached wrapping N-dimensional point query (chaff namespace alias).

static void chaff_wrow (uint32_t *out, unsigned n, const int16_t *p0, int16_t dstep, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t *c)

Wrapping scanline row evaluator (chaff namespace alias).

static void chaff_wplane (uint32_t *out, unsigned n, unsigned rows, size_t stride, const int16_t *p0, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t *c)

Wrapping 2D plane evaluator (chaff namespace alias).

static uint32_t chaff_layer_seed (const chaff_field_t *field, const chaff_layer_t *lay, uint8_t l)

Derive the effective 32-bit seed for layer index l.

static uint32_t chaff_fade_frac_ex (uint32_t fi, uint16_t frac, unsigned x, uint8_t flags)
static uint32_t chaff_fade_frac (uint32_t fi, uint16_t frac, unsigned x)

Evaluate fractional smoothstep weight for sub-cell offset frac.

static void chaff_fill (const chaff_field_t *field, uint8_t layer_lo, uint8_t layer_hi, const chaff_coord_t origin[], const int32_t step_q16[], const uint16_t n[], int32_t *out, size_t stride, unsigned mode)
static unsigned noise_cascade_vshift (const noise_cascade_t *cfg)

Return effective value shift for cascade cfg.

static unsigned noise_cascade_flags (const noise_cascade_t *cfg)

Return effective interpolation flags for cascade cfg.

static uint32_t noise_cascade_octave_seed (const noise_cascade_t *cfg, const noise_octave_t *oct, uint8_t idx)

Derive deterministic seed for octave index o in cascade cfg.

static void noise_scanline_init (noise_scanline_t *scan, const noise_cascade_t *cfg, uint8_t dim)

Initialize scanline evaluator scan for cascade cfg and dimension dim.

static void noise_scanline_eval_row (noise_scanline_t *scan, int16_t start_x, int16_t y, int16_t z, size_t count, int32_t *out_row)
static void noise_matrix_fill_2d (const noise_cascade_t *cfg, int16_t origin_x, int16_t origin_y, uint8_t size_shift, int32_t *out_matrix)
static int32_t noise_sample_2d (const noise_cascade_t *cfg, int16_t x, int16_t y)
static int32_t noise_sample_3d (const noise_cascade_t *cfg, int16_t x, int16_t y, int16_t z)

Evaluate multi-octave cascade cfg at 3D coordinates (x, y, z).

static int32_t noise_sample_4d (const noise_cascade_t *cfg, int16_t x, int16_t y, int16_t z, int16_t w)

Evaluate multi-octave cascade cfg at 4D coordinates (x, y, z, w).

static void chaff_matrix_fill_2d (const chaff_cascade_t *cfg, int16_t origin_x, int16_t origin_y, uint8_t size_shift, int32_t *out_matrix)

Fill a 2D dense matrix from cascade cfg (chaff namespace alias).

static void chaff_scanline_init (chaff_scanline_t *scan, const chaff_cascade_t *cfg, uint8_t dim)

Initialize a scanline evaluator (chaff namespace alias).

static void chaff_scanline_eval_row (chaff_scanline_t *scan, int16_t start_x, int16_t y, int16_t z, size_t count, int32_t *out_row)

Evaluate a scanline row (chaff namespace alias).

static int32_t chaff_sample_2d (const chaff_cascade_t *cfg, int16_t x, int16_t y)

Sample 2D cascade cfg (chaff namespace alias).

static int32_t chaff_sample_3d (const chaff_cascade_t *cfg, int16_t x, int16_t y, int16_t z)

Sample 3D cascade cfg (chaff namespace alias).

static int32_t chaff_sample_4d (const chaff_cascade_t *cfg, int16_t x, int16_t y, int16_t z, int16_t w)

Sample 4D cascade cfg (chaff namespace alias).

Detailed Description

Standalone generic N-dimensional wrapping procedural noise engine, dense matrix stepper, point sampler, and multi-octave cascade API.

ttypt/noise.h โ€” Standalone Generic N-Dimensional Procedural Noise Library.

A noise algorithm that wraps well around data type limits.

LICENSE: BSD-2-Clause Copyright (c) 2026, tty-pt

DEFINITIONS:

A point has DIM coordinates (int16_t). A matrix has 2^y (cy) edge length and (2^cy)^dim total elements. A noise feature quad has 2^x edge length and 2^dim vertices with random values. Other values are the result of a fade (multilinear smoothstep) between those.

Provides:

1.
Dense Matrix Stepper (noise_oct, noise_m, noise_quad): bulk hypercube generation.
2.
Generic Point Sampler (noise_point_n, noise_point_2d, noise_point_3d): O(1) zero-allocation point queries.
3.
Wrapping Original-Algorithm Sampler (noise_wpoint_n, noise_wpoint_c, noise_wrow): point / cached / row-stepped queries that reproduce the matrix stepper exactly, so coordinates (e.g. an ever-increasing time counter cast to int16_t) may keep incrementing across the data-type boundary without a seam.

Macro Definition Documentation

#define CHAFF_MAX NOISE_MAX

--- Canonical libchaff aliases (chaff_ prefix) ---------------------------

#define CHAFF_SEED_PRIME 0x85EBCA77u

Per-layer seed decorrelation multiplier (Murmur3 finalizer constant).

#define NOISE_CASCADE_LINEAR 0x80u

Flag for noise_cascade_t::flags to explicitly request raw linear interpolation (disabling NOISE_FADE).

#define NOISE_CONTRAST_IDENTITY 256u

Identity contrast multiplier in Q8.8 fixed-point (256 = 1.0x).

#define NOISE_FADE 1u

Point queries that follow the ORIGINAL lattice algorithm of noise_m:

#define NOISE_MAX_OCTAVES 16

Maximum number of octaves supported by noise_scanline_t and cascade evaluators.

Typedef Documentation

typedef noise_octave_t chaff_octave_t

Canonical declarative libchaff aliases

typedef noise_wcache_t noise_cache_t

Corner cache: aliased to noise_wcache_t to eliminate layout drift and type punning

Function Documentation

uint32_t chaff_fade_frac_ex (uint32_t fi, uint16_t frac, unsigned x, uint8_t flags) [inline], [static]

Fractional fade helper with selectable C1 cubic Hermite or C2 quintic Hermite in 16.16

void chaff_fill (const chaff_field_t * field, uint8_t layer_lo, uint8_t layer_hi, const chaff_coord_t origin[], const int32_t step_q16[], const uint16_t n[], int32_t * out, size_t stride, unsigned mode) [inline], [static]

Primary multi-layer region generator (point, row, plane, volume). Evaluates field layers [layer_lo, layer_hi) over a grid of size n[dim] starting at origin[dim] with step_q16[dim] (rational 16.16 fixed-point steps). Zero heap allocations; callers supply out.

int noise_fdiv (int a, int b) [inline], [static]

Euclidean integer floor division

void noise_get_v (uint32_t * v, int16_t * s, uint16_t x, unsigned w, unsigned seed, uint8_t dim) [inline], [static]

Generate values at N-dimensional quad vertices

void noise_get_v_periodic (uint32_t * v, const int16_t * s, uint16_t x, unsigned w, unsigned seed, uint8_t dim, uint8_t period_shift) [inline], [static]

Generate values at N-dimensional quad vertices with optional periodic domain wrapping

uint32_t noise_hash2_1 (int16_t p0, int16_t p1, uint32_t seed) [inline], [static]

Branchless 4-byte XXH32 matching XXH32(int16_t[2]{p0,p1}, 4, seed) bit-for-bit

void noise_hash2_4x (const uint32_t packed[4], uint32_t seed, unsigned w, uint32_t out[4]) [inline], [static]

4-wide 4-byte XXH32 hash + right-shift by w. Bit-exact with noise_r(p, seed, w, 2).

void noise_m (uint32_t * mat, int16_t * ms, unsigned x, unsigned w, unsigned seed, unsigned cy, uint8_t dim) [inline], [static]

Fills matrix "mat" with deterministic N-dimensional noise

void noise_matrix_fill_2d (const noise_cascade_t * cfg, int16_t origin_x, int16_t origin_y, uint8_t size_shift, int32_t * out_matrix) [inline], [static]

2.
Universal Bulk Matrix Stepper Fills 2^size_shift x 2^size_shift chunk by scanline rows. Guarantees out_matrix[r * side + c] == noise_sample_2d(origin_x + c, origin_y + r). Zero heap allocations.

void noise_oct (uint32_t * m, int16_t * s, size_t oct_n, octave_t * oct, unsigned seed, unsigned cy, uint8_t dim) [inline], [static]

Multi-octave N-dimensional matrix noise evaluation

uint32_t noise_pack2 (int16_t p0, int16_t p1) [inline], [static]

Pack 2D lattice coordinate (p0, p1) into little-endian 4-byte key

int noise_point_1d (int16_t x, uint32_t seed, uint8_t shift) [inline], [static]

Point-evaluation ergonomic helpers

int noise_point_n (const int16_t * p, uint32_t seed, uint8_t shift, uint8_t dim) [inline], [static]

Evaluates continuous N-dimensional smoothstep value noise at point p[dim]. Returns fixed-point value in range 0..255. Zero heap allocations.

int noise_point_n_ex (const int16_t * p, uint32_t seed, uint8_t shift, uint8_t dim, uint8_t vshift) [inline], [static]

Evaluates continuous N-dimensional smoothstep value noise at point p[dim] with configurable bit-shift divider vshift (1..15; 0 defaults to NOISE_DEFAULT_VSHIFT = 8). Returns fixed-point value in range 0 .. (1 << (16 - vshift)) - 1. Zero heap allocations.

void noise_quad (uint32_t * c, uint32_t * vc, unsigned z, unsigned cy, uint8_t dim) [inline], [static]

Fade between vertices and step target values across matrix

uint32_t noise_r (int16_t * p, unsigned seed, unsigned w, uint8_t dim) [inline], [static]

Deterministic random value for an N-dimensional point p

int32_t noise_sample_2d (const noise_cascade_t * cfg, int16_t x, int16_t y) [inline], [static]

3.
Sparse Point Sampler (Collision, Entrances, Caverns)

void noise_scanline_eval_row (noise_scanline_t * scan, int16_t start_x, int16_t y, int16_t z, size_t count, int32_t * out_row) [inline], [static]

1.
Universal Scanline Stepper with Corner Cache Evaluates rows in-register, applying skew per sample so values match the point sampler. Zero heap allocations.

void noise_wcell (int16_t * s, uint32_t * f, const int16_t * p, unsigned x, unsigned flags, uint8_t dim) [inline], [static]

Lattice cell origin and in-quad offsets of p

const uint32_t * noise_wcorners (noise_wcache_t * c, int16_t * s, unsigned x, unsigned w, unsigned seed, uint8_t dim) [inline], [static]

Vertex values of the cell at s, from the cache when it matches

const uint32_t * noise_wcorners_periodic (noise_wcache_t * c, const int16_t * s, unsigned x, unsigned w, unsigned seed, uint8_t dim, uint8_t period_shift) [inline], [static]

Vertex values of the cell at s with optional periodic domain wrapping

uint32_t noise_wfade (uint32_t f, unsigned x) [inline], [static]

Hermite smoothstep of f in [0, 2^x), mapped onto [0, 2^x)

uint32_t noise_wfade5 (uint32_t f, unsigned x) [inline], [static]

Ken Perlin's quintic polynomial: 6t^5 - 15t^4 + 10t^3. First and second derivatives are zero at 0 and 1, ensuring C^2 continuity. Input f in [0, 2^x), returns value in [0, 2^x).

void noise_wfade5_4x (const uint32_t f[4], unsigned x, uint32_t out[4]) [inline], [static]

4-wide bit-exact Perlin quintic fade matching noise_wfade5(f[i], x)

void noise_wplane (uint32_t * out, unsigned n, unsigned rows, size_t stride, const int16_t * p0, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t * c) [inline], [static]

Plane stepper: out[r * stride + k] = noise_wpoint_n(p0 with the last two axes advanced by r (rows, axis dim-2) and k (columns, axis dim-1)), for r < rows, k < n; both coordinates wrap in int16_t. In noise_quad order it fetches the 2^dim corners ONCE per 2D lattice cell (rows x cols / 4^x fetches), collapses the fixed outer axes once per cell, the row axis once per row, and spends one multiply-add per sample. Requires dim >= 2. c may be NULL.

void noise_wpoint_2d_4x (noise_wcache_t * c, const int16_t py[4], const int16_t px[4], unsigned x, unsigned w, unsigned seed, unsigned flags, uint32_t out[4]) [inline], [static]

4-wide 2D wrapped point query: bit-exact with 4 calls to noise_wpoint_c(c, {py[i], px[i]}, x, w, seed, 2, flags).

uint32_t noise_wpoint_c (noise_wcache_t * c, const int16_t * p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags) [inline], [static]

Cached point query: value-equal to noise_wpoint_n

uint32_t noise_wpoint_c_periodic (noise_wcache_t * c, const int16_t * p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, uint8_t period_shift) [inline], [static]

Cached point query with optional periodic domain wrapping

uint32_t noise_wpoint_n (const int16_t * p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags) [inline], [static]

Uncached point query (2^dim hashes)

uint32_t noise_wpoint_n_periodic (const int16_t * p, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, uint8_t period_shift) [inline], [static]

Uncached point query with optional periodic domain wrapping

void noise_wreduce (uint32_t * v, const uint32_t * f, unsigned x, unsigned levels, uint8_t dim, unsigned flags) [inline], [static]

Collapse the first levels axes of the 2^dim vertex values in v, axis 0 first, at in-quad offsets f[] (already faded if requested). With NOISE_FADE/NOISE_FADE5, multiplies before shifting to eliminate slope truncation across cells. Without NOISE_FADE, preserves exact bit-level noise_m calc_steps arithmetic.

void noise_wrow (uint32_t * out, unsigned n, const int16_t * p0, int16_t dstep, unsigned x, unsigned w, unsigned seed, uint8_t dim, unsigned flags, noise_wcache_t * c) [inline], [static]

Row stepper: out[k] = noise_wpoint_n(p0 + k * dstep along the LAST axis), k < n, the coordinate wrapping in int16_t. Like noise_get_v + noise_quad, it fetches the 2^dim corners once per lattice cell and collapses the other axes once per cell; each sample is then one multiply-add on the innermost axis. c may be NULL.

uint32_t noise_wstep (uint32_t v0, uint32_t v1, uint32_t f, unsigned x) [inline], [static]

Multiply-then-shift fixed-point linear interpolation step: Evaluates v0 + (((v1 - v0) * f) >> x) without premature division.

void noise_wstep_4x (const uint32_t v0[4], const uint32_t v1[4], const uint32_t f[4], unsigned x, uint32_t out[4]) [inline], [static]

4-wide bit-exact fixed-point linear interpolation matching noise_wstep(v0[i], v1[i], f[i], x)

int32_t noise_wstep_slope (uint32_t v0, uint32_t v1, unsigned x) [inline], [static]

Legacy slope helper for un-faded matrix steppers

Author

Generated automatically by Doxygen for chaff from the source code.