Skip to content

Commit fc776ee

Browse files
committed
add comment to explain coordinate packing logic
1 parent 79376bb commit fc776ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

wled00/image_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void drawPixelCallback2D(int16_t x, int16_t y, uint8_t red, uint8_t green, uint8
8585
// simple nearest-neighbor scaling
8686
int outY = (int)y * activeSeg->vHeight() / gifHeight;
8787
int outX = (int)x * activeSeg->vWidth() / gifWidth;
88+
// Pack coordinates uniquely: outY into upper 16 bits, outX into lower 16 bits
8889
if (((outY << 16) | outX) == lastCoordinate) return; // skip setting same coordinate again
8990
lastCoordinate = (outY << 16) | outX; // since input is a "scanline" this is sufficient to identify a "unique" coordinate
9091
// set multiple pixels if upscaling

0 commit comments

Comments
 (0)