]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Minor tweeks so that ICC1-ICCF colorspaces are Lab, not XYZ.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 5 Feb 2003 03:10:21 +0000 (03:10 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 5 Feb 2003 03:10:21 +0000 (03:10 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@3318 7a7537e8-13f0-0310-91df-b6672ffda945

filter/image-colorspace.c
filter/imagetoraster.c
pstoraster/gdevcups.c

index 9a7b47805c4ed7abaa97b48a64041b7263ab4330..7c725876cd5719b27bb660c554f1cf0e23f9f8ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: image-colorspace.c,v 1.31 2003/01/24 20:39:42 mike Exp $"
+ * "$Id: image-colorspace.c,v 1.32 2003/02/05 03:10:20 mike Exp $"
  *
  *   Colorspace conversions for the Common UNIX Printing System (CUPS).
  *
@@ -235,9 +235,9 @@ ImageWhiteToRGB(const ib_t *in,             /* I - Input pixels */
       *out++ = *in;
       *out++ = *in++;
 
-      if (ImageColorSpace == CUPS_CSPACE_CIELab)
+      if (ImageColorSpace >= CUPS_CSPACE_CIELab)
         rgb_to_lab(out - 3);
-      else if (ImageColorSpace >= CUPS_CSPACE_CIEXYZ)
+      else if (ImageColorSpace == CUPS_CSPACE_CIEXYZ)
         rgb_to_xyz(out - 3);
 
       count --;
@@ -616,7 +616,7 @@ ImageRGBToRGB(const ib_t *in,       /* I - Input pixels */
     {
       while (count > 0)
       {
-       if (ImageColorSpace == CUPS_CSPACE_CIELab)
+       if (ImageColorSpace >= CUPS_CSPACE_CIELab)
           rgb_to_lab(out);
        else
           rgb_to_xyz(out);
@@ -956,9 +956,9 @@ ImageCMYKToRGB(const ib_t *in,      /* I - Input pixels */
       else
         *out++ = 0;
 
-      if (ImageColorSpace == CUPS_CSPACE_CIELab)
+      if (ImageColorSpace >= CUPS_CSPACE_CIELab)
         rgb_to_lab(out - 3);
-      else if (ImageColorSpace >= CUPS_CSPACE_CIEXYZ)
+      else if (ImageColorSpace == CUPS_CSPACE_CIEXYZ)
         rgb_to_xyz(out - 3);
 
       count --;
@@ -1540,5 +1540,5 @@ zshear(float mat[3][3],   /* I - Matrix */
 
 
 /*
- * End of "$Id: image-colorspace.c,v 1.31 2003/01/24 20:39:42 mike Exp $".
+ * End of "$Id: image-colorspace.c,v 1.32 2003/02/05 03:10:20 mike Exp $".
  */
index a08a1b9d258f27b0a61779dbd24b7322c9e26748..fcee20d75c32d3f100cbe3419e1b14692929b2ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: imagetoraster.c,v 1.69 2002/12/17 18:59:28 swdev Exp $"
+ * "$Id: imagetoraster.c,v 1.70 2003/02/05 03:10:20 mike Exp $"
  *
  *   Image file to raster filter for the Common UNIX Printing System (CUPS).
  *
@@ -539,6 +539,15 @@ main(int  argc,            /* I - Number of command-line arguments */
         primary   = IMAGE_RGB;
        secondary = IMAGE_RGB;
 
+       /*
+        * Ensure that colorimetric colorspaces use at least 8 bits per
+       * component...
+       */
+
+        if (header.cupsColorSpace >= CUPS_CSPACE_CIEXYZ &&
+           header.cupsBitsPerColor < 8)
+         header.cupsBitsPerColor = 8;
+
        if (header.cupsColorOrder == CUPS_ORDER_CHUNKED)
        {
          if (header.cupsBitsPerColor >= 8)
@@ -4541,5 +4550,5 @@ make_lut(ib_t  *lut,              /* I - Lookup table */
 
 
 /*
- * End of "$Id: imagetoraster.c,v 1.69 2002/12/17 18:59:28 swdev Exp $".
+ * End of "$Id: imagetoraster.c,v 1.70 2003/02/05 03:10:20 mike Exp $".
  */
index 438848b9159b90ef003e186d960ab79377d13803..7c8f6700b36ca542d4e18038b0a04c7556fbc95f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: gdevcups.c,v 1.60 2003/01/07 16:54:32 mike Exp $"
+ * "$Id: gdevcups.c,v 1.61 2003/02/05 03:10:21 mike Exp $"
  *
  *   GNU Ghostscript raster output driver for the Common UNIX Printing
  *   System (CUPS).
@@ -1620,7 +1620,7 @@ cups_map_rgb_color(gx_device      *pdev,  /* I - Device info */
        ciey = 0.212671 * rr + 0.715160 * rg + 0.072169 * rb;
        ciez = 0.019334 * rr + 0.119193 * rg + 0.950227 * rb;
 
-        if (cups->header.cupsColorSpace != CUPS_CSPACE_CIELab)
+        if (cups->header.cupsColorSpace == CUPS_CSPACE_CIEXYZ)
        {
         /*
          * Convert to an integer XYZ color value...
@@ -2376,14 +2376,7 @@ cups_set_color_info(gx_device *pdev)     /* I - Device info */
         if (cups->header.cupsColorOrder != CUPS_ORDER_CHUNKED)
            cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor;
         else
-        {
-          if (cups->header.cupsColorSpace < CUPS_CSPACE_ICC1)
-            cups->header.cupsBitsPerPixel = 3 * cups->header.cupsBitsPerColor;
-          else
-            cups->header.cupsBitsPerPixel =
-                (cups->header.cupsColorSpace - CUPS_CSPACE_ICC1 + 1) *
-                cups->header.cupsBitsPerColor;
-         }
+           cups->header.cupsBitsPerPixel = 3 * cups->header.cupsBitsPerColor;
 
         cups->color_info.depth          = 24;
         cups->color_info.num_components = 3;
@@ -3649,5 +3642,5 @@ cups_print_planar(gx_device_printer *pdev,        /* I - Printer device */
 
 
 /*
- * End of "$Id: gdevcups.c,v 1.60 2003/01/07 16:54:32 mike Exp $".
+ * End of "$Id: gdevcups.c,v 1.61 2003/02/05 03:10:21 mike Exp $".
  */