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

◆ processJpeg()

void CodecProcessor::processJpeg ( )

Definition at line 53 of file codec_processor.cpp.

53 {
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
64
65 // Configure JPEG decoder
66 fl::JpegConfig config;
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}
static bool decode(const JpegConfig &config, fl::span< const fl::u8 > data, Frame *frame, fl::string *error_message=nullptr)
Definition jpeg.cpp.hpp:296
static bool isSupported()
Definition jpeg.cpp.hpp:376
const char * c_str() const FL_NOEXCEPT
const size_t sampleJpegDataLength
const uint8_t sampleJpegData[]
void displayFrameOnLEDs(const fl::Frame &frame)
void showDecodedMessage(const char *format)
void * memcopy(void *dest, const void *src, size_t n) FL_NOEXCEPT
Definition cstring.h:103
PixelFormat format
Definition jpeg.h:31
Quality quality
Definition jpeg.h:30
#define Serial
Definition serial.h:304

References fl::basic_string::c_str(), fl::vector< T >::data(), fl::Jpeg::decode(), displayFrameOnLEDs(), fl::JpegConfig::format, fl::Jpeg::isSupported(), fl::JpegConfig::Medium, fl::memcopy(), fl::JpegConfig::quality, fl::RGB888, CodecData::sampleJpegData, CodecData::sampleJpegDataLength, Serial, showDecodedMessage(), and fl::vector_basic::size().

Referenced by loop().

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