/*
* ColorModel...
*/
+ if ((defattr = ippFindAttribute(response, "print-color-mode-default",
+ IPP_TAG_KEYWORD)) == NULL)
+ defattr = ippFindAttribute(response, "output-mode-default",
+ IPP_TAG_KEYWORD);
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) ==
NULL)
have_bi_level = 0,
have_mono = 0;
+ if ((keyword = ippGetString(defattr, 0, NULL)) != NULL)
+ {
+ if (!strcmp(keyword, "bi-level"))
+ default_color = "FastGray";
+ else if (!strcmp(keyword, "monochrome") ||
+ !strcmp(keyword, "auto-monochrome"))
+ default_color = "Gray";
+ else
+ default_color = "RGB";
+ }
+
cupsFilePrintf(fp, "*%% ColorModel from %s\n", ippGetName(attr));
for (i = 0, count = ippGetCount(attr); i < count; i ++) {
(human_readable2 ? human_readable2 :
_cupsLangString(lang, _("Grayscale"))));
- if (!default_color || !strcmp(default_color, "FastGray"))
+ if (!default_color || (!defattr && !strcmp(default_color, "FastGray")))
default_color = "Gray";
} else if (!strcasecmp(keyword, "sgray_16") ||
!strncmp(keyword, "W8-16", 5) ||
cupsFilePrintf(fp, "*ColorModel Gray16/%s: \"<</cupsColorSpace 18/cupsBitsPerColor 16/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n",
_cupsLangString(lang, _("Deep Gray (High Definition Grayscale)")));
- if (!default_color || !strcmp(default_color, "FastGray"))
+ if (!default_color || (!defattr && !strcmp(default_color, "FastGray")))
default_color = "Gray16";
} else if (!strcasecmp(keyword, "srgb_8") ||
!strncmp(keyword, "SRGB24", 6) ||
(human_readable2 ? human_readable2 :
_cupsLangString(lang, _("Color"))));
- default_color = "RGB";
+ if (!defattr)
+ default_color = "RGB";
} else if ((!strcasecmp(keyword, "srgb_16") ||
!strncmp(keyword, "SRGB48", 6)) &&
!ippContainsString(attr, "srgb_8")) {
(human_readable2 ? human_readable2 :
_cupsLangString(lang, _("Color"))));
- default_color = "RGB";
+ if (!default_color)
+ default_color = "RGB";
/* Apparently some printers only advertise color support, so make sure
we also do grayscale for these printers... */
if (default_pagesize != NULL) {
/* Here we are dealing with a cluster, if the default cluster color
is not supplied we set it Gray*/
- if (default_cluster_color != NULL) {
+ if (default_cluster_color != NULL && (!default_color || !defattr)) {
default_color = default_cluster_color;
} else
default_color = "Gray";