FastLED 3.9.15
Loading...
Searching...
No Matches

◆ inoise16() [4/4]

uint16_t inoise16 ( uint32_t x,
uint32_t y,
uint32_t z,
uint32_t t )
extern

16-bit, fixed point implementation of Perlin's noise.

See also
inoise16_raw()
Returns
scaled noise value as an unsigned integer, 0-65535
Parameters
xx-axis coordinate on noise map (1D)
yy-axis coordinate on noise map (2D)
tt-axis coordinate on noise map (3D)

Definition at line 420 of file noise.cpp.

420 {
421 int32_t ans = inoise16_raw(x,y,z,t);
422 ans = ans + 19052L;
423 uint32_t pan = ans;
424 // pan = (ans * 220L) >> 7. That's the same as:
425 // pan = (ans * 440L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
426 // Identical math, except for the highest bit, which we don't care about anyway,
427 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
428 pan *= 440L;
429 return (pan>>8);
430
431 // return scale16by8(pan,220)<<1;
432 // return ((inoise16_raw(x,y,z)+19052)*220)>>7;
433 // return scale16by8(inoise16_raw(x,y,z)+19052,220)<<1;
434}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:94
static uint32_t t
Definition Luminova.h:54
int16_t inoise16_raw(uint32_t x, uint32_t y, uint32_t z)
16-bit, fixed point implementation of Perlin's noise without scaling.
Definition noise.cpp:298

References inoise16_raw(), t, x, y, and z.

Referenced by PlasmaWaveGenerator::calculatePlasmaPixel(), drawBinaryPulse(), drawCosmicSwirl(), drawDigitalRain(), drawElectricStorm(), drawFireDance(), drawGlitchCity(), drawLavaLamp(), drawNebulaDrift(), drawOceanDepths(), fill_raw_2dnoise16(), fill_raw_2dnoise16into8(), fill_raw_noise16into8(), Fire2023(), getFirePaletteIndex(), getPaletteIndex(), getPaletteIndex(), loop(), showGenerative(), and NoiseGenerator::Value().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: