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

◆ inoise16() [2/4]

fl::u16 inoise16 ( fl::u32 x,
fl::u32 y )
extern

Parameters
yy-axis coordinate on noise map (2D)

Definition at line 490 of file noise.cpp.hpp.

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

References inoise16_raw(), x, and y.

+ Here is the call graph for this function: