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

◆ grad8() [1/3]

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

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

250{
251 // since the tests below can be done bit-wise on the bottom
252 // four bits, there's no need to mask off the higher bits
253 // hash = hash & 15;
254
255 fl::i8 u,v;
256 if(hash & 8) {
257 u=x; v=x;
258 } else {
259 if(hash & 4) {
260 u=1; v=x;
261 } else {
262 u=x; v=1;
263 }
264 }
265
266 if(hash&1) { u = -u; }
267 if(hash&2) { v = -v; }
268
269 return fl::avg7(u,v);
270}
int x
Definition simple.h:92
signed char i8
Definition stdint.h:130

References FL_NO_EXCEPT, and x.