MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / drawJpg

Method drawJpg

lib/TJpg_Decoder/src/TJpg_Decoder.cpp:200–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200JRESULT TJpg_Decoder::drawJpg(int32_t x, int32_t y, const uint8_t jpeg_data[], uint32_t data_size) {
201 JDEC jdec;
202 JRESULT jresult = JDR_OK;
203
204 jpg_source = TJPG_ARRAY;
205 array_index = 0;
206 array_data = jpeg_data;
207 array_size = data_size;
208
209 jpeg_x = x;
210 jpeg_y = y;
211
212 jdec.swap = _swap;
213
214 // Analyse input data
215 jresult = jd_prepare(&jdec, jd_input, workspace, TJPGD_WORKSPACE_SIZE, 0);
216
217 // Extract image and render
218 if (jresult == JDR_OK) {
219 jresult = jd_decomp(&jdec, jd_output, jpgScale);
220 }
221
222 return jresult;
223}

Callers 1

drawJPGMethod · 0.80

Calls 2

jd_prepareFunction · 0.85
jd_decompFunction · 0.85

Tested by

no test coverage detected