FastLED
3.10.8
Loading...
Searching...
No Matches
◆
grad()
[2/4]
static fl::i32 grad
(
fl::u8
hash
,
fl::i32
x
,
fl::i32
y
)
static
Definition at line
84
of file
simplex.cpp.hpp
.
84
{
85
fl::u8
h =
hash
& 7;
// Convert low 3 bits of hash code
86
fl::i32 u = h < 4 ?
x
:
y
;
// into 8 simple gradient directions,
87
fl::i32 v = h < 4 ?
y
:
x
;
// and compute the dot product with (x,y).
88
return
((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -2*v : 2*v);
89
}
y
int y
Definition
simple.h:93
x
int x
Definition
simple.h:92
fl::anonymous_namespace{noise_woryley.cpp.hpp}::hash
u16 hash(i32 x, i32 y) FL_NO_EXCEPT
Definition
noise_woryley.cpp.hpp:20
fl::u8
unsigned char u8
Definition
stdint.h:131
References
FL_NO_EXCEPT
,
x
, and
y
.
simplex.cpp.hpp
Generated on Sun Oct 18 2026 00:57:00 for FastLED by
1.13.2