19 #define JPEG_INTERNALS
39 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
50 void * client_data = cinfo->client_data;
53 cinfo->client_data = client_data;
55 cinfo->is_decompressor =
FALSE;
61 cinfo->progress = NULL;
64 cinfo->comp_info = NULL;
67 cinfo->quant_tbl_ptrs[
i] = NULL;
70 cinfo->dc_huff_tbl_ptrs[
i] = NULL;
71 cinfo->ac_huff_tbl_ptrs[
i] = NULL;
74 cinfo->script_space = NULL;
76 cinfo->input_gamma = 1.0;
126 if ((qtbl = cinfo->quant_tbl_ptrs[
i]) != NULL)
131 if ((
htbl = cinfo->dc_huff_tbl_ptrs[
i]) != NULL)
133 if ((
htbl = cinfo->ac_huff_tbl_ptrs[
i]) != NULL)
154 if (cinfo->next_scanline < cinfo->image_height)
155 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
156 (*cinfo->master->finish_pass) (cinfo);
158 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
160 while (! cinfo->master->is_last_pass) {
161 (*cinfo->master->prepare_for_pass) (cinfo);
162 for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
163 if (cinfo->progress != NULL) {
164 cinfo->progress->pass_counter = (long) iMCU_row;
165 cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
166 (*cinfo->progress->progress_monitor) ((
j_common_ptr) cinfo);
171 if (! (*cinfo->coef->compress_data) (cinfo, (
JSAMPIMAGE) NULL))
172 ERREXIT(cinfo, JERR_CANT_SUSPEND);
174 (*cinfo->master->finish_pass) (cinfo);
177 (*cinfo->marker->write_file_trailer) (cinfo);
178 (*cinfo->dest->term_destination) (cinfo);
197 if (cinfo->next_scanline != 0 ||
201 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
203 (*cinfo->marker->write_marker_header) (cinfo,
marker,
datalen);
206 (*write_marker_byte) (cinfo, *
dataptr);
216 if (cinfo->next_scanline != 0 ||
220 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
222 (*cinfo->marker->write_marker_header) (cinfo,
marker,
datalen);
228 (*cinfo->marker->write_marker_byte) (cinfo,
val);
257 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
261 (*cinfo->dest->init_destination) (cinfo);
265 (*cinfo->marker->write_tables_only) (cinfo);
267 (*cinfo->dest->term_destination) (cinfo);