** Function name: drawFsJpg für AWTRIX ** Description: Draw a jpg with opened file handle at x,y ***************************************************************************************/
| 172 | ** Description: Draw a jpg with opened file handle at x,y |
| 173 | ***************************************************************************************/ |
| 174 | JRESULT 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 | |
| 200 | JRESULT TJpg_Decoder::drawJpg(int32_t x, int32_t y, const uint8_t jpeg_data[], uint32_t data_size) { |
no test coverage detected