summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2014-03-03 12:21:12 -0800
committerRay Johnston <ray.johnston@artifex.com>2014-03-05 09:47:29 -0800
commite63f9d066c001052f5594f09c3a3a59ff80d2d03 (patch)
treecb2154865fbe702165cb99b28ee3e55bc426dac6
parentb442d9a0c193d2d0114e72e1312e7bcc6e558aab (diff)
downloadghostpdl-e63f9d066c001052f5594f09c3a3a59ff80d2d03.tar.gz
Fix problem with -d***Values=16 and bitrgb device.
The max_gray and max_color would confuse the gx_device_must_halftone macro because setting -dGrayValues=16 would end up setting the max_gray and max_color to 31 (0x1f) which does NOT halftone. with the change setting to 16 values doesn't change the bpc if put_params is called again. Also remove allowing -dGrayValues=32 from supported choices.
-rw-r--r--gs/devices/gdevbit.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gs/devices/gdevbit.c b/gs/devices/gdevbit.c
index ab23ef485..3eb632679 100644
--- a/gs/devices/gdevbit.c
+++ b/gs/devices/gdevbit.c
@@ -556,16 +556,19 @@ bit_put_params(gx_device * pdev, gs_param_list * plist)
gx_device_color_info save_info;
int ncomps = pdev->color_info.num_components;
int real_ncomps = REAL_NUM_COMPONENTS(pdev);
- int bpc = pdev->color_info.depth / real_ncomps;
int v;
int ecode = 0;
int code;
- static const byte depths[4][16] = {
- {1, 2, 0, 4, 8, 0, 0, 8, 0, 0, 0, 16, 0, 0, 0, 16},
- {0},
- {4, 8, 0, 16, 16, 0, 0, 24, 0, 0, 0, 40, 0, 0, 0, 48},
- {4, 8, 0, 16, 32, 0, 0, 32, 0, 0, 0, 48, 0, 0, 0, 64}
+ /* map to depths that we actually have memory devices to support */
+ static const byte depths[4 /* ncomps - 1 */][16 /* bpc - 1 */] = {
+ {1, 2, 0, 4, 8, 0, 0, 8, 0, 0, 0, 16, 0, 0, 0, 16}, /* ncomps = 1 */
+ {0}, /* ncomps = 2, not supported */
+ {4, 8, 0, 16, 16, 0, 0, 24, 0, 0, 0, 40, 0, 0, 0, 48}, /* ncomps = 3 (rgb) */
+ {4, 8, 0, 16, 32, 0, 0, 32, 0, 0, 0, 48, 0, 0, 0, 64} /* ncomps = 4 (cmyk) */
};
+ /* map back from depth to the actual bits per component */
+ static int real_bpc[17] = { 0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 12, 12, 12, 12, 16 };
+ int bpc = real_bpc[pdev->color_info.depth / real_ncomps];
const char *vname;
int FirstLine = ((gx_device_bit *)pdev)->FirstLine;
int LastLine = ((gx_device_bit *)pdev)->LastLine;
@@ -588,7 +591,6 @@ bit_put_params(gx_device * pdev, gs_param_list * plist)
case 2: bpc = 1; break;
case 4: bpc = 2; break;
case 16: bpc = 4; break;
- case 32: bpc = 5; break;
case 256: bpc = 8; break;
case 4096: bpc = 12; break;
case 65536: bpc = 16; break;