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

◆ drawJpg()

JRESULT fl::third_party::TJpg_Decoder::drawJpg ( int32_t x,
int32_t y,
const uint8_t array[],
size_t array_size )

Definition at line 137 of file TJpg_Decoder.cpp.hpp.

137 {
138 JDEC jdec;
139 JRESULT jresult = JDR_OK;
140
142 array_index = 0;
143 array_data = jpeg_data;
144 array_size = data_size;
145
146 jpeg_x = x;
147 jpeg_y = y;
148
149 jdec.swap = _swap;
150
151 // Analyse input data - pass 'this' as device pointer for callbacks
152 jresult = jd_prepare(&jdec, jd_input, workspace, TJPGD_WORKSPACE_SIZE, this);
153
154 // Extract image and render
155 if (jresult == JDR_OK) {
156 // Debug: Check image dimensions from jdec
157 // jdec should now have width/height populated
158 jresult = jd_decomp(&jdec, jd_output, jpgScale);
159 }
160
161 return jresult;
162}
static int jd_output(JDEC *jdec, void *bitmap, JRECT *jrect) FL_NOEXCEPT
uint8_t workspace[TJPGD_WORKSPACE_SIZE]
static size_t jd_input(JDEC *jdec, uint8_t *buf, size_t len) FL_NOEXCEPT
JRESULT jd_decomp(JDEC *jd, int(*outfunc)(JDEC *, void *, JRECT *), uint8_t scale) FL_NOEXCEPT
JRESULT jd_prepare(JDEC *jd, size_t(*infunc)(JDEC *, uint8_t *, size_t), void *pool, size_t sz_pool, void *dev) FL_NOEXCEPT
struct JDEC JDEC
Definition tjpgd.h:49
#define TJPGD_WORKSPACE_SIZE
Definition tjpgdcnf.h:39

References _swap, array_data, array_index, array_size, FL_NOEXCEPT, fl::third_party::jd_decomp(), jd_input(), jd_output(), fl::third_party::jd_prepare(), fl::third_party::JDR_OK, jpeg_x, jpeg_y, jpg_source, jpgScale, fl::third_party::JDEC::swap, fl::third_party::TJPG_ARRAY, TJPGD_WORKSPACE_SIZE, workspace, fl::x, and fl::y.

+ Here is the call graph for this function: