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

◆ inoise16() [3/4]

uint16_t inoise16 ( uint32_t x,
uint32_t y,
uint32_t z )
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)
zz-axis coordinate on noise map (3D)

Definition at line 456 of file noise.cpp.

456 {
457 int32_t ans = inoise16_raw(x,y,z);
458 ans = ans + 19052L;
459 uint32_t pan = ans;
460 // pan = (ans * 220L) >> 7. That's the same as:
461 // pan = (ans * 440L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
462 // Identical math, except for the highest bit, which we don't care about anyway,
463 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
464 pan *= 440L;
465 return (pan>>8);
466
467 // // return scale16by8(pan,220)<<1;
468 // return ((inoise16_raw(x,y,z)+19052)*220)>>7;
469 // return scale16by8(inoise16_raw(x,y,z)+19052,220)<<1;
470}
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:84
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:318

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

+ Here is the call graph for this function: