19 #define JPEG_INTERNALS 52 #ifdef QUANT_2PASS_SUPPORTED 86 if (post->buffer ==
NULL) {
87 post->buffer = (*cinfo->mem->access_virt_sarray)
95 post->pub.post_process_data = cinfo->
upsample->upsample;
98 #ifdef QUANT_2PASS_SUPPORTED 101 if (post->whole_image ==
NULL)
102 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
107 if (post->whole_image ==
NULL)
108 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
113 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
116 post->starting_row = post->next_row = 0;
137 max_rows = out_rows_avail - *out_row_ctr;
138 if (max_rows > post->strip_height)
139 max_rows = post->strip_height;
141 (*cinfo->upsample->upsample) (cinfo,
142 input_buf, in_row_group_ctr, in_row_groups_avail,
143 post->buffer, &num_rows, max_rows);
145 (*cinfo->cquantize->color_quantize) (cinfo,
146 post->buffer, output_buf + *out_row_ctr, (
int)
num_rows);
151 #ifdef QUANT_2PASS_SUPPORTED 168 if (post->next_row == 0) {
169 post->buffer = (*cinfo->mem->access_virt_sarray)
171 post->starting_row, post->strip_height,
TRUE);
175 old_next_row = post->next_row;
176 (*cinfo->upsample->upsample) (cinfo,
177 input_buf, in_row_group_ctr, in_row_groups_avail,
178 post->buffer, &post->next_row, post->strip_height);
182 if (post->next_row > old_next_row) {
183 num_rows = post->next_row - old_next_row;
184 (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
190 if (post->next_row >= post->strip_height) {
191 post->starting_row += post->strip_height;
212 if (post->next_row == 0) {
213 post->buffer = (*cinfo->mem->access_virt_sarray)
215 post->starting_row, post->strip_height,
FALSE);
219 num_rows = post->strip_height - post->next_row;
220 max_rows = out_rows_avail - *out_row_ctr;
221 if (num_rows > max_rows)
224 max_rows = cinfo->output_height - post->starting_row;
225 if (num_rows > max_rows)
229 (*cinfo->cquantize->color_quantize) (cinfo,
230 post->buffer + post->next_row, output_buf + *out_row_ctr,
236 if (post->next_row >= post->strip_height) {
237 post->starting_row += post->strip_height;
256 SIZEOF(my_post_controller));
258 post->pub.start_pass = start_pass_dpost;
259 post->whole_image =
NULL;
263 if (cinfo->quantize_colors) {
268 post->strip_height = (
JDIMENSION) cinfo->max_v_samp_factor;
269 if (need_full_buffer) {
272 #ifdef QUANT_2PASS_SUPPORTED 273 post->whole_image = (*cinfo->mem->request_virt_sarray)
275 cinfo->output_width * cinfo->out_color_components,
277 (
long) post->strip_height),
280 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
284 post->buffer = (*cinfo->mem->alloc_sarray)
286 cinfo->output_width * cinfo->out_color_components,
struct jpeg_d_post_controller * post
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
jinit_d_post_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
jround_up(long a, long b)
int JSAMPARRAY int int num_rows
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
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)
if(!abbox) return FT_THROW(Invalid_Argument)
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)
struct jpeg_upsampler * upsample
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)
my_post_controller * my_post_ptr
struct jvirt_sarray_control * jvirt_sarray_ptr