OLD | NEW |
1 /* | 1 /* |
2 * cjpeg.c | 2 * cjpeg.c |
3 * | 3 * |
4 * Copyright (C) 1991-1998, Thomas G. Lane. | 4 * Copyright (C) 1991-1998, Thomas G. Lane. |
5 * Modified 2003-2008 by Guido Vollbeding. | 5 * Modified 2003-2008 by Guido Vollbeding. |
6 * Copyright (C) 2010, D. R. Commander. | 6 * Copyright (C) 2010, D. R. Commander. |
7 * This file is part of the Independent JPEG Group's software. | 7 * This file is part of the Independent JPEG Group's software. |
8 * For conditions of distribution and use, see the accompanying README file. | 8 * For conditions of distribution and use, see the accompanying README file. |
9 * | 9 * |
10 * This file contains a command-line user interface for the JPEG compressor. | 10 * This file contains a command-line user interface for the JPEG compressor. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 #ifdef ENTROPY_OPT_SUPPORTED | 157 #ifdef ENTROPY_OPT_SUPPORTED |
158 fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but sl
ow compression)\n"); | 158 fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but sl
ow compression)\n"); |
159 #endif | 159 #endif |
160 #ifdef C_PROGRESSIVE_SUPPORTED | 160 #ifdef C_PROGRESSIVE_SUPPORTED |
161 fprintf(stderr, " -progressive Create progressive JPEG file\n"); | 161 fprintf(stderr, " -progressive Create progressive JPEG file\n"); |
162 #endif | 162 #endif |
163 #ifdef TARGA_SUPPORTED | 163 #ifdef TARGA_SUPPORTED |
164 fprintf(stderr, " -targa Input file is Targa format (usually not need
ed)\n"); | 164 fprintf(stderr, " -targa Input file is Targa format (usually not need
ed)\n"); |
165 #endif | 165 #endif |
166 fprintf(stderr, "Switches for advanced users:\n"); | 166 fprintf(stderr, "Switches for advanced users:\n"); |
| 167 #ifdef C_ARITH_CODING_SUPPORTED |
| 168 fprintf(stderr, " -arithmetic Use arithmetic coding\n"); |
| 169 #endif |
167 #ifdef DCT_ISLOW_SUPPORTED | 170 #ifdef DCT_ISLOW_SUPPORTED |
168 fprintf(stderr, " -dct int Use integer DCT method%s\n", | 171 fprintf(stderr, " -dct int Use integer DCT method%s\n", |
169 (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); | 172 (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); |
170 #endif | 173 #endif |
171 #ifdef DCT_IFAST_SUPPORTED | 174 #ifdef DCT_IFAST_SUPPORTED |
172 fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n", | 175 fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n", |
173 (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : "")); | 176 (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : "")); |
174 #endif | 177 #endif |
175 #ifdef DCT_FLOAT_SUPPORTED | 178 #ifdef DCT_FLOAT_SUPPORTED |
176 fprintf(stderr, " -dct float Use floating-point DCT method%s\n", | 179 fprintf(stderr, " -dct float Use floating-point DCT method%s\n", |
177 (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : "")); | 180 (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : "")); |
178 #endif | 181 #endif |
179 fprintf(stderr, " -restart N Set restart interval in rows, or in blocks w
ith B\n"); | 182 fprintf(stderr, " -restart N Set restart interval in rows, or in blocks w
ith B\n"); |
180 #ifdef INPUT_SMOOTHING_SUPPORTED | 183 #ifdef INPUT_SMOOTHING_SUPPORTED |
181 fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)
\n"); | 184 fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)
\n"); |
182 #endif | 185 #endif |
183 fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); | 186 fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); |
184 fprintf(stderr, " -outfile name Specify name for output file\n"); | 187 fprintf(stderr, " -outfile name Specify name for output file\n"); |
185 fprintf(stderr, " -verbose or -debug Emit debug output\n"); | 188 fprintf(stderr, " -verbose or -debug Emit debug output\n"); |
186 fprintf(stderr, "Switches for wizards:\n"); | 189 fprintf(stderr, "Switches for wizards:\n"); |
187 #ifdef C_ARITH_CODING_SUPPORTED | |
188 fprintf(stderr, " -arithmetic Use arithmetic coding\n"); | |
189 #endif | |
190 fprintf(stderr, " -baseline Force baseline quantization tables\n"); | 190 fprintf(stderr, " -baseline Force baseline quantization tables\n"); |
191 fprintf(stderr, " -qtables file Use quantization tables given in file\n"); | 191 fprintf(stderr, " -qtables file Use quantization tables given in file\n"); |
192 fprintf(stderr, " -qslots N[,...] Set component quantization tables\n"); | 192 fprintf(stderr, " -qslots N[,...] Set component quantization tables\n"); |
193 fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n"); | 193 fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n"); |
194 #ifdef C_MULTISCAN_FILES_SUPPORTED | 194 #ifdef C_MULTISCAN_FILES_SUPPORTED |
195 fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); | 195 fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); |
196 #endif | 196 #endif |
197 exit(EXIT_FAILURE); | 197 exit(EXIT_FAILURE); |
198 } | 198 } |
199 | 199 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 usage(); | 270 usage(); |
271 | 271 |
272 } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { | 272 } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { |
273 /* Enable debug printouts. */ | 273 /* Enable debug printouts. */ |
274 /* On first -d, print version identification */ | 274 /* On first -d, print version identification */ |
275 static boolean printed_version = FALSE; | 275 static boolean printed_version = FALSE; |
276 | 276 |
277 if (! printed_version) { | 277 if (! printed_version) { |
278 fprintf(stderr, "%s version %s (build %s)\n", | 278 fprintf(stderr, "%s version %s (build %s)\n", |
279 PACKAGE_NAME, VERSION, BUILD); | 279 PACKAGE_NAME, VERSION, BUILD); |
280 » fprintf(stderr, "%s\n\n", LJTCOPYRIGHT); | 280 » fprintf(stderr, "%s\n\n", JCOPYRIGHT); |
281 » fprintf(stderr, "Based on Independent JPEG Group's libjpeg, version %s\n
%s\n\n", | 281 » fprintf(stderr, "Emulating The Independent JPEG Group's libjpeg, version
%s\n\n", |
282 » » JVERSION, JCOPYRIGHT); | 282 » » JVERSION); |
283 printed_version = TRUE; | 283 printed_version = TRUE; |
284 } | 284 } |
285 cinfo->err->trace_level++; | 285 cinfo->err->trace_level++; |
286 | 286 |
287 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { | 287 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { |
288 /* Force a monochrome JPEG file to be generated. */ | 288 /* Force a monochrome JPEG file to be generated. */ |
289 jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); | 289 jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); |
290 | 290 |
291 } else if (keymatch(arg, "maxmemory", 3)) { | 291 } else if (keymatch(arg, "maxmemory", 3)) { |
292 /* Maximum memory in Kb (or Mb with 'm'). */ | 292 /* Maximum memory in Kb (or Mb with 'm'). */ |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 fclose(output_file); | 596 fclose(output_file); |
597 | 597 |
598 #ifdef PROGRESS_REPORT | 598 #ifdef PROGRESS_REPORT |
599 end_progress_monitor((j_common_ptr) &cinfo); | 599 end_progress_monitor((j_common_ptr) &cinfo); |
600 #endif | 600 #endif |
601 | 601 |
602 /* All done. */ | 602 /* All done. */ |
603 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); | 603 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); |
604 return 0; /* suppress no-return-value warnings */ | 604 return 0; /* suppress no-return-value warnings */ |
605 } | 605 } |
OLD | NEW |