OLD | NEW |
1 /* | 1 /* |
2 * djpeg.c | 2 * djpeg.c |
3 * | 3 * |
4 * This file was part of the Independent JPEG Group's software: | 4 * This file was part of the Independent JPEG Group's software: |
5 * Copyright (C) 1991-1997, Thomas G. Lane. | 5 * Copyright (C) 1991-1997, Thomas G. Lane. |
6 * libjpeg-turbo Modifications: | 6 * libjpeg-turbo Modifications: |
7 * Copyright (C) 2010-2011, 2013-2015, D. R. Commander. | 7 * Copyright (C) 2010-2011, 2013-2015, D. R. Commander. |
8 * Copyright (C) 2015, Google, Inc. | 8 * Copyright (C) 2015, Google, Inc. |
9 * For conditions of distribution and use, see the accompanying README file. | 9 * For conditions of distribution and use, see the accompanying README file. |
10 * | 10 * |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 fprintf(stderr, "inputfile outputfile\n"); | 103 fprintf(stderr, "inputfile outputfile\n"); |
104 #else | 104 #else |
105 fprintf(stderr, "[inputfile]\n"); | 105 fprintf(stderr, "[inputfile]\n"); |
106 #endif | 106 #endif |
107 | 107 |
108 fprintf(stderr, "Switches (names may be abbreviated):\n"); | 108 fprintf(stderr, "Switches (names may be abbreviated):\n"); |
109 fprintf(stderr, " -colors N Reduce image to no more than N colors\n"); | 109 fprintf(stderr, " -colors N Reduce image to no more than N colors\n"); |
110 fprintf(stderr, " -fast Fast, low-quality processing\n"); | 110 fprintf(stderr, " -fast Fast, low-quality processing\n"); |
111 fprintf(stderr, " -grayscale Force grayscale output\n"); | 111 fprintf(stderr, " -grayscale Force grayscale output\n"); |
112 fprintf(stderr, " -rgb Force RGB output\n"); | 112 fprintf(stderr, " -rgb Force RGB output\n"); |
| 113 fprintf(stderr, " -rgb565 Force RGB565 output\n"); |
113 #ifdef IDCT_SCALING_SUPPORTED | 114 #ifdef IDCT_SCALING_SUPPORTED |
114 fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\
n"); | 115 fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\
n"); |
115 #endif | 116 #endif |
116 #ifdef BMP_SUPPORTED | 117 #ifdef BMP_SUPPORTED |
117 fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n
", | 118 fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n
", |
118 (DEFAULT_FMT == FMT_BMP ? " (default)" : "")); | 119 (DEFAULT_FMT == FMT_BMP ? " (default)" : "")); |
119 #endif | 120 #endif |
120 #ifdef GIF_SUPPORTED | 121 #ifdef GIF_SUPPORTED |
121 fprintf(stderr, " -gif Select GIF output format%s\n", | 122 fprintf(stderr, " -gif Select GIF output format%s\n", |
122 (DEFAULT_FMT == FMT_GIF ? " (default)" : "")); | 123 (DEFAULT_FMT == FMT_GIF ? " (default)" : "")); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 requested_fmt = FMT_GIF; | 282 requested_fmt = FMT_GIF; |
282 | 283 |
283 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { | 284 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { |
284 /* Force monochrome output. */ | 285 /* Force monochrome output. */ |
285 cinfo->out_color_space = JCS_GRAYSCALE; | 286 cinfo->out_color_space = JCS_GRAYSCALE; |
286 | 287 |
287 } else if (keymatch(arg, "rgb", 2)) { | 288 } else if (keymatch(arg, "rgb", 2)) { |
288 /* Force RGB output. */ | 289 /* Force RGB output. */ |
289 cinfo->out_color_space = JCS_RGB; | 290 cinfo->out_color_space = JCS_RGB; |
290 | 291 |
| 292 } else if (keymatch(arg, "rgb565", 2)) { |
| 293 /* Force RGB565 output. */ |
| 294 cinfo->out_color_space = JCS_RGB565; |
| 295 |
291 } else if (keymatch(arg, "map", 3)) { | 296 } else if (keymatch(arg, "map", 3)) { |
292 /* Quantize to a color map taken from an input file. */ | 297 /* Quantize to a color map taken from an input file. */ |
293 if (++argn >= argc) /* advance to next argument */ | 298 if (++argn >= argc) /* advance to next argument */ |
294 usage(); | 299 usage(); |
295 if (for_real) { /* too expensive to do twice! */ | 300 if (for_real) { /* too expensive to do twice! */ |
296 #ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ | 301 #ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ |
297 FILE * mapfile; | 302 FILE * mapfile; |
298 | 303 |
299 if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { | 304 if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { |
300 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); | 305 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 end_progress_monitor((j_common_ptr) &cinfo); | 739 end_progress_monitor((j_common_ptr) &cinfo); |
735 #endif | 740 #endif |
736 | 741 |
737 if (memsrc && inbuffer != NULL) | 742 if (memsrc && inbuffer != NULL) |
738 free(inbuffer); | 743 free(inbuffer); |
739 | 744 |
740 /* All done. */ | 745 /* All done. */ |
741 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); | 746 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); |
742 return 0; /* suppress no-return-value warnings */ | 747 return 0; /* suppress no-return-value warnings */ |
743 } | 748 } |
OLD | NEW |