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

◆ jd_decomp()

JRESULT fl::third_party::jd_decomp ( JDEC * jd,
int(* outfunc )(JDEC *, void *, JRECT *),
uint8_t scale )

Definition at line 1144 of file tjpgd.cpp.hpp.

1149{
1150 unsigned int x, y, mx, my;
1151 uint16_t rst, rsc;
1152 JRESULT rc;
1153
1154
1155 if (scale > (JD_USE_SCALE ? 3 : 0)) return JDR_PAR;
1156 jd->scale = scale;
1157
1158 mx = jd->msx * 8; my = jd->msy * 8; /* Size of the MCU (pixel) */
1159
1160 jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */
1161 rst = rsc = 0;
1162
1163 rc = JDR_OK;
1164 for (y = 0; y < jd->height; y += my) { /* Vertical loop of MCUs */
1165 for (x = 0; x < jd->width; x += mx) { /* Horizontal loop of MCUs */
1166 if (jd->nrst && rst++ == jd->nrst) { /* Process restart interval if enabled */
1167 rc = restart(jd, rsc++);
1168 if (rc != JDR_OK) return rc;
1169 rst = 1;
1170 }
1171 rc = mcu_load(jd); /* Load an MCU (decompress huffman coded stream, dequantize and apply IDCT) */
1172 if (rc != JDR_OK) return rc;
1173 rc = mcu_output(jd, outfunc, x, y); /* Output the MCU (YCbCr to RGB, scaling and output) */
1174 if (rc != JDR_OK) return rc;
1175 }
1176 }
1177
1178 return rc;
1179}
fl::UISlider scale("Scale", 4,.1, 4,.1)
fl::u16 uint16_t
Definition coder.h:214
static JRESULT restart(JDEC *jd, uint16_t rstn) FL_NOEXCEPT
static JRESULT mcu_load(JDEC *jd) FL_NOEXCEPT
static JRESULT mcu_output(JDEC *jd, int(*outfunc)(JDEC *, void *, JRECT *), unsigned int x, unsigned int y) FL_NOEXCEPT
int16_t dcv[3]
Definition tjpgd.h:59
uint16_t height
Definition tjpgd.h:61
#define JD_USE_SCALE
Definition tjpgdcnf.h:15

References fl::third_party::JDEC::dcv, FL_NOEXCEPT, fl::third_party::JDEC::height, JD_USE_SCALE, JDR_OK, JDR_PAR, mcu_load(), mcu_output(), fl::third_party::JDEC::msx, fl::third_party::JDEC::msy, fl::third_party::JDEC::nrst, restart(), fl::third_party::JDEC::scale, scale, fl::third_party::JDEC::width, fl::x, and fl::y.

Referenced by fl::third_party::TJpg_Decoder::drawJpg(), and fl::third_party::TJpgInstanceDecoder::processChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: