/* 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;
/* 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 */
{
/* 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 ?
/* Gamma values */
-double *cmGammaAdobeRgb(void)
+double *cfCmGammaAdobeRGB(void)
{
return adobergb_gamma;
}
-double *cmGammaSGray(void)
+double *cfCmGammaSGray(void)
{
return sgray_gamma;
}
/* Whitepoint values */
-double *cmWhitePointAdobeRgb(void)
+double *cfCmWhitePointAdobeRGB(void)
{
return adobergb_wp;
}
-double *cmWhitePointSGray(void)
+double *cfCmWhitePointSGray(void)
{
return sgray_wp;
}
/* Adapted primaries matrix */
-double *cmMatrixAdobeRgb(void)
+double *cfCmMatrixAdobeRGB(void)
{
return adobergb_matrix;
}
/* Blackpoint value */
-double *cmBlackPointDefault(void)
+double *cfCmBlackPointDefault(void)
{
return blackpoint_default;
}
#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;
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
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;
"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);
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 */
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...
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;
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 */
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
cmsCIExyY adobergb_wp()
{
- double * xyY = cmWhitePointAdobeRgb();
+ double * xyY = cfCmWhitePointAdobeRGB();
cmsCIExyY wp;
wp.x = xyY[0];
cmsCIExyY sgray_wp()
{
- double * xyY = cmWhitePointSGray();
+ double * xyY = cfCmWhitePointSGray();
cmsCIExyY wp;
wp.x = xyY[0];
{
cmsCIExyYTRIPLE m;
- double * matrix = cmMatrixAdobeRgb();
+ double * matrix = cfCmMatrixAdobeRGB();
m.Red.x = matrix[0];
m.Red.y = matrix[1];
}
/* 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");
}
/* 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");
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
cmsCIExyY adobergb_wp_cms()
{
- double * xyY = cmWhitePointAdobeRgb();
+ double * xyY = cfCmWhitePointAdobeRGB();
cmsCIExyY wp;
wp.x = xyY[0];
cmsCIExyY sgray_wp_cms()
{
- double * xyY = cmWhitePointSGray();
+ double * xyY = cfCmWhitePointSGray();
cmsCIExyY wp;
wp.x = xyY[0];
{
cmsCIExyYTRIPLE m;
- double * matrix = cmMatrixAdobeRgb();
+ double * matrix = cfCmMatrixAdobeRGB();
m.Red.x = matrix[0];
m.Red.y = matrix[1];
}
/* 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");
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");
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)
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 */
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 )
/* 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");
_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) {
0.0,
1.0
};
- cm_calibration_t cm_calibrate; /* Color calibration mode */
+ cf_cm_calibration_t cm_calibrate; /* Color calibration mode */
/*
* Debug info...
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)
{