10 #define JPEG_INTERNALS 30 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
41 void * client_data = cinfo->client_data;
44 cinfo->client_data = client_data;
46 cinfo->is_decompressor =
FALSE;
52 cinfo->progress = NULL;
55 cinfo->comp_info = NULL;
58 cinfo->quant_tbl_ptrs[
i] = NULL;
61 cinfo->dc_huff_tbl_ptrs[
i] = NULL;
62 cinfo->ac_huff_tbl_ptrs[
i] = NULL;
65 cinfo->script_space = NULL;
67 cinfo->input_gamma = 1.0;
117 if ((qtbl = cinfo->quant_tbl_ptrs[
i]) != NULL)
122 if ((
htbl = cinfo->dc_huff_tbl_ptrs[
i]) != NULL)
124 if ((
htbl = cinfo->ac_huff_tbl_ptrs[
i]) != NULL)
145 if (cinfo->next_scanline < cinfo->image_height)
146 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
147 (*cinfo->master->finish_pass) (cinfo);
149 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
151 while (! cinfo->master->is_last_pass) {
152 (*cinfo->master->prepare_for_pass) (cinfo);
153 for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
154 if (cinfo->progress != NULL) {
155 cinfo->progress->pass_counter = (long) iMCU_row;
156 cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
157 (*cinfo->progress->progress_monitor) ((
j_common_ptr) cinfo);
162 if (! (*cinfo->coef->compress_data) (cinfo, (
JSAMPIMAGE) NULL))
163 ERREXIT(cinfo, JERR_CANT_SUSPEND);
165 (*cinfo->master->finish_pass) (cinfo);
168 (*cinfo->marker->write_file_trailer) (cinfo);
169 (*cinfo->dest->term_destination) (cinfo);
188 if (cinfo->next_scanline != 0 ||
192 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
194 (*cinfo->marker->write_marker_header) (cinfo,
marker,
datalen);
197 (*write_marker_byte) (cinfo, *
dataptr);
207 if (cinfo->next_scanline != 0 ||
211 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
213 (*cinfo->marker->write_marker_header) (cinfo,
marker,
datalen);
219 (*cinfo->marker->write_marker_byte) (cinfo,
val);
248 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
252 (*cinfo->dest->init_destination) (cinfo);
256 (*cinfo->marker->write_tables_only) (cinfo);
258 (*cinfo->dest->term_destination) (cinfo);
int const JOCTET * dataptr
jpeg_write_tables(j_compress_ptr cinfo)
struct jpeg_common_struct * j_common_ptr
jpeg_destroy(j_common_ptr cinfo)
#define ERREXIT(cinfo, code)
jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
jpeg_finish_compress(j_compress_ptr cinfo)
jpeg_abort(j_common_ptr cinfo)
jinit_memory_mgr(j_common_ptr cinfo)
int const JOCTET unsigned int datalen
#define JMETHOD(type, methodname, arglist)
jpeg_destroy_compress(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen)
write_marker_byte(j_compress_ptr cinfo, int val)
#define ERREXIT2(cinfo, code, p1, p2)
jinit_marker_writer(j_compress_ptr cinfo)
jpeg_abort_compress(j_compress_ptr cinfo)
#define MEMZERO(target, size)