10 #define JPEG_INTERNALS 42 #ifdef QUANT_2PASS_SUPPORTED 67 if (cinfo->quantize_colors)
78 if (post->
buffer ==
nullptr)
80 post->
buffer = (*cinfo->mem->access_virt_sarray)(
90 post->
pub.post_process_data = cinfo->upsample->upsample;
93 #ifdef QUANT_2PASS_SUPPORTED 97 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
103 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
108 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
130 max_rows = out_rows_avail - *out_row_ctr;
133 (*cinfo->upsample->upsample)(
134 cinfo, input_buf, in_row_group_ctr, in_row_groups_avail, post->
buffer,
135 &num_rows, max_rows);
137 (*cinfo->cquantize->color_quantize)(
139 *out_row_ctr += num_rows;
142 #ifdef QUANT_2PASS_SUPPORTED 162 post->
buffer = (*cinfo->mem->access_virt_sarray)(
169 (*cinfo->upsample->upsample)(
170 cinfo, input_buf, in_row_group_ctr, in_row_groups_avail, post->
buffer,
177 num_rows = post->
next_row - old_next_row;
178 (*cinfo->cquantize->color_quantize)(
181 *out_row_ctr += num_rows;
211 post->
buffer = (*cinfo->mem->access_virt_sarray)(
218 max_rows = out_rows_avail - *out_row_ctr;
219 if (num_rows > max_rows) num_rows = max_rows;
222 if (num_rows > max_rows) num_rows = max_rows;
225 (*cinfo->cquantize->color_quantize)(
228 *out_row_ctr += num_rows;
258 if (cinfo->quantize_colors)
265 if (need_full_buffer)
269 #ifdef QUANT_2PASS_SUPPORTED 270 post->
whole_image = (*cinfo->mem->request_virt_sarray)(
272 cinfo->output_width * cinfo->out_color_components,
277 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
283 post->
buffer = (*cinfo->mem->alloc_sarray)(
285 cinfo->output_width * cinfo->out_color_components,
jinit_d_post_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
post_process_1pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
jround_up(long a, long b)
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
post_process_prepass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
struct jpeg_d_post_controller pub
my_post_controller * my_post_ptr
start_pass_dpost(j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
post_process_2pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
post_process_1pass JPP((j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail))
jvirt_sarray_ptr whole_image