Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Add DeviceN color space support #3419

Closed

Description

@michaelrsweet

Version: 1.4-feature
CUPS.org User: robert.krawitz

Please add DeviceN color support to CUPS (ability to print in device-specific color space, which may include colorants other than RGB and/or CMYK).

Activity

  1. michaelrsweet commented on Nov 15, 2009

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Specifics: this will add DeviceN colorspaces (15 of them) to the CUPS raster format, but no changes need to be made to the imagetoraster filter since we can't generate them.

  2. michaelrsweet commented on Jun 16, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Moving to CUPS 1.5. Patch attached.

    Will likely include in CUPS 1.4.5 since it doesn't affect the filters or APIs.

  3. michaelrsweet commented on Aug 16, 2010

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Moving to 1.4.x.

  4. michaelrsweet commented on Aug 31, 2010

    @michaelrsweet
    ContributorAuthor

    "str3419.patch":

    Index: cups/raster.h

    --- cups/raster.h (revision 9144)
    +++ cups/raster.h (working copy)
    @@ -1,9 +1,9 @@
    /*

    • "$Id$"
      *
      • * Raster file definitions for the Common UNIX Printing System (CUPS).
      • * Raster file definitions for CUPS.
        *
      • * Copyright 2007-2008 by Apple Inc.
      • * Copyright 2007-2010 by Apple Inc.
    • Copyright 1997-2006 by Easy Software Products.
    • This file is part of the CUPS Imaging library.
      @@ -86,26 +86,28 @@

    typedef enum cups_cspace_e /**** cupsColorSpace attribute values ****/
    {

    • CUPS_CSPACE_W = 0, /* Luminance */
    • CUPS_CSPACE_RGB = 1, /* Red, green, blue */
    • CUPS_CSPACE_RGBA = 2, /* Red, green, blue, alpha */
    • CUPS_CSPACE_K = 3, /* Black */
    • CUPS_CSPACE_CMY = 4, /* Cyan, magenta, yellow */
    • CUPS_CSPACE_YMC = 5, /* Yellow, magenta, cyan */
    • CUPS_CSPACE_CMYK = 6, /* Cyan, magenta, yellow, black */
    • CUPS_CSPACE_YMCK = 7, /* Yellow, magenta, cyan, black */
    • CUPS_CSPACE_KCMY = 8, /* Black, cyan, magenta, yellow */
    • CUPS_CSPACE_KCMYcm = 9, /* Black, cyan, magenta, yellow, *
    •                \* light-cyan, light-magenta     */
      
    • CUPS_CSPACE_GMCK = 10, /* Gold, magenta, yellow, black */
    • CUPS_CSPACE_GMCS = 11, /* Gold, magenta, yellow, silver */
    • CUPS_CSPACE_WHITE = 12, /* White ink (as black) */
    • CUPS_CSPACE_GOLD = 13, /* Gold foil */
    • CUPS_CSPACE_SILVER = 14, /* Silver foil */
    • CUPS_CSPACE_W = 0, /* Luminance (DeviceGray, gamma 2.2 by default) */
    • CUPS_CSPACE_RGB = 1, /* Red, green, blue (DeviceRGB, sRGB by default) */
    • CUPS_CSPACE_RGBA = 2, /* Red, green, blue, alpha (DeviceRGB, sRGB by default) */
    • CUPS_CSPACE_K = 3, /* Black (DeviceK) */
    • CUPS_CSPACE_CMY = 4, /* Cyan, magenta, yellow (DeviceCMY) */
    • CUPS_CSPACE_YMC = 5, /* Yellow, magenta, cyan @deprecated@ */
    • CUPS_CSPACE_CMYK = 6, /* Cyan, magenta, yellow, black (DeviceCMYK) */
    • CUPS_CSPACE_YMCK = 7, /* Yellow, magenta, cyan, black @deprecated@ */
    • CUPS_CSPACE_KCMY = 8, /* Black, cyan, magenta, yellow @deprecated@ */
    • CUPS_CSPACE_KCMYcm = 9, /* Black, cyan, magenta, yellow, light-cyan, light-magenta @deprecated@ */
    • CUPS_CSPACE_GMCK = 10, /* Gold, magenta, yellow, black @deprecated@ */
    • CUPS_CSPACE_GMCS = 11, /* Gold, magenta, yellow, silver @deprecated@ */
    • CUPS_CSPACE_WHITE = 12, /* White ink (as black) @deprecated@ */
    • CUPS_CSPACE_GOLD = 13, /* Gold foil @deprecated@ */
    • CUPS_CSPACE_SILVER = 14, /* Silver foil @deprecated@ */

    CUPS_CSPACE_CIEXYZ = 15, /* CIE XYZ @SInCE CUPS 1.1.19/Mac OS X 10.3@ /
    CUPS_CSPACE_CIELab = 16, /
    CIE Lab @SInCE CUPS 1.1.19/Mac OS X 10.3@ */

    • CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white @SInCE CUPS 1.2/Mac OS X 10.5@ */
    • CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white (DeviceRGB, sRGB by default) @SInCE CUPS 1.2/Mac OS X 10.5@ */
    • CUPS_CSPACE_SW = 18, /* Luminance (gamma 2.2) @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_SRGB = 19, /* Red, green, blue (sRGB) @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_ADOBERGB = 20, /* Red, green, blue (Adobe RGB) @SInCE CUPS 1.4.5@ */

    CUPS_CSPACE_ICC1 = 32, /* ICC-based, 1 color @SInCE CUPS 1.1.19/Mac OS X 10.3@ /
    CUPS_CSPACE_ICC2 = 33, /
    ICC-based, 2 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ /
    @@ -121,7 +123,23 @@
    CUPS_CSPACE_ICCC = 43, /
    ICC-based, 12 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ /
    CUPS_CSPACE_ICCD = 44, /
    ICC-based, 13 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ /
    CUPS_CSPACE_ICCE = 45, /
    ICC-based, 14 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ */

    • CUPS_CSPACE_ICCF = 46 /* ICC-based, 15 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ */
    • CUPS_CSPACE_ICCF = 46, /* ICC-based, 15 colors @SInCE CUPS 1.1.19/Mac OS X 10.3@ */
      +
    • CUPS_CSPACE_DEVICE1 = 48, /* DeviceN, 1 color @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE2 = 49, /* DeviceN, 2 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE3 = 50, /* DeviceN, 3 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE4 = 51, /* DeviceN, 4 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE5 = 52, /* DeviceN, 5 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE6 = 53, /* DeviceN, 6 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE7 = 54, /* DeviceN, 7 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE8 = 55, /* DeviceN, 8 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICE9 = 56, /* DeviceN, 9 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICEA = 57, /* DeviceN, 10 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICEB = 58, /* DeviceN, 11 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICEC = 59, /* DeviceN, 12 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICED = 60, /* DeviceN, 13 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICEE = 61, /* DeviceN, 14 colors @SInCE CUPS 1.4.5@ */
    • CUPS_CSPACE_DEVICEF = 62 /* DeviceN, 15 colors @SInCE CUPS 1.4.5@ */
      } cups_cspace_t;

    typedef enum cups_cut_e /**** CutMedia attribute values ****/

    Index: filter/imagetoraster.c

    --- filter/imagetoraster.c (revision 9144)
    +++ filter/imagetoraster.c (working copy)
    @@ -481,6 +481,7 @@
    switch (header.cupsColorSpace)
    {
    case CUPS_CSPACE_W :

    • case CUPS_CSPACE_SW :
      if (header.cupsBitsPerColor >= 8)
      {
      primary = CUPS_IMAGE_WHITE;
      @@ -493,10 +494,11 @@
      }
      break;
    • default :
      case CUPS_CSPACE_RGB :
      case CUPS_CSPACE_RGBA :
      case CUPS_CSPACE_RGBW :
    • case CUPS_CSPACE_SRGB :
    • case CUPS_CSPACE_ADOBERGB :
      if (header.cupsBitsPerColor >= 8)
      {
      primary = CUPS_IMAGE_RGB;
      @@ -540,6 +542,42 @@
      primary = CUPS_IMAGE_CMY;
      secondary = CUPS_IMAGE_CMY;
      break;
    • case CUPS_CSPACE_CIEXYZ :
    • case CUPS_CSPACE_CIELab :
    • case CUPS_CSPACE_ICC1 :
    • case CUPS_CSPACE_ICC2 :
    • case CUPS_CSPACE_ICC3 :
    • case CUPS_CSPACE_ICC4 :
    • case CUPS_CSPACE_ICC5 :
    • case CUPS_CSPACE_ICC6 :
    • case CUPS_CSPACE_ICC7 :
    • case CUPS_CSPACE_ICC8 :
    • case CUPS_CSPACE_ICC9 :
    • case CUPS_CSPACE_ICCA :
    • case CUPS_CSPACE_ICCB :
    • case CUPS_CSPACE_ICCC :
    • case CUPS_CSPACE_ICCD :
    • case CUPS_CSPACE_ICCE :
    • case CUPS_CSPACE_ICCF :
    • case CUPS_CSPACE_DEVICE1 :
    • case CUPS_CSPACE_DEVICE2 :
    • case CUPS_CSPACE_DEVICE3 :
    • case CUPS_CSPACE_DEVICE4 :
    • case CUPS_CSPACE_DEVICE5 :
    • case CUPS_CSPACE_DEVICE6 :
    • case CUPS_CSPACE_DEVICE7 :
    • case CUPS_CSPACE_DEVICE8 :
    • case CUPS_CSPACE_DEVICE9 :
    • case CUPS_CSPACE_DEVICEA :
    • case CUPS_CSPACE_DEVICEB :
    • case CUPS_CSPACE_DEVICEC :
    • case CUPS_CSPACE_DEVICED :
    • case CUPS_CSPACE_DEVICEE :
    • case CUPS_CSPACE_DEVICEF :
    •    fprintf(stderr, "ERROR: Colorspace %d not supported.\n",
      
    •       header.cupsColorSpace);
      
    • exit(1);
      break;
      }

    Index: filter/raster.c

    --- filter/raster.c (revision 9144)
    +++ filter/raster.c (working copy)
    @@ -1,9 +1,9 @@
    /*

    • "$Id$"
      *
      • * Raster file routines for the Common UNIX Printing System (CUPS).
      • * Raster file routines for CUPS.
        *
      • * Copyright 2007-2008 by Apple Inc.
      • * Copyright 2007-2010 by Apple Inc.
    • Copyright 1997-2006 by Easy Software Products.
    • This file is part of the CUPS Imaging library.
      @@ -915,6 +915,7 @@
      case CUPS_CSPACE_WHITE :
      case CUPS_CSPACE_GOLD :
      case CUPS_CSPACE_SILVER :
    •  case CUPS_CSPACE_SW :
      
      r->header.cupsNumColors = 1;
      break;

    @@ -923,6 +924,8 @@
    case CUPS_CSPACE_YMC :
    case CUPS_CSPACE_CIEXYZ :
    case CUPS_CSPACE_CIELab :

    •  case CUPS_CSPACE_SRGB :
      
    •  case CUPS_CSPACE_ADOBERGB :
      
      case CUPS_CSPACE_ICC1 :
      case CUPS_CSPACE_ICC2 :
      case CUPS_CSPACE_ICC3 :
      @@ -957,6 +960,25 @@
      else
      r->header.cupsNumColors = 4;
      break;
      +
    •  case CUPS_CSPACE_DEVICE1 :
      
    •  case CUPS_CSPACE_DEVICE2 :
      
    •  case CUPS_CSPACE_DEVICE3 :
      
    •  case CUPS_CSPACE_DEVICE4 :
      
    •  case CUPS_CSPACE_DEVICE5 :
      
    •  case CUPS_CSPACE_DEVICE6 :
      
    •  case CUPS_CSPACE_DEVICE7 :
      
    •  case CUPS_CSPACE_DEVICE8 :
      
    •  case CUPS_CSPACE_DEVICE9 :
      
    •  case CUPS_CSPACE_DEVICEA :
      
    •  case CUPS_CSPACE_DEVICEB :
      
    •  case CUPS_CSPACE_DEVICEC :
      
    •  case CUPS_CSPACE_DEVICED :
      
    •  case CUPS_CSPACE_DEVICEE :
      
    •  case CUPS_CSPACE_DEVICEF :
      
    •      r->header.cupsNumColors = r->header.cupsColorSpace -
      
    •                           CUPS_CSPACE_DEVICE1 + 1;
      
    • break;
      
      }
      }
  5. added this to the Stable milestone on Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions