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

◆ grad8() [2/3]

static fl::i8 grad8 ( fl::u8 hash,
fl::i8 x,
fl::i8 y )
inlinestatic

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

230{
231 // since the tests below can be done bit-wise on the bottom
232 // three bits, there's no need to mask off the higher bits
233 // hash = hash & 7;
234
235 fl::i8 u,v;
236 if( hash & 4) {
237 u = y; v = x;
238 } else {
239 u = x; v = y;
240 }
241
242 if(hash&1) { u = -u; }
243 if(hash&2) { v = -v; }
244
245 return fl::avg7(u,v);
246}
int y
Definition simple.h:93
int x
Definition simple.h:92
signed char i8
Definition stdint.h:130

References FL_NO_EXCEPT, x, and y.