10 #define JPEG_INTERNALS 114 if (!(*dest->empty_output_buffer)(cinfo))
115 ERREXIT(cinfo, JERR_CANT_SUSPEND);
148 if (qtbl ==
nullptr)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE,
index);
153 if (qtbl->
quantval[i] > 255) prec = 1;
168 if (prec)
emit_byte(cinfo, (
int)(qval >> 8));
187 htbl = cinfo->ac_huff_tbl_ptrs[
index];
192 htbl = cinfo->dc_huff_tbl_ptrs[
index];
195 if (htbl ==
nullptr)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE,
index);
202 for (i = 1; i <= 16; i++)
length += htbl->
bits[i];
221 #ifdef C_ARITH_CODING_SUPPORTED 227 for (i = 0; i <
NUM_ARITH_TBLS; i++) dc_in_use[i] = ac_in_use[i] = 0;
229 for (i = 0; i < cinfo->comps_in_scan; i++)
231 compptr = cinfo->cur_comp_info[i];
249 cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i] << 4));
280 emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1);
283 if ((
long)cinfo->image_height > 65535L || (
long)cinfo->image_width > 65535L)
284 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (
unsigned int)65535);
292 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
311 emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3);
315 for (i = 0; i < cinfo->comps_in_scan; i++)
317 compptr = cinfo->cur_comp_info[i];
321 if (cinfo->progressive_mode)
333 if (cinfo->Ah != 0 && !cinfo->arith_code)
346 emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
367 emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1);
374 emit_byte(cinfo, cinfo->JFIF_major_version);
375 emit_byte(cinfo, cinfo->JFIF_minor_version);
415 switch (cinfo->jpeg_color_space)
441 if (datalen > (
unsigned int)65533)
442 ERREXIT(cinfo, JERR_BAD_LENGTH);
477 if (cinfo->write_JFIF_header)
479 if (cinfo->write_Adobe_marker)
502 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
512 if (cinfo->arith_code || cinfo->progressive_mode ||
513 cinfo->data_precision != 8)
520 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
526 if (prec && is_baseline)
530 TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
535 if (cinfo->arith_code)
541 if (cinfo->progressive_mode)
543 else if (is_baseline)
564 if (cinfo->arith_code)
577 for (i = 0; i < cinfo->comps_in_scan; i++)
579 compptr = cinfo->cur_comp_info[i];
580 if (cinfo->progressive_mode)
638 if (cinfo->quant_tbl_ptrs[i] !=
nullptr) (
void)
emit_dqt(cinfo, i);
641 if (!cinfo->arith_code)
645 if (cinfo->dc_huff_tbl_ptrs[i] !=
nullptr)
647 if (cinfo->ac_huff_tbl_ptrs[i] !=
nullptr)
emit_dht(cinfo, i,
TRUE);
UINT16 quantval[DCTSIZE2]
emit_marker(j_compress_ptr cinfo, JPEG_MARKER mark)
emit_dht(j_compress_ptr cinfo, int index, boolean is_ac)
const int jpeg_natural_order[]
struct jpeg_common_struct * j_common_ptr
emit_adobe_app14(j_compress_ptr cinfo)
#define ERREXIT(cinfo, code)
emit_dri(j_compress_ptr cinfo)
write_scan_header(j_compress_ptr cinfo)
write_file_header(j_compress_ptr cinfo)
unsigned int last_restart_interval
#define TRACEMS(cinfo, lvl, code)
emit_2bytes(j_compress_ptr cinfo, int value)
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
emit_dqt(j_compress_ptr cinfo, int index)
emit_byte(j_compress_ptr cinfo, int val)
write_tables_only(j_compress_ptr cinfo)
write_frame_header(j_compress_ptr cinfo)
emit_sos(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
GLuint GLsizei GLsizei * length
emit_jfif_app0(j_compress_ptr cinfo)
write_file_trailer(j_compress_ptr cinfo)
write_marker_byte(j_compress_ptr cinfo, int val)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
struct jpeg_marker_writer pub
GLsizei const GLfloat * value
jinit_marker_writer(j_compress_ptr cinfo)
emit_sof(j_compress_ptr cinfo, JPEG_MARKER code)
my_marker_writer * my_marker_ptr
JOCTET * next_output_byte
jpeg_component_info * compptr