Lines Matching refs:cinfo
34 jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize) in jpeg_CreateDecompress() argument
39 cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ in jpeg_CreateDecompress()
41 ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); in jpeg_CreateDecompress()
43 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, in jpeg_CreateDecompress()
53 struct jpeg_error_mgr *err = cinfo->err; in jpeg_CreateDecompress()
54 void *client_data = cinfo->client_data; /* ignore Purify complaint here */ in jpeg_CreateDecompress()
55 MEMZERO(cinfo, sizeof(struct jpeg_decompress_struct)); in jpeg_CreateDecompress()
56 cinfo->err = err; in jpeg_CreateDecompress()
57 cinfo->client_data = client_data; in jpeg_CreateDecompress()
59 cinfo->is_decompressor = TRUE; in jpeg_CreateDecompress()
62 jinit_memory_mgr((j_common_ptr)cinfo); in jpeg_CreateDecompress()
65 cinfo->progress = NULL; in jpeg_CreateDecompress()
66 cinfo->src = NULL; in jpeg_CreateDecompress()
69 cinfo->quant_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
72 cinfo->dc_huff_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
73 cinfo->ac_huff_tbl_ptrs[i] = NULL; in jpeg_CreateDecompress()
79 cinfo->marker_list = NULL; in jpeg_CreateDecompress()
80 jinit_marker_reader(cinfo); in jpeg_CreateDecompress()
83 jinit_input_controller(cinfo); in jpeg_CreateDecompress()
86 cinfo->global_state = DSTATE_START; in jpeg_CreateDecompress()
91 cinfo->master = (struct jpeg_decomp_master *) in jpeg_CreateDecompress()
92 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT, in jpeg_CreateDecompress()
94 MEMZERO(cinfo->master, sizeof(my_decomp_master)); in jpeg_CreateDecompress()
103 jpeg_destroy_decompress(j_decompress_ptr cinfo) in jpeg_destroy_decompress() argument
105 jpeg_destroy((j_common_ptr)cinfo); /* use common routine */ in jpeg_destroy_decompress()
115 jpeg_abort_decompress(j_decompress_ptr cinfo) in jpeg_abort_decompress() argument
117 jpeg_abort((j_common_ptr)cinfo); /* use common routine */ in jpeg_abort_decompress()
126 default_decompress_parms(j_decompress_ptr cinfo) in default_decompress_parms() argument
131 switch (cinfo->num_components) { in default_decompress_parms()
133 cinfo->jpeg_color_space = JCS_GRAYSCALE; in default_decompress_parms()
134 cinfo->out_color_space = JCS_GRAYSCALE; in default_decompress_parms()
138 if (cinfo->saw_JFIF_marker) { in default_decompress_parms()
139 cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ in default_decompress_parms()
140 } else if (cinfo->saw_Adobe_marker) { in default_decompress_parms()
141 switch (cinfo->Adobe_transform) { in default_decompress_parms()
143 cinfo->jpeg_color_space = JCS_RGB; in default_decompress_parms()
146 cinfo->jpeg_color_space = JCS_YCbCr; in default_decompress_parms()
149 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); in default_decompress_parms()
150 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ in default_decompress_parms()
155 int cid0 = cinfo->comp_info[0].component_id; in default_decompress_parms()
156 int cid1 = cinfo->comp_info[1].component_id; in default_decompress_parms()
157 int cid2 = cinfo->comp_info[2].component_id; in default_decompress_parms()
160 cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ in default_decompress_parms()
162 cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ in default_decompress_parms()
164 TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); in default_decompress_parms()
165 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ in default_decompress_parms()
169 cinfo->out_color_space = JCS_RGB; in default_decompress_parms()
173 if (cinfo->saw_Adobe_marker) { in default_decompress_parms()
174 switch (cinfo->Adobe_transform) { in default_decompress_parms()
176 cinfo->jpeg_color_space = JCS_CMYK; in default_decompress_parms()
179 cinfo->jpeg_color_space = JCS_YCCK; in default_decompress_parms()
182 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); in default_decompress_parms()
183 cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ in default_decompress_parms()
188 cinfo->jpeg_color_space = JCS_CMYK; in default_decompress_parms()
190 cinfo->out_color_space = JCS_CMYK; in default_decompress_parms()
194 cinfo->jpeg_color_space = JCS_UNKNOWN; in default_decompress_parms()
195 cinfo->out_color_space = JCS_UNKNOWN; in default_decompress_parms()
200 cinfo->scale_num = 1; /* 1:1 scaling */ in default_decompress_parms()
201 cinfo->scale_denom = 1; in default_decompress_parms()
202 cinfo->output_gamma = 1.0; in default_decompress_parms()
203 cinfo->buffered_image = FALSE; in default_decompress_parms()
204 cinfo->raw_data_out = FALSE; in default_decompress_parms()
205 cinfo->dct_method = JDCT_DEFAULT; in default_decompress_parms()
206 cinfo->do_fancy_upsampling = TRUE; in default_decompress_parms()
207 cinfo->do_block_smoothing = TRUE; in default_decompress_parms()
208 cinfo->quantize_colors = FALSE; in default_decompress_parms()
210 cinfo->dither_mode = JDITHER_FS; in default_decompress_parms()
212 cinfo->two_pass_quantize = TRUE; in default_decompress_parms()
214 cinfo->two_pass_quantize = FALSE; in default_decompress_parms()
216 cinfo->desired_number_of_colors = 256; in default_decompress_parms()
217 cinfo->colormap = NULL; in default_decompress_parms()
219 cinfo->enable_1pass_quant = FALSE; in default_decompress_parms()
220 cinfo->enable_external_quant = FALSE; in default_decompress_parms()
221 cinfo->enable_2pass_quant = FALSE; in default_decompress_parms()
253 jpeg_read_header(j_decompress_ptr cinfo, boolean require_image) in jpeg_read_header() argument
257 if (cinfo->global_state != DSTATE_START && in jpeg_read_header()
258 cinfo->global_state != DSTATE_INHEADER) in jpeg_read_header()
259 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_read_header()
261 retcode = jpeg_consume_input(cinfo); in jpeg_read_header()
269 ERREXIT(cinfo, JERR_NO_IMAGE); in jpeg_read_header()
274 jpeg_abort((j_common_ptr)cinfo); /* sets state = DSTATE_START */ in jpeg_read_header()
299 jpeg_consume_input(j_decompress_ptr cinfo) in jpeg_consume_input() argument
304 switch (cinfo->global_state) { in jpeg_consume_input()
307 (*cinfo->inputctl->reset_input_controller) (cinfo); in jpeg_consume_input()
309 (*cinfo->src->init_source) (cinfo); in jpeg_consume_input()
310 cinfo->global_state = DSTATE_INHEADER; in jpeg_consume_input()
313 retcode = (*cinfo->inputctl->consume_input) (cinfo); in jpeg_consume_input()
316 default_decompress_parms(cinfo); in jpeg_consume_input()
318 cinfo->global_state = DSTATE_READY; in jpeg_consume_input()
332 retcode = (*cinfo->inputctl->consume_input) (cinfo); in jpeg_consume_input()
335 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_consume_input()
346 jpeg_input_complete(j_decompress_ptr cinfo) in jpeg_input_complete() argument
349 if (cinfo->global_state < DSTATE_START || in jpeg_input_complete()
350 cinfo->global_state > DSTATE_STOPPING) in jpeg_input_complete()
351 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_input_complete()
352 return cinfo->inputctl->eoi_reached; in jpeg_input_complete()
361 jpeg_has_multiple_scans(j_decompress_ptr cinfo) in jpeg_has_multiple_scans() argument
364 if (cinfo->global_state < DSTATE_READY || in jpeg_has_multiple_scans()
365 cinfo->global_state > DSTATE_STOPPING) in jpeg_has_multiple_scans()
366 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_has_multiple_scans()
367 return cinfo->inputctl->has_multiple_scans; in jpeg_has_multiple_scans()
381 jpeg_finish_decompress(j_decompress_ptr cinfo) in jpeg_finish_decompress() argument
383 if ((cinfo->global_state == DSTATE_SCANNING || in jpeg_finish_decompress()
384 cinfo->global_state == DSTATE_RAW_OK) && !cinfo->buffered_image) { in jpeg_finish_decompress()
386 if (cinfo->output_scanline < cinfo->output_height) in jpeg_finish_decompress()
387 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); in jpeg_finish_decompress()
388 (*cinfo->master->finish_output_pass) (cinfo); in jpeg_finish_decompress()
389 cinfo->global_state = DSTATE_STOPPING; in jpeg_finish_decompress()
390 } else if (cinfo->global_state == DSTATE_BUFIMAGE) { in jpeg_finish_decompress()
392 cinfo->global_state = DSTATE_STOPPING; in jpeg_finish_decompress()
393 } else if (cinfo->global_state != DSTATE_STOPPING) { in jpeg_finish_decompress()
395 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); in jpeg_finish_decompress()
398 while (!cinfo->inputctl->eoi_reached) { in jpeg_finish_decompress()
399 if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) in jpeg_finish_decompress()
403 (*cinfo->src->term_source) (cinfo); in jpeg_finish_decompress()
405 jpeg_abort((j_common_ptr)cinfo); in jpeg_finish_decompress()