31 }
while (ch !=
'\n' && ch !=
EOF);
52 }
while (isspace(ch));
91 fprintf(stderr,
"Can't open table file %s\n",
filename);
98 fprintf(stderr,
"Too many tables in file %s\n",
filename);
105 fprintf(stderr,
"Invalid table data in file %s\n",
filename);
115 if (termchar !=
EOF) {
116 fprintf(stderr,
"Non-numeric data in file %s\n",
filename);
126 #ifdef C_MULTISCAN_FILES_SUPPORTED 139 while (ch !=
EOF && isspace(ch))
142 if (ungetc(ch, file) ==
EOF)
149 if (ch !=
EOF && ch !=
';' && ch !=
':')
176 int scanno, ncomps, termchar;
179 #define MAX_SCANS 100 183 fprintf(stderr,
"Can't open scan definition file %s\n",
filename);
191 fprintf(stderr,
"Too many scans defined in file %s\n",
filename);
197 while (termchar ==
' ') {
199 fprintf(stderr,
"Too many components in one scan in file %s\n",
210 if (termchar ==
':') {
230 if (termchar !=
';' && termchar !=
EOF) {
232 fprintf(stderr,
"Invalid scan entry format in file %s\n",
filename);
239 if (termchar !=
EOF) {
240 fprintf(stderr,
"Non-numeric data in file %s\n",
filename);
254 cinfo->scan_info = scanptr;
255 cinfo->num_scans = scanno;
279 if (sscanf(
arg,
"%d%c", &
val, &ch) < 1)
284 fprintf(stderr,
"JPEG quantization tables are numbered 0..%d\n",
288 cinfo->comp_info[ci].quant_tbl_no =
val;
289 while (*
arg && *
arg++ !=
',')
293 cinfo->comp_info[ci].quant_tbl_no =
val;
313 if (sscanf(
arg,
"%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
315 if ((ch1 !=
'x' && ch1 !=
'X') || ch2 !=
',')
317 if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
318 fprintf(stderr,
"JPEG sampling factors must be 1..4\n");
321 cinfo->comp_info[ci].h_samp_factor = val1;
322 cinfo->comp_info[ci].v_samp_factor = val2;
323 while (*
arg && *
arg++ !=
',')
327 cinfo->comp_info[ci].h_samp_factor = 1;
328 cinfo->comp_info[ci].v_samp_factor = 1;
char int boolean force_baseline
struct jpeg_common_struct * j_common_ptr
read_quant_tables(j_compress_ptr cinfo, char *filename, int scale_factor, boolean force_baseline)
read_scan_integer(FILE *file, long *result, int *termchar)
int component_index[MAX_COMPS_IN_SCAN]
#define MEMCOPY(dest, src, size)
set_sample_factors(j_compress_ptr cinfo, char *arg)
read_text_integer(FILE *file, long *result, int *termchar)
read_scan_script(j_compress_ptr cinfo, char *filename)
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline)
set_quant_slots(j_compress_ptr cinfo, char *arg)
GLenum GLsizei GLenum GLenum const GLvoid * table
#define MAX_COMPS_IN_SCAN