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

◆ XY()

int XY ( int x,
int y )

Definition at line 190 of file funky.cpp.

190 {
191 if (y > HEIGHT) {
192 y = HEIGHT;
193 }
194 if (y < 0) {
195 y = 0;
196 }
197 if (x > WIDTH) {
198 x = WIDTH;
199 }
200 if (x < 0) {
201 x = 0;
202 }
203 // for a serpentine layout reverse every 2nd row:
204 if (x % 2 == 1) {
205 return (x * (WIDTH) + (HEIGHT - y - 1));
206 } else {
207 // use that line only, if you have all rows beginning at the same side
208 return (x * (WIDTH) + y);
209 }
210}
#define WIDTH
Definition Blur2d.ino:9
#define HEIGHT
Definition Blur2d.ino:10
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:83

References HEIGHT, WIDTH, x, and y.

Referenced by Audio3(), AudioSpiral(), Caleidoscope1(), Caleidoscope2(), Caleidoscope3(), Caleidoscope4(), Caleidoscope5(), Caleidoscope6(), Copy(), Dots1(), HorizontalStream(), Line(), MirrorTriangle(), MSGEQtest9(), NoiseExample1(), NoiseExample2(), NoiseExample3(), NoiseExample4(), NoiseExample5(), NoiseExample6(), NoiseExample7(), NoiseExample8(), Pixel(), RenderCustomMatrix(), RotateTriangle(), Scale(), SpiralStream(), VerticalMove(), and VerticalStream().

+ Here is the caller graph for this function: