MCPcopy Create free account
hub / github.com/FastLED/FastLED / processJpeg

Function processJpeg

examples/Codec/codec_processor.cpp:53–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void processJpeg() {
54 Serial.println("\n=== Processing JPEG ===");
55
56 if (!fl::Jpeg::isSupported()) {
57 Serial.println("JPEG decoding not supported on this platform");
58 return;
59 }
60
61 // Copy data from PROGMEM to RAM
62 fl::vector<fl::u8> jpegData(CodecData::sampleJpegDataLength);
63 fl::memcopy(jpegData.data(), CodecData::sampleJpegData, CodecData::sampleJpegDataLength);
64
65 // Configure JPEG decoder
66 fl::JpegConfig config;
67 config.format = fl::PixelFormat::RGB888;
68 config.quality = fl::JpegConfig::Medium;
69
70 // Create data span
71 fl::span<const fl::u8> data(jpegData.data(), jpegData.size());
72
73 // Decode the JPEG
74 fl::string error_msg;
75 fl::FramePtr framePtr = fl::Jpeg::decode(config, data, &error_msg);
76
77 if (framePtr && framePtr->isValid()) {
78 displayFrameOnLEDs(*framePtr);
79 showDecodedMessage("JPEG decoded successfully!");
80 } else {
81 Serial.print("Failed to decode JPEG: ");
82 Serial.println(error_msg.c_str());
83 }
84}
85
86
87void processGif() {

Callers

nothing calls this directly

Calls 9

memcopyFunction · 0.85
displayFrameOnLEDsFunction · 0.85
showDecodedMessageFunction · 0.85
printlnMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
isValidMethod · 0.45
printMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected