~ubuntu-branches/ubuntu/precise/ghostscript/precise-security

« back to all changes in this revision

Viewing changes to debian/patches/020110815-eb6b631-cups-raster-generate-cups-rgbw.patch

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-08-15 14:49:31 UTC
  • Revision ID: james.westby@ubuntu.com-20110815144931-5dun6e92ojvt4my6
Tags: 9.04~dfsg-0ubuntu4
* debian/patches/020110816-d8da050-cups-raster-improve-black-recognition-on-cmyk-to-rgbw.patch:
  CUPS Raster: Improved recognition of black pixels on CMYK -> RGBW conversion
  (Upstream bug 691922).
* debian/patches/020110815-1920f21-cups-raster-set-default-color-profiles.patch:
  Let the CUPS Raster output device set the correct default output color
  space if none is explicitly selected via the "-sOutputICCProfile=..."
  (Upstream bug 691922).
* debian/patches/020110815-05b517b-gdevcups-c-eliminate-compiler-warning.patch:
  Eliminated a compiler warning caused by the previous patch.
* debian/patches/020110815-eb6b631-cups-raster-generate-cups-rgbw.patch:
  Let the CUPS Raster output device generate RGBW as it is described in the
  CUPS specification for the CUPS Raster format (Upstream bug 691922).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/cups/gdevcups.c
 
2
+++ b/cups/gdevcups.c
 
3
@@ -1182,16 +1182,17 @@
 
4
 
 
5
     case CUPS_CSPACE_RGB :
 
6
     case CUPS_CSPACE_RGBW :
 
7
-        if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) {
 
8
-         c0 = c;
 
9
-         c1 = m;
 
10
-         c2 = y;
 
11
-         c3 = k;
 
12
-       } else {
 
13
-         c0 = c + k;
 
14
-         c1 = m + k;
 
15
-         c2 = y + k;
 
16
-       }
 
17
+        c0 = c + k;
 
18
+        c1 = m + k;
 
19
+        c2 = y + k;
 
20
+        if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW)
 
21
+         if (k >= frac_1) {
 
22
+           c0 = frac_1;
 
23
+           c1 = frac_1;
 
24
+           c2 = frac_1;
 
25
+           c3 = frac_1;
 
26
+         } else
 
27
+           c3 = 0;
 
28
 
 
29
         if (c0 < 0)
 
30
          c0 = 0;
 
31
@@ -1212,11 +1213,12 @@
 
32
        out[2] = frac_1 - (frac)cups->Density[c2];
 
33
 
 
34
         if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) {
 
35
-         if (c3 < 0)
 
36
-           c3 = 0;
 
37
-         else if (c3 > frac_1)
 
38
-           c3 = frac_1;
 
39
-         out[3] = frac_1 - (frac)cups->Density[c3];
 
40
+         if (c3 == 0)
 
41
+           out[3] = frac_1;
 
42
+         else if (c3 == frac_1)
 
43
+           out[3] = 0;
 
44
+         else
 
45
+           out[3] = frac_1;
 
46
        }
 
47
         break;
 
48
 
 
49
@@ -2034,10 +2036,15 @@
 
50
         * cups->DecodeLUT actually maps to RGBW, not CMYK...
 
51
        */
 
52
 
 
53
-        k = cups->DecodeLUT[c3];
 
54
-        c = cups->DecodeLUT[c0] + k - gx_max_color_value;
 
55
-        m = cups->DecodeLUT[c1] + k - gx_max_color_value;
 
56
-        y = cups->DecodeLUT[c2] + k - gx_max_color_value;
 
57
+        if (c3 == 0) {
 
58
+         c = 0;
 
59
+         m = 0;
 
60
+         y = 0;
 
61
+       } else {
 
62
+         c = cups->DecodeLUT[c0];
 
63
+         m = cups->DecodeLUT[c1];
 
64
+         y = cups->DecodeLUT[c2];
 
65
+       }
 
66
 
 
67
         if (c > gx_max_color_value)
 
68
          prgb[0] = gx_max_color_value;
 
69
@@ -2282,20 +2289,20 @@
 
70
           switch (cups->header.cupsBitsPerColor)
 
71
           {
 
72
             default :
 
73
-               i = 0x0e;
 
74
+               i = 0x00;
 
75
                break;
 
76
             case 2 :
 
77
-               i = 0xfc;
 
78
+               i = 0x00;
 
79
                break;
 
80
             case 4 :
 
81
-               i = 0xfff0;
 
82
+               i = 0x0000;
 
83
                break;
 
84
             case 8 :
 
85
-               i = 0xffffff00;
 
86
+               i = 0x00000000;
 
87
                break;
 
88
 #ifdef GX_COLOR_INDEX_TYPE
 
89
            case 16 :
 
90
-               i = 0xffffffffffff0000;
 
91
+               i = 0x0000000000000000;
 
92
                break;
 
93
 #endif /* GX_COLOR_INDEX_TYPE */
 
94
           }