summaryrefslogtreecommitdiff
path: root/src/main/print-escp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/print-escp2.c')
-rw-r--r--src/main/print-escp2.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/main/print-escp2.c b/src/main/print-escp2.c
index 2fd9083..3c95d8e 100644
--- a/src/main/print-escp2.c
+++ b/src/main/print-escp2.c
@@ -1,5 +1,5 @@
/*
- * "$Id: print-escp2.c,v 1.433 2010/12/11 22:04:07 rlk Exp $"
+ * "$Id: print-escp2.c,v 1.438 2012/01/19 13:26:28 m0m Exp $"
*
* Print plug-in EPSON ESC/P2 driver for the GIMP.
*
@@ -899,6 +899,14 @@ static const float_param_t float_parameters[] =
},
{
{
+ "SubchannelCutoff", N_("Subchannel Cutoff"), "Color=Yes,Category=Advanced Output Control",
+ N_("Upper limit for using light ink"),
+ STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT,
+ STP_PARAMETER_LEVEL_ADVANCED4, 0, 1, 0, 1, 0
+ }, 0.0, 1.0, 1.0, 1
+ },
+ {
+ {
"PageDryTime", N_("Drying Time Per Page"), "Color=No,Category=Advanced Printer Functionality",
N_("Set drying time per page"),
STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_FEATURE,
@@ -1673,15 +1681,18 @@ get_inktype(const stp_vars_t *v)
* This may mean duplicate work, but that's cheap enough.
*/
ink_type = get_default_inktype(v);
- for (i = 0; i < ink_list->n_inks; i++)
+ if (ink_type && ink_list)
{
- if (strcmp(ink_type, ink_list->inknames[i].name) == 0)
- return &(ink_list->inknames[i]);
+ for (i = 0; i < ink_list->n_inks; i++)
+ {
+ if (strcmp(ink_type, ink_list->inknames[i].name) == 0)
+ return &(ink_list->inknames[i]);
+ }
}
/*
* If even *that* doesn't work, try using the first ink type on the list.
*/
- return &(ink_list->inknames[0]);
+ return (ink_list) ? &(ink_list->inknames[0]) : NULL;
}
static const inkname_t *
@@ -2160,6 +2171,8 @@ escp2_parameters(const stp_vars_t *v, const char *name,
if (name == NULL)
return;
+ memset(&description->deflt, 0, sizeof(description->deflt));
+
for (i = 0; i < float_parameter_count; i++)
if (strcmp(name, float_parameters[i].param.name) == 0)
{
@@ -2194,7 +2207,6 @@ escp2_parameters(const stp_vars_t *v, const char *name,
break;
}
- description->deflt.str = NULL;
if (strcmp(name, "AutoMode") == 0)
{
description->bounds.str = stp_string_list_create();
@@ -2366,14 +2378,11 @@ escp2_parameters(const stp_vars_t *v, const char *name,
description->bounds.str = stp_string_list_create();
if (ninklists > 1)
{
- int has_default_choice = 0;
for (i = 0; i < ninklists; i++)
{
stp_string_list_add_string(description->bounds.str,
inks->inklists[i].name,
gettext(inks->inklists[i].text));
- if (strcmp(inks->inklists[i].name, "None") == 0)
- has_default_choice = 1;
}
description->deflt.str =
stp_string_list_param(description->bounds.str, 0)->name;
@@ -3363,7 +3372,6 @@ setup_inks(stp_vars_t *v)
escp2_dropsize_t *drops;
const inkname_t *ink_type = pd->inkname;
const stp_vars_t *pv = pd->paper_type->v;
- int gloss_channel = -1;
double gloss_scale = get_double_param(v, "Density");
drops = escp2_copy_dropsizes(v);
@@ -3409,7 +3417,6 @@ setup_inks(stp_vars_t *v)
else if (strcmp(param, "GlossDensity") == 0)
{
gloss_scale *= get_double_param(v, param);
- gloss_channel = i;
}
}
for (j = 0; j < channel->n_subchannels; j++)
@@ -4301,7 +4308,6 @@ escp2_print_page(stp_vars_t *v, stp_image_t *image)
{
int status;
escp2_privdata_t *pd = get_privdata(v);
- int out_channels; /* Output bytes per pixel */
int line_width = (pd->image_printed_width + 7) / 8 * pd->bitwidth;
int weave_pattern = STP_WEAVE_ZIGZAG;
if (stp_check_string_parameter(v, "Weave", STP_PARAMETER_ACTIVE))
@@ -4351,7 +4357,7 @@ escp2_print_page(stp_vars_t *v, stp_image_t *image)
pd->res->printed_vres);
allocate_channels(v, line_width);
adjust_print_quality(v);
- out_channels = stp_color_init(v, image, 65536);
+ (void) stp_color_init(v, image, 65536);
/* stpi_dither_set_expansion(v, pd->res->hres / pd->res->printed_hres); */
@@ -4396,7 +4402,7 @@ escp2_do_print(stp_vars_t *v, stp_image_t *image, int print_op)
stp_allocate_component_data(v, "Driver", NULL, NULL, pd);
pd->inkname = get_inktype(v);
- if (pd->inkname->inkset != INKSET_EXTENDED &&
+ if (pd->inkname && pd->inkname->inkset != INKSET_EXTENDED &&
stp_check_boolean_parameter(v, "UseGloss", STP_PARAMETER_ACTIVE) &&
stp_get_boolean_parameter(v, "UseGloss"))
pd->use_aux_channels = 1;