]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Rename API functions of colormanager.h to "cf..."
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 6 Apr 2022 11:18:16 +0000 (13:18 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 6 Apr 2022 11:18:16 +0000 (13:18 +0200)
Also renamed constants to start with "CF_" and data types to start
with "cf_".

cupsfilters/colormanager.c
cupsfilters/colormanager.h
cupsfilters/ghostscript.c
cupsfilters/imagetoraster.c
cupsfilters/mupdftopwg.c
cupsfilters/pdftoraster.cxx
cupsfilters/pwgtoraster.c
cupsfilters/rastertopdf.cpp
filter/foomatic-rip/foomaticrip.c
filter/rastertopclx.c

index 49505f0c98ceeb66a122f9636ebce6f145fe9614..b01eacbae790f14eb9fe3b94fd060d33447c582c 100644 (file)
@@ -67,7 +67,7 @@ double    blackpoint_default[3] = {0.0, 0.0, 0.0};
 
 /* Get printer color management status from the system's color manager */
 int          
-cmIsPrinterCmDisabled(filter_data_t *data)
+cfCmIsPrinterCmDisabled(filter_data_t *data)
 {
     filter_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
@@ -88,7 +88,7 @@ cmIsPrinterCmDisabled(filter_data_t *data)
 
 /* Get printer ICC profile from the system's color manager */
 int 
-cmGetPrinterIccProfile(filter_data_t *data,
+cfCmGetPrinterIccProfile(filter_data_t *data,
                        char **icc_profile,        /* ICC Profile Path */
                        ppd_file_t *ppd)           /* Optional PPD file for fallback profile */
 {
@@ -109,22 +109,22 @@ cmGetPrinterIccProfile(filter_data_t *data,
 
 
 /* Find the "cm-calibration" CUPS option */
-cm_calibration_t    
-cmGetCupsColorCalibrateMode(filter_data_t *data,
+cf_cm_calibration_t    
+cfCmGetCupsColorCalibrateMode(filter_data_t *data,
                            cups_option_t *options,    /* Options from CUPS */
                             int num_options)           /* Options from CUPS */
 {
 
     filter_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
-    cm_calibration_t status;     /* color management status */
+    cf_cm_calibration_t status;     /* color management status */
 
 
     /* Find the string in CUPS options and */
-    if (cupsGetOption(CM_CALIBRATION_STRING, num_options, options) != NULL)
-      status = CM_CALIBRATION_ENABLED;
+    if (cupsGetOption(CF_CM_CALIBRATION_STRING, num_options, options) != NULL)
+      status = CF_CM_CALIBRATION_ENABLED;
     else
-      status = CM_CALIBRATION_DISABLED;
+      status = CF_CM_CALIBRATION_DISABLED;
 
     if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
                "Color Manager: %s", status ?
@@ -140,11 +140,11 @@ cmGetCupsColorCalibrateMode(filter_data_t *data,
 
 /* Gamma values */
 
-double *cmGammaAdobeRgb(void)
+double *cfCmGammaAdobeRGB(void)
 {
     return adobergb_gamma;
 }
-double *cmGammaSGray(void)
+double *cfCmGammaSGray(void)
 {
     return sgray_gamma;
 }
@@ -152,11 +152,11 @@ double *cmGammaSGray(void)
 
 /* Whitepoint values */
 
-double *cmWhitePointAdobeRgb(void)
+double *cfCmWhitePointAdobeRGB(void)
 {
     return adobergb_wp;
 }
-double *cmWhitePointSGray(void)
+double *cfCmWhitePointSGray(void)
 {
     return sgray_wp;
 }
@@ -164,7 +164,7 @@ double *cmWhitePointSGray(void)
 
 /* Adapted primaries matrix */
 
-double *cmMatrixAdobeRgb(void)
+double *cfCmMatrixAdobeRGB(void)
 {
     return adobergb_matrix;
 }
@@ -172,7 +172,7 @@ double *cmMatrixAdobeRgb(void)
 
 /* Blackpoint value */
 
-double *cmBlackPointDefault(void)
+double *cfCmBlackPointDefault(void)
 {
     return blackpoint_default;
 }
index a43a317f896b0b152b73585a932d5624b5f656f1..c8f05812f009f77738b78259a5b1bc66b89ee480 100644 (file)
@@ -42,15 +42,17 @@ extern "C" {
 #include <cupsfilters/filter.h>
 
 
-#define CM_CALIBRATION_STRING "cm-calibration"       /* String for "Color Calibration Mode" */
+#define CF_CM_CALIBRATION_STRING "cm-calibration"  /* String for "Color
+                                                     Calibration Mode" */
 
 
 /* Enum for status of CUPS color calibration */
-typedef enum cm_calibration_e
+typedef enum cf_cm_calibration_e
 { 
-  CM_CALIBRATION_DISABLED = 0,                       /* "cm-calibration" option not found */
-  CM_CALIBRATION_ENABLED = 1                         /* "cm-calibration" found */
-} cm_calibration_t;
+  CF_CM_CALIBRATION_DISABLED = 0,                  /* "cm-calibration" option
+                                                     not found */
+  CF_CM_CALIBRATION_ENABLED = 1                    /* "cm-calibration" found */
+} cf_cm_calibration_t;
 
 
 
@@ -60,25 +62,24 @@ typedef enum cm_calibration_e
 
 
 extern 
-cm_calibration_t    cmGetCupsColorCalibrateMode       (filter_data_t *data,
-                                                      cups_option_t *options,
-                                                       int num_options);
+cf_cm_calibration_t cfCmGetCupsColorCalibrateMode(filter_data_t *data,
+                                                 cups_option_t *options,
+                                                 int num_options);
 
-extern int          cmGetPrinterIccProfile            (filter_data_t *data,
-                                                       char **icc_profile,
-                                                       ppd_file_t *ppd);
+extern int cfCmGetPrinterIccProfile(filter_data_t *data,
+                                   char **icc_profile,
+                                   ppd_file_t *ppd);
 
-extern int          cmIsPrinterCmDisabled             (filter_data_t *data);
+extern int cfCmIsPrinterCmDisabled(filter_data_t *data);
 
-extern double*      cmGammaAdobeRgb                   (void);
-extern double*      cmGammaSGray                      (void);
+extern double* cfCmGammaAdobeRGB(void);
+extern double* cfCmGammaSGray(void);
 
-extern double*      cmWhitePointAdobeRgb              (void);
-extern double*      cmWhitePointSGray                 (void);
-
-extern double*      cmMatrixAdobeRgb                  (void);
-extern double*      cmBlackPointDefault               (void);
+extern double* cfCmWhitePointAdobeRGB(void);
+extern double* cfCmWhitePointSGray(void);
 
+extern double* cfCmMatrixAdobeRGB(void);
+extern double* cfCmBlackPointDefault(void);
 
 
 #  ifdef __cplusplus
index 4fe19b5a1138be25cafeafb27de982f25d332be3..973a62501164725c51cf03c59f55815adef7bcc1 100644 (file)
@@ -718,7 +718,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
   ipp_t *printer_attrs = data->printer_attrs;
   ipp_t *job_attrs = data->job_attrs;
   struct sigaction sa;
-  cm_calibration_t cm_calibrate;
+  cf_cm_calibration_t cm_calibrate;
   int pxlcolor = 0; /* 1 if printer is color printer otherwise 0. */
   ppd_attr_t *attr;
   ipp_attribute_t *ipp_attr;
@@ -982,15 +982,15 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
              "Print rendering intent = %s", h.cupsRenderingIntent);
 
   /*  Check status of color management in CUPS */
-  cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+  cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-  if (cm_calibrate == CM_CALIBRATION_ENABLED)
+  if (cm_calibrate == CF_CM_CALIBRATION_ENABLED)
     cm_disabled = 1;
   else 
-    cm_disabled = cmIsPrinterCmDisabled(data);
+    cm_disabled = cfCmIsPrinterCmDisabled(data);
 
   if (!cm_disabled)
-    cmGetPrinterIccProfile(data, &icc_profile, ppd);
+    cfCmGetPrinterIccProfile(data, &icc_profile, ppd);
 
   /* Ghostscript parameters */
   gs_args = cupsArrayNew(NULL, NULL);
index 84fa7d6ac1ddbb12c60b7e28d0ea03bd8d0549ef..fb02dd56900048881b7f4775c7b456505daf825b 100644 (file)
@@ -247,7 +247,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   int                   fd;            /* File descriptor for temp file */
   char                  buf[BUFSIZ];
   int                   bytes;
-  cm_calibration_t      cm_calibrate;   /* Are we color calibrating the
+  cf_cm_calibration_t      cm_calibrate;   /* Are we color calibrating the
                                           device? */
   int                   cm_disabled;    /* Color management disabled? */
   int                   fillprint = 0; /* print-scaling = fill */
@@ -669,12 +669,12 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Resolution = %s", resolution);
 
   /* support the "cm-calibration" option */
-  cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+  cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-  if (cm_calibrate == CM_CALIBRATION_ENABLED)
+  if (cm_calibrate == CF_CM_CALIBRATION_ENABLED)
     cm_disabled = 1;
   else
-    cm_disabled = cmIsPrinterCmDisabled(data);
+    cm_disabled = cfCmIsPrinterCmDisabled(data);
 
  /*
   * Choose the appropriate colorspace...
index 899a223607715a0173d1bcc00565abde9d414895..68e75a71526686ff437510286707c52e024dc248 100644 (file)
@@ -411,7 +411,7 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
   int status = 1;
   ppd_file_t *ppd = NULL;
   struct sigaction sa;
-  cm_calibration_t cm_calibrate;
+  cf_cm_calibration_t cm_calibrate;
   filter_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
@@ -496,15 +496,15 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
     goto out;
 
   /*  Check status of color management in CUPS */
-  cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+  cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-  if (cm_calibrate == CM_CALIBRATION_ENABLED)
+  if (cm_calibrate == CF_CM_CALIBRATION_ENABLED)
     cm_disabled = 1;
   else 
-    cm_disabled = cmIsPrinterCmDisabled(data);
+    cm_disabled = cfCmIsPrinterCmDisabled(data);
 
   if (!cm_disabled)
-    cmGetPrinterIccProfile(data, &icc_profile, ppd);
+    cfCmGetPrinterIccProfile(data, &icc_profile, ppd);
 
 /*  Find print-rendering-intent */
 
index 9aeef8fad9d9c500c4287fd32eaa70770502b1ed..33c98fd5d252fc0e741380fac3885ac614a77ba4 100644 (file)
@@ -107,7 +107,7 @@ typedef struct cms_profile_s
   cmsCIEXYZ D65WhitePoint;
   int renderingIntent = INTENT_PERCEPTUAL;
   int cm_disabled = 0;
-  cm_calibration_t cm_calibrate;
+  cf_cm_calibration_t cm_calibrate;
 } cms_profile_t;
 
 typedef struct pdftoraster_doc_s
@@ -163,7 +163,7 @@ typedef struct conversion_function_s
 
 cmsCIExyY adobergb_wp()
 {
-    double * xyY = cmWhitePointAdobeRgb();
+    double * xyY = cfCmWhitePointAdobeRGB();
     cmsCIExyY wp;
 
     wp.x = xyY[0];
@@ -175,7 +175,7 @@ cmsCIExyY adobergb_wp()
 
 cmsCIExyY sgray_wp()
 {
-    double * xyY = cmWhitePointSGray();
+    double * xyY = cfCmWhitePointSGray();
     cmsCIExyY wp;
 
     wp.x = xyY[0];
@@ -189,7 +189,7 @@ cmsCIExyYTRIPLE adobergb_matrix()
 {
     cmsCIExyYTRIPLE m;
 
-    double * matrix = cmMatrixAdobeRgb();
+    double * matrix = cfCmMatrixAdobeRGB();
 
     m.Red.x = matrix[0];
     m.Red.y = matrix[1];
@@ -423,15 +423,15 @@ static int parseOpts(filter_data_t *data,
     }
 
     /* support the CUPS "cm-calibration" option */
-    doc->colour_profile.cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+    doc->colour_profile.cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-    if (doc->colour_profile.cm_calibrate == CM_CALIBRATION_ENABLED)
+    if (doc->colour_profile.cm_calibrate == CF_CM_CALIBRATION_ENABLED)
       doc->colour_profile.cm_disabled = 1;
     else
-      doc->colour_profile.cm_disabled = cmIsPrinterCmDisabled(data);
+      doc->colour_profile.cm_disabled = cfCmIsPrinterCmDisabled(data);
 
     if (!doc->colour_profile.cm_disabled)
-      cmGetPrinterIccProfile(data, &profile, doc->ppd);
+      cfCmGetPrinterIccProfile(data, &profile, doc->ppd);
 
     if (profile != NULL) {
       doc->colour_profile.colorProfile = cmsOpenProfileFromFile(profile,"r");
@@ -502,15 +502,15 @@ static int parseOpts(filter_data_t *data,
     }
 
     /* support the CUPS "cm-calibration" option */
-    doc->colour_profile.cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+    doc->colour_profile.cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-    if (doc->colour_profile.cm_calibrate == CM_CALIBRATION_ENABLED)
+    if (doc->colour_profile.cm_calibrate == CF_CM_CALIBRATION_ENABLED)
       doc->colour_profile.cm_disabled = 1;
     else
-      doc->colour_profile.cm_disabled = cmIsPrinterCmDisabled(data);
+      doc->colour_profile.cm_disabled = cfCmIsPrinterCmDisabled(data);
 
     if (!doc->colour_profile.cm_disabled)
-      cmGetPrinterIccProfile(data, &profile, doc->ppd);
+      cfCmGetPrinterIccProfile(data, &profile, doc->ppd);
 
     if (profile != NULL) {
       doc->colour_profile.colorProfile = cmsOpenProfileFromFile(profile,"r");
index 21c1296ab0d680eee5d4d05a608e0d350d06bc38..833b4f790ba6970a5c1b649ef56dffd54c32d1b4 100644 (file)
@@ -99,7 +99,7 @@ typedef struct cms_profile_s
   cmsCIEXYZ D65WhitePoint;
   int renderingIntent;
   int cm_disabled;
-  cm_calibration_t cm_calibrate;
+  cf_cm_calibration_t cm_calibrate;
 } cms_profile_t;
 
 typedef struct pwgtoraster_doc_s
@@ -153,7 +153,7 @@ typedef struct conversion_function_s
 
 cmsCIExyY adobergb_wp_cms()
 {
-    double * xyY = cmWhitePointAdobeRgb();
+    double * xyY = cfCmWhitePointAdobeRGB();
     cmsCIExyY wp;
 
     wp.x = xyY[0];
@@ -165,7 +165,7 @@ cmsCIExyY adobergb_wp_cms()
 
 cmsCIExyY sgray_wp_cms()
 {
-    double * xyY = cmWhitePointSGray();
+    double * xyY = cfCmWhitePointSGray();
     cmsCIExyY wp;
 
     wp.x = xyY[0];
@@ -179,7 +179,7 @@ cmsCIExyYTRIPLE adobergb_matrix_cms()
 {
     cmsCIExyYTRIPLE m;
 
-    double * matrix = cmMatrixAdobeRgb();
+    double * matrix = cfCmMatrixAdobeRGB();
 
     m.Red.x = matrix[0];
     m.Red.y = matrix[1];
@@ -382,15 +382,15 @@ static int parseOpts(filter_data_t *data,
     }
 
     /* support the CUPS "cm-calibration" option */
-    doc->color_profile.cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+    doc->color_profile.cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-    if (doc->color_profile.cm_calibrate == CM_CALIBRATION_ENABLED)
+    if (doc->color_profile.cm_calibrate == CF_CM_CALIBRATION_ENABLED)
       doc->color_profile.cm_disabled = 1;
     else
-      doc->color_profile.cm_disabled = cmIsPrinterCmDisabled(data);
+      doc->color_profile.cm_disabled = cfCmIsPrinterCmDisabled(data);
 
     if (!doc->color_profile.cm_disabled)
-      cmGetPrinterIccProfile(data, &profile, doc->ppd);
+      cfCmGetPrinterIccProfile(data, &profile, doc->ppd);
 
     if (profile != NULL) {
       doc->color_profile.colorProfile = cmsOpenProfileFromFile(profile,"r");
index 230e76bd6237f9ee8ed91af02a947a73ffe4614f..7af7905ddeacfe52bf3d12f01fbb5b6cfda26f47 100644 (file)
@@ -775,12 +775,12 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
                 break;
             case CUPS_CSPACE_SW:
                 if (use_blackpoint)
-                  dict["/ColorSpace"]=getCalGrayArray(cmWhitePointSGray(),
-                                                     cmGammaSGray(), 
-                                                      cmBlackPointDefault());
+                  dict["/ColorSpace"]=getCalGrayArray(cfCmWhitePointSGray(),
+                                                     cfCmGammaSGray(), 
+                                                      cfCmBlackPointDefault());
                 else
-                  dict["/ColorSpace"]=getCalGrayArray(cmWhitePointSGray(),
-                                                     cmGammaSGray(), 0);
+                  dict["/ColorSpace"]=getCalGrayArray(cfCmWhitePointSGray(),
+                                                     cfCmGammaSGray(), 0);
                 break;
             case CUPS_CSPACE_CMYK:
                 dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceCMYK");
@@ -797,14 +797,14 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
                 break;
             case CUPS_CSPACE_ADOBERGB:
                 if (use_blackpoint)
-                  dict["/ColorSpace"]=getCalRGBArray(cmWhitePointAdobeRgb(),
-                                                    cmGammaAdobeRgb(), 
-                                                    cmMatrixAdobeRgb(),
-                                                    cmBlackPointDefault());
+                  dict["/ColorSpace"]=getCalRGBArray(cfCmWhitePointAdobeRGB(),
+                                                    cfCmGammaAdobeRGB(), 
+                                                    cfCmMatrixAdobeRGB(),
+                                                    cfCmBlackPointDefault());
                 else
-                  dict["/ColorSpace"]=getCalRGBArray(cmWhitePointAdobeRgb(), 
-                                                     cmGammaAdobeRgb(),
-                                                    cmMatrixAdobeRgb(), 0);
+                  dict["/ColorSpace"]=getCalRGBArray(cfCmWhitePointAdobeRGB(), 
+                                                     cfCmGammaAdobeRGB(),
+                                                    cfCmMatrixAdobeRGB(), 0);
                 break;
             default:
                 if (doc->logfunc)
@@ -1386,7 +1386,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   FILE          *outputfp;              /* Output data stream */
   filter_out_format_t outformat; /* Output format */
   int Page, empty = 1;
-  cm_calibration_t    cm_calibrate;   /* Status of CUPS color management
+  cf_cm_calibration_t    cm_calibrate;   /* Status of CUPS color management
                                         ("on" or "off") */
   struct pdf_info pdf;
   cups_raster_t        *ras;           /* Raster stream for printing */
@@ -1442,13 +1442,13 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   doc.iscanceleddata = icd;
 
   /* support the CUPS "cm-calibration" option */ 
-  cm_calibrate = cmGetCupsColorCalibrateMode(data, data->options, data->num_options);
+  cm_calibrate = cfCmGetCupsColorCalibrateMode(data, data->options, data->num_options);
 
   if (outformat == OUTPUT_FORMAT_PCLM ||
-      cm_calibrate == CM_CALIBRATION_ENABLED)
+      cm_calibrate == CF_CM_CALIBRATION_ENABLED)
     doc.cm_disabled = 1;
   else
-    doc.cm_disabled = cmIsPrinterCmDisabled(data);
+    doc.cm_disabled = cfCmIsPrinterCmDisabled(data);
 
   if (outformat == OUTPUT_FORMAT_PCLM && data->ppd == NULL
         && printer_attrs == NULL )
index a03c83726c856199df7999b463abf71597daa96a..b1de607cfceb317f34e332f0a490eb3c3168732c 100644 (file)
@@ -916,7 +916,7 @@ int main(int argc, char** argv)
 
     /* Check status of printer color management from the color manager */
     data->printer = job->printer;
-    cm_disabled = cmIsPrinterCmDisabled(data);
+    cm_disabled = cfCmIsPrinterCmDisabled(data);
 
     _log("'CM Color Calibration' Mode in SPOOLER-LESS: %s\n", cm_calibrate ? 
          "Activated" : "Off");
@@ -1042,7 +1042,7 @@ int main(int argc, char** argv)
                   _log("INFO: Using qualifer: '%s.%s.%s'\n",
                         qualifier[0], qualifier[1], qualifier[2]);
 
-                  cmGetPrinterIccProfile(data, (char **)&icc_profile, 0);
+                  cfCmGetPrinterIccProfile(data, (char **)&icc_profile, 0);
 
                   /* fall back to PPD */
                   if (icc_profile == NULL) {
index 8dbab3ec80892a5afeb6734da4f304a6105cd1f4..43f41f8dc98496b1d7b03a26e4964260ad84077f 100644 (file)
@@ -135,7 +135,7 @@ StartPage(filter_data_t      *data, /* I - filter data */
                  0.0,
                  1.0
                };
-  cm_calibration_t cm_calibrate;       /* Color calibration mode */
+  cf_cm_calibration_t cm_calibrate;    /* Color calibration mode */
 
  /*
   * Debug info...
@@ -347,12 +347,12 @@ StartPage(filter_data_t      *data,       /* I - filter data */
     fprintf(stderr, "DEBUG: Resolution = %s\n", resolution);
 
     /* support the "cm-calibration" option */
-    cm_calibrate = cmGetCupsColorCalibrateMode(data, options, num_options);
+    cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
 
-    if (cm_calibrate == CM_CALIBRATION_ENABLED)
+    if (cm_calibrate == CF_CM_CALIBRATION_ENABLED)
       cm_disabled = 1;
     else
-      cm_disabled = cmIsPrinterCmDisabled(data);
+      cm_disabled = cfCmIsPrinterCmDisabled(data);
 
     if (ppd && !cm_disabled)
     {