OLD | NEW |
1 /* | 1 /* |
2 * jdmaster.c | 2 * jdmaster.c |
3 * | 3 * |
4 * Copyright (C) 1991-1997, Thomas G. Lane. | 4 * Copyright (C) 1991-1997, Thomas G. Lane. |
5 * Copyright (C) 2009-2010, D. R. Commander. | 5 * Copyright (C) 2009-2011, D. R. Commander. |
6 * This file is part of the Independent JPEG Group's software. | 6 * This file is part of the Independent JPEG Group's software. |
7 * For conditions of distribution and use, see the accompanying README file. | 7 * For conditions of distribution and use, see the accompanying README file. |
8 * | 8 * |
9 * This file contains master control logic for the JPEG decompressor. | 9 * This file contains master control logic for the JPEG decompressor. |
10 * These routines are concerned with selecting the modules to be executed | 10 * These routines are concerned with selecting the modules to be executed |
11 * and with determining the number of passes and the work to be done in each | 11 * and with determining the number of passes and the work to be done in each |
12 * pass. | 12 * pass. |
13 */ | 13 */ |
14 | 14 |
15 #define JPEG_INTERNALS | 15 #define JPEG_INTERNALS |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) | 50 if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) |
51 return FALSE; | 51 return FALSE; |
52 /* jdmerge.c only supports YCC=>RGB color conversion */ | 52 /* jdmerge.c only supports YCC=>RGB color conversion */ |
53 if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || | 53 if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || |
54 (cinfo->out_color_space != JCS_RGB && | 54 (cinfo->out_color_space != JCS_RGB && |
55 cinfo->out_color_space != JCS_EXT_RGB && | 55 cinfo->out_color_space != JCS_EXT_RGB && |
56 cinfo->out_color_space != JCS_EXT_RGBX && | 56 cinfo->out_color_space != JCS_EXT_RGBX && |
57 cinfo->out_color_space != JCS_EXT_BGR && | 57 cinfo->out_color_space != JCS_EXT_BGR && |
58 cinfo->out_color_space != JCS_EXT_BGRX && | 58 cinfo->out_color_space != JCS_EXT_BGRX && |
59 cinfo->out_color_space != JCS_EXT_XBGR && | 59 cinfo->out_color_space != JCS_EXT_XBGR && |
60 cinfo->out_color_space != JCS_EXT_XRGB) || | 60 cinfo->out_color_space != JCS_EXT_XRGB && |
| 61 cinfo->out_color_space != JCS_EXT_RGBA && |
| 62 cinfo->out_color_space != JCS_EXT_BGRA && |
| 63 cinfo->out_color_space != JCS_EXT_ABGR && |
| 64 cinfo->out_color_space != JCS_EXT_ARGB) || |
61 cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space]) | 65 cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space]) |
62 return FALSE; | 66 return FALSE; |
63 /* and it only handles 2h1v or 2h2v sampling ratios */ | 67 /* and it only handles 2h1v or 2h2v sampling ratios */ |
64 if (cinfo->comp_info[0].h_samp_factor != 2 || | 68 if (cinfo->comp_info[0].h_samp_factor != 2 || |
65 cinfo->comp_info[1].h_samp_factor != 1 || | 69 cinfo->comp_info[1].h_samp_factor != 1 || |
66 cinfo->comp_info[2].h_samp_factor != 1 || | 70 cinfo->comp_info[2].h_samp_factor != 1 || |
67 cinfo->comp_info[0].v_samp_factor > 2 || | 71 cinfo->comp_info[0].v_samp_factor > 2 || |
68 cinfo->comp_info[1].v_samp_factor != 1 || | 72 cinfo->comp_info[1].v_samp_factor != 1 || |
69 cinfo->comp_info[2].v_samp_factor != 1) | 73 cinfo->comp_info[2].v_samp_factor != 1) |
70 return FALSE; | 74 return FALSE; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 case JCS_GRAYSCALE: | 206 case JCS_GRAYSCALE: |
203 cinfo->out_color_components = 1; | 207 cinfo->out_color_components = 1; |
204 break; | 208 break; |
205 case JCS_RGB: | 209 case JCS_RGB: |
206 case JCS_EXT_RGB: | 210 case JCS_EXT_RGB: |
207 case JCS_EXT_RGBX: | 211 case JCS_EXT_RGBX: |
208 case JCS_EXT_BGR: | 212 case JCS_EXT_BGR: |
209 case JCS_EXT_BGRX: | 213 case JCS_EXT_BGRX: |
210 case JCS_EXT_XBGR: | 214 case JCS_EXT_XBGR: |
211 case JCS_EXT_XRGB: | 215 case JCS_EXT_XRGB: |
| 216 case JCS_EXT_RGBA: |
| 217 case JCS_EXT_BGRA: |
| 218 case JCS_EXT_ABGR: |
| 219 case JCS_EXT_ARGB: |
212 cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space]; | 220 cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space]; |
213 break; | 221 break; |
214 case JCS_YCbCr: | 222 case JCS_YCbCr: |
215 cinfo->out_color_components = 3; | 223 cinfo->out_color_components = 3; |
216 break; | 224 break; |
217 case JCS_CMYK: | 225 case JCS_CMYK: |
218 case JCS_YCCK: | 226 case JCS_YCCK: |
219 cinfo->out_color_components = 4; | 227 cinfo->out_color_components = 4; |
220 break; | 228 break; |
221 default: /* else must be same colorspace as in file */ | 229 default: /* else must be same colorspace as in file */ |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, | 592 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
585 SIZEOF(my_decomp_master)); | 593 SIZEOF(my_decomp_master)); |
586 cinfo->master = (struct jpeg_decomp_master *) master; | 594 cinfo->master = (struct jpeg_decomp_master *) master; |
587 master->pub.prepare_for_output_pass = prepare_for_output_pass; | 595 master->pub.prepare_for_output_pass = prepare_for_output_pass; |
588 master->pub.finish_output_pass = finish_output_pass; | 596 master->pub.finish_output_pass = finish_output_pass; |
589 | 597 |
590 master->pub.is_dummy_pass = FALSE; | 598 master->pub.is_dummy_pass = FALSE; |
591 | 599 |
592 master_selection(cinfo); | 600 master_selection(cinfo); |
593 } | 601 } |
OLD | NEW |