FastLED 3.10.8
Loading...
Searching...
No Matches

◆ inoise16() [2/4]

fl::u16 inoise16 ( fl::u32 x,
fl::u32 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 528 of file noise.cpp.hpp.

528 {
529 fl::i32 ans = inoise16_raw(x,y);
530 ans = ans + 17308L;
531 fl::u32 pan = ans;
532 // pan = (ans * 242L) >> 7. That's the same as:
533 // pan = (ans * 484L) >> 8. And this way avoids a 7X four-byte shift-loop on AVR.
534 // Identical math, except for the highest bit, which we don't care about anyway,
535 // since we're returning the 'middle' 16 out of a 32-bit value anyway.
536 pan *= 484L;
537 return (pan>>8);
538
539 // return (uint32_t)(((int32_t)inoise16_raw(x,y)+(uint32_t)17308)*242)>>7;
540 // return scale16by8(inoise16_raw(x,y)+17308,242)<<1;
541}
int y
Definition simple.h:93
int x
Definition simple.h:92
fl::i16 inoise16_raw(fl::u32 x, fl::u32 y, fl::u32 z) FL_NO_EXCEPT
16-bit, fixed point implementation of Perlin's noise without scaling.

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

+ Here is the call graph for this function: