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 466 of file noise.cpp.

466 {
467 int32_t ans = inoise16_raw(x,y,z,t);
468 ans = ans + 19052L;
469 uint32_t pan = ans;
470 // pan = (ans * 220L) >> 7. That's the same as:
471 // pan = (ans * 440L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
472 // Identical math, except for the highest bit, which we don't care about anyway,
473 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
474 pan *= 440L;
475 return (pan>>8);
476
477 // return scale16by8(pan,220)<<1;
478 // return ((inoise16_raw(x,y,z)+19052)*220)>>7;
479 // return scale16by8(inoise16_raw(x,y,z)+19052,220)<<1;
480}
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
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:344

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

Referenced by draw(), fill_raw_2dnoise16(), fill_raw_2dnoise16into8(), fill_raw_noise16into8(), Fire2023(), getPaletteIndex(), getPaletteIndex(), loop(), and NoiseGenerator::Value().

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