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

◆ inoise16() [2/4]

uint16_t inoise16 ( uint32_t x,
uint32_t y )
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)

Definition at line 485 of file noise.cpp.

485 {
486 int32_t ans = inoise16_raw(x,y);
487 ans = ans + 17308L;
488 uint32_t pan = ans;
489 // pan = (ans * 242L) >> 7. That's the same as:
490 // pan = (ans * 484L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
491 // Identical math, except for the highest bit, which we don't care about anyway,
492 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
493 pan *= 484L;
494 return (pan>>8);
495
496 // return (uint32_t)(((int32_t)inoise16_raw(x,y)+(uint32_t)17308)*242)>>7;
497 // return scale16by8(inoise16_raw(x,y)+17308,242)<<1;
498}
int y
Definition simple.h:93
int x
Definition simple.h:92
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(), x, and y.

+ Here is the call graph for this function: