| 198 | |
| 199 | |
| 200 | JRESULT 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 | } |
no test coverage detected