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

◆ grad16() [3/3]

static int16_t grad16 ( uint8_t hash,
int16_t x,
int16_t y,
int16_t z )
inlinestatic

Definition at line 107 of file noise.cpp.

107 {
108#if 0
109 switch(hash & 0xF) {
110 case 0: return (( x) + ( y))>>1;
111 case 1: return ((-x) + ( y))>>1;
112 case 2: return (( x) + (-y))>>1;
113 case 3: return ((-x) + (-y))>>1;
114 case 4: return (( x) + ( z))>>1;
115 case 5: return ((-x) + ( z))>>1;
116 case 6: return (( x) + (-z))>>1;
117 case 7: return ((-x) + (-z))>>1;
118 case 8: return (( y) + ( z))>>1;
119 case 9: return ((-y) + ( z))>>1;
120 case 10: return (( y) + (-z))>>1;
121 case 11: return ((-y) + (-z))>>1;
122 case 12: return (( y) + ( x))>>1;
123 case 13: return ((-y) + ( z))>>1;
124 case 14: return (( y) + (-x))>>1;
125 case 15: return ((-y) + (-z))>>1;
126 }
127#else
128 hash = hash&15;
129 int16_t u = hash<8?x:y;
130 int16_t v = hash<4?y:hash==12||hash==14?x:z;
131 if(hash&1) { u = -u; }
132 if(hash&2) { v = -v; }
133
134 return AVG15(u,v);
135#endif
136}
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:84
uint16_t hash(int32_t x, int32_t y)

References x, y, and z.

Referenced by inoise16_raw(), inoise16_raw(), inoise16_raw(), and inoise16_raw().

+ Here is the caller graph for this function: