const char *media, /* I - Media type */
const char *resolution, /* I - Resolution */
char *spec, /* O - Final selection string */
- int specsize) /* I - Size of string buffer */
+ int specsize, /* I - Size of string buffer */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
ppd_attr_t *attr; /* Attribute */
*/
snprintf(spec, specsize, "%s.%s.%s", colormodel, media, resolution);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
snprintf(spec, specsize, "%s.%s", colormodel, resolution);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
snprintf(spec, specsize, "%s", colormodel);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
snprintf(spec, specsize, "%s.%s", media, resolution);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
snprintf(spec, specsize, "%s", media);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
snprintf(spec, specsize, "%s", resolution);
- fprintf(stderr, "DEBUG2: Looking for \"*%s %s\"...\n", name, spec);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s %s\"...", name, spec);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
spec[0] = '\0';
- fprintf(stderr, "DEBUG2: Looking for \"*%s\"...\n", name);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Looking for \"*%s\"...", name);
if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
return (attr);
- fprintf(stderr, "DEBUG2: No instance of \"*%s\" found...\n", name);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "No instance of \"*%s\" found...", name);
return (NULL);
}
cupsCMYKLoad(ppd_file_t *ppd, /* I - PPD file */
const char *colormodel, /* I - ColorModel value */
const char *media, /* I - MediaType value */
- const char *resolution) /* I - Resolution value */
+ const char *resolution, /* I - Resolution value */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
cups_cmyk_t *cmyk; /* CMYK color separation */
char spec[PPD_MAX_NAME]; /* Profile name */
*/
if ((attr = cupsFindAttr(ppd, "cupsInkChannels", colormodel, media,
- resolution, spec, sizeof(spec))) == NULL)
+ resolution, spec, sizeof(spec), log, ld)) == NULL)
return (NULL);
num_channels = atoi(attr->value);
*/
if ((attr = cupsFindAttr(ppd, "cupsInkLimit", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
cupsCMYKSetInkLimit(cmyk, atof(attr->value));
/*
*/
if ((attr = cupsFindAttr(ppd, "cupsBlackGeneration", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &lower, &upper) == 2)
- cupsCMYKSetBlack(cmyk, lower, upper);
+ cupsCMYKSetBlack(cmyk, lower, upper, log, ld);
}
/*
if (num_channels != 3)
{
if ((attr = cupsFindAttr(ppd, "cupsBlackXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 1 :
case 2 :
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
break;
case 4 :
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsBlackGamma", colormodel,
media, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 1 :
case 2 :
- cupsCMYKSetGamma(cmyk, 0, gamval, density);
+ cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 3, gamval, density);
+ cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 5, gamval, density);
+ cupsCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 1 :
case 2 :
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
break;
case 4 :
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel,
media, resolution, spec,
- sizeof(spec))) != NULL &&
+ sizeof(spec), log, ld)) != NULL &&
num_channels != 3)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
{
case 1 :
case 2 :
- cupsCMYKSetGamma(cmyk, 0, gamval, density);
+ cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 3, gamval, density);
+ cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 5, gamval, density);
+ cupsCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
break;
}
}
*/
if ((attr = cupsFindAttr(ppd, "cupsCyanXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsCyanGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 0, gamval, density);
+ cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 0, gamval, density);
+ cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
}
/*
*/
if ((attr = cupsFindAttr(ppd, "cupsMagentaXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsMagentaGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density);
+ cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density);
+ cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density);
+ cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density);
+ cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
}
}
*/
if ((attr = cupsFindAttr(ppd, "cupsYellowXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsYellowGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density);
+ cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 4, gamval, density);
+ cupsCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density);
+ cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 4, gamval, density);
+ cupsCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
break;
}
}
if (num_channels == 2 || num_channels == 7)
{
if ((attr = cupsFindAttr(ppd, "cupsLightBlackXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
switch (num_channels)
{
case 2 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 7 :
- cupsCMYKSetCurve(cmyk, 6, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 6, num_xypoints, xypoints, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsLightBlackGamma", colormodel,
media, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
switch (num_channels)
{
case 2 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density);
+ cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 7 :
- cupsCMYKSetGamma(cmyk, 6, gamval, density);
+ cupsCMYKSetGamma(cmyk, 6, gamval, density, log, ld);
break;
}
}
else if ((attr = cupsFindAttr(ppd, "cupsBlackLtDk", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
switch (num_channels)
{
case 2 :
- cupsCMYKSetLtDk(cmyk, 0, light, dark);
+ cupsCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
break;
case 7 :
- cupsCMYKSetLtDk(cmyk, 5, light, dark);
+ cupsCMYKSetLtDk(cmyk, 5, light, dark, log, ld);
break;
}
else
- fprintf(stderr, "ERROR: Bad cupsBlackLtDk value \"%s\"!\n",
- attr->value);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsBlackLtDk value \"%s\"!",
+ attr->value);
}
else
- fprintf(stderr, "WARNING: No light black attribute found for %s!\n",
- spec);
+ if (log) log(ld, FILTER_LOGLEVEL_WARN,
+ "No light black attribute found for %s!",
+ spec);
}
if (num_channels >= 6)
*/
if ((attr = cupsFindAttr(ppd, "cupsLightCyanXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsLightCyanGamma", colormodel,
media, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 1, gamval, density);
+ cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsCyanLtDk", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
- cupsCMYKSetLtDk(cmyk, 0, light, dark);
+ cupsCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
else
- fprintf(stderr, "ERROR: Bad cupsCyanLtDk value \"%s\"!\n",
- attr->value);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsCyanLtDk value \"%s\"!",
+ attr->value);
}
else
- fprintf(stderr, "WARNING: No light cyan attribute found for %s!\n",
- spec);
+ if (log) log(ld, FILTER_LOGLEVEL_WARN,
+ "No light cyan attribute found for %s!",
+ spec);
/*
* Get the optional cupsLightMagentaXY, cupsLightMagentaGamma, or
*/
if ((attr = cupsFindAttr(ppd, "cupsLightMagentaXY", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
attr != NULL && attr->value != NULL && num_xypoints < 100;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints);
+ cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsLightMagentaGamma", colormodel,
media, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 3, gamval, density);
+ cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
}
else if ((attr = cupsFindAttr(ppd, "cupsMagentaLtDk", colormodel, media,
- resolution, spec, sizeof(spec))) != NULL)
+ resolution, spec, sizeof(spec), log, ld)) !=
+ NULL)
{
if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
- cupsCMYKSetLtDk(cmyk, 2, light, dark);
+ cupsCMYKSetLtDk(cmyk, 2, light, dark, log, ld);
else
- fprintf(stderr, "ERROR: Bad cupsMagentaLtDk value \"%s\"!\n",
- attr->value);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsMagentaLtDk value \"%s\"!",
+ attr->value);
}
else
- fprintf(stderr, "WARNING: No light magenta attribute found for %s!\n",
- spec);
+ if (log) log(ld, FILTER_LOGLEVEL_WARN,
+ "No light magenta attribute found for %s!",
+ spec);
}
/*
void
cupsCMYKSetBlack(cups_cmyk_t *cmyk, /* I - CMYK color separation */
float lower, /* I - No black ink */
- float upper) /* I - Only black ink */
+ float upper, /* I - Only black ink */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int i, /* Looping var */
delta, /* Difference between lower and upper */
cmyk->color_lut[i] = 0;
}
- fprintf(stderr, "DEBUG: cupsCMYKSetBlack(cmyk, lower=%.3f, upper=%.3f)\n", lower, upper);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "cupsCMYKSetBlack(cmyk, lower=%.3f, upper=%.3f)",
+ lower, upper);
- for (i = 0; i < 256; i += 17)
- fprintf(stderr, "DEBUG: %3d = %3dk + %3dc\n", i,
- cmyk->black_lut[i], cmyk->color_lut[i]);
+ if (log)
+ for (i = 0; i < 256; i += 17)
+ log(ld, FILTER_LOGLEVEL_DEBUG,
+ " %3d = %3dk + %3dc", i,
+ cmyk->black_lut[i], cmyk->color_lut[i]);
}
int channel, /* I - Color channel */
int num_xypoints,
/* I - Number of X,Y points */
- const float *xypoints) /* I - X,Y points */
+ const float *xypoints, /* I - X,Y points */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int i; /* Looping var */
int xstart; /* Start position */
for (i = xend; i < 256; i ++)
cmyk->channels[channel][i] = yend;
- fprintf(stderr, "DEBUG: cupsCMYKSetXY(cmyk, channel=%d, num_xypoints=%d, "
- "xypoints=[%.3f %.3f %.3f %.3f ...])\n", channel,
- num_xypoints, xypoints[0], xypoints[1], xypoints[2], xypoints[3]);
-
- for (i = 0; i < 256; i += 17)
- fprintf(stderr, "DEBUG: %3d = %4d\n", i,
- cmyk->channels[channel + 0][i]);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "cupsCMYKSetXY(cmyk, channel=%d, num_xypoints=%d, "
+ "xypoints=[%.3f %.3f %.3f %.3f ...])", channel,
+ num_xypoints, xypoints[0], xypoints[1], xypoints[2],
+ xypoints[3]);
+
+ if (log)
+ for (i = 0; i < 256; i += 17)
+ log(ld, FILTER_LOGLEVEL_DEBUG,
+ " %3d = %4d", i,
+ cmyk->channels[channel + 0][i]);
}
cupsCMYKSetGamma(cups_cmyk_t *cmyk, /* I - CMYK color separation */
int channel, /* I - Ink channel */
float gamval, /* I - Gamma correction */
- float density) /* I - Maximum density */
+ float density, /* I - Maximum density */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int i; /* Looping var */
cmyk->channels[channel][i] = (int)(density * CUPS_MAX_LUT *
pow((float)i / 255.0, gamval) + 0.5);
- fprintf(stderr, "DEBUG: cupsCMYKSetGamma(cmyk, channel=%d, gamval=%.3f, "
- "density=%.3f)\n", channel, gamval, density);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "cupsCMYKSetGamma(cmyk, channel=%d, gamval=%.3f, "
+ "density=%.3f)", channel, gamval, density);
- for (i = 0; i < 256; i += 17)
- fprintf(stderr, "DEBUG: %3d = %4d\n", i,
- cmyk->channels[channel + 0][i]);
+ if (log)
+ for (i = 0; i < 256; i += 17)
+ log(ld, FILTER_LOGLEVEL_DEBUG,
+ " %3d = %4d", i,
+ cmyk->channels[channel + 0][i]);
}
cupsCMYKSetLtDk(cups_cmyk_t *cmyk, /* I - CMYK color separation */
int channel, /* I - Dark ink channel (+1 for light) */
float light, /* I - Light ink only level */
- float dark) /* I - Dark ink only level */
+ float dark, /* I - Dark ink only level */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int i, /* Looping var */
delta, /* Difference between lower and upper */
cmyk->channels[channel + 1][i] = 0;
}
- fprintf(stderr, "DEBUG: cupsCMYKSetLtDk(cmyk, channel=%d, light=%.3f, "
- "dark=%.3f)\n", channel, light, dark);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "cupsCMYKSetLtDk(cmyk, channel=%d, light=%.3f, "
+ "dark=%.3f)", channel, light, dark);
- for (i = 0; i < 256; i += 17)
- fprintf(stderr, "DEBUG: %3d = %4dlt + %4ddk\n", i,
- cmyk->channels[channel + 0][i], cmyk->channels[channel + 1][i]);
+ if (log)
+ for (i = 0; i < 256; i += 17)
+ log(ld, FILTER_LOGLEVEL_DEBUG,
+ " %3d = %4dlt + %4ddk", i,
+ cmyk->channels[channel + 0][i], cmyk->channels[channel + 1][i]);
}
# include <stdlib.h>
# include <time.h>
# include <math.h>
+# include "filter.h"
# include <ppd/ppd.h>
# if defined(WIN32) || defined(__EMX__)
const char *colormodel,
const char *media,
const char *resolution,
- char *spec, int specsize);
+ char *spec, int specsize,
+ filter_logfunc_t log,
+ void *ld);
/*
* Byte checking functions...
* Lookup table functions for dithering...
*/
-extern cups_lut_t *cupsLutNew(int num_vals, const float *vals);
+extern cups_lut_t *cupsLutNew(int num_vals, const float *vals,
+ filter_logfunc_t log, void *ld);
extern void cupsLutDelete(cups_lut_t *lut);
extern cups_lut_t *cupsLutLoad(ppd_file_t *ppd,
const char *colormodel,
const char *media,
const char *resolution,
- const char *ink);
+ const char *ink,
+ filter_logfunc_t log,
+ void *ld);
/*
extern cups_rgb_t *cupsRGBLoad(ppd_file_t *ppd,
const char *colormodel,
const char *media,
- const char *resolution);
+ const char *resolution,
+ filter_logfunc_t log,
+ void *ld);
extern cups_rgb_t *cupsRGBNew(int num_samples, cups_sample_t *samples,
int cube_size, int num_channels);
extern cups_cmyk_t *cupsCMYKLoad(ppd_file_t *ppd,
const char *colormodel,
const char *media,
- const char *resolution);
+ const char *resolution,
+ filter_logfunc_t log,
+ void *ld);
extern void cupsCMYKSetBlack(cups_cmyk_t *cmyk,
- float lower, float upper);
+ float lower, float upper,
+ filter_logfunc_t log, void *ld);
extern void cupsCMYKSetCurve(cups_cmyk_t *cmyk, int channel,
int num_xypoints,
- const float *xypoints);
+ const float *xypoints,
+ filter_logfunc_t log, void *ld);
extern void cupsCMYKSetGamma(cups_cmyk_t *cmyk, int channel,
- float gamval, float density);
+ float gamval, float density,
+ filter_logfunc_t log, void *ld);
extern void cupsCMYKSetInkLimit(cups_cmyk_t *cmyk, float limit);
extern void cupsCMYKSetLtDk(cups_cmyk_t *cmyk, int channel,
- float light, float dark);
+ float light, float dark,
+ filter_logfunc_t log, void *ld);
/*
const char *colormodel, /* I - Color model */
const char *media, /* I - Media type */
const char *resolution, /* I - Resolution */
- const char *ink) /* I - Ink name */
+ const char *ink, /* I - Ink name */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
char name[PPD_MAX_NAME], /* Attribute name */
spec[PPD_MAX_NAME]; /* Attribute spec */
snprintf(name, sizeof(name), "cups%sDither", ink);
if ((attr = cupsFindAttr(ppd, name, colormodel, media, resolution, spec,
- sizeof(spec))) == NULL)
+ sizeof(spec), log, ld)) == NULL)
attr = cupsFindAttr(ppd, "cupsAllDither", colormodel, media,
- resolution, spec, sizeof(spec));
+ resolution, spec, sizeof(spec), log, ld);
if (!attr)
return (NULL);
vals[3] = 0.0;
nvals = sscanf(attr->value, "%f%f%f", vals + 1, vals + 2, vals + 3) + 1;
- fprintf(stderr, "DEBUG: Loaded LUT %s from PPD with values [%.3f %.3f %.3f %.3f]\n",
- name, vals[0], vals[1], vals[2], vals[3]);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "Loaded LUT %s from PPD with values [%.3f %.3f %.3f %.3f]",
+ name, vals[0], vals[1], vals[2], vals[3]);
- return (cupsLutNew(nvals, vals));
+ return (cupsLutNew(nvals, vals, log, ld));
}
cups_lut_t * /* O - New lookup table */
cupsLutNew(int num_values, /* I - Number of values */
- const float *values) /* I - Lookup table values */
+ const float *values, /* I - Lookup table values */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int pixel; /* Pixel value */
cups_lut_t *lut; /* Lookup table */
* Show the lookup table...
*/
- for (start = 0; start <= CUPS_MAX_LUT; start += CUPS_MAX_LUT / 15)
- fprintf(stderr, "DEBUG: %d = %d/%d/%d\n", start, lut[start].intensity,
- lut[start].pixel, lut[start].error);
+ if (log)
+ for (start = 0; start <= CUPS_MAX_LUT; start += CUPS_MAX_LUT / 15)
+ log(ld, FILTER_LOGLEVEL_DEBUG,
+ "%d = %d/%d/%d", start, lut[start].intensity,
+ lut[start].pixel, lut[start].error);
/*
* Return the lookup table...
cupsRGBLoad(ppd_file_t *ppd, /* I - PPD file */
const char *colormodel, /* I - Color model */
const char *media, /* I - Media type */
- const char *resolution) /* I - Resolution */
+ const char *resolution, /* I - Resolution */
+ filter_logfunc_t log, /* I - Log function */
+ void *ld) /* I - Log function data */
{
int i, /* Looping var */
cube_size, /* Size of color lookup cube */
*/
if ((attr = cupsFindAttr(ppd, "cupsRGBProfile", colormodel, media,
- resolution, spec, sizeof(spec))) == NULL)
+ resolution, spec, sizeof(spec), log, ld)) == NULL)
{
- fputs("DEBUG2: No cupsRGBProfile attribute found for the current settings!\n", stderr);
+ if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+ "No cupsRGBProfile attribute found for the current settings!");
return (NULL);
}
if (!attr->value || sscanf(attr->value, "%d%d%d", &cube_size, &num_channels,
&num_samples) != 3)
{
- fprintf(stderr, "ERROR: Bad cupsRGBProfile attribute \'%s\'!\n",
- attr->value ? attr->value : "(null)");
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsRGBProfile attribute \'%s\'!",
+ attr->value ? attr->value : "(null)");
return (NULL);
}
num_channels < 1 || num_channels > CUPS_MAX_RGB ||
num_samples != (cube_size * cube_size * cube_size))
{
- fprintf(stderr, "ERROR: Bad cupsRGBProfile attribute \'%s\'!\n",
- attr->value);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsRGBProfile attribute \'%s\'!",
+ attr->value);
return (NULL);
}
if ((samples = calloc(num_samples, sizeof(cups_sample_t))) == NULL)
{
- fputs("ERROR: Unable to allocate memory for RGB profile!\n", stderr);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Unable to allocate memory for RGB profile!");
return (NULL);
}
break;
else if (!attr->value)
{
- fputs("ERROR: Bad cupsRGBSample value!\n", stderr);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsRGBSample value!");
break;
}
else if (sscanf(attr->value, "%f%f%f%f%f%f%f", values + 0,
values + 1, values + 2, values + 3, values + 4, values + 5,
values + 6) != (3 + num_channels))
{
- fputs("ERROR: Bad cupsRGBSample value!\n", stderr);
+ if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+ "Bad cupsRGBSample value!");
break;
}
else
#include "driver.h"
#include <sys/stat.h>
+filter_logfunc_t logfunc = cups_logfunc; /* Log function */
+void *ld = NULL; /* Log function data */
void test_gray(int num_comps, const char *basename);
void test_rgb(int num_comps, const char *basename);
switch (num_comps)
{
case 2 : /* Kk */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 2, 1.0, 0.9);
- cupsCMYKSetBlack(cmyk, 0.5, 1.0);
+ cupsCMYKSetGamma(cmyk, 2, 1.0, 0.9, logfunc, ld);
+ cupsCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
break;
case 6 : /* CcMmYK */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
- cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0);
- cupsCMYKSetGamma(cmyk, 4, 1.0, 0.9);
- cupsCMYKSetBlack(cmyk, 0.5, 1.0);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetGamma(cmyk, 4, 1.0, 0.9, logfunc, ld);
+ cupsCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
break;
case 7 : /* CcMmYKk */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
- cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0);
- cupsCMYKSetGamma(cmyk, 4, 1.0, 0.9);
- cupsCMYKSetLtDk(cmyk, 5, 0.5, 1.0);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetGamma(cmyk, 4, 1.0, 0.9, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 5, 0.5, 1.0, logfunc, ld);
break;
}
cmyk = cupsCMYKNew(num_comps);
- cupsCMYKSetBlack(cmyk, 0.5, 1.0);
+ cupsCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
switch (num_comps)
{
case 2 : /* Kk */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
break;
case 6 : /* CcMmYK */
- cupsCMYKSetGamma(cmyk, 0, 1.0, 0.8);
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
- cupsCMYKSetGamma(cmyk, 2, 1.0, 0.8);
- cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0);
+ cupsCMYKSetGamma(cmyk, 0, 1.0, 0.8, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetGamma(cmyk, 2, 1.0, 0.8, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
break;
case 7 : /* CcMmYKk */
- cupsCMYKSetGamma(cmyk, 0, 1.0, 0.8);
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0);
- cupsCMYKSetGamma(cmyk, 2, 1.0, 0.8);
- cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0);
- cupsCMYKSetLtDk(cmyk, 5, 0.5, 1.0);
+ cupsCMYKSetGamma(cmyk, 0, 1.0, 0.8, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetGamma(cmyk, 2, 1.0, 0.8, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cupsCMYKSetLtDk(cmyk, 5, 0.5, 1.0, logfunc, ld);
break;
}
#include <string.h>
#include <ctype.h>
+filter_logfunc_t logfunc = cups_logfunc; /* Log function */
+void *ld = NULL; /* Log function data */
+
/*
* Local functions...
* Create the lookup table and dither state...
*/
- lut = cupsLutNew(nlutvals, lutvals);
+ lut = cupsLutNew(nlutvals, lutvals, logfunc, ld);
dither = cupsDitherNew(512);
/*
cups_dither_t *DitherStates[7]; /* Dither state tables */
int OutputFeed; /* Number of lines to skip */
int Canceled; /* Is the job canceled? */
+filter_logfunc_t logfunc; /* Log function */
+void *ld; /* Log function data */
/*
if (header->cupsColorSpace == CUPS_CSPACE_RGB ||
header->cupsColorSpace == CUPS_CSPACE_W)
- RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution);
+ RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution,
+ logfunc, ld);
else
RGB = NULL;
- CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution);
+ CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution,
+ logfunc, ld);
if (RGB)
fputs("DEBUG: Loaded RGB separation from PPD.\n", stderr);
{
case 1 : /* K */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
case 2 : /* Kk */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightBlack");
+ resolution, "LightBlack", logfunc, ld);
break;
case 3 : /* CMY */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
break;
case 4 : /* CMYK */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
case 6 : /* CcMmYK */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightCyan");
+ resolution, "LightCyan", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightMagenta");
+ resolution, "LightMagenta", logfunc, ld);
DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
case 7 : /* CcMmYKk */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightCyan");
+ resolution, "LightCyan", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightMagenta");
+ resolution, "LightMagenta", logfunc, ld);
DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
DitherLuts[6] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightBlack");
+ resolution, "LightBlack", logfunc, ld);
break;
}
DitherStates[plane] = cupsDitherNew(header->cupsWidth);
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut);
+ DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
}
if (DitherLuts[0][4095].pixel > 1)
if ((attr = cupsFindAttr(ppd, "cupsESCPDirection", colormodel,
header->MediaType, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), logfunc, ld)) != NULL)
printf("\033U%c", atoi(attr->value));
/*
if ((attr = cupsFindAttr(ppd, "cupsESCPMicroWeave", colormodel,
header->MediaType, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), logfunc, ld)) != NULL)
printf("\033(i\001%c%c", 0, atoi(attr->value));
/*
if ((attr = cupsFindAttr(ppd, "cupsESCPDotSize", colormodel,
header->MediaType, resolution, spec,
- sizeof(spec))) != NULL)
+ sizeof(spec), logfunc, ld)) != NULL)
printf("\033(e\002%c%c%c", 0, 0, atoi(attr->value));
if (ppd->model_number & ESCP_ESCK)
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+ /*
+ * Log function for the library functions, standard CUPS logging to stderr...
+ */
+
+ logfunc = cups_logfunc;
+ ld = NULL;
+
/*
* Make sure status messages are not buffered...
*/
{ 5, 0, 1, 2, 3, 4, 6 } /* KCMYcmk */
};
int Canceled; /* Is the job canceled? */
+filter_logfunc_t logfunc; /* Log function */
+void *ld; /* Log function data */
/*
{
if (header->cupsColorSpace == CUPS_CSPACE_RGB ||
header->cupsColorSpace == CUPS_CSPACE_W)
- RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution);
+ RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution,
+ logfunc, ld);
- CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution);
+ CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution,
+ logfunc, ld);
}
if (RGB)
{
case 1 : /* K */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
case 3 : /* CMY */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
break;
case 4 : /* CMYK */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
case 6 : /* CcMmYK */
DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Cyan");
+ resolution, "Cyan", logfunc, ld);
DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightCyan");
+ resolution, "LightCyan", logfunc, ld);
DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Magenta");
+ resolution, "Magenta", logfunc, ld);
DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "LightMagenta");
+ resolution, "LightMagenta", logfunc, ld);
DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Yellow");
+ resolution, "Yellow", logfunc, ld);
DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
- resolution, "Black");
+ resolution, "Black", logfunc, ld);
break;
}
for (plane = 0; plane < PrinterPlanes; plane ++)
{
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut);
+ DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
if (DitherLuts[plane][4095].pixel > 1)
DotBits[plane] = 2;
DitherStates[plane] = cupsDitherNew(header->cupsWidth);
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut);
+ DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
}
}
if (ppd && ((attr = cupsFindAttr(ppd, "cupsPCLQuality", colormodel,
header->MediaType, resolution, spec,
- sizeof(spec))) != NULL))
+ sizeof(spec), logfunc, ld)) != NULL))
{
/*
* Set the print quality...
if (ppd && ((attr = cupsFindAttr(ppd, "cupsPCLCRDMode", colormodel,
header->MediaType, resolution, spec,
- sizeof(spec))) != NULL))
+ sizeof(spec), logfunc, ld)) != NULL))
i = atoi(attr->value);
else
i = 31;
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+ /*
+ * Log function for the library functions, standard CUPS logging to stderr...
+ */
+
+ logfunc = cups_logfunc;
+ ld = NULL;
+
/*
* Make sure status messages are not buffered...
*/