10 #define JPEG_INTERNALS 30 cinfo, JERR_BAD_STRUCT_SIZE,
45 cinfo->client_data = client_data;
47 cinfo->is_decompressor =
FALSE;
53 cinfo->progress =
nullptr;
54 cinfo->dest =
nullptr;
56 cinfo->comp_info =
nullptr;
62 cinfo->dc_huff_tbl_ptrs[
i] =
nullptr;
63 cinfo->ac_huff_tbl_ptrs[
i] =
nullptr;
66 cinfo->script_space =
nullptr;
68 cinfo->input_gamma = 1.0;
116 if ((qtbl = cinfo->quant_tbl_ptrs[
i]) !=
nullptr)
122 if ((htbl = cinfo->dc_huff_tbl_ptrs[
i]) !=
nullptr)
124 if ((htbl = cinfo->ac_huff_tbl_ptrs[
i]) !=
nullptr)
145 if (cinfo->next_scanline < cinfo->image_height)
146 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
147 (*cinfo->master->finish_pass)(cinfo);
150 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
152 while (!cinfo->master->is_last_pass)
154 (*cinfo->master->prepare_for_pass)(cinfo);
155 for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++)
157 if (cinfo->progress !=
nullptr)
159 cinfo->progress->pass_counter = (long)iMCU_row;
160 cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows;
161 (*cinfo->progress->progress_monitor)((
j_common_ptr)cinfo);
167 if (!(*cinfo->coef->compress_data)(cinfo, (
JSAMPIMAGE)
nullptr))
168 ERREXIT(cinfo, JERR_CANT_SUSPEND);
170 (*cinfo->master->finish_pass)(cinfo);
173 (*cinfo->marker->write_file_trailer)(cinfo);
174 (*cinfo->dest->term_destination)(cinfo);
189 unsigned int datalen)
193 if (cinfo->next_scanline != 0 || (cinfo->global_state !=
CSTATE_SCANNING &&
196 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
198 (*cinfo->marker->write_marker_header)(cinfo, marker, datalen);
202 (*write_marker_byte)(cinfo, *dataptr);
212 if (cinfo->next_scanline != 0 || (cinfo->global_state !=
CSTATE_SCANNING &&
215 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
217 (*cinfo->marker->write_marker_header)(cinfo, marker, datalen);
223 (*cinfo->marker->write_marker_byte)(cinfo,
val);
251 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
255 (*cinfo->dest->init_destination)(cinfo);
259 (*cinfo->marker->write_tables_only)(cinfo);
261 (*cinfo->dest->term_destination)(cinfo);
jpeg_write_tables(j_compress_ptr cinfo)
struct jpeg_common_struct * j_common_ptr
jpeg_destroy(j_common_ptr cinfo)
#define ERREXIT(cinfo, code)
for(ctr=DCTSIZE;ctr > 0;ctr--)
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)
#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)