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

◆ displayFrameOnLEDs()

void CodecProcessor::displayFrameOnLEDs ( const fl::Frame & frame)

Definition at line 211 of file codec_processor.cpp.

211 {
212 for (int y = 0; y < ledHeight; y++) {
213 for (int x = 0; x < ledWidth; x++) {
214 // Calculate source pixel coordinates (with scaling)
215 int srcX = (x * (int)frame.getWidth()) / ledWidth;
216 int srcY = (y * (int)frame.getHeight()) / ledHeight;
217
218 // Get pixel from frame
219 CRGB color = getPixelFromFrame(frame, srcX, srcY);
220
221 // Set LED color
222 int ledIndex = y * ledWidth + x;
223 if (ledIndex < numLeds) {
224 leds[ledIndex] = color;
225 }
226 }
227 }
228}
int y
Definition simple.h:93
int x
Definition simple.h:92
fl::u16 getWidth() const
Definition frame.h:59
fl::u16 getHeight() const
Definition frame.h:60
fl::CRGB CRGB
Definition crgb.h:25
CRGB getPixelFromFrame(const fl::Frame &frame, int x, int y)

References fl::Frame::getHeight(), getPixelFromFrame(), fl::Frame::getWidth(), ledHeight, leds, ledWidth, numLeds, x, and y.

Referenced by processGif(), processJpeg(), and processMpeg1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: