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

Method drawFsJpg

lib/TJpg_Decoder/src/TJpg_Decoder.cpp:174–197  ·  view source on GitHub ↗

** Function name: drawFsJpg für AWTRIX ** Description: Draw a jpg with opened file handle at x,y ***************************************************************************************/

Source from the content-addressed store, hash-verified

172** Description: Draw a jpg with opened file handle at x,y
173***************************************************************************************/
174JRESULT TJpg_Decoder::drawFsJpg(int32_t x, int32_t y, fs::File inFile)
175{
176
177 JDEC jdec;
178 JRESULT jresult = JDR_OK;
179
180 jpg_source = TJPG_FS_FILE;
181 jpeg_x = x;
182 jpeg_y = y;
183
184 jdec.swap = _swap;
185
186 jpgFile = inFile;
187
188 jresult = jd_prepare(&jdec, jd_input, workspace, TJPGD_WORKSPACE_SIZE, (unsigned int)0);
189
190 // Extract image and render
191 if (jresult == JDR_OK)
192 {
193 jresult = jd_decomp(&jdec, jd_output, jpgScale);
194 }
195 inFile.seek(0);
196 return jresult;
197}
198
199
200JRESULT TJpg_Decoder::drawJpg(int32_t x, int32_t y, const uint8_t jpeg_data[], uint32_t data_size) {

Callers 1

drawJPGMethod · 0.80

Calls 2

jd_prepareFunction · 0.85
jd_decompFunction · 0.85

Tested by

no test coverage detected