Lines Matching refs:cinfo
30 jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) in jpeg_CreateDecompress() argument
35 cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ in jpeg_CreateDecompress()
37 ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); in jpeg_CreateDecompress()
39 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, in jpeg_CreateDecompress()
49 struct jpeg_error_mgr * err = cinfo->err; in jpeg_CreateDecompress()
50 void * client_data = cinfo->client_data; /* ignore Purify complaint here */ in jpeg_CreateDecompress()
51 MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); in jpeg_CreateDecompress()
52 cinfo->err = err; in jpeg_CreateDecompress()
53 cinfo->client_data = client_data; in jpeg_CreateDecompress()
55 cinfo->is_decompressor = TRUE; in jpeg_CreateDecompress()
56 cinfo->tile_decode = FALSE; in jpeg_CreateDecompress()
59 jinit_memory_mgr((j_common_ptr) cinfo); in jpeg_CreateDecompress()
62 cinfo->progress = NULL; in jpeg_CreateDecompress()
63 cinfo->src = NULL; in jpeg_CreateDecompress()
66 cinfo->quant_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
69 cinfo->dc_huff_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
70 cinfo->ac_huff_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
76 cinfo->marker_list = NULL; in jpeg_CreateDecompress()
77 jinit_marker_reader(cinfo); in jpeg_CreateDecompress()
80 jinit_input_controller(cinfo); in jpeg_CreateDecompress()
83 cinfo->global_state = DSTATE_START; in jpeg_CreateDecompress()
92 jpeg_destroy_decompress (j_decompress_ptr cinfo) in jpeg_destroy_decompress() argument
94 jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ in jpeg_destroy_decompress()
104 jpeg_abort_decompress (j_decompress_ptr cinfo) in jpeg_abort_decompress() argument
106 jpeg_abort((j_common_ptr) cinfo); /* use common routine */ in jpeg_abort_decompress()
115 default_decompress_parms (j_decompress_ptr cinfo) in default_decompress_parms() argument
120 switch (cinfo->num_components) { in default_decompress_parms()
122 cinfo->jpeg_color_space = JCS_GRAYSCALE; in default_decompress_parms()
123 cinfo->out_color_space = JCS_GRAYSCALE; in default_decompress_parms()
127 if (cinfo->saw_JFIF_marker) { in default_decompress_parms()
128 cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ in default_decompress_parms()
129 } else if (cinfo->saw_Adobe_marker) { in default_decompress_parms()
130 switch (cinfo->Adobe_transform) { in default_decompress_parms()
132 cinfo->jpeg_color_space = JCS_RGB; in default_decompress_parms()
135 cinfo->jpeg_color_space = JCS_YCbCr; in default_decompress_parms()
138 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); in default_decompress_parms()
139 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ in default_decompress_parms()
144 int cid0 = cinfo->comp_info[0].component_id; in default_decompress_parms()
145 int cid1 = cinfo->comp_info[1].component_id; in default_decompress_parms()
146 int cid2 = cinfo->comp_info[2].component_id; in default_decompress_parms()
149 cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ in default_decompress_parms()
151 cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ in default_decompress_parms()
153 TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); in default_decompress_parms()
154 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ in default_decompress_parms()
158 cinfo->out_color_space = JCS_RGB; in default_decompress_parms()
162 if (cinfo->saw_Adobe_marker) { in default_decompress_parms()
163 switch (cinfo->Adobe_transform) { in default_decompress_parms()
165 cinfo->jpeg_color_space = JCS_CMYK; in default_decompress_parms()
168 cinfo->jpeg_color_space = JCS_YCCK; in default_decompress_parms()
171 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); in default_decompress_parms()
172 cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ in default_decompress_parms()
177 cinfo->jpeg_color_space = JCS_CMYK; in default_decompress_parms()
179 cinfo->out_color_space = JCS_CMYK; in default_decompress_parms()
183 cinfo->jpeg_color_space = JCS_UNKNOWN; in default_decompress_parms()
184 cinfo->out_color_space = JCS_UNKNOWN; in default_decompress_parms()
189 cinfo->scale_num = 1; /* 1:1 scaling */ in default_decompress_parms()
190 cinfo->scale_denom = 1; in default_decompress_parms()
191 cinfo->output_gamma = 1.0; in default_decompress_parms()
192 cinfo->buffered_image = FALSE; in default_decompress_parms()
193 cinfo->raw_data_out = FALSE; in default_decompress_parms()
194 cinfo->dct_method = JDCT_DEFAULT; in default_decompress_parms()
195 cinfo->do_fancy_upsampling = TRUE; in default_decompress_parms()
196 cinfo->do_block_smoothing = TRUE; in default_decompress_parms()
197 cinfo->quantize_colors = FALSE; in default_decompress_parms()
199 cinfo->dither_mode = JDITHER_FS; in default_decompress_parms()
201 cinfo->two_pass_quantize = TRUE; in default_decompress_parms()
203 cinfo->two_pass_quantize = FALSE; in default_decompress_parms()
205 cinfo->desired_number_of_colors = 256; in default_decompress_parms()
206 cinfo->colormap = NULL; in default_decompress_parms()
208 cinfo->enable_1pass_quant = FALSE; in default_decompress_parms()
209 cinfo->enable_external_quant = FALSE; in default_decompress_parms()
210 cinfo->enable_2pass_quant = FALSE; in default_decompress_parms()
242 jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) in jpeg_read_header() argument
246 if (cinfo->global_state != DSTATE_START && in jpeg_read_header()
247 cinfo->global_state != DSTATE_INHEADER) in jpeg_read_header()
248 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_read_header()
250 retcode = jpeg_consume_input(cinfo); in jpeg_read_header()
258 ERREXIT(cinfo, JERR_NO_IMAGE); in jpeg_read_header()
263 jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ in jpeg_read_header()
288 jpeg_consume_input (j_decompress_ptr cinfo) in jpeg_consume_input() argument
293 switch (cinfo->global_state) { in jpeg_consume_input()
296 (*cinfo->inputctl->reset_input_controller) (cinfo); in jpeg_consume_input()
298 (*cinfo->src->init_source) (cinfo); in jpeg_consume_input()
299 cinfo->global_state = DSTATE_INHEADER; in jpeg_consume_input()
302 retcode = (*cinfo->inputctl->consume_input) (cinfo); in jpeg_consume_input()
305 default_decompress_parms(cinfo); in jpeg_consume_input()
307 cinfo->global_state = DSTATE_READY; in jpeg_consume_input()
321 retcode = (*cinfo->inputctl->consume_input) (cinfo); in jpeg_consume_input()
324 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_consume_input()
335 jpeg_input_complete (j_decompress_ptr cinfo) in jpeg_input_complete() argument
338 if (cinfo->global_state < DSTATE_START || in jpeg_input_complete()
339 cinfo->global_state > DSTATE_STOPPING) in jpeg_input_complete()
340 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_input_complete()
341 return cinfo->inputctl->eoi_reached; in jpeg_input_complete()
350 jpeg_has_multiple_scans (j_decompress_ptr cinfo) in jpeg_has_multiple_scans() argument
353 if (cinfo->global_state < DSTATE_READY || in jpeg_has_multiple_scans()
354 cinfo->global_state > DSTATE_STOPPING) in jpeg_has_multiple_scans()
355 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_has_multiple_scans()
356 return cinfo->inputctl->has_multiple_scans; in jpeg_has_multiple_scans()
370 jpeg_finish_decompress (j_decompress_ptr cinfo) in jpeg_finish_decompress() argument
372 if ((cinfo->global_state == DSTATE_SCANNING || in jpeg_finish_decompress()
373 cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { in jpeg_finish_decompress()
376 cinfo->output_scanline = cinfo->output_height; in jpeg_finish_decompress()
378 if (cinfo->output_scanline < cinfo->output_height) in jpeg_finish_decompress()
379 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); in jpeg_finish_decompress()
380 (*cinfo->master->finish_output_pass) (cinfo); in jpeg_finish_decompress()
381 cinfo->global_state = DSTATE_STOPPING; in jpeg_finish_decompress()
382 } else if (cinfo->global_state == DSTATE_BUFIMAGE) { in jpeg_finish_decompress()
384 cinfo->global_state = DSTATE_STOPPING; in jpeg_finish_decompress()
385 } else if (cinfo->global_state != DSTATE_STOPPING) { in jpeg_finish_decompress()
387 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_finish_decompress()
391 while (! cinfo->inputctl->eoi_reached) { in jpeg_finish_decompress()
392 if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) in jpeg_finish_decompress()
397 (*cinfo->src->term_source) (cinfo); in jpeg_finish_decompress()
399 jpeg_abort((j_common_ptr) cinfo); in jpeg_finish_decompress()