10 #define JPEG_INTERNALS 35 if (cinfo->buffered_image)
46 if (cinfo->inputctl->has_multiple_scans)
48 #ifdef D_MULTISCAN_FILES_SUPPORTED 53 if (cinfo->progress !=
nullptr)
54 (*cinfo->progress->progress_monitor)((
j_common_ptr)cinfo);
56 retcode = (*cinfo->inputctl->consume_input)(cinfo);
60 if (cinfo->progress !=
nullptr &&
64 if (++cinfo->progress->pass_counter >=
65 cinfo->progress->pass_limit)
69 cinfo->progress->pass_limit +=
70 (long)cinfo->total_iMCU_rows;
75 ERREXIT(cinfo, JERR_NOT_COMPILED);
78 cinfo->output_scan_number = cinfo->input_scan_number;
81 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
100 (*cinfo->master->prepare_for_output_pass)(cinfo);
101 cinfo->output_scanline = 0;
105 while (cinfo->master->is_dummy_pass)
107 #ifdef QUANT_2PASS_SUPPORTED 109 while (cinfo->output_scanline < cinfo->output_height)
113 if (cinfo->progress !=
nullptr)
115 cinfo->progress->pass_counter = (long)cinfo->output_scanline;
116 cinfo->progress->pass_limit = (
long)cinfo->output_height;
117 (*cinfo->progress->progress_monitor)((
j_common_ptr)cinfo);
120 last_scanline = cinfo->output_scanline;
121 (*cinfo->main->process_data)(
122 cinfo, (
JSAMPARRAY)
nullptr, &cinfo->output_scanline,
124 if (cinfo->output_scanline == last_scanline)
128 (*cinfo->master->finish_output_pass)(cinfo);
129 (*cinfo->master->prepare_for_output_pass)(cinfo);
130 cinfo->output_scanline = 0;
132 ERREXIT(cinfo, JERR_NOT_COMPILED);
162 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
163 if (cinfo->output_scanline >= cinfo->output_height)
165 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
170 if (cinfo->progress !=
nullptr)
172 cinfo->progress->pass_counter = (long)cinfo->output_scanline;
173 cinfo->progress->pass_limit = (
long)cinfo->output_height;
174 (*cinfo->progress->progress_monitor)((
j_common_ptr)cinfo);
179 (*cinfo->main->process_data)(cinfo, scanlines, &row_ctr, max_lines);
180 cinfo->output_scanline += row_ctr;
196 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
197 if (cinfo->output_scanline >= cinfo->output_height)
199 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
204 if (cinfo->progress !=
nullptr)
206 cinfo->progress->pass_counter = (long)cinfo->output_scanline;
207 cinfo->progress->pass_limit = (
long)cinfo->output_height;
208 (*cinfo->progress->progress_monitor)((
j_common_ptr)cinfo);
212 lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
213 if (max_lines < lines_per_iMCU_row)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
216 if (!(*cinfo->coef->decompress_data)(cinfo,
data))
220 cinfo->output_scanline += lines_per_iMCU_row;
221 return lines_per_iMCU_row;
226 #ifdef D_MULTISCAN_FILES_SUPPORTED 237 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
239 if (scan_number <= 0) scan_number = 1;
240 if (cinfo->inputctl->eoi_reached && scan_number > cinfo->input_scan_number)
241 scan_number = cinfo->input_scan_number;
242 cinfo->output_scan_number = scan_number;
259 cinfo->buffered_image)
263 (*cinfo->master->finish_output_pass)(cinfo);
269 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
272 while (cinfo->input_scan_number <= cinfo->output_scan_number &&
273 !cinfo->inputctl->eoi_reached)
#define JPEG_ROW_COMPLETED
LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo))
jpeg_finish_output(j_decompress_ptr cinfo)
jpeg_start_decompress(j_decompress_ptr cinfo)
#define ERREXIT(cinfo, code)
output_pass_setup(j_decompress_ptr cinfo)
jpeg_start_output(j_decompress_ptr cinfo, int scan_number)
jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines)
jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines)
#define WARNMS(cinfo, code)
#define ERREXIT1(cinfo, code, p1)
GLsizei GLsizei GLenum GLenum const GLvoid * data
jinit_master_decompress(j_decompress_ptr cinfo)