*
* Contents:
*
- * cupsFindAttr() - Find a PPD attribute based on the colormodel,
+ * cfFindAttr() - Find a PPD attribute based on the colormodel,
* media, and resolution.
*/
/*
- * 'cupsFindAttr()' - Find a PPD attribute based on the colormodel,
+ * 'cfFindAttr()' - Find a PPD attribute based on the colormodel,
* media, and resolution.
*/
ppd_attr_t * /* O - Matching attribute or NULL */
-cupsFindAttr(ppd_file_t *ppd, /* I - PPD file */
+cfFindAttr(ppd_file_t *ppd, /* I - PPD file */
const char *name, /* I - Attribute name */
const char *colormodel, /* I - Color model */
const char *media, /* I - Media type */
*
* Contents:
*
- * cupsCheckBytes() - Check to see if all bytes are zero.
- * cupsCheckValue() - Check to see if all bytes match the given value.
+ * cfCheckBytes() - Check to see if all bytes are zero.
+ * cfCheckValue() - Check to see if all bytes match the given value.
*/
/*
/*
- * 'cupsCheckBytes()' - Check to see if all bytes are zero.
+ * 'cfCheckBytes()' - Check to see if all bytes are zero.
*/
int /* O - 1 if they match */
-cupsCheckBytes(const unsigned char *bytes, /* I - Bytes to check */
+cfCheckBytes(const unsigned char *bytes, /* I - Bytes to check */
int length) /* I - Number of bytes to check */
{
while (length > 7)
/*
- * 'cupsCheckValue()' - Check to see if all bytes match the given value.
+ * 'cfCheckValue()' - Check to see if all bytes match the given value.
*/
int /* O - 1 if they match */
-cupsCheckValue(const unsigned char *bytes, /* I - Bytes to check */
+cfCheckValue(const unsigned char *bytes, /* I - Bytes to check */
int length, /* I - Number of bytes to check */
const unsigned char value) /* I - Value to check */
{
*
* Contents:
*
- * cupsCMYKDelete() - Delete a color separation.
- * cupsCMYKDoBlack() - Do a black separation...
- * cupsCMYKDoCMYK() - Do a CMYK separation...
- * cupsCMYKDoGray() - Do a grayscale separation...
- * cupsCMYKDoRGB() - Do an sRGB separation...
- * cupsCMYKLoad() - Load a CMYK color profile from PPD attributes.
- * cupsCMYKNew() - Create a new CMYK color separation.
- * cupsCMYKSetBlack() - Set the transition range for CMY to black.
- * cupsCMYKSetCurve() - Set a color transform curve using points.
- * cupsCMYKSetGamma() - Set a color transform curve using gamma and
+ * cfCMYKDelete() - Delete a color separation.
+ * cfCMYKDoBlack() - Do a black separation...
+ * cfCMYKDoCMYK() - Do a CMYK separation...
+ * cfCMYKDoGray() - Do a grayscale separation...
+ * cfCMYKDoRGB() - Do an sRGB separation...
+ * cfCMYKLoad() - Load a CMYK color profile from PPD attributes.
+ * cfCMYKNew() - Create a new CMYK color separation.
+ * cfCMYKSetBlack() - Set the transition range for CMY to black.
+ * cfCMYKSetCurve() - Set a color transform curve using points.
+ * cfCMYKSetGamma() - Set a color transform curve using gamma and
* density.
- * cupsCMYKSetInkLimit() - Set the limit on the amount of ink.
- * cupsCMYKSetLtDk() - Set light/dark ink transforms.
+ * cfCMYKSetInkLimit() - Set the limit on the amount of ink.
+ * cfCMYKSetLtDk() - Set light/dark ink transforms.
*/
/*
/*
- * 'cupsCMYKDelete()' - Delete a color separation.
+ * 'cfCMYKDelete()' - Delete a color separation.
*/
void
-cupsCMYKDelete(cups_cmyk_t *cmyk) /* I - Color separation */
+cfCMYKDelete(cf_cmyk_t *cmyk) /* I - Color separation */
{
/*
* Range check input...
/*
- * 'cupsCMYKDoBlack()' - Do a black separation...
+ * 'cfCMYKDoBlack()' - Do a black separation...
*/
void
-cupsCMYKDoBlack(const cups_cmyk_t *cmyk,
+cfCMYKDoBlack(const cf_cmyk_t *cmyk,
/* I - Color separation */
const unsigned char *input,
/* I - Input grayscale pixels */
/*
- * 'cupsCMYKDoCMYK()' - Do a CMYK separation...
+ * 'cfCMYKDoCMYK()' - Do a CMYK separation...
*/
void
-cupsCMYKDoCMYK(const cups_cmyk_t *cmyk,
+cfCMYKDoCMYK(const cf_cmyk_t *cmyk,
/* I - Color separation */
const unsigned char *input,
/* I - Input grayscale pixels */
/*
- * 'cupsCMYKDoGray()' - Do a grayscale separation...
+ * 'cfCMYKDoGray()' - Do a grayscale separation...
*/
void
-cupsCMYKDoGray(const cups_cmyk_t *cmyk,
+cfCMYKDoGray(const cf_cmyk_t *cmyk,
/* I - Color separation */
const unsigned char *input,
/* I - Input grayscale pixels */
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
*output++ = channels[0][k];
num_pixels --;
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
output[0] = channels[0][k];
output[1] = channels[1][k];
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
output[0] = channels[0][k];
output[1] = channels[1][k];
output[2] = channels[2][k];
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
kc = cmyk->color_lut[k];
k = cmyk->black_lut[k];
output[0] = channels[0][kc];
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
kc = cmyk->color_lut[k];
k = cmyk->black_lut[k];
output[0] = channels[0][kc];
* channel values...
*/
- k = cups_scmy_lut[*input++];
+ k = cf_scmy_lut[*input++];
kc = cmyk->color_lut[k];
k = cmyk->black_lut[k];
output[0] = channels[0][kc];
/*
- * 'cupsCMYKDoRGB()' - Do an sRGB separation...
+ * 'cfCMYKDoRGB()' - Do an sRGB separation...
*/
void
-cupsCMYKDoRGB(const cups_cmyk_t *cmyk,
+cfCMYKDoRGB(const cf_cmyk_t *cmyk,
/* I - Color separation */
const unsigned char *input,
/* I - Input grayscale pixels */
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
k = (c * 31 + m * 61 + y * 8) / 100;
*output++ = channels[0][k];
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
k = (c * 31 + m * 61 + y * 8) / 100;
output[0] = channels[0][k];
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
output[0] = channels[0][c];
output[1] = channels[1][m];
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
k = min(c, min(m, y));
if ((km = max(c, max(m, y))) > k)
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
k = min(c, min(m, y));
if ((km = max(c, max(m, y))) > k)
* channel values...
*/
- c = cups_scmy_lut[*input++];
- m = cups_scmy_lut[*input++];
- y = cups_scmy_lut[*input++];
+ c = cf_scmy_lut[*input++];
+ m = cf_scmy_lut[*input++];
+ y = cf_scmy_lut[*input++];
k = min(c, min(m, y));
if ((km = max(c, max(m, y))) > k)
/*
- * 'cupsCMYKLoad()' - Load a CMYK color profile from PPD attributes.
+ * 'cfCMYKLoad()' - Load a CMYK color profile from PPD attributes.
*/
-cups_cmyk_t * /* O - CMYK color separation */
-cupsCMYKLoad(ppd_file_t *ppd, /* I - PPD file */
+cf_cmyk_t * /* O - CMYK color separation */
+cfCMYKLoad(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 */
filter_logfunc_t log, /* I - Log function */
void *ld) /* I - Log function data */
{
- cups_cmyk_t *cmyk; /* CMYK color separation */
+ cf_cmyk_t *cmyk; /* CMYK color separation */
char spec[PPD_MAX_NAME]; /* Profile name */
ppd_attr_t *attr; /* Attribute from PPD file */
int num_channels; /* Number of color components */
* Get the required cupsInkChannels attribute...
*/
- if ((attr = cupsFindAttr(ppd, "cupsInkChannels", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsInkChannels", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) == NULL)
return (NULL);
if (num_channels < 1 || num_channels > 7 || num_channels == 5)
return (NULL);
- if ((cmyk = cupsCMYKNew(num_channels)) == NULL)
+ if ((cmyk = cfCMYKNew(num_channels)) == NULL)
return (NULL);
/*
* Get the optional cupsInkLimit attribute...
*/
- if ((attr = cupsFindAttr(ppd, "cupsInkLimit", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsInkLimit", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
- cupsCMYKSetInkLimit(cmyk, atof(attr->value));
+ cfCMYKSetInkLimit(cmyk, atof(attr->value));
/*
* Get the optional cupsBlackGeneration attribute...
*/
- if ((attr = cupsFindAttr(ppd, "cupsBlackGeneration", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsBlackGeneration", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &lower, &upper) == 2)
- cupsCMYKSetBlack(cmyk, lower, upper, log, ld);
+ cfCMYKSetBlack(cmyk, lower, upper, log, ld);
}
/*
if (num_channels != 3)
{
- if ((attr = cupsFindAttr(ppd, "cupsBlackXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsBlackXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
{
case 1 :
case 2 :
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
break;
case 4 :
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsBlackGamma", colormodel,
+ else if ((attr = cfFindAttr(ppd, "cupsBlackGamma", colormodel,
media, resolution, spec,
sizeof(spec), log, ld)) != NULL)
{
{
case 1 :
case 2 :
- cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 1 :
case 2 :
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
break;
case 4 :
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 5, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel,
+ else if ((attr = cfFindAttr(ppd, "cupsAllGamma", colormodel,
media, resolution, spec,
sizeof(spec), log, ld)) != NULL &&
num_channels != 3)
{
case 1 :
case 2 :
- cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 5, gamval, density, log, ld);
break;
}
}
* Get the optional cupsCyanXY or cupsCyanGamma attributes...
*/
- if ((attr = cupsFindAttr(ppd, "cupsCyanXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsCyanXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsCyanGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsCyanGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 0, num_xypoints, xypoints, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
}
/*
* Get the optional cupsMagentaXY or cupsMagentaGamma attributes...
*/
- if ((attr = cupsFindAttr(ppd, "cupsMagentaXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsMagentaXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsMagentaGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsMagentaGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
}
}
* Get the optional cupsYellowXY or cupsYellowGamma attributes...
*/
- if ((attr = cupsFindAttr(ppd, "cupsYellowXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsYellowXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsYellowGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsYellowGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllXY", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 2, num_xypoints, xypoints, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 4, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsAllGamma", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsAllGamma", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
{
case 3 :
case 4 :
- cupsCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 2, gamval, density, log, ld);
break;
case 6 :
case 7 :
- cupsCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 4, gamval, density, log, ld);
break;
}
}
if (num_channels == 2 || num_channels == 7)
{
- if ((attr = cupsFindAttr(ppd, "cupsLightBlackXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsLightBlackXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
switch (num_channels)
{
case 2 :
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
break;
case 7 :
- cupsCMYKSetCurve(cmyk, 6, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 6, num_xypoints, xypoints, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsLightBlackGamma", colormodel,
+ else if ((attr = cfFindAttr(ppd, "cupsLightBlackGamma", colormodel,
media, resolution, spec,
sizeof(spec), log, ld)) != NULL)
{
switch (num_channels)
{
case 2 :
- cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
break;
case 7 :
- cupsCMYKSetGamma(cmyk, 6, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 6, gamval, density, log, ld);
break;
}
}
- else if ((attr = cupsFindAttr(ppd, "cupsBlackLtDk", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsBlackLtDk", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
switch (num_channels)
{
case 2 :
- cupsCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
+ cfCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
break;
case 7 :
- cupsCMYKSetLtDk(cmyk, 5, light, dark, log, ld);
+ cfCMYKSetLtDk(cmyk, 5, light, dark, log, ld);
break;
}
else
* cupsCyanLtDk attributes...
*/
- if ((attr = cupsFindAttr(ppd, "cupsLightCyanXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsLightCyanXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 1, num_xypoints, xypoints, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsLightCyanGamma", colormodel,
+ else if ((attr = cfFindAttr(ppd, "cupsLightCyanGamma", colormodel,
media, resolution, spec,
sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 1, gamval, density, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsCyanLtDk", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsCyanLtDk", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
- cupsCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
+ cfCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
else
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"Bad cupsCyanLtDk value \"%s\"!",
* cupsMagentaLtDk attributes...
*/
- if ((attr = cupsFindAttr(ppd, "cupsLightMagentaXY", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsLightMagentaXY", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) != NULL)
{
for (num_xypoints = 0, xyptr = xypoints;
xyptr += 2;
}
- cupsCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
+ cfCMYKSetCurve(cmyk, 3, num_xypoints, xypoints, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsLightMagentaGamma", colormodel,
+ else if ((attr = cfFindAttr(ppd, "cupsLightMagentaGamma", colormodel,
media, resolution, spec,
sizeof(spec), log, ld)) != NULL)
{
if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
- cupsCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
+ cfCMYKSetGamma(cmyk, 3, gamval, density, log, ld);
}
- else if ((attr = cupsFindAttr(ppd, "cupsMagentaLtDk", colormodel, media,
+ else if ((attr = cfFindAttr(ppd, "cupsMagentaLtDk", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) !=
NULL)
{
if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
- cupsCMYKSetLtDk(cmyk, 2, light, dark, log, ld);
+ cfCMYKSetLtDk(cmyk, 2, light, dark, log, ld);
else
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"Bad cupsMagentaLtDk value \"%s\"!",
/*
- * 'cupsCMYKNew()' - Create a new CMYK color separation.
+ * 'cfCMYKNew()' - Create a new CMYK color separation.
*/
-cups_cmyk_t * /* O - New CMYK separation or NULL */
-cupsCMYKNew(int num_channels) /* I - Number of color components */
+cf_cmyk_t * /* O - New CMYK separation or NULL */
+cfCMYKNew(int num_channels) /* I - Number of color components */
{
- cups_cmyk_t *cmyk; /* New color separation */
+ cf_cmyk_t *cmyk; /* New color separation */
int i; /* Looping var */
* Allocate memory for the separation...
*/
- if ((cmyk = calloc(1, sizeof(cups_cmyk_t))) == NULL)
+ if ((cmyk = calloc(1, sizeof(cf_cmyk_t))) == NULL)
return (NULL);
/*
case 2 : /* Kk */
for (i = 0; i < 256; i ++)
{
- cmyk->channels[0][i] = CUPS_MAX_LUT * i / 255;
+ cmyk->channels[0][i] = CF_MAX_LUT * i / 255;
}
break;
case 3 : /* CMY */
for (i = 0; i < 256; i ++)
{
- cmyk->channels[0][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[1][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[2][i] = CUPS_MAX_LUT * i / 255;
+ cmyk->channels[0][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[1][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[2][i] = CF_MAX_LUT * i / 255;
}
break;
case 4 : /* CMYK */
for (i = 0; i < 256; i ++)
{
- cmyk->channels[0][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[1][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[2][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[3][i] = CUPS_MAX_LUT * i / 255;
+ cmyk->channels[0][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[1][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[2][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[3][i] = CF_MAX_LUT * i / 255;
}
break;
case 6 : /* CcMmYK */
case 7 : /* CcMmYKk */
for (i = 0; i < 256; i ++)
{
- cmyk->channels[0][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[2][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[4][i] = CUPS_MAX_LUT * i / 255;
- cmyk->channels[5][i] = CUPS_MAX_LUT * i / 255;
+ cmyk->channels[0][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[2][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[4][i] = CF_MAX_LUT * i / 255;
+ cmyk->channels[5][i] = CF_MAX_LUT * i / 255;
}
break;
}
/*
- * 'cupsCMYKSetBlack()' - Set the transition range for CMY to black.
+ * 'cfCMYKSetBlack()' - Set the transition range for CMY to black.
*/
void
-cupsCMYKSetBlack(cups_cmyk_t *cmyk, /* I - CMYK color separation */
+cfCMYKSetBlack(cf_cmyk_t *cmyk, /* I - CMYK color separation */
float lower, /* I - No black ink */
float upper, /* I - Only black ink */
filter_logfunc_t log, /* I - Log function */
}
if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
- "cupsCMYKSetBlack(cmyk, lower=%.3f, upper=%.3f)",
+ "cfCMYKSetBlack(cmyk, lower=%.3f, upper=%.3f)",
lower, upper);
if (log)
/*
- * 'cupsCMYKSetCurve()' - Set a color transform curve using points.
+ * 'cfCMYKSetCurve()' - Set a color transform curve using points.
*/
void
-cupsCMYKSetCurve(cups_cmyk_t *cmyk, /* I - CMYK color separation */
+cfCMYKSetCurve(cf_cmyk_t *cmyk, /* I - CMYK color separation */
int channel, /* I - Color channel */
int num_xypoints,
/* I - Number of X,Y points */
num_xypoints --, xypoints += 2, xstart = xend, ystart = yend)
{
xend = (int)(255.0 * xypoints[1] + 0.5);
- yend = (int)(CUPS_MAX_LUT * xypoints[0] + 0.5);
+ yend = (int)(CF_MAX_LUT * xypoints[0] + 0.5);
xdelta = xend - xstart;
ydelta = yend - ystart;
/*
- * 'cupsCMYKSetGamma()' - Set a color transform curve using gamma and density.
+ * 'cfCMYKSetGamma()' - Set a color transform curve using gamma and density.
*/
void
-cupsCMYKSetGamma(cups_cmyk_t *cmyk, /* I - CMYK color separation */
+cfCMYKSetGamma(cf_cmyk_t *cmyk, /* I - CMYK color separation */
int channel, /* I - Ink channel */
float gamval, /* I - Gamma correction */
float density, /* I - Maximum density */
*/
for (i = 0; i < 256; i ++)
- cmyk->channels[channel][i] = (int)(density * CUPS_MAX_LUT *
+ cmyk->channels[channel][i] = (int)(density * CF_MAX_LUT *
pow((float)i / 255.0, gamval) + 0.5);
if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
- "cupsCMYKSetGamma(cmyk, channel=%d, gamval=%.3f, "
+ "cfCMYKSetGamma(cmyk, channel=%d, gamval=%.3f, "
"density=%.3f)", channel, gamval, density);
if (log)
/*
- * 'cupsCMYKSetInkLimit()' - Set the limit on the amount of ink.
+ * 'cfCMYKSetInkLimit()' - Set the limit on the amount of ink.
*/
void
-cupsCMYKSetInkLimit(cups_cmyk_t *cmyk, /* I - CMYK color separation */
+cfCMYKSetInkLimit(cf_cmyk_t *cmyk, /* I - CMYK color separation */
float limit) /* I - Limit of ink */
{
if (!cmyk || limit < 0.0)
return;
- cmyk->ink_limit = limit * CUPS_MAX_LUT;
+ cmyk->ink_limit = limit * CF_MAX_LUT;
}
/*
- * 'cupsCMYKSetLtDk()' - Set light/dark ink transforms.
+ * 'cfCMYKSetLtDk()' - Set light/dark ink transforms.
*/
void
-cupsCMYKSetLtDk(cups_cmyk_t *cmyk, /* I - CMYK color separation */
+cfCMYKSetLtDk(cf_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 */
for (i = 0; i < ilight; i ++)
{
cmyk->channels[channel + 0][i] = 0;
- cmyk->channels[channel + 1][i] = CUPS_MAX_LUT * i / ilight;
+ cmyk->channels[channel + 1][i] = CF_MAX_LUT * i / ilight;
}
/*
for (; i < idark; i ++)
{
- cmyk->channels[channel + 0][i] = CUPS_MAX_LUT * idark * (i - ilight) /
+ cmyk->channels[channel + 0][i] = CF_MAX_LUT * idark * (i - ilight) /
delta / 255;
- cmyk->channels[channel + 1][i] = CUPS_MAX_LUT - CUPS_MAX_LUT *
+ cmyk->channels[channel + 1][i] = CF_MAX_LUT - CF_MAX_LUT *
(i - ilight) / delta;
}
for (; i < 256; i ++)
{
- cmyk->channels[channel + 0][i] = CUPS_MAX_LUT * i / 255;
+ cmyk->channels[channel + 0][i] = CF_MAX_LUT * i / 255;
cmyk->channels[channel + 1][i] = 0;
}
if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
- "cupsCMYKSetLtDk(cmyk, channel=%d, light=%.3f, "
+ "cfCMYKSetLtDk(cmyk, channel=%d, light=%.3f, "
"dark=%.3f)", channel, light, dark);
if (log)
*
* Contents:
*
- * cupsDitherDelete() - Free a dithering buffer.
- * cupsDitherLine() - Dither a line of pixels...
- * cupsDitherNew() - Create a dithering buffer.
+ * cfDitherDelete() - Free a dithering buffer.
+ * cfDitherLine() - Dither a line of pixels...
+ * cfDitherNew() - Create a dithering buffer.
*/
/*
/*
- * 'cupsDitherDelete()' - Free a dithering buffer.
+ * 'cfDitherDelete()' - Free a dithering buffer.
*
* Returns 0 on success, -1 on failure.
*/
void
-cupsDitherDelete(cups_dither_t *d) /* I - Dithering buffer */
+cfDitherDelete(cf_dither_t *d) /* I - Dithering buffer */
{
if (d != NULL)
free(d);
/*
- * 'cupsDitherLine()' - Dither a line of pixels...
+ * 'cfDitherLine()' - Dither a line of pixels...
*/
void
-cupsDitherLine(cups_dither_t *d, /* I - Dither data */
- const cups_lut_t *lut, /* I - Lookup table */
+cfDitherLine(cf_dither_t *d, /* I - Dither data */
+ const cf_lut_t *lut, /* I - Lookup table */
const short *data, /* I - Separation data */
int num_channels,
/* I - Number of components */
pixel = lut[*data].intensity + e0 / 128;
- if (pixel > CUPS_MAX_LUT)
- pixel = CUPS_MAX_LUT;
+ if (pixel > CF_MAX_LUT)
+ pixel = CF_MAX_LUT;
else if (pixel < 0)
pixel = 0;
pixel = lut[*data].intensity + e0 / 128;
- if (pixel > CUPS_MAX_LUT)
- pixel = CUPS_MAX_LUT;
+ if (pixel > CF_MAX_LUT)
+ pixel = CF_MAX_LUT;
else if (pixel < 0)
pixel = 0;
/*
- * 'cupsDitherNew()' - Create an error-diffusion dithering buffer.
+ * 'cfDitherNew()' - Create an error-diffusion dithering buffer.
*/
-cups_dither_t * /* O - New state array */
-cupsDitherNew(int width) /* I - Width of output in pixels */
+cf_dither_t * /* O - New state array */
+cfDitherNew(int width) /* I - Width of output in pixels */
{
- cups_dither_t *d; /* New dithering buffer */
+ cf_dither_t *d; /* New dithering buffer */
- if ((d = (cups_dither_t *)calloc(1, sizeof(cups_dither_t) +
+ if ((d = (cf_dither_t *)calloc(1, sizeof(cf_dither_t) +
2 * (width + 4) *
sizeof(int))) == NULL)
return (NULL);
* Constants...
*/
-#define CUPS_MAX_CHAN 15 /* Maximum number of color components */
-#define CUPS_MAX_LUT 4095 /* Maximum LUT value */
-#define CUPS_MAX_RGB 4 /* Maximum number of sRGB components */
+#define CF_MAX_CHAN 15 /* Maximum number of color components */
+#define CF_MAX_LUT 4095 /* Maximum LUT value */
+#define CF_MAX_RGB 4 /* Maximum number of sRGB components */
/*
* Types/structures for the various routines.
*/
-typedef struct cups_lut_s /**** Lookup Table for Dithering ****/
+typedef struct cf_lut_s /**** Lookup Table for Dithering ****/
{
short intensity; /* Adjusted intensity */
short pixel; /* Output pixel value */
int error; /* Error from desired value */
-} cups_lut_t;
+} cf_lut_t;
-typedef struct cups_dither_s /**** Dithering State ****/
+typedef struct cf_dither_s /**** Dithering State ****/
{
int width; /* Width of buffer */
int row; /* Current row */
int errors[96]; /* Error values */
-} cups_dither_t;
+} cf_dither_t;
-typedef struct cups_sample_s /**** Color sample point ****/
+typedef struct cf_sample_s /**** Color sample point ****/
{
unsigned char rgb[3]; /* sRGB values */
- unsigned char colors[CUPS_MAX_RGB]; /* Color values */
-} cups_sample_t;
+ unsigned char colors[CF_MAX_RGB]; /* Color values */
+} cf_sample_t;
-typedef struct cups_rgb_s /**** Color separation lookup table ****/
+typedef struct cf_rgb_s /*** Color separation lookup table ***/
{
int cube_size; /* Size of color cube (2-N) on a side */
int num_channels; /* Number of colors per sample */
int cube_index[256]; /* Index into cube for a given sRGB value */
int cube_mult[256]; /* Multiplier value for a given sRGB value */
int cache_init; /* Are cached values initialized? */
- unsigned char black[CUPS_MAX_RGB]; /* Cached black (sRGB = 0,0,0) */
- unsigned char white[CUPS_MAX_RGB]; /* Cached white (sRGB = 255,255,255) */
-} cups_rgb_t;
+ unsigned char black[CF_MAX_RGB]; /* Cached black (sRGB = 0,0,0) */
+ unsigned char white[CF_MAX_RGB]; /* Cached white (sRGB = 255,255,255) */
+} cf_rgb_t;
-typedef struct cups_cmyk_s /**** Simple CMYK lookup table ****/
+typedef struct cf_cmyk_s /**** Simple CMYK lookup table ****/
{
unsigned char black_lut[256]; /* Black generation LUT */
unsigned char color_lut[256]; /* Color removal LUT */
int ink_limit; /* Ink limit */
int num_channels; /* Number of components */
- short *channels[CUPS_MAX_CHAN];
+ short *channels[CF_MAX_CHAN];
/* Lookup tables */
-} cups_cmyk_t;
+} cf_cmyk_t;
/*
*/
extern const unsigned char
- cups_srgb_lut[256];
+ cf_srgb_lut[256];
/* sRGB gamma lookup table */
extern const unsigned char
- cups_scmy_lut[256];
+ cf_scmy_lut[256];
/* sRGB gamma lookup table (inverted) */
* Attribute function...
*/
-extern ppd_attr_t *cupsFindAttr(ppd_file_t *ppd, const char *name,
- const char *colormodel,
- const char *media,
- const char *resolution,
- char *spec, int specsize,
- filter_logfunc_t log,
- void *ld);
+extern ppd_attr_t *cfFindAttr(ppd_file_t *ppd, const char *name,
+ const char *colormodel,
+ const char *media,
+ const char *resolution,
+ char *spec, int specsize,
+ filter_logfunc_t log,
+ void *ld);
/*
* Byte checking functions...
*/
-extern int cupsCheckBytes(const unsigned char *, int);
-extern int cupsCheckValue(const unsigned char *, int,
- const unsigned char);
+extern int cfCheckBytes(const unsigned char *, int);
+extern int cfCheckValue(const unsigned char *, int,
+ const unsigned char);
/*
* Dithering functions...
*/
-extern void cupsDitherLine(cups_dither_t *d, const cups_lut_t *lut,
- const short *data, int num_channels,
- unsigned char *p);
-extern cups_dither_t *cupsDitherNew(int width);
-extern void cupsDitherDelete(cups_dither_t *);
+extern void cfDitherLine(cf_dither_t *d, const cf_lut_t *lut,
+ const short *data, int num_channels,
+ unsigned char *p);
+extern cf_dither_t *cfDitherNew(int width);
+extern void cfDitherDelete(cf_dither_t *);
/*
* Lookup table functions for dithering...
*/
-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,
- filter_logfunc_t log,
- void *ld);
+extern cf_lut_t *cfLutNew(int num_vals, const float *vals,
+ filter_logfunc_t log, void *ld);
+extern void cfLutDelete(cf_lut_t *lut);
+extern cf_lut_t *cfLutLoad(ppd_file_t *ppd,
+ const char *colormodel,
+ const char *media,
+ const char *resolution,
+ const char *ink,
+ filter_logfunc_t log,
+ void *ld);
/*
* Bit packing functions...
*/
-extern void cupsPackHorizontal(const unsigned char *,
- unsigned char *, int,
- const unsigned char, const int);
-extern void cupsPackHorizontal2(const unsigned char *,
- unsigned char *, int, const int);
-extern void cupsPackHorizontalBit(const unsigned char *,
- unsigned char *, int,
- const unsigned char,
- const unsigned char);
-extern void cupsPackVertical(const unsigned char *, unsigned char *,
- int, const unsigned char, const int);
+extern void cfPackHorizontal(const unsigned char *,
+ unsigned char *, int,
+ const unsigned char, const int);
+ extern void cfPackHorizontal2(const unsigned char *,
+ unsigned char *, int, const int);
+extern void cfPackHorizontalBit(const unsigned char *,
+ unsigned char *, int,
+ const unsigned char,
+ const unsigned char);
+extern void cfPackVertical(const unsigned char *, unsigned char *,
+ int, const unsigned char, const int);
/*
* Color separation functions...
*/
-extern void cupsRGBDelete(cups_rgb_t *rgb);
-extern void cupsRGBDoGray(cups_rgb_t *rgb,
- const unsigned char *input,
- unsigned char *output, int num_pixels);
-extern void cupsRGBDoRGB(cups_rgb_t *rgb,
- const unsigned char *input,
- unsigned char *output, int num_pixels);
-extern cups_rgb_t *cupsRGBLoad(ppd_file_t *ppd,
- const char *colormodel,
- const char *media,
- 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 void cfRGBDelete(cf_rgb_t *rgb);
+extern void cfRGBDoGray(cf_rgb_t *rgb,
+ const unsigned char *input,
+ unsigned char *output, int num_pixels);
+extern void cfRGBDoRGB(cf_rgb_t *rgb,
+ const unsigned char *input,
+ unsigned char *output, int num_pixels);
+extern cf_rgb_t *cfRGBLoad(ppd_file_t *ppd,
+ const char *colormodel,
+ const char *media,
+ const char *resolution,
+ filter_logfunc_t log,
+ void *ld);
+extern cf_rgb_t *cfRGBNew(int num_samples, cf_sample_t *samples,
+ int cube_size, int num_channels);
/*
* CMYK separation functions...
*/
-extern cups_cmyk_t *cupsCMYKNew(int num_channels);
-extern void cupsCMYKDelete(cups_cmyk_t *cmyk);
-extern void cupsCMYKDoBlack(const cups_cmyk_t *cmyk,
- const unsigned char *input,
- short *output, int num_pixels);
-extern void cupsCMYKDoCMYK(const cups_cmyk_t *cmyk,
- const unsigned char *input,
- short *output, int num_pixels);
-extern void cupsCMYKDoGray(const cups_cmyk_t *cmyk,
- const unsigned char *input,
- short *output, int num_pixels);
-extern void cupsCMYKDoRGB(const cups_cmyk_t *cmyk,
- const unsigned char *input,
- short *output, int num_pixels);
-extern cups_cmyk_t *cupsCMYKLoad(ppd_file_t *ppd,
- const char *colormodel,
- const char *media,
- const char *resolution,
- filter_logfunc_t log,
- void *ld);
-extern void cupsCMYKSetBlack(cups_cmyk_t *cmyk,
- 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,
- filter_logfunc_t log, void *ld);
-extern void cupsCMYKSetGamma(cups_cmyk_t *cmyk, int channel,
- 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,
- filter_logfunc_t log, void *ld);
+extern cf_cmyk_t *cfCMYKNew(int num_channels);
+extern void cfCMYKDelete(cf_cmyk_t *cmyk);
+extern void cfCMYKDoBlack(const cf_cmyk_t *cmyk,
+ const unsigned char *input,
+ short *output, int num_pixels);
+extern void cfCMYKDoCMYK(const cf_cmyk_t *cmyk,
+ const unsigned char *input,
+ short *output, int num_pixels);
+extern void cfCMYKDoGray(const cf_cmyk_t *cmyk,
+ const unsigned char *input,
+ short *output, int num_pixels);
+extern void cfCMYKDoRGB(const cf_cmyk_t *cmyk,
+ const unsigned char *input,
+ short *output, int num_pixels);
+extern cf_cmyk_t *cfCMYKLoad(ppd_file_t *ppd,
+ const char *colormodel,
+ const char *media,
+ const char *resolution,
+ filter_logfunc_t log,
+ void *ld);
+ extern void cfCMYKSetBlack(cf_cmyk_t *cmyk,
+ float lower, float upper,
+ filter_logfunc_t log, void *ld);
+extern void cfCMYKSetCurve(cf_cmyk_t *cmyk, int channel,
+ int num_xypoints,
+ const float *xypoints,
+ filter_logfunc_t log, void *ld);
+extern void cfCMYKSetGamma(cf_cmyk_t *cmyk, int channel,
+ float gamval, float density,
+ filter_logfunc_t log, void *ld);
+extern void cfCMYKSetInkLimit(cf_cmyk_t *cmyk, float limit);
+ extern void cfCMYKSetLtDk(cf_cmyk_t *cmyk, int channel,
+ float light, float dark,
+ filter_logfunc_t log, void *ld);
/*
* Convenience macro for writing print data...
*/
-# define cupsWritePrintData(s,n) fwrite((s), 1, (n), stdout)
+# define cfWritePrintData(s,n) fwrite((s), 1, (n), stdout)
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_FILTERS_DRIVER_H_ */
-
*
* Contents:
*
- * cupsLutDelete() - Free the memory used by a lookup table.
- * cupsLutLoad() - Load a LUT from a PPD file.
- * cupsLutNew() - Make a lookup table from a list of pixel values.
+ * cfLutDelete() - Free the memory used by a lookup table.
+ * cfLutLoad() - Load a LUT from a PPD file.
+ * cfLutNew() - Make a lookup table from a list of pixel values.
*/
/*
/*
- * 'cupsLutDelete()' - Free the memory used by a lookup table.
+ * 'cfLutDelete()' - Free the memory used by a lookup table.
*/
void
-cupsLutDelete(cups_lut_t *lut) /* I - Lookup table to free */
+cfLutDelete(cf_lut_t *lut) /* I - Lookup table to free */
{
if (lut != NULL)
free(lut);
/*
- * 'cupsLutLoad()' - Load a LUT from a PPD file.
+ * 'cfLutLoad()' - Load a LUT from a PPD file.
*/
-cups_lut_t * /* O - New lookup table */
-cupsLutLoad(ppd_file_t *ppd, /* I - PPD file */
+cf_lut_t * /* O - New lookup table */
+cfLutLoad(ppd_file_t *ppd, /* I - PPD file */
const char *colormodel, /* I - Color model */
const char *media, /* I - Media type */
const char *resolution, /* I - Resolution */
snprintf(name, sizeof(name), "cups%sDither", ink);
- if ((attr = cupsFindAttr(ppd, name, colormodel, media, resolution, spec,
+ if ((attr = cfFindAttr(ppd, name, colormodel, media, resolution, spec,
sizeof(spec), log, ld)) == NULL)
- attr = cupsFindAttr(ppd, "cupsAllDither", colormodel, media,
+ attr = cfFindAttr(ppd, "cupsAllDither", colormodel, media,
resolution, spec, sizeof(spec), log, ld);
if (!attr)
"Loaded LUT %s from PPD with values [%.3f %.3f %.3f %.3f]",
name, vals[0], vals[1], vals[2], vals[3]);
- return (cupsLutNew(nvals, vals, log, ld));
+ return (cfLutNew(nvals, vals, log, ld));
}
/*
- * 'cupsLutNew()' - Make a lookup table from a list of pixel values.
+ * 'cfLutNew()' - Make a lookup table from a list of pixel values.
*
* Returns a pointer to the lookup table on success, NULL on failure.
*/
-cups_lut_t * /* O - New lookup table */
-cupsLutNew(int num_values, /* I - Number of values */
+cf_lut_t * /* O - New lookup table */
+cfLutNew(int num_values, /* I - Number of 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 */
+ cf_lut_t *lut; /* Lookup table */
int start, /* Start value */
end, /* End value */
maxval; /* Maximum value */
* Allocate memory for the lookup table...
*/
- if ((lut = (cups_lut_t *)calloc((CUPS_MAX_LUT + 1),
- sizeof(cups_lut_t))) == NULL)
+ if ((lut = (cf_lut_t *)calloc((CF_MAX_LUT + 1),
+ sizeof(cf_lut_t))) == NULL)
return (NULL);
/*
* close enough for jazz.
*/
- maxval = CUPS_MAX_LUT / values[num_values - 1];
+ maxval = CF_MAX_LUT / values[num_values - 1];
- for (start = 0; start <= CUPS_MAX_LUT; start ++)
- lut[start].intensity = start * maxval / CUPS_MAX_LUT;
+ for (start = 0; start <= CF_MAX_LUT; start ++)
+ lut[start].intensity = start * maxval / CF_MAX_LUT;
for (pixel = 0; pixel < num_values; pixel ++)
{
if (start < 0)
start = 0;
- else if (start > CUPS_MAX_LUT)
- start = CUPS_MAX_LUT;
+ else if (start > CF_MAX_LUT)
+ start = CF_MAX_LUT;
if (pixel == (num_values - 1))
- end = CUPS_MAX_LUT;
+ end = CF_MAX_LUT;
else
end = (int)(0.5 * maxval * (values[pixel] + values[pixel + 1]));
if (end < 0)
end = 0;
- else if (end > CUPS_MAX_LUT)
- end = CUPS_MAX_LUT;
+ else if (end > CF_MAX_LUT)
+ end = CF_MAX_LUT;
if (start == end)
break;
*/
if (log)
- for (start = 0; start <= CUPS_MAX_LUT; start += CUPS_MAX_LUT / 15)
+ for (start = 0; start <= CF_MAX_LUT; start += CF_MAX_LUT / 15)
log(ld, FILTER_LOGLEVEL_DEBUG,
"%d = %d/%d/%d", start, lut[start].intensity,
lut[start].pixel, lut[start].error);
*
* Contents:
*
- * cupsPackHorizontal() - Pack pixels horizontally...
- * cupsPackHorizontal2() - Pack 2-bit pixels horizontally...
- * cupsPackHorizontalBit() - Pack pixels horizontally by bit...
- * cupsPackVertical() - Pack pixels vertically...
+ * cfPackHorizontal() - Pack pixels horizontally...
+ * cfPackHorizontal2() - Pack 2-bit pixels horizontally...
+ * cfPackHorizontalBit() - Pack pixels horizontally by bit...
+ * cfPackVertical() - Pack pixels vertically...
*/
/*
/*
- * 'cupsPackHorizontal()' - Pack pixels horizontally...
+ * 'cfPackHorizontal()' - Pack pixels horizontally...
*/
void
-cupsPackHorizontal(const unsigned char *ipixels,/* I - Input pixels */
+cfPackHorizontal(const unsigned char *ipixels,/* I - Input pixels */
unsigned char *obytes, /* O - Output bytes */
int width, /* I - Number of pixels */
const unsigned char clearto, /* I - Initial value of bytes */
/*
- * 'cupsPackHorizontal2()' - Pack 2-bit pixels horizontally...
+ * 'cfPackHorizontal2()' - Pack 2-bit pixels horizontally...
*/
void
-cupsPackHorizontal2(const unsigned char *ipixels, /* I - Input pixels */
+cfPackHorizontal2(const unsigned char *ipixels, /* I - Input pixels */
unsigned char *obytes, /* O - Output bytes */
int width, /* I - Number of pixels */
const int step) /* I - Stepping value */
/*
- * 'cupsPackHorizontalBit()' - Pack pixels horizontally by bit...
+ * 'cfPackHorizontalBit()' - Pack pixels horizontally by bit...
*/
void
-cupsPackHorizontalBit(const unsigned char *ipixels, /* I - Input pixels */
+cfPackHorizontalBit(const unsigned char *ipixels, /* I - Input pixels */
unsigned char *obytes, /* O - Output bytes */
int width, /* I - Number of pixels */
const unsigned char clearto, /* I - Initial value of bytes */
/*
- * 'cupsPackVertical()' - Pack pixels vertically...
+ * 'cfPackVertical()' - Pack pixels vertically...
*/
void
-cupsPackVertical(const unsigned char *ipixels, /* I - Input pixels */
+cfPackVertical(const unsigned char *ipixels, /* I - Input pixels */
unsigned char *obytes, /* O - Output bytes */
int width, /* I - Number of input pixels */
const unsigned char bit, /* I - Output bit */
*
* Contents:
*
- * cupsRGBDelete() - Delete a color separation.
- * cupsRGBDoGray() - Do a grayscale separation...
- * cupsRGBDoRGB() - Do a RGB separation...
- * cupsRGBLoad() - Load a RGB color profile from a PPD file.
- * cupsRGBNew() - Create a new RGB color separation.
+ * cfRGBDelete() - Delete a color separation.
+ * cfRGBDoGray() - Do a grayscale separation...
+ * cfRGBDoRGB() - Do a RGB separation...
+ * cfRGBLoad() - Load a RGB color profile from a PPD file.
+ * cfRGBNew() - Create a new RGB color separation.
*/
/*
/*
- * 'cupsRGBDelete()' - Delete a color separation.
+ * 'cfRGBDelete()' - Delete a color separation.
*/
void
-cupsRGBDelete(cups_rgb_t *rgbptr) /* I - Color separation */
+cfRGBDelete(cf_rgb_t *rgbptr) /* I - Color separation */
{
if (rgbptr == NULL)
return;
/*
- * 'cupsRGBDoGray()' - Do a grayscale separation...
+ * 'cfRGBDoGray()' - Do a grayscale separation...
*/
void
-cupsRGBDoGray(cups_rgb_t *rgbptr,
+cfRGBDoGray(cf_rgb_t *rgbptr,
/* I - Color separation */
const unsigned char *input,
/* I - Input grayscale pixels */
num_pixels --;
- g = cups_srgb_lut[*input++];
+ g = cf_srgb_lut[*input++];
if (g == lastgray)
{
/*
- * 'cupsRGBDoRGB()' - Do a RGB separation...
+ * 'cfRGBDoRGB()' - Do a RGB separation...
*/
void
-cupsRGBDoRGB(cups_rgb_t *rgbptr,
+cfRGBDoRGB(cf_rgb_t *rgbptr,
/* I - Color separation */
const unsigned char *input,
/* I - Input RGB pixels */
num_pixels --;
- r = cups_srgb_lut[*input++];
- g = cups_srgb_lut[*input++];
- b = cups_srgb_lut[*input++];
+ r = cf_srgb_lut[*input++];
+ g = cf_srgb_lut[*input++];
+ b = cf_srgb_lut[*input++];
rgb = (((r << 8) | g) << 8) | b;
if (rgb == lastrgb)
/*
- * 'cupsRGBLoad()' - Load a RGB color profile from a PPD file.
+ * 'cfRGBLoad()' - Load a RGB color profile from a PPD file.
*/
-cups_rgb_t * /* O - New color profile */
-cupsRGBLoad(ppd_file_t *ppd, /* I - PPD file */
+cf_rgb_t * /* O - New color profile */
+cfRGBLoad(ppd_file_t *ppd, /* I - PPD file */
const char *colormodel, /* I - Color model */
const char *media, /* I - Media type */
const char *resolution, /* I - Resolution */
cube_size, /* Size of color lookup cube */
num_channels, /* Number of color channels */
num_samples; /* Number of color samples */
- cups_sample_t *samples; /* Color samples */
+ cf_sample_t *samples; /* Color samples */
float values[7]; /* Color sample values */
char spec[PPD_MAX_NAME]; /* Profile name */
ppd_attr_t *attr; /* Attribute from PPD file */
- cups_rgb_t *rgbptr; /* RGB color profile */
+ cf_rgb_t *rgbptr; /* RGB color profile */
/*
* cupsRGBSample - Specifies an RGB to CMYK color sample
*/
- if ((attr = cupsFindAttr(ppd, "cupsRGBProfile", colormodel, media,
+ if ((attr = cfFindAttr(ppd, "cupsRGBProfile", colormodel, media,
resolution, spec, sizeof(spec), log, ld)) == NULL)
{
if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
}
if (cube_size < 2 || cube_size > 16 ||
- num_channels < 1 || num_channels > CUPS_MAX_RGB ||
+ num_channels < 1 || num_channels > CF_MAX_RGB ||
num_samples != (cube_size * cube_size * cube_size))
{
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
* Allocate memory for the samples and read them...
*/
- if ((samples = calloc(num_samples, sizeof(cups_sample_t))) == NULL)
+ if ((samples = calloc(num_samples, sizeof(cf_sample_t))) == NULL)
{
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"Unable to allocate memory for RGB profile!");
*/
if (i == num_samples)
- rgbptr = cupsRGBNew(num_samples, samples, cube_size, num_channels);
+ rgbptr = cfRGBNew(num_samples, samples, cube_size, num_channels);
else
rgbptr = NULL;
/*
- * 'cupsRGBNew()' - Create a new RGB color separation.
+ * 'cfRGBNew()' - Create a new RGB color separation.
*/
-cups_rgb_t * /* O - New color separation or NULL */
-cupsRGBNew(int num_samples, /* I - Number of samples */
- cups_sample_t *samples, /* I - Samples */
+cf_rgb_t * /* O - New color separation or NULL */
+cfRGBNew(int num_samples, /* I - Number of samples */
+ cf_sample_t *samples, /* I - Samples */
int cube_size, /* I - Size of LUT cube */
int num_channels) /* I - Number of color components */
{
- cups_rgb_t *rgbptr; /* New color separation */
+ cf_rgb_t *rgbptr; /* New color separation */
int i; /* Looping var */
int r, g, b; /* Current RGB */
int tempsize; /* Sibe of main arrays */
*/
if (!samples || num_samples != (cube_size * cube_size * cube_size) ||
- num_channels <= 0 || num_channels > CUPS_MAX_RGB)
+ num_channels <= 0 || num_channels > CF_MAX_RGB)
return (NULL);
/*
* Allocate memory for the separation...
*/
- if ((rgbptr = calloc(1, sizeof(cups_rgb_t))) == NULL)
+ if ((rgbptr = calloc(1, sizeof(cf_rgb_t))) == NULL)
return (NULL);
/*
rgb[1] = 0;
rgb[2] = 0;
- cupsRGBDoRGB(rgbptr, rgb, rgbptr->black, 1);
+ cfRGBDoRGB(rgbptr, rgb, rgbptr->black, 1);
rgb[0] = 255;
rgb[1] = 255;
rgb[2] = 255;
- cupsRGBDoRGB(rgbptr, rgb, rgbptr->white, 1);
+ cfRGBDoRGB(rgbptr, rgb, rgbptr->white, 1);
rgbptr->cache_init = 1;
* sRGB gamma lookup table.
*/
-const unsigned char cups_srgb_lut[256] =
+const unsigned char cf_srgb_lut[256] =
{
0, 20, 28, 33, 38, 42, 46, 49, 52, 55, 58, 61, 63, 65, 68,
70, 72, 74, 76, 78, 80, 81, 83, 85, 87, 88, 90, 91, 93, 94,
* sRGB gamma lookup table (inverted output to map to CMYK...)
*/
-const unsigned char cups_scmy_lut[256] =
+const unsigned char cf_scmy_lut[256] =
{
255, 235, 227, 222, 217, 213, 209, 206, 203, 200, 197, 194, 192, 190, 187,
185, 183, 181, 179, 177, 175, 174, 172, 170, 168, 167, 165, 164, 162, 161,
short output[48000], /* Output separation data */
*outptr; /* Pointer in output */
FILE *in; /* Input PPM file */
- FILE *out[CUPS_MAX_CHAN];
+ FILE *out[CF_MAX_CHAN];
/* Output PGM files */
FILE *comp; /* Composite output */
- cups_cmyk_t *cmyk; /* Color separation */
+ cf_cmyk_t *cmyk; /* Color separation */
/*
* Create the color separation...
*/
- cmyk = cupsCMYKNew(num_comps);
+ cmyk = cfCMYKNew(num_comps);
switch (num_comps)
{
case 2 : /* Kk */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
break;
case 4 :
- cupsCMYKSetGamma(cmyk, 2, 1.0, 0.9, logfunc, ld);
- cupsCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetGamma(cmyk, 2, 1.0, 0.9, logfunc, ld);
+ cfCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
break;
case 6 : /* CcMmYK */
- 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);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetGamma(cmyk, 4, 1.0, 0.9, logfunc, ld);
+ cfCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
break;
case 7 : /* CcMmYKk */
- 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);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetGamma(cmyk, 4, 1.0, 0.9, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 5, 0.5, 1.0, logfunc, ld);
break;
}
{
fread(input, width, 1, in);
- cupsCMYKDoGray(cmyk, input, output, width);
+ cfCMYKDoGray(cmyk, input, output, width);
for (x = 0, outptr = output; x < width; x ++, outptr += num_comps)
{
fclose(comp);
fclose(in);
- cupsCMYKDelete(cmyk);
+ cfCMYKDelete(cmyk);
}
short output[48000], /* Output separation data */
*outptr; /* Pointer in output */
FILE *in; /* Input PPM file */
- FILE *out[CUPS_MAX_CHAN];
+ FILE *out[CF_MAX_CHAN];
/* Output PGM files */
FILE *comp; /* Composite output */
- cups_cmyk_t *cmyk; /* Color separation */
+ cf_cmyk_t *cmyk; /* Color separation */
/*
* Create the color separation...
*/
- cmyk = cupsCMYKNew(num_comps);
+ cmyk = cfCMYKNew(num_comps);
- cupsCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetBlack(cmyk, 0.5, 1.0, logfunc, ld);
switch (num_comps)
{
case 2 : /* Kk */
- cupsCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
break;
case 6 : /* CcMmYK */
- 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);
+ cfCMYKSetGamma(cmyk, 0, 1.0, 0.8, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetGamma(cmyk, 2, 1.0, 0.8, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
break;
case 7 : /* CcMmYKk */
- 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);
+ cfCMYKSetGamma(cmyk, 0, 1.0, 0.8, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 0, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetGamma(cmyk, 2, 1.0, 0.8, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 2, 0.5, 1.0, logfunc, ld);
+ cfCMYKSetLtDk(cmyk, 5, 0.5, 1.0, logfunc, ld);
break;
}
{
fread(input, width, 3, in);
- cupsCMYKDoRGB(cmyk, input, output, width);
+ cfCMYKDoRGB(cmyk, input, output, width);
for (x = 0, outptr = output; x < width; x ++, outptr += num_comps)
{
fclose(comp);
fclose(in);
- cupsCMYKDelete(cmyk);
+ cfCMYKDelete(cmyk);
}
unsigned char pixels[512], /* Dither pixels */
*pixptr; /* Pointer in line */
int output; /* Output pixel */
- cups_lut_t *lut; /* Dither lookup table */
- cups_dither_t *dither; /* Dither state */
+ cf_lut_t *lut; /* Dither lookup table */
+ cf_dither_t *dither; /* Dither state */
int nlutvals; /* Number of lookup values */
float lutvals[16]; /* Lookup values */
int pixvals[16]; /* Pixel values */
* Create the lookup table and dither state...
*/
- lut = cupsLutNew(nlutvals, lutvals, logfunc, ld);
- dither = cupsDitherNew(512);
+ lut = cfLutNew(nlutvals, lutvals, logfunc, ld);
+ dither = cfDitherNew(512);
/*
* Put out the PGM header for a raw 256x256x8-bit grayscale file...
* Dither the line...
*/
- cupsDitherLine(dither, lut, line, 1, pixels);
+ cfDitherLine(dither, lut, line, 1, pixels);
if (y == 0)
{
* Free the dither state and lookup table...
*/
- cupsDitherDelete(dither);
- cupsLutDelete(lut);
+ cfDitherDelete(dither);
+ cfLutDelete(lut);
/*
* Return with no errors...
#endif /* USE_LCMS1 */
-void test_gray(cups_sample_t *samples, int num_samples,
+void test_gray(cf_sample_t *samples, int num_samples,
int cube_size, int num_comps, const char *basename);
-void test_rgb(cups_sample_t *samples, int num_samples,
+void test_rgb(cf_sample_t *samples, int num_samples,
int cube_size, int num_comps,
const char *basename);
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
- static cups_sample_t CMYK[] = /* Basic 4-color sep */
+ static cf_sample_t CMYK[] = /* Basic 4-color sep */
{
/*{ r, g, b }, { C, M, Y, K }*/
{ { 0, 0, 0 }, { 0, 0, 0, 255 } },
*/
void
-test_gray(cups_sample_t *samples, /* I - Sample values */
+test_gray(cf_sample_t *samples, /* I - Sample values */
int num_samples, /* I - Number of samples */
int cube_size, /* I - Cube size */
int num_comps, /* I - Number of components */
unsigned char output[48000], /* Output rgb data */
*outptr; /* Pointer in output */
FILE *in; /* Input PPM file */
- FILE *out[CUPS_MAX_CHAN];
+ FILE *out[CF_MAX_CHAN];
/* Output PGM files */
FILE *comp; /* Composite output */
- cups_rgb_t *rgb; /* Color separation */
+ cf_rgb_t *rgb; /* Color separation */
/*
* Create the color rgb...
*/
- rgb = cupsRGBNew(num_samples, samples, cube_size, num_comps);
+ rgb = cfRGBNew(num_samples, samples, cube_size, num_comps);
/*
* Open the color rgb files...
{
fread(input, width, 1, in);
- cupsRGBDoGray(rgb, input, output, width);
+ cfRGBDoGray(rgb, input, output, width);
for (x = 0, outptr = output; x < width; x ++, outptr += num_comps)
{
fclose(comp);
fclose(in);
- cupsRGBDelete(rgb);
+ cfRGBDelete(rgb);
}
*/
void
-test_rgb(cups_sample_t *samples, /* I - Sample values */
+test_rgb(cf_sample_t *samples, /* I - Sample values */
int num_samples, /* I - Number of samples */
int cube_size, /* I - Cube size */
int num_comps, /* I - Number of components */
unsigned char output[48000], /* Output rgb data */
*outptr; /* Pointer in output */
FILE *in; /* Input PPM file */
- FILE *out[CUPS_MAX_CHAN];
+ FILE *out[CF_MAX_CHAN];
/* Output PGM files */
FILE *comp; /* Composite output */
- cups_rgb_t *rgb; /* Color separation */
+ cf_rgb_t *rgb; /* Color separation */
/*
* Create the color rgb...
*/
- rgb = cupsRGBNew(num_samples, samples, cube_size, num_comps);
+ rgb = cfRGBNew(num_samples, samples, cube_size, num_comps);
/*
* Open the color rgb files...
{
fread(input, width, 3, in);
- cupsRGBDoRGB(rgb, input, output, width);
+ cfRGBDoRGB(rgb, input, output, width);
for (x = 0, outptr = output; x < width; x ++, outptr += num_comps)
{
fclose(comp);
fclose(in);
- cupsRGBDelete(rgb);
+ cfRGBDelete(rgb);
}
*/
if (ppd->model_number & ESCP_USB)
- cupsWritePrintData("\000\000\000\033\001@EJL 1284.4\n@EJL \n\033@", 29);
+ cfWritePrintData("\000\000\000\033\001@EJL 1284.4\n@EJL \n\033@", 29);
/*
* Reset the printer...
*/
- cupsWritePrintData("\033@", 2);
+ cfWritePrintData("\033@", 2);
/*
* Enter remote mode...
*/
- cupsWritePrintData("\033(R\010\000\000REMOTE1", 13);
+ cfWritePrintData("\033(R\010\000\000REMOTE1", 13);
feedpage = 0;
/*
* Clean heads...
*/
- cupsWritePrintData("CH\002\000\000\000", 6);
+ cfWritePrintData("CH\002\000\000\000", 6);
}
else if (strncasecmp(lineptr, "PrintAlignmentPage", 18) == 0)
{
phase = atoi(lineptr + 18);
- cupsWritePrintData("DT\003\000\000", 5);
+ cfWritePrintData("DT\003\000\000", 5);
putchar(phase & 255);
putchar(phase >> 8);
feedpage = 1;
* Print version info and nozzle check...
*/
- cupsWritePrintData("VI\002\000\000\000", 6);
- cupsWritePrintData("NC\002\000\000\000", 6);
+ cfWritePrintData("VI\002\000\000\000", 6);
+ cfWritePrintData("NC\002\000\000\000", 6);
feedpage = 1;
}
else if (strncasecmp(lineptr, "ReportLevels", 12) == 0)
* Report ink levels...
*/
- cupsWritePrintData("IQ\001\000\001", 5);
+ cfWritePrintData("IQ\001\000\001", 5);
}
else if (strncasecmp(lineptr, "SetAlignment", 12) == 0)
{
continue;
}
- cupsWritePrintData("DA\004\000", 4);
+ cfWritePrintData("DA\004\000", 4);
putchar(0);
putchar(phase);
putchar(0);
putchar(x);
- cupsWritePrintData("SV\000\000", 4);
+ cfWritePrintData("SV\000\000", 4);
}
else
fprintf(stderr, "ERROR: Invalid printer command \"%s\"!\n", lineptr);
* Exit remote mode...
*/
- cupsWritePrintData("\033\000\000\000", 4);
+ cfWritePrintData("\033\000\000\000", 4);
/*
* Eject the page as needed...
* Reset the printer...
*/
- cupsWritePrintData("\033@", 2);
+ cfWritePrintData("\033@", 2);
/*
* Close the command file and return...
* Reset the printer...
*/
- cupsWritePrintData("\033E", 2);
+ cfWritePrintData("\033E", 2);
/*
* Read the commands from the file and send the appropriate commands...
* Clean heads...
*/
- cupsWritePrintData("\033&b16WPML \004\000\006\001\004\001\005\001"
+ cfWritePrintData("\033&b16WPML \004\000\006\001\004\001\005\001"
"\001\004\001\144", 22);
}
else
* Reset the printer...
*/
- cupsWritePrintData("\033E", 2);
+ cfWritePrintData("\033E", 2);
/*
* Close the command file and return...
* Globals...
*/
-cups_rgb_t *RGB; /* RGB color separation data */
-cups_cmyk_t *CMYK; /* CMYK color separation data */
+cf_rgb_t *RGB; /* RGB color separation data */
+cf_cmyk_t *CMYK; /* CMYK color separation data */
unsigned char *PixelBuffer, /* Pixel buffer */
*CMYKBuffer, /* CMYK buffer */
*OutputBuffers[7], /* Output buffers */
BitPlanes, /* # of bit planes per color */
PrinterTop, /* Top of page */
PrinterLength; /* Length of page */
-cups_lut_t *DitherLuts[7]; /* Lookup tables for dithering */
-cups_dither_t *DitherStates[7]; /* Dither state tables */
+cf_lut_t *DitherLuts[7]; /* Lookup tables for dithering */
+cf_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 */
*/
if (ppd->model_number & ESCP_USB)
- cupsWritePrintData("\000\000\000\033\001@EJL 1284.4\n@EJL \n\033@", 29);
+ cfWritePrintData("\000\000\000\033\001@EJL 1284.4\n@EJL \n\033@", 29);
}
if (header->cupsColorSpace == CUPS_CSPACE_RGB ||
header->cupsColorSpace == CUPS_CSPACE_W)
- RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution,
+ RGB = cfRGBLoad(ppd, colormodel, header->MediaType, resolution,
logfunc, ld);
else
RGB = NULL;
- CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution,
+ CMYK = cfCMYKLoad(ppd, colormodel, header->MediaType, resolution,
logfunc, ld);
if (RGB)
else
{
fputs("DEBUG: Loading default CMYK separation.\n", stderr);
- CMYK = cupsCMYKNew(4);
+ CMYK = cfCMYKNew(4);
}
PrinterPlanes = CMYK->num_channels;
switch (PrinterPlanes)
{
case 1 : /* K */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
case 2 : /* Kk */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightBlack", logfunc, ld);
break;
case 3 : /* CMY */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
break;
case 4 : /* CMYK */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
- DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[3] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
case 6 : /* CcMmYK */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightCyan", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[3] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightMagenta", logfunc, ld);
- DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[4] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
- DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[5] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
case 7 : /* CcMmYKk */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightCyan", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[3] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightMagenta", logfunc, ld);
- DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[4] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
- DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[5] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
- DitherLuts[6] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[6] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightBlack", logfunc, ld);
break;
}
for (plane = 0; plane < PrinterPlanes; plane ++)
{
- DitherStates[plane] = cupsDitherNew(header->cupsWidth);
+ DitherStates[plane] = cfDitherNew(header->cupsWidth);
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
+ DitherLuts[plane] = cfLutNew(2, default_lut, logfunc, ld);
}
if (DitherLuts[0][4095].pixel > 1)
* Go into remote mode...
*/
- cupsWritePrintData("\033(R\010\000\000REMOTE1", 13);
+ cfWritePrintData("\033(R\010\000\000REMOTE1", 13);
/*
* Disable status reporting...
*/
- cupsWritePrintData("ST\002\000\000\000", 6);
+ cfWritePrintData("ST\002\000\000\000", 6);
/*
* Enable borderless printing...
i = atoi(attr->value);
- cupsWritePrintData("FP\003\000\000", 5);
+ cfWritePrintData("FP\003\000\000", 5);
putchar(i & 255);
putchar(i >> 8);
}
* Set feed sequence...
*/
- cupsWritePrintData("SN\003\000\000\000", 6);
+ cfWritePrintData("SN\003\000\000\000", 6);
putchar(atoi(attr->value));
}
* Set platten gap...
*/
- cupsWritePrintData("SN\003\000\000\001", 6);
+ cfWritePrintData("SN\003\000\000\001", 6);
putchar(atoi(attr->value));
}
* Paper feeding/ejecting sequence...
*/
- cupsWritePrintData("SN\003\000\000\002", 6);
+ cfWritePrintData("SN\003\000\000\002", 6);
putchar(atoi(attr->value));
}
* Eject delay...
*/
- cupsWritePrintData("SN\003\000\000\006", 6);
+ cfWritePrintData("SN\003\000\000\006", 6);
putchar(atoi(attr->value));
}
* Set media type.
*/
- cupsWritePrintData("MT\003\000\000\000", 6);
+ cfWritePrintData("MT\003\000\000\000", 6);
putchar(atoi(attr->value));
}
* Set paper thickness.
*/
- cupsWritePrintData("PH\002\000\000", 5);
+ cfWritePrintData("PH\002\000\000", 5);
putchar(atoi(attr->value));
}
}
* Paper check.
*/
- cupsWritePrintData("PC\002\000\000", 5);
+ cfWritePrintData("PC\002\000\000", 5);
putchar(atoi(attr->value));
}
a = b = 0;
sscanf(attr->value, "%d%d", &a, &b);
- cupsWritePrintData("PP\003\000\000", 5);
+ cfWritePrintData("PP\003\000\000", 5);
putchar(a);
putchar(b);
}
* Set media position.
*/
- cupsWritePrintData("EX\006\000\000\000\000\000\005", 9);
+ cfWritePrintData("EX\006\000\000\000\000\000\005", 9);
putchar(atoi(attr->value));
}
}
* Set media size...
*/
- cupsWritePrintData("MS\010\000\000", 5);
+ cfWritePrintData("MS\010\000\000", 5);
putchar(atoi(attr->value));
switch (header->PageSize[1])
* Enable/disable cutter.
*/
- cupsWritePrintData("AC\002\000\000", 5);
+ cfWritePrintData("AC\002\000\000", 5);
putchar(atoi(attr->value));
if ((attr = ppdFindAttr(ppd, "cupsESCPSN80", header->MediaType)) != NULL && attr->value)
* Cutting method...
*/
- cupsWritePrintData("SN\003\000\000\200", 6);
+ cfWritePrintData("SN\003\000\000\200", 6);
putchar(atoi(attr->value));
}
* Cutting pressure...
*/
- cupsWritePrintData("SN\003\000\000\201", 6);
+ cfWritePrintData("SN\003\000\000\201", 6);
putchar(atoi(attr->value));
}
}
* Enable/disable cutter.
*/
- cupsWritePrintData("CO\010\000\000\000", 6);
+ cfWritePrintData("CO\010\000\000\000", 6);
putchar(atoi(attr->value));
- cupsWritePrintData("\000\000\000\000\000", 5);
+ cfWritePrintData("\000\000\000\000\000", 5);
}
/*
* Exit remote mode...
*/
- cupsWritePrintData("\033\000\000\000", 4);
+ cfWritePrintData("\033\000\000\000", 4);
}
/*
* Enter graphics mode...
*/
- cupsWritePrintData("\033(G\001\000\001", 6);
+ cfWritePrintData("\033(G\001\000\001", 6);
/*
* Set the line feed increment...
if (ppd->model_number & ESCP_EXT_UNITS)
{
- cupsWritePrintData("\033(U\005\000", 5);
+ cfWritePrintData("\033(U\005\000", 5);
putchar(units / header->HWResolution[1]);
putchar(units / header->HWResolution[1]);
putchar(units / header->HWResolution[0]);
}
else
{
- cupsWritePrintData("\033(U\001\000", 5);
+ cfWritePrintData("\033(U\001\000", 5);
putchar(3600 / header->HWResolution[1]);
}
* Set page size (expands bottom margin)...
*/
- cupsWritePrintData("\033(S\010\000", 5);
+ cfWritePrintData("\033(S\010\000", 5);
i = header->PageSize[0] * header->HWResolution[1] / 72;
putchar(i);
}
else
{
- cupsWritePrintData("\033(C\002\000", 5);
+ cfWritePrintData("\033(C\002\000", 5);
putchar(PrinterLength & 255);
putchar(PrinterLength >> 8);
}
if (ppd->model_number & ESCP_EXT_MARGINS)
{
- cupsWritePrintData("\033(c\010\000", 5);
+ cfWritePrintData("\033(c\010\000", 5);
putchar(PrinterTop);
putchar(PrinterTop >> 8);
}
else
{
- cupsWritePrintData("\033(c\004\000", 5);
+ cfWritePrintData("\033(c\004\000", 5);
putchar(PrinterTop & 255);
putchar(PrinterTop >> 8);
* Set the top position...
*/
- cupsWritePrintData("\033(V\002\000\000\000", 7);
+ cfWritePrintData("\033(V\002\000\000\000", 7);
/*
* Enable unidirectional printing depending on the mode...
*/
- if ((attr = cupsFindAttr(ppd, "cupsESCPDirection", colormodel,
+ if ((attr = cfFindAttr(ppd, "cupsESCPDirection", colormodel,
header->MediaType, resolution, spec,
sizeof(spec), logfunc, ld)) != NULL)
printf("\033U%c", atoi(attr->value));
* Enable/disable microweaving as needed...
*/
- if ((attr = cupsFindAttr(ppd, "cupsESCPMicroWeave", colormodel,
+ if ((attr = cfFindAttr(ppd, "cupsESCPMicroWeave", colormodel,
header->MediaType, resolution, spec,
sizeof(spec), logfunc, ld)) != NULL)
printf("\033(i\001%c%c", 0, atoi(attr->value));
* Set the dot size and print speed as needed...
*/
- if ((attr = cupsFindAttr(ppd, "cupsESCPDotSize", colormodel,
+ if ((attr = cfFindAttr(ppd, "cupsESCPDotSize", colormodel,
header->MediaType, resolution, spec,
sizeof(spec), logfunc, ld)) != NULL)
printf("\033(e\002%c%c%c", 0, 0, atoi(attr->value));
* Fast black printing.
*/
- cupsWritePrintData("\033(K\002\000\000\001", 7);
+ cfWritePrintData("\033(K\002\000\000\001", 7);
}
else
{
* Color printing.
*/
- cupsWritePrintData("\033(K\002\000\000\002", 7);
+ cfWritePrintData("\033(K\002\000\000\002", 7);
}
}
* Set the output resolution...
*/
- cupsWritePrintData("\033(D\004\000", 5);
+ cfWritePrintData("\033(D\004\000", 5);
putchar(units);
putchar(units >> 8);
putchar(units * DotRowStep / header->HWResolution[1]);
for (i = 0; i < PrinterPlanes; i ++)
{
- cupsDitherDelete(DitherStates[i]);
- cupsLutDelete(DitherLuts[i]);
+ cfDitherDelete(DitherStates[i]);
+ cfLutDelete(DitherLuts[i]);
}
free(OutputBuffers[0]);
free(InputBuffer);
free(CompBuffer);
- cupsCMYKDelete(CMYK);
+ cfCMYKDelete(CMYK);
if (RGB)
{
- cupsRGBDelete(RGB);
+ cfRGBDelete(RGB);
free(CMYKBuffer);
}
}
* Go into remote mode...
*/
- cupsWritePrintData("\033(R\010\000\000REMOTE1", 13);
+ cfWritePrintData("\033(R\010\000\000REMOTE1", 13);
/*
* Load defaults...
*/
- cupsWritePrintData("LD\000\000", 4);
+ cfWritePrintData("LD\000\000", 4);
/*
* Exit remote mode...
*/
- cupsWritePrintData("\033\000\000\000", 4);
+ cfWritePrintData("\033\000\000\000", 4);
}
}
if (offset)
{
if (BitPlanes == 1)
- cupsWritePrintData("\033(\\\004\000\240\005", 7);
+ cfWritePrintData("\033(\\\004\000\240\005", 7);
else
printf("\033\\");
putchar(bytes >> 8);
}
- cupsWritePrintData(line_ptr, line_end - line_ptr);
+ cfWritePrintData(line_ptr, line_end - line_ptr);
}
if (OutputFeed > 0)
{
- cupsWritePrintData("\033(v\002\000", 5);
+ cfWritePrintData("\033(v\002\000", 5);
putchar(OutputFeed & 255);
putchar(OutputFeed >> 8);
case CUPS_CSPACE_W :
if (RGB)
{
- cupsRGBDoGray(RGB, PixelBuffer, CMYKBuffer, width);
- cupsCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
+ cfRGBDoGray(RGB, PixelBuffer, CMYKBuffer, width);
+ cfCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
}
else
- cupsCMYKDoGray(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoGray(CMYK, PixelBuffer, InputBuffer, width);
break;
case CUPS_CSPACE_K :
- cupsCMYKDoBlack(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoBlack(CMYK, PixelBuffer, InputBuffer, width);
break;
default :
case CUPS_CSPACE_RGB :
if (RGB)
{
- cupsRGBDoRGB(RGB, PixelBuffer, CMYKBuffer, width);
- cupsCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
+ cfRGBDoRGB(RGB, PixelBuffer, CMYKBuffer, width);
+ cfCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
}
else
- cupsCMYKDoRGB(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoRGB(CMYK, PixelBuffer, InputBuffer, width);
break;
case CUPS_CSPACE_CMYK :
- cupsCMYKDoCMYK(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoCMYK(CMYK, PixelBuffer, InputBuffer, width);
break;
}
for (plane = 0; plane < PrinterPlanes; plane ++)
{
- cupsDitherLine(DitherStates[plane], DitherLuts[plane], InputBuffer + plane,
+ cfDitherLine(DitherStates[plane], DitherLuts[plane], InputBuffer + plane,
PrinterPlanes, OutputBuffers[plane]);
if (DotRowMax == 1)
* Handle microweaved output...
*/
- if (cupsCheckBytes(OutputBuffers[plane], width))
+ if (cfCheckBytes(OutputBuffers[plane], width))
continue;
if (BitPlanes == 1)
- cupsPackHorizontal(OutputBuffers[plane], DotBuffers[plane],
+ cfPackHorizontal(OutputBuffers[plane], DotBuffers[plane],
width, 0, 1);
else
- cupsPackHorizontal2(OutputBuffers[plane], DotBuffers[plane],
+ cfPackHorizontal2(OutputBuffers[plane], DotBuffers[plane],
width, 1);
if (OutputFeed > 0)
{
- cupsWritePrintData("\033(v\002\000", 5);
+ cfWritePrintData("\033(v\002\000", 5);
putchar(OutputFeed & 255);
putchar(OutputFeed >> 8);
OutputFeed = 0;
offset = band->row * DotBufferSize;
if (BitPlanes == 1)
- cupsPackHorizontal(OutputBuffers[plane] + pass,
+ cfPackHorizontal(OutputBuffers[plane] + pass,
band->buffer + offset, subwidth, 0, DotColStep);
else
- cupsPackHorizontal2(OutputBuffers[plane] + pass,
+ cfPackHorizontal2(OutputBuffers[plane] + pass,
band->buffer + offset, subwidth, DotColStep);
band->row ++;
- band->dirty |= !cupsCheckBytes(band->buffer + offset, DotBufferSize);
+ band->dirty |= !cfCheckBytes(band->buffer + offset, DotBufferSize);
if (band->row >= band->count)
{
if (band->dirty)
* Globals...
*/
-cups_rgb_t *RGB; /* RGB color separation data */
-cups_cmyk_t *CMYK; /* CMYK color separation data */
+cf_rgb_t *RGB; /* RGB color separation data */
+cf_cmyk_t *CMYK; /* CMYK color separation data */
unsigned char *PixelBuffer, /* Pixel buffer */
*CMYKBuffer, /* CMYK buffer */
*OutputBuffers[6], /* Output buffers */
*SeedBuffer, /* Mode 3 seed buffers */
BlankValue; /* The blank value */
short *InputBuffer; /* Color separation buffer */
-cups_lut_t *DitherLuts[6]; /* Lookup tables for dithering */
-cups_dither_t *DitherStates[6]; /* Dither state tables */
+cf_lut_t *DitherLuts[6]; /* Lookup tables for dithering */
+cf_dither_t *DitherStates[6]; /* Dither state tables */
int PrinterPlanes, /* Number of color planes */
SeedInvalid, /* Contents of seed buffer invalid? */
DotBits[6], /* Number of bits per color */
{
if (header->cupsColorSpace == CUPS_CSPACE_RGB ||
header->cupsColorSpace == CUPS_CSPACE_W)
- RGB = cupsRGBLoad(ppd, colormodel, header->MediaType, resolution,
+ RGB = cfRGBLoad(ppd, colormodel, header->MediaType, resolution,
logfunc, ld);
- CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution,
+ CMYK = cfCMYKLoad(ppd, colormodel, header->MediaType, resolution,
logfunc, ld);
}
PrinterPlanes = 1;
/*fputs("DEBUG: Loading default K separation.\n", stderr);*/
fprintf(stderr, "DEBUG: Color Space: %d; Color Planes %d\n", header->cupsColorSpace, PrinterPlanes);
- CMYK = cupsCMYKNew(PrinterPlanes);
+ CMYK = cfCMYKNew(PrinterPlanes);
}
PrinterPlanes = CMYK->num_channels;
switch (PrinterPlanes)
{
case 1 : /* K */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
case 3 : /* CMY */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
break;
case 4 : /* CMYK */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
- DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[3] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
case 6 : /* CcMmYK */
- DitherLuts[0] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[0] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Cyan", logfunc, ld);
- DitherLuts[1] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[1] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightCyan", logfunc, ld);
- DitherLuts[2] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[2] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Magenta", logfunc, ld);
- DitherLuts[3] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[3] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "LightMagenta", logfunc, ld);
- DitherLuts[4] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[4] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Yellow", logfunc, ld);
- DitherLuts[5] = cupsLutLoad(ppd, colormodel, header->MediaType,
+ DitherLuts[5] = cfLutLoad(ppd, colormodel, header->MediaType,
resolution, "Black", logfunc, ld);
break;
}
for (plane = 0; plane < PrinterPlanes; plane ++)
{
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
+ DitherLuts[plane] = cfLutNew(2, default_lut, logfunc, ld);
if (DitherLuts[plane][4095].pixel > 1)
DotBits[plane] = 2;
else
DotBits[plane] = 1;
- DitherStates[plane] = cupsDitherNew(header->cupsWidth);
+ DitherStates[plane] = cfDitherNew(header->cupsWidth);
if (!DitherLuts[plane])
- DitherLuts[plane] = cupsLutNew(2, default_lut, logfunc, ld);
+ DitherLuts[plane] = cfLutNew(2, default_lut, logfunc, ld);
}
}
printf("\033*p0Y\033*p0X");
}
- if (ppd && ((attr = cupsFindAttr(ppd, "cupsPCLQuality", colormodel,
+ if (ppd && ((attr = cfFindAttr(ppd, "cupsPCLQuality", colormodel,
header->MediaType, resolution, spec,
sizeof(spec), logfunc, ld)) != NULL))
{
* vertical resolutions as well as a color count...
*/
- if (ppd && ((attr = cupsFindAttr(ppd, "cupsPCLCRDMode", colormodel,
+ if (ppd && ((attr = cfFindAttr(ppd, "cupsPCLCRDMode", colormodel,
header->MediaType, resolution, spec,
sizeof(spec), logfunc, ld)) != NULL))
i = atoi(attr->value);
pcl_set_simple_resolution(header->HWResolution[0]);
/* Set output resolution */
- cupsWritePrintData("\033*v6W\2\3\0\10\10\10", 11);
+ cfWritePrintData("\033*v6W\2\3\0\10\10\10", 11);
/* 24-bit sRGB */
}
else
{
for (plane = 0; plane < PrinterPlanes; plane ++)
{
- cupsDitherDelete(DitherStates[plane]);
- cupsLutDelete(DitherLuts[plane]);
+ cfDitherDelete(DitherStates[plane]);
+ cfLutDelete(DitherLuts[plane]);
}
free(DotBuffers[0]);
free(InputBuffer);
free(OutputBuffers[0]);
- cupsCMYKDelete(CMYK);
+ cfCMYKDelete(CMYK);
if (RGB)
{
- cupsRGBDelete(RGB);
+ cfRGBDelete(RGB);
free(CMYKBuffer);
}
}
line_ptr = line;
- if (cupsCheckBytes(line, length))
+ if (cfCheckBytes(line, length))
line_end = line; /* Blank line */
else
line_end = line + length; /* Non-blank line */
*/
printf("\033*b%d%c", (int)(line_end - line_ptr), pend);
- cupsWritePrintData(line_ptr, line_end - line_ptr);
+ cfWritePrintData(line_ptr, line_end - line_ptr);
}
bit <= DotBits[plane];
bit <<= 1, ptr += bytes, j ++)
{
- cupsPackHorizontalBit(OutputBuffers[plane], DotBuffers[plane],
+ cfPackHorizontalBit(OutputBuffers[plane], DotBuffers[plane],
width, 0, bit);
CompressData(ptr, bytes, j,
i == (PrinterPlanes - 1) &&
* See if it is blank; if so, return right away...
*/
- if (cupsCheckValue(PixelBuffer, header->cupsBytesPerLine, BlankValue))
+ if (cfCheckValue(PixelBuffer, header->cupsBytesPerLine, BlankValue))
return (0);
/*
case CUPS_CSPACE_W :
if (RGB)
{
- cupsRGBDoGray(RGB, PixelBuffer, CMYKBuffer, width);
+ cfRGBDoGray(RGB, PixelBuffer, CMYKBuffer, width);
if (RGB->num_channels == 1)
- cupsCMYKDoBlack(CMYK, CMYKBuffer, InputBuffer, width);
+ cfCMYKDoBlack(CMYK, CMYKBuffer, InputBuffer, width);
else
- cupsCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
+ cfCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
}
else
- cupsCMYKDoGray(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoGray(CMYK, PixelBuffer, InputBuffer, width);
break;
case CUPS_CSPACE_K :
- cupsCMYKDoBlack(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoBlack(CMYK, PixelBuffer, InputBuffer, width);
break;
default :
case CUPS_CSPACE_RGB :
if (RGB)
{
- cupsRGBDoRGB(RGB, PixelBuffer, CMYKBuffer, width);
+ cfRGBDoRGB(RGB, PixelBuffer, CMYKBuffer, width);
if (RGB->num_channels == 1)
- cupsCMYKDoBlack(CMYK, CMYKBuffer, InputBuffer, width);
+ cfCMYKDoBlack(CMYK, CMYKBuffer, InputBuffer, width);
else
- cupsCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
+ cfCMYKDoCMYK(CMYK, CMYKBuffer, InputBuffer, width);
}
else
- cupsCMYKDoRGB(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoRGB(CMYK, PixelBuffer, InputBuffer, width);
break;
case CUPS_CSPACE_CMYK :
- cupsCMYKDoCMYK(CMYK, PixelBuffer, InputBuffer, width);
+ cfCMYKDoCMYK(CMYK, PixelBuffer, InputBuffer, width);
break;
}
*/
for (plane = 0; plane < PrinterPlanes; plane ++)
- cupsDitherLine(DitherStates[plane], DitherLuts[plane], InputBuffer + plane,
+ cfDitherLine(DitherStates[plane], DitherLuts[plane], InputBuffer + plane,
PrinterPlanes, OutputBuffers[plane]);
/*