diff options
author | Didier Raboud <odyx@debian.org> | 2017-01-22 10:36:11 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2017-01-22 10:36:11 +0100 |
commit | 7bd83d89975d166521a0b326b64b4cad80117750 (patch) | |
tree | d303f82c5651a20c507e69d9a8bb37a845492feb /src/main | |
parent | 54a135b87201e48d4da4894a61b81a8c6fe46d26 (diff) |
New upstream version 5.2.12
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/curve.c | 3 | ||||
-rw-r--r-- | src/main/generic-options.c | 24 | ||||
-rw-r--r-- | src/main/module.c | 4 | ||||
-rw-r--r-- | src/main/print-color.c | 1 | ||||
-rw-r--r-- | src/main/print-dpl.c | 9 | ||||
-rw-r--r-- | src/main/print-lexmark.c | 2 | ||||
-rw-r--r-- | src/main/print-olympus.c | 1517 | ||||
-rw-r--r-- | src/main/print-pcl.c | 32 |
8 files changed, 1433 insertions, 159 deletions
diff --git a/src/main/curve.c b/src/main/curve.c index 9c0795e..d552cc7 100644 --- a/src/main/curve.c +++ b/src/main/curve.c @@ -85,9 +85,6 @@ static const char *const stpi_wrap_mode_names[] = "wrap" }; -static const int stpi_wrap_mode_count = -(sizeof(stpi_wrap_mode_names) / sizeof(const char *)); - /* * Get the total number of points in the base sequence class */ diff --git a/src/main/generic-options.c b/src/main/generic-options.c index c91e41c..ed360f6 100644 --- a/src/main/generic-options.c +++ b/src/main/generic-options.c @@ -79,7 +79,19 @@ static const stp_parameter_t the_parameters[] = "PageNumber", N_("Page Number"), "Color=No,Category=Job Mode", N_("Page number"), STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_CORE, - STP_PARAMETER_LEVEL_BASIC, 0, 1, STP_CHANNEL_NONE, 1, 0 + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "NumCopies", N_("Number of Copies"), "Color=No,Category=Job Mode", + N_("Number of Copies"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_CORE, + STP_PARAMETER_LEVEL_INTERNAL, 1, 0, STP_CHANNEL_NONE, 1, 0 + }, + { + "Collate", N_("Collate the Job"), "Color=No,Category=Job Mode", + N_("Collate the Job"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_CORE, + STP_PARAMETER_LEVEL_INTERNAL, 1, 0, STP_CHANNEL_NONE, 1, 0 }, }; @@ -252,5 +264,15 @@ stpi_describe_generic_parameter(const stp_vars_t *v, const char *name, description->bounds.integer.lower = 0; description->bounds.integer.upper = INT_MAX; } + else if (strcmp(name, "NumCopies") == 0) + { + description->deflt.integer = 1; + description->bounds.integer.lower = 1; + description->bounds.integer.upper = INT_MAX; + } + else if (strcmp(name, "Collate") == 0) + { + description->deflt.boolean = 0; + } } diff --git a/src/main/module.c b/src/main/module.c index c21d320..5d223bf 100644 --- a/src/main/module.c +++ b/src/main/module.c @@ -46,6 +46,9 @@ static int stp_module_register(stp_module_t *module); static void *stp_dlsym(void *handle, const char *symbol, const char *modulename); #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-const-variable" + static const stpi_internal_module_class_t module_classes[] = { {STP_MODULE_CLASS_MISC, N_("Miscellaneous (unclassified)")}, @@ -54,6 +57,7 @@ static const stpi_internal_module_class_t module_classes[] = {STP_MODULE_CLASS_DITHER, N_("Dither algorithm")}, {STP_MODULE_CLASS_INVALID, NULL} /* Must be last */ }; +#pragma GCC diagnostic pop #if !defined(MODULE) extern stp_module_t print_canon_LTX_stp_module_data; diff --git a/src/main/print-color.c b/src/main/print-color.c index cf9c51b..6edd61b 100644 --- a/src/main/print-color.c +++ b/src/main/print-color.c @@ -1475,6 +1475,7 @@ stpi_compute_lut(stp_vars_t *v) for (i = 0; i < STP_CHANNEL_LIMIT; i++) { + STPI_ASSERT(i < raw_channel_param_count, v); if (lut->output_color_description->channel_count < 1 && i < lut->out_channels) setup_channel(v, i, &(raw_channel_params[i])); diff --git a/src/main/print-dpl.c b/src/main/print-dpl.c index 0802838..fde76ea 100644 --- a/src/main/print-dpl.c +++ b/src/main/print-dpl.c @@ -799,9 +799,11 @@ pcx_header (stp_vars_t * v, stp_image_t * image) unsigned short top; /* y = 0 is at bottom */ unsigned short bytes; short xdpi; - int *xdpi_p = (int *) (&xdpi); + int i_xdpi; + int *xdpi_p = (&i_xdpi); short ydpi; - int *ydpi_p = (int *) (&ydpi); + int i_ydpi; + int *ydpi_p = (&i_ydpi); int n; const short zero = 0; @@ -813,6 +815,9 @@ pcx_header (stp_vars_t * v, stp_image_t * image) /* Get resolutions */ dpl_describe_resolution (v, xdpi_p, ydpi_p); + xdpi = (short) i_xdpi; + ydpi = (short) i_ydpi; + bytes = (xdpi * 4 + 7 ) / 8; /* must be an even number */ if (bytes != (bytes & 0xfffe)) bytes++; diff --git a/src/main/print-lexmark.c b/src/main/print-lexmark.c index dcf9cbf..5d48bfb 100644 --- a/src/main/print-lexmark.c +++ b/src/main/print-lexmark.c @@ -951,7 +951,7 @@ get_media_type(const char *name, const lexmark_cap_t * caps) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-pedantic" +#pragma GCC diagnostic ignored "-Wpedantic" static inline int lexmark_source_type(const char *name, const lexmark_cap_t * caps) { diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c index 73dfa67..59c8d0c 100644 --- a/src/main/print-olympus.c +++ b/src/main/print-olympus.c @@ -36,7 +36,7 @@ #include <string.h> #include <stdio.h> #include <limits.h> - +#include <time.h> /* For strftime() and localtime_r() */ #ifdef __GNUC__ #define inline __inline__ #endif @@ -55,6 +55,7 @@ #define DYESUB_FEATURE_BIGENDIAN 0x00000400 #define DYESUB_FEATURE_RGBtoYCBCR 0x00000800 #define DYESUB_FEATURE_DUPLEX 0x00001000 +#define DYESUB_FEATURE_MONOCHROME 0x00002000 /* Monochrome only..? */ #define DYESUB_PORTRAIT 0 #define DYESUB_LANDSCAPE 1 @@ -177,24 +178,53 @@ typedef struct { typedef struct { int multicut; + const char *print_speed; /* DS820 only */ } dnp_privdata_t; typedef struct { int quality; int finedeep; + int contrast; } mitsu9550_privdata_t; typedef struct { int quality; int laminate_offset; -#ifdef MITSU70X_8BPP int use_lut; -#endif int sharpen; + int delay; } mitsu70x_privdata_t; +typedef struct +{ + int sharpen; +} kodak9810_privdata_t; + +typedef struct +{ + int sharpen; + int matte_intensity; +} kodak8500_privdata_t; + +typedef struct +{ + int matte_intensity; + int dust_removal; +} shinko1245_privdata_t; + +typedef struct +{ + int clear_mem; + int cont_print; + int gamma; + int flags; + int comment; + char usercomment[34]; + char commentbuf[19]; /* With one extra byte for null termination */ +} mitsu_p95d_privdata_t; + /* Private data for dyesub driver as a whole */ typedef struct { @@ -211,10 +241,15 @@ typedef struct int bpp; const char* duplex_mode; int page_number; + int copies; union { dnp_privdata_t dnp; mitsu9550_privdata_t m9550; mitsu70x_privdata_t m70x; + kodak9810_privdata_t k9810; + kodak8500_privdata_t k8500; + shinko1245_privdata_t s1245; + mitsu_p95d_privdata_t m95d; } privdata; } dyesub_privdata_t; @@ -306,6 +341,13 @@ static const ink_t bgr_inks[] = LIST(ink_list_t, bgr_ink_list, ink_t, bgr_inks); +static const ink_t w_inks[] = +{ + { "Whitescale", 1, "BW", "\1" }, +}; + +LIST(ink_list_t, w_ink_list, ink_t, w_inks); + /* Olympus P-10 */ static const dyesub_resolution_t res_310dpi[] = { @@ -318,7 +360,6 @@ static const dyesub_pagesize_t p10_page[] = { { "w288h432", "4x6", 298, 430, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 4x6" */ { "B7", "3.5x5", 266, 370, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 3.5x5" */ - { "Custom", NULL, 298, 430, 28, 28, 48, 48, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, p10_page_list, dyesub_pagesize_t, p10_page); @@ -327,7 +368,6 @@ static const dyesub_printsize_t p10_printsize[] = { { "310x310", "w288h432", 1280, 1848}, { "310x310", "B7", 1144, 1591}, - { "310x310", "Custom", 1280, 1848}, }; LIST(dyesub_printsize_list_t, p10_printsize_list, dyesub_printsize_t, p10_printsize); @@ -377,7 +417,6 @@ LIST(dyesub_resolution_list_t, res_320dpi_list, dyesub_resolution_t, res_320dpi) static const dyesub_pagesize_t p200_page[] = { { "ISOB7", "80x125mm", -1, -1, 16, 17, 33, 33, DYESUB_PORTRAIT}, - { "Custom", NULL, -1, -1, 16, 17, 33, 33, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, p200_page_list, dyesub_pagesize_t, p200_page); @@ -385,7 +424,6 @@ LIST(dyesub_pagesize_list_t, p200_page_list, dyesub_pagesize_t, p200_page); static const dyesub_printsize_t p200_printsize[] = { { "320x320", "ISOB7", 960, 1280}, - { "320x320", "Custom", 960, 1280}, }; LIST(dyesub_printsize_list_t, p200_printsize_list, dyesub_printsize_t, p200_printsize); @@ -441,7 +479,6 @@ LIST(dyesub_resolution_list_t, p300_res_list, dyesub_resolution_t, p300_res); static const dyesub_pagesize_t p300_page[] = { { "A6", "A6", -1, -1, 28, 28, 48, 48, DYESUB_PORTRAIT}, - { "Custom", NULL, -1, -1, 28, 28, 48, 48, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, p300_page_list, dyesub_pagesize_t, p300_page); @@ -450,8 +487,6 @@ static const dyesub_printsize_t p300_printsize[] = { { "306x306", "A6", 1024, 1376}, { "153x153", "A6", 512, 688}, - { "306x306", "Custom", 1024, 1376}, - { "153x153", "Custom", 512, 688}, }; LIST(dyesub_printsize_list_t, p300_printsize_list, dyesub_printsize_t, p300_printsize); @@ -551,7 +586,6 @@ static const dyesub_pagesize_t p400_page[] = { "A4", "A4", -1, -1, 22, 22, 54, 54, DYESUB_PORTRAIT}, { "c8x10", "A5 wide", -1, -1, 58, 59, 84, 85, DYESUB_PORTRAIT}, { "C6", "2 Postcards (A4)", -1, -1, 9, 9, 9, 9, DYESUB_PORTRAIT}, - { "Custom", NULL, -1, -1, 22, 22, 54, 54, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, p400_page_list, dyesub_pagesize_t, p400_page); @@ -561,7 +595,6 @@ static const dyesub_printsize_t p400_printsize[] = { "314x314", "A4", 2400, 3200}, { "314x314", "c8x10", 2000, 2400}, { "314x314", "C6", 1328, 1920}, - { "314x314", "Custom", 2400, 3200}, }; LIST(dyesub_printsize_list_t, p400_printsize_list, dyesub_printsize_t, p400_printsize); @@ -678,7 +711,6 @@ static const dyesub_pagesize_t p440_page[] = { "c8x10", "A5 wide", -1, -1, 58, 59, 72, 72, DYESUB_PORTRAIT}, { "C6", "2 Postcards (A4)", -1, -1, 9, 9, 9, 9, DYESUB_PORTRAIT}, { "w255h581", "A6 wide", -1, -1, 25, 25, 25, 24, DYESUB_PORTRAIT}, - { "Custom", NULL, -1, -1, 22, 22, 54, 54, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, p440_page_list, dyesub_pagesize_t, p440_page); @@ -689,7 +721,6 @@ static const dyesub_printsize_t p440_printsize[] = { "314x314", "c8x10", 2000, 2508}, { "314x314", "C6", 1328, 1920}, { "314x314", "w255h581", 892, 2320}, - { "314x314", "Custom", 2508, 3200}, }; LIST(dyesub_printsize_list_t, p440_printsize_list, dyesub_printsize_t, p440_printsize); @@ -697,8 +728,7 @@ LIST(dyesub_printsize_list_t, p440_printsize_list, dyesub_printsize_t, p440_prin static void p440_printer_init_func(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); - int wide = ! (strcmp(pd->pagesize, "A4") == 0 - || strcmp(pd->pagesize, "Custom") == 0); + int wide = strcmp(pd->pagesize, "A4") != 0; stp_zprintf(v, "\033FP"); dyesub_nputc(v, '\0', 61); stp_zprintf(v, "\033Y"); @@ -734,8 +764,7 @@ static void p440_printer_end_func(stp_vars_t *v) static void p440_block_init_func(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); - int wide = ! (strcmp(pd->pagesize, "A4") == 0 - || strcmp(pd->pagesize, "Custom") == 0); + int wide = strcmp(pd->pagesize, "A4") != 0; stp_zprintf(v, "\033ZT"); if (wide) @@ -774,7 +803,6 @@ static const dyesub_pagesize_t ps100_page[] = { { "w288h432", "4x6", 296, 426, 0, 0, 0, 0, DYESUB_PORTRAIT},/* 4x6" */ { "B7", "3.5x5", 264, 366, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 3.5x5" */ - { "Custom", NULL, 296, 426, 0, 0, 0, 0, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, ps100_page_list, dyesub_pagesize_t, ps100_page); @@ -783,7 +811,6 @@ static const dyesub_printsize_t ps100_printsize[] = { { "306x306", "w288h432", 1254, 1808}, { "306x306", "B7", 1120, 1554}, - { "306x306", "Custom", 1254, 1808}, }; LIST(dyesub_printsize_list_t, ps100_printsize_list, dyesub_printsize_t, ps100_printsize); @@ -802,7 +829,7 @@ static void ps100_printer_init_func(stp_vars_t *v) stp_put16_be(pd->h_size, v); /* paper height (px) */ stp_put16_be(pd->w_size, v); /* paper width (px) */ dyesub_nputc(v, '\0', 3); - stp_putc('\1', v); /* number of copies */ + stp_putc(pd->copies, v); /* number of copies */ dyesub_nputc(v, '\0', 8); stp_putc('\1', v); dyesub_nputc(v, '\0', 15); @@ -1117,11 +1144,11 @@ static void cp900_printer_end_func(stp_vars_t *v) dyesub_nputc(v, 0x0, 4); } -/* Canon CP820/CP910 */ +/* Canon CP820/CP910/CP1000/CP1200 and beynod */ static const dyesub_pagesize_t cp910_page[] = { { "Postcard", "Postcard 100x148mm", PT(1248,300)+1, PT(1872,300)+1, 13, 13, 16, 19, DYESUB_PORTRAIT}, - { "w253h337", "CP_L 89x119mm", PT(1104,300)+1, PT(1536,300)+1, 13, 13, 15, 15, DYESUB_PORTRAIT}, + { "w253h337", "CP_L 89x119mm", PT(1152,300)+1, PT(1472,300)+1, 13, 13, 15, 15, DYESUB_PORTRAIT}, { "w155h244", "Card 54x86mm", PT(1088,300)+1, PT(668,300)+1, 13, 13, 15, 15, DYESUB_LANDSCAPE}, }; @@ -1130,7 +1157,7 @@ LIST(dyesub_pagesize_list_t, cp910_page_list, dyesub_pagesize_t, cp910_page); static const dyesub_printsize_t cp910_printsize[] = { { "300x300", "Postcard", 1248, 1872}, - { "300x300", "w253h337", 1104, 1536}, + { "300x300", "w253h337", 1152, 1472}, { "300x300", "w155h244", 668, 1088}, }; @@ -1155,28 +1182,8 @@ static void cp910_printer_init_func(stp_vars_t *v) dyesub_nputc(v, '\0', 5); - pg = (strcmp(pd->pagesize, "Postcard") == 0 ? 0xe0 : - (strcmp(pd->pagesize, "w253h337") == 0 ? 0x80 : - (strcmp(pd->pagesize, "w155h244") == 0 ? 0x40 : - 0xe0 ))); - stp_putc(pg, v); - - stp_putc(0x04, v); - dyesub_nputc(v, '\0', 2); - - pg = (strcmp(pd->pagesize, "Postcard") == 0 ? 0x50 : - (strcmp(pd->pagesize, "w253h337") == 0 ? 0xc0 : - (strcmp(pd->pagesize, "w155h244") == 0 ? 0x9c : - 0x50 ))); - stp_putc(pg, v); - - pg = (strcmp(pd->pagesize, "Postcard") == 0 ? 0x07 : - (strcmp(pd->pagesize, "w253h337") == 0 ? 0x05 : - (strcmp(pd->pagesize, "w155h244") == 0 ? 0x02 : - 0x07 ))); - stp_putc(pg, v); - - dyesub_nputc(v, '\0', 2); + stp_put32_le(pd->w_size, v); + stp_put32_le(pd->h_size, v); } /* Sony DPP-EX5, DPP-EX7 */ @@ -1192,8 +1199,6 @@ static const dyesub_pagesize_t dppex5_page[] = { { "w288h432", "Postcard", PT(1664,403)+1, PT(2466,403)+1, 13, 14, 18, 17, DYESUB_PORTRAIT}, - { "Custom", NULL, PT(1664,403)+1, PT(2466,403)+1, 13, 14, 18, 17, - DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, dppex5_page_list, dyesub_pagesize_t, dppex5_page); @@ -1201,7 +1206,6 @@ LIST(dyesub_pagesize_list_t, dppex5_page_list, dyesub_pagesize_t, dppex5_page); static const dyesub_printsize_t dppex5_printsize[] = { { "403x403", "w288h432", 1664, 2466}, - { "403x403", "Custom", 1664, 2466}, }; LIST(dyesub_printsize_list_t, dppex5_printsize_list, dyesub_printsize_t, dppex5_printsize); @@ -1263,11 +1267,6 @@ static const dyesub_pagesize_t updp10_page[] = { { "w288h432", "UPC-10P23 (4x6)", -1, -1, 12, 12, 18, 18, DYESUB_LANDSCAPE}, { "w288h387", "UPC-10P34 (4x5)", -1, 384, 12, 12, 16, 16, DYESUB_LANDSCAPE}, -#if 0 - /* We can't have two paper sizes that are the same size --rlk 20080813 */ - { "w288h432", "UPC-10S01 (Sticker)", -1, -1, 12, 12, 18, 18, DYESUB_LANDSCAPE}, -#endif - { "Custom", NULL, -1, -1, 12, 12, 0, 0, DYESUB_LANDSCAPE}, }; LIST(dyesub_pagesize_list_t, updp10_page_list, dyesub_pagesize_t, updp10_page); @@ -1276,7 +1275,6 @@ static const dyesub_printsize_t updp10_printsize[] = { { "300x300", "w288h432", 1200, 1800}, { "300x300", "w288h387", 1200, 1600}, - { "300x300", "Custom", 1200, 1800}, }; LIST(dyesub_printsize_list_t, updp10_printsize_list, dyesub_printsize_t, updp10_printsize); @@ -1513,7 +1511,7 @@ static void updr150_200_printer_init_func(stp_vars_t *v, int updr200) "\x1b\xee\x00\x00\x00\x02\x00" "\x02\x00\x00\x00" "\x00", 1, 43, v); - stp_putc(1, v); /* Copies */ + stp_putc(pd->copies, v); if (updr200) { /* UP-DR200-specific! */ stp_zfwrite("\x07\x00\x00\x00" @@ -1680,7 +1678,7 @@ static void upcr10_printer_end_func(stp_vars_t *v) stp_zfwrite("\xfa\xff\xff\xff" "\x09\x00\x00\x00" "\x1b\xee\x00\x00\x00\x02\x00\x00", 1, 16, v); - stp_putc(1, v); /* Copies */ + stp_putc(pd->copies, v); stp_zfwrite("\x07\x00\x00\x00" "\x1b\x17\x00\x00\x00\x00\x00", 1, 11, v); stp_zfwrite("\xf9\xff\xff\xff" @@ -1696,7 +1694,6 @@ static const dyesub_pagesize_t cx400_page[] = { "w288h432", "4x6", 295, 428, 24, 24, 23, 22, DYESUB_PORTRAIT}, { "w288h387", "4x5 3/8", 295, 386, 24, 24, 23, 23, DYESUB_PORTRAIT}, { "w288h504", "4x7", 295, 513, 24, 24, 23, 22, DYESUB_PORTRAIT}, - { "Custom", NULL, 295, 428, 0, 0, 0, 0, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, cx400_page_list, dyesub_pagesize_t, cx400_page); @@ -1706,7 +1703,6 @@ static const dyesub_printsize_t cx400_printsize[] = { "310x310", "w288h387", 1268, 1658}, { "310x310", "w288h432", 1268, 1842}, { "310x310", "w288h504", 1268, 2208}, - { "310x310", "Custom", 1268, 1842}, }; LIST(dyesub_printsize_list_t, cx400_printsize_list, dyesub_printsize_t, cx400_printsize); @@ -1756,7 +1752,6 @@ LIST(dyesub_resolution_list_t, res_306dpi_list, dyesub_resolution_t, res_306dpi) static const dyesub_pagesize_t nx500_page[] = { { "Postcard", "Postcard", -1, -1, 21, 21, 29, 29, DYESUB_PORTRAIT}, - { "Custom", NULL, -1, -1, 21, 21, 29, 29, DYESUB_PORTRAIT}, }; LIST(dyesub_pagesize_list_t, nx500_page_list, dyesub_pagesize_t, nx500_page); @@ -1764,7 +1759,6 @@ LIST(dyesub_pagesize_list_t, nx500_page_list, dyesub_pagesize_t, nx500_page); static const dyesub_printsize_t nx500_printsize[] = { { "306x306", "Postcard", 1024, 1518}, - { "306x306", "Custom", 1024, 1518}, }; LIST(dyesub_printsize_list_t, nx500_printsize_list, dyesub_printsize_t, nx500_printsize); @@ -1791,8 +1785,6 @@ static const dyesub_pagesize_t kodak_dock_page[] = { { "w288h432", "4x6", PT(1248,300)+1, PT(1856,300)+1, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 4x6 */ - { "Custom", NULL, PT(1248,300)+1, PT(1856,300)+1, 0, 0, 0, 0, - DYESUB_PORTRAIT}, /* 4x6 */ }; LIST(dyesub_pagesize_list_t, kodak_dock_page_list, dyesub_pagesize_t, kodak_dock_page); @@ -1800,7 +1792,6 @@ LIST(dyesub_pagesize_list_t, kodak_dock_page_list, dyesub_pagesize_t, kodak_dock static const dyesub_printsize_t kodak_dock_printsize[] = { { "300x300", "w288h432", 1248, 1856}, - { "300x300", "Custom", 1248, 1856}, }; LIST(dyesub_printsize_list_t, kodak_dock_printsize_list, dyesub_printsize_t, kodak_dock_printsize); @@ -1870,12 +1861,33 @@ static const dyesub_printsize_t kodak_6850_printsize[] = LIST(dyesub_printsize_list_t, kodak_6850_printsize_list, dyesub_printsize_t, kodak_6850_printsize); +static unsigned short short_to_packed_bcd(unsigned short val) +{ + unsigned short bcd; + unsigned short i; + + /* Handle from 0-9999 */ + i = val % 10; + bcd = i; + val /= 10; + i = val % 10; + bcd |= (i << 4); + val /= 10; + i = val % 10; + bcd |= (i << 8); + val /= 10; + i = val % 10; + bcd |= (i << 12); + + return bcd; +} + static void kodak_68xx_printer_init(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); stp_zfwrite("\x03\x1b\x43\x48\x43\x0a\x00\x01", 1, 8, v); - stp_put16_be(0x01, v); /* Number of copies in BCD */ + stp_put16_be(short_to_packed_bcd(pd->copies), v); /* Number of copies in BCD */ stp_put16_be(pd->w_size, v); stp_put16_be(pd->h_size, v); @@ -1920,7 +1932,7 @@ static void kodak_605_printer_init(stp_vars_t *v) dyesub_privdata_t *pd = get_privdata(v); stp_zfwrite("\x01\x40\x0a\x00\x01", 1, 5, v); - stp_putc(0x01, v); /* Number of copies */ + stp_put16_be(short_to_packed_bcd(pd->copies), v); /* Number of copies in BCD */ stp_putc(0x00, v); stp_put16_le(pd->w_size, v); stp_put16_le(pd->h_size, v); @@ -2056,7 +2068,7 @@ static void kodak_805_printer_init(stp_vars_t *v) dyesub_nputc(v, 0x00, 12); } -/* Kodak 9810 */ +/* Kodak 9810 / 8800 */ static const dyesub_pagesize_t kodak_9810_page[] = { { "c8x10", "8x10", PT(2464,300)+1, PT(3024,300)+1, 0, 0, 0, 0, DYESUB_PORTRAIT}, @@ -2080,6 +2092,63 @@ static const laminate_t kodak_9810_laminate[] = LIST(laminate_list_t, kodak_9810_laminate_list, laminate_t, kodak_9810_laminate); +static const stp_parameter_t kodak_9810_parameters[] = +{ + { + "Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup", + N_("Sharpening to apply to image (0 is off, 18 is normal, 24 is max"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define kodak_9810_parameter_count (sizeof(kodak_9810_parameters) / sizeof(const stp_parameter_t)) + +static int +kodak_9810_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "Sharpen") == 0) + { + description->deflt.integer = 18; + description->bounds.integer.lower = 0; + description->bounds.integer.upper = 24; + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int kodak_9810_parse_parameters(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + /* Parse options */ + pd->privdata.k9810.sharpen = stp_get_int_parameter(v, "Sharpen"); + + return 1; +} + static void kodak_9810_printer_init(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); @@ -2175,14 +2244,14 @@ static void kodak_9810_printer_init(stp_vars_t *v) dyesub_nputc(v, 0x00, 4); stp_put32_be(2, v); stp_putc(0xFF, v); - stp_putc(0x12, v); /* SHARPENING -- 0 is off, 0x12 Normal, 0x19 is High */ + stp_putc(pd->privdata.k9810.sharpen, v); /* Number of Copies */ stp_putc(0x1b, v); stp_zfwrite("FlsPgCopies ", 1, 19, v); dyesub_nputc(v, 0x00, 4); stp_put32_be(4, v); - stp_put32_be(1, v); /* Number of copies, at least 1 */ + stp_put32_be(pd->copies, v); /* Mirroring */ stp_putc(0x1b, v); @@ -2293,7 +2362,7 @@ static void kodak_8810_printer_init(stp_vars_t *v) stp_putc(0x12, v); stp_putc(0x00, v); stp_putc(0x01, v); - stp_put16_le(0x01, v); /* Actually, # of copies */ + stp_put16_le(pd->copies, v); stp_put16_le(pd->w_size, v); stp_put16_le(pd->h_size, v); stp_put16_le(pd->w_size, v); @@ -2336,7 +2405,7 @@ static void kodak_70xx_printer_init(stp_vars_t *v) dyesub_privdata_t *pd = get_privdata(v); stp_zfwrite("\x01\x40\x0a\x00\x01", 1, 5, v); - stp_put16_le(0x01, v); /* Actually, # of copies */ + stp_put16_le(pd->copies, v); stp_put16_le(pd->w_size, v); stp_put16_le(pd->h_size, v); @@ -2389,18 +2458,8 @@ LIST(dyesub_printsize_list_t, kodak_8500_printsize_list, dyesub_printsize_t, kod static const dyesub_media_t kodak_8500_media[] = { - { "Glossy", N_("Glossy"), {2, "\x00\x00"}}, - { "Matte+5", N_("Matte +5"), {2, "\x01\x05"}}, - { "Matte+4", N_("Matte +4"), {2, "\x01\x04"}}, - { "Matte+3", N_("Matte +3"), {2, "\x01\x03"}}, - { "Matte+2", N_("Matte +2"), {2, "\x01\x02"}}, - { "Matte+1", N_("Matte +1"), {2, "\x01\x01"}}, - { "Matte", N_("Matte"), {2, "\x01\x00"}}, - { "Matte-1", N_("Matte -1"), {2, "\x01\xff"}}, - { "Matte-2", N_("Matte -2"), {2, "\x01\xfe"}}, - { "Matte-3", N_("Matte -3"), {2, "\x01\xfd"}}, - { "Matte-4", N_("Matte -4"), {2, "\x01\xfc"}}, - { "Matte-5", N_("Matte -5"), {2, "\x01\xfb"}}, + { "Glossy", N_("Glossy"), {1, "\x00"}}, + { "Matte", N_("Matte"), {1, "\x01"}}, }; LIST(dyesub_media_list_t, kodak_8500_media_list, dyesub_media_t, kodak_8500_media); @@ -2412,6 +2471,77 @@ static const laminate_t kodak_8500_laminate[] = LIST(laminate_list_t, kodak_8500_laminate_list, laminate_t, kodak_8500_laminate); +static const stp_parameter_t kodak_8500_parameters[] = +{ + { + "Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup", + N_("Sharpening to apply to image (-5 through +5)"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "MatteIntensity", N_("Matte Intensity"), "Color=No,Category=Advanced Printer Setup", + N_("Strengh of matte lamination pattern (-5 through +5)"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define kodak_8500_parameter_count (sizeof(kodak_8500_parameters) / sizeof(const stp_parameter_t)) + +static int +kodak_8500_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "Sharpen") == 0) + { + description->deflt.integer = 0; + description->bounds.integer.lower = -5; + description->bounds.integer.upper = 5; + description->is_active = 1; + } + else if (strcmp(name, "MatteIntensity") == 0) + { + description->deflt.integer = 0; + description->bounds.integer.lower = -5; + description->bounds.integer.upper = 5; + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int kodak_8500_parse_parameters(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + /* Parse options */ + pd->privdata.k8500.sharpen = stp_get_int_parameter(v, "Sharpen"); + pd->privdata.k8500.matte_intensity = stp_get_int_parameter(v, "MatteIntensity"); + + return 1; +} + static void kodak_8500_printer_init(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); @@ -2421,7 +2551,7 @@ static void kodak_8500_printer_init(stp_vars_t *v) /* Number of copies */ stp_putc(0x1b, v); stp_putc(0x4e, v); - stp_putc(1, v); /* 1-50 */ + stp_putc(pd->copies > 50 ? 50 : pd->copies, v); /* 1-50 */ dyesub_nputc(v, 0x00, 61); /* Paper type. Fixed. */ stp_putc(0x1b, v); @@ -2436,22 +2566,27 @@ static void kodak_8500_printer_init(stp_vars_t *v) stp_put16_be(pd->w_size, v); stp_put16_be(pd->h_size, v); dyesub_nputc(v, 0x00, 57); - /* Sharpening -- XXX not exported. */ + /* Sharpening */ stp_putc(0x1b, v); stp_putc(0x46, v); stp_putc(0x50, v); - stp_putc(0, v); /* 8-bit signed, range is +- 5. IOW, 0xfb->0x5 */ + stp_putc(pd->privdata.k8500.sharpen, v); dyesub_nputc(v, 0x00, 60); /* Lamination */ stp_putc(0x1b, v); stp_putc(0x59, v); - if (*((const char*)((pd->laminate->seq).data)) == 0x02) { /* None */ + if (*((const char*)((pd->laminate->seq).data)) == 0x02) { /* No lamination */ stp_putc(0x02, v); stp_putc(0x00, v); } else { stp_zfwrite((const char*)((pd->media->seq).data), 1, (pd->media->seq).bytes, v); - } + if (*((const char*)((pd->media->seq).data)) == 0x01) { /* Matte */ + stp_putc(pd->privdata.k8500.matte_intensity, v); + } else { + stp_putc(0x00, v); + } + } dyesub_nputc(v, 0x00, 60); /* Unknown */ stp_putc(0x1b, v); @@ -2488,6 +2623,469 @@ static void kodak_8500_printer_end(stp_vars_t *v) dyesub_nputc(v, 0x00, 62); } +/* Mitsubishi P95D/DW */ +static const dyesub_resolution_t res_325dpi[] = +{ + { "325x325", 325, 325}, +}; + +LIST(dyesub_resolution_list_t, res_325dpi_list, dyesub_resolution_t, res_325dpi); + +/* All are "custom" page sizes.. bleh.. */ +static const dyesub_pagesize_t mitsu_p95d_page[] = +{ + { "w213h284", "1280x960", PT(960,325)+1, PT(1280,325)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w227h284", "1280x1024", PT(1024,325)+1, PT(1280,325)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w284h284", "1280x1280", PT(1280,325)+1, PT(1280,325)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w284h426", "1280x1920", PT(1280,325)+1, PT(1920,325)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w284h1277", "1280x5760", PT(1280,325)+1, PT(5760,325)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + /* A true "custom" size, printer will cut at the image boundary */ + { "Custom", NULL, PT(1280,325)+1, -1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, +}; + +LIST(dyesub_pagesize_list_t, mitsu_p95d_page_list, dyesub_pagesize_t, mitsu_p95d_page); + +static const dyesub_printsize_t mitsu_p95d_printsize[] = +{ + { "325x325", "w213h284", 960, 1280}, + { "325x325", "w227h284", 1024, 1280}, + { "325x325", "w284h284", 1280, 1280}, + { "325x325", "w284h426", 1280, 1920}, + { "325x325", "w284h1277", 1280, 5760}, + { "325x325", "Custom", 1280, 5760}, /* Maximum */ +}; + +LIST(dyesub_printsize_list_t, mitsu_p95d_printsize_list, dyesub_printsize_t, mitsu_p95d_printsize); + +static const dyesub_media_t mitsu_p95d_medias[] = +{ + {"Standard", N_("Standard (KP61B)"), {1, "\x00"}}, + {"HighDensity", N_("High Density (KP65HM)"), {1, "\x01"}}, + {"HighGlossy", N_("High Glossy (KP91HG)"), {1, "\x02"}}, + {"HighGlossyK95HG", N_("High Glosy (K95HG)"), {1, "\x03"}}, +}; + +LIST(dyesub_media_list_t, mitsu_p95d_media_list, dyesub_media_t, mitsu_p95d_medias); + +static const dyesub_stringitem_t mitsu_p95d_gammas[] = +{ + { "Printer", N_ ("Printer-Defined Setting") }, + { "T1", N_ ("Table 1") }, + { "T2", N_ ("Table 2") }, + { "T3", N_ ("Table 3") }, + { "T4", N_ ("Table 4") }, + { "T5", N_ ("Table 5") }, + { "LUT", N_ ("Use LUT") }, +}; +LIST(dyesub_stringlist_t, mitsu_p95d_gamma_list, dyesub_stringitem_t, mitsu_p95d_gammas); + +static const dyesub_stringitem_t mitsu_p95d_buzzers[] = +{ + { "Off", N_ ("Off") }, + { "Low", N_ ("Low") }, + { "High", N_ ("High") }, +}; +LIST(dyesub_stringlist_t, mitsu_p95d_buzzer_list, dyesub_stringitem_t, mitsu_p95d_buzzers); + +static const dyesub_stringitem_t mitsu_p95d_cutters[] = +{ + { "PaperSave", N_ ("Paper Save") }, + { "4mm", N_ ("4mm") }, + { "5mm", N_ ("5mm") }, + { "6mm", N_ ("6mm") }, + { "7mm", N_ ("7mm") }, + { "8mm", N_ ("8mm") }, +}; +LIST(dyesub_stringlist_t, mitsu_p95d_cutter_list, dyesub_stringitem_t, mitsu_p95d_cutters); + +static const dyesub_stringitem_t mitsu_p95d_comments[] = +{ + { "Off", N_ ("Off") }, + { "Settings", N_ ("Printer Settings") }, + { "Date", N_ ("Date") }, + { "DateTime", N_ ("Date and Time") }, +}; +LIST(dyesub_stringlist_t, mitsu_p95d_comment_list, dyesub_stringitem_t, mitsu_p95d_comments); + +static const stp_parameter_t mitsu_p95d_parameters[] = +{ + { + "P95Gamma", N_("Printer Gamma Correction"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Gamma Correction"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Buzzer", N_("Printer Buzzer"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Buzzer"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "MediaCut", N_("Media Cut Length"), "Color=No,Category=Advanced Printer Setup", + N_("Media Cut Length"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Comment", N_("Generate Comment"), "Color=No,Category=Advanced Printer Setup", + N_("Generate Comment"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "ClearMemory", N_("Clear Memory"), "Color=No,Category=Advanced Printer Setup", + N_("Clear Memory"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "ContinuousPrint", N_("Continuous Printing"), "Color=No,Category=Advanced Printer Setup", + N_("Continuous Printing"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "P95Brightness", N_("Brightness"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Brightness Adjustment"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "P95Contrast", N_("Contrast"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Contrast Adjustment"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "UserComment", N_("User Comment"), "Color=No,Category=Advanced Printer Setup", + N_("User-specified comment (0-34 characters from 0x20->0x7E), null terminated if under 34 characters long"), + STP_PARAMETER_TYPE_RAW, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 0, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define mitsu_p95d_parameter_count (sizeof(mitsu_p95d_parameters) / sizeof(const stp_parameter_t)) + +static int +mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "P95Gamma") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "Buzzer") == 0) { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_buzzer_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } else if (strcmp(name, "MediaCut") == 0) { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_cutter_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } else if (strcmp(name, "Comment") == 0) { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_comment_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "ClearMemory") == 0) { + description->is_active = 1; + description->deflt.boolean = 0; + } else if (strcmp(name, "ContinuousPrint") == 0) { + description->is_active = 1; + description->deflt.boolean = 0; + } else if (strcmp(name, "P95Brightness") == 0) { + description->deflt.integer = 0; + description->bounds.integer.lower = -127; + description->bounds.integer.upper = 127; + description->is_active = 1; + } else if (strcmp(name, "P95Contrast") == 0) { + description->deflt.integer = 0; + description->bounds.integer.lower = -127; + description->bounds.integer.upper = 127; + description->is_active = 1; + } else if (strcmp(name, "UserComment") == 0) { + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int mitsu_p95d_parse_parameters(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + const char *gamma = stp_get_string_parameter(v, "P95Gamma"); + const char *buzzer = stp_get_string_parameter(v, "Buzzer"); + const char *cutter = stp_get_string_parameter(v, "MediaCut"); + const char *comment = stp_get_string_parameter(v, "Comment"); + const stp_raw_t *usercomment = NULL; + + /* Sanity check */ + if (stp_check_raw_parameter(v, "UserComment", STP_PARAMETER_ACTIVE)) { + usercomment = stp_get_raw_parameter(v, "UserComment"); + if (usercomment->bytes > 34) { + stp_eprintf(v, _("StpUserComment must be between 0 and 34 bytes!\n")); + return 0; + } + } + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + /* Parse options */ + pd->privdata.m95d.clear_mem = stp_get_boolean_parameter(v, "ClearMemory"); + pd->privdata.m95d.cont_print = stp_get_boolean_parameter(v, "ContinuousPrint"); + + if (pd->copies > 200) + pd->copies = 200; + + if (!strcmp(gamma, "Printer")) { + pd->privdata.m95d.gamma = 0x00; + } else if (!strcmp(gamma, "T1")) { + pd->privdata.m95d.gamma = 0x01; + } else if (!strcmp(gamma, "T2")) { + pd->privdata.m95d.gamma = 0x02; + } else if (!strcmp(gamma, "T3")) { + pd->privdata.m95d.gamma = 0x03; + } else if (!strcmp(gamma, "T4")) { + pd->privdata.m95d.gamma = 0x04; + } else if (!strcmp(gamma, "T5")) { + pd->privdata.m95d.gamma = 0x05; + } else if (!strcmp(gamma, "LUT")) { + pd->privdata.m95d.gamma = 0x10; + } + + if (!strcmp(buzzer, "Off")) { + pd->privdata.m95d.flags |= 0x00; + } else if (!strcmp(buzzer, "Low")) { + pd->privdata.m95d.flags |= 0x02; + } else if (!strcmp(buzzer, "High")) { + pd->privdata.m95d.flags |= 0x03; + } + + if (!strcmp(cutter, "PaperSave")) { + pd->privdata.m95d.flags |= 0x54; + } else if (!strcmp(cutter, "4mm")) { + pd->privdata.m95d.flags |= 0x40; + } else if (!strcmp(cutter, "5mm")) { + pd->privdata.m95d.flags |= 0x50; + } else if (!strcmp(cutter, "6mm")) { + pd->privdata.m95d.flags |= 0x60; + } else if (!strcmp(cutter, "7mm")) { + pd->privdata.m95d.flags |= 0x70; + } else if (!strcmp(cutter, "8mm")) { + pd->privdata.m95d.flags |= 0x80; + } + + if (!strcmp(comment, "Off")) { + memset(pd->privdata.m95d.commentbuf, 0, sizeof(pd->privdata.m95d.commentbuf)); + pd->privdata.m95d.comment = 0; + } else if (!strcmp(comment, "Settings")) { + memset(pd->privdata.m95d.commentbuf, 0, sizeof(pd->privdata.m95d.commentbuf)); + pd->privdata.m95d.comment = 1; + } else if (!strcmp(comment, "Date")) { + struct tm tmp; + time_t t; + t = time(NULL); + localtime_r(&t, &tmp); + strftime(pd->privdata.m95d.commentbuf, sizeof(pd->privdata.m95d.commentbuf), " %F", &tmp); + pd->privdata.m95d.comment = 2; + } else if (!strcmp(comment, "DateTime")) { + struct tm tmp; + time_t t; + t = time(NULL); + localtime_r(&t, &tmp); + strftime(pd->privdata.m95d.commentbuf, sizeof(pd->privdata.m95d.commentbuf), " %F %R", &tmp); + pd->privdata.m95d.comment = 3; + } + + if (usercomment) { + if (strncmp("None", usercomment->data, usercomment->bytes)) { + int i; + memcpy(pd->privdata.m95d.usercomment, usercomment->data, usercomment->bytes); + if (usercomment->bytes < 34) + pd->privdata.m95d.usercomment[usercomment->bytes] = 0; + for (i = 0 ; i < usercomment->bytes ; i++) { + if (pd->privdata.m95d.usercomment[i] < 0x20 || + pd->privdata.m95d.usercomment[i] > 0x7F) + pd->privdata.m95d.usercomment[i] = 0x20; + } + } + } else { + memset(pd->privdata.m95d.usercomment, 0x20, sizeof(pd->privdata.m95d.usercomment)); + } + + return 1; +} + +static const char *p95d_lut = "\x00\x12\x01\x5e\x03\x52\x05\xdc\x08\x66\x0a\x96\x0c\x3a\x0d\x70\x0e\x42\x0e\xce\x0f\x32\x0f\x78\x0f\xa0\x0f\xb4\x0f\xc8\x0f\xd8\x0f\xff"; /* Taken from "P95D.lut" dated 2016-05-25 */ + +static void mitsu_p95d_printer_init(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* Header */ + stp_putc(0x1b, v); + stp_putc(0x51, v); + + /* Clear memory */ + if (pd->privdata.m95d.clear_mem) { + stp_putc(0x1b, v); + stp_putc(0x5a, v); + stp_putc(0x43, v); + stp_putc(0x00, v); + } + + /* Page Setup */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x20, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x0a, v); + stp_putc(0x00, v); + stp_putc(0x02, v); + dyesub_nputc(v, 0x00, 6); + stp_put16_be(pd->w_size, v); /* Columns */ + stp_put16_be(pd->h_size, v); /* Rows */ + + /* This is only set under Windows if a "custom" size is selected, + but the USB comms always show it set to 1... */ + if (!strcmp(pd->pagesize,"Custom")) + stp_putc(0x01, v); + else + stp_putc(0x00, v); + dyesub_nputc(v, 0x00, 31); + + /* Print Options */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x21, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x4a, v); + stp_putc(0xaa, v); + stp_putc(0x00, v); + stp_putc(0x20, v); + stp_zfwrite((pd->media->seq).data, 1, 1, v); /* Media Type */ + stp_putc(0x00, v); + stp_putc(0x00, v); + stp_putc(0x64, v); + if (pd->privdata.m95d.cont_print) + stp_putc(0xff, v); + else + stp_putc(pd->copies, v); + stp_putc(0x00, v); + stp_putc(pd->privdata.m95d.comment, v); + stp_zfwrite(pd->privdata.m95d.commentbuf, 1, sizeof(pd->privdata.m95d.commentbuf) -1, v); + dyesub_nputc(v, 0x00, 3); + stp_putc(0x02, v); + dyesub_nputc(v, 0x00, 11); + stp_putc(pd->privdata.m95d.flags, v); + + /* Gamma */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x22, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x15, v); + if (pd->privdata.m95d.gamma == 0x10) + stp_putc(0x01, v); + else + stp_putc(0x00, v); + dyesub_nputc(v, 0x00, 5); + stp_putc(pd->privdata.m95d.gamma, v); + dyesub_nputc(v, 0x00, 3); + if (pd->privdata.m95d.gamma == 0x10) { + stp_zfwrite(p95d_lut, 1, sizeof(p95d_lut), v); /* XXX only for K95HG? */ + } else { + dyesub_nputc(v, 0x00, 34); + } + + /* User Comment */ + stp_putc(0x1b, v); + stp_putc(0x58, v); + stp_zfwrite(pd->privdata.m95d.usercomment, 1, sizeof(pd->privdata.m95d.usercomment), v); +} + +static void mitsu_p95d_plane_start(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* Plane header */ + stp_putc(0x1b, v); + stp_putc(0x5a, v); + stp_putc(0x74, v); + stp_putc(0x00, v); + stp_put16_be(0, v); /* Column Offset */ + stp_put16_be(0, v); /* Row Offset */ + stp_put16_be(pd->w_size, v); /* Columns */ + stp_put16_be(pd->h_size, v); /* Rows */ +} + +static void mitsu_p95d_printer_end(stp_vars_t *v) +{ + /* Kick off the actual print */ + stp_putc(0x1b, v); + stp_putc(0x50, v); +} + /* Mitsubishi CP3020D/DU/DE */ static const dyesub_pagesize_t mitsu_cp3020d_page[] = { @@ -2527,7 +3125,7 @@ static void mitsu_cp3020d_printer_init(stp_vars_t *v) /* Number of copies */ stp_putc(0x1b, v); stp_putc(0x4e, v); - stp_putc(1, v); /* 1-50 */ + stp_putc(pd->copies > 50 ? 50 : pd->copies, v); /* 1-50 */ dyesub_nputc(v, 0x00, 61); /* Unknown */ stp_putc(0x1b, v); @@ -2617,7 +3215,7 @@ static void mitsu_cp3020da_printer_init(stp_vars_t *v) stp_putc(0x00, v); stp_putc(0x02, v); dyesub_nputc(v, 0x00, 19); - stp_putc(0x01, v); /* Copies -- 01-50d */ + stp_putc(pd->copies > 50 ? 50 : pd->copies, v); /* 1-50 */ dyesub_nputc(v, 0x00, 20); /* Contrast ? */ stp_putc(0x1b, v); @@ -2665,6 +3263,185 @@ static void mitsu_cp3020da_plane_init(stp_vars_t *v) stp_put16_be(pd->h_size, v); /* Number of rows in this block */ } +/* Mitsubishi 9500D/DW */ +static const dyesub_resolution_t res_m9500[] = +{ + { "346x346", 346, 346}, + { "346x792", 346, 792}, +}; + +LIST(dyesub_resolution_list_t, res_m9500_list, dyesub_resolution_t, res_m9500); + +static const dyesub_pagesize_t mitsu_cp9500_page[] = +{ + { "B7", "3.5x5", PT(1240,346)+1, PT(1812,346)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w288h432", "4x6", PT(1416,346)+1, PT(2152,346)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w360h504", "5x7", PT(1812,346)+1, PT(2452,346)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w432h576", "6x8", PT(2152,346)+1, PT(2792,346)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w432h648", "6x9", PT(2152,346)+1, PT(3146,346)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, +}; + +LIST(dyesub_pagesize_list_t, mitsu_cp9500_page_list, dyesub_pagesize_t, mitsu_cp9500_page); + +static const dyesub_printsize_t mitsu_cp9500_printsize[] = +{ + { "346x346", "B7", 1240, 1812}, + { "346x792", "B7", 2480, 1812}, + { "346x346", "w288h432", 1416, 2152}, + { "346x792", "w288h432", 2832, 2152}, + { "346x346", "w360h504", 1812, 2452}, + { "346x792", "w360h504", 1812, 4904}, + { "346x346", "w432h576", 2152, 2792}, + { "346x792", "w432h576", 2152, 5584}, + { "346x346", "w432h648", 2152, 3146}, + { "346x792", "w432h648", 2152, 6292}, +}; + +LIST(dyesub_printsize_list_t, mitsu_cp9500_printsize_list, dyesub_printsize_t, mitsu_cp9500_printsize); + +static void mitsu_cp9500_printer_init(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* Init */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x21, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x80, v); + stp_putc(0x00, v); + stp_putc(0x22, v); + stp_putc(0xa8, v); + stp_putc(0x03, v); + dyesub_nputc(v, 0x00, 18); + stp_put16_be(pd->copies, v); + dyesub_nputc(v, 0x00, 19); + stp_putc(0x01, v); + /* Parameters 1 */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x20, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x0a, v); + stp_putc(0x10, v); + dyesub_nputc(v, 0x00, 7); + stp_put16_be(pd->w_size, v); + stp_put16_be(pd->h_size, v); + dyesub_nputc(v, 0x00, 32); + /* Parameters 2 */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x22, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0xf0, v); + dyesub_nputc(v, 0x00, 5); + stp_putc(0x00, v); // XXX 0x01 for "High Contrast" mode + dyesub_nputc(v, 0x00, 38); + /* Unknown */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x26, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x70, v); + dyesub_nputc(v, 0x00, 6); + stp_putc(0x01, v); + stp_putc(0x01, v); + dyesub_nputc(v, 0x00, 36); +} + +static void mitsu_cp9500_printer_end(stp_vars_t *v) +{ + /* Page Footer */ + stp_putc(0x1b, v); + stp_putc(0x50, v); + stp_putc(0x57, v); + stp_putc(0x00, v); +} + +static const dyesub_stringitem_t mitsu9500_contrasts[] = +{ + { "Photo", N_ ("Photo") }, + { "HighContrast", N_ ("High Contrast") }, +}; +LIST(dyesub_stringlist_t, mitsu9500_contrast_list, dyesub_stringitem_t, mitsu9500_contrasts); + +static const stp_parameter_t mitsu9500_parameters[] = +{ + { + "CP9500Contrast", N_("Printer Contrast"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Contrast"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define mitsu9500_parameter_count (sizeof(mitsu9500_parameters) / sizeof(const stp_parameter_t)) + +static int +mitsu9500_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "CP9500Contrast") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu9500_contrast_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int mitsu9500_parse_parameters(stp_vars_t *v) +{ + const char *contrast = stp_get_string_parameter(v, "CP9500Contrast"); + dyesub_privdata_t *pd = get_privdata(v); + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + if (strcmp(contrast, "HighContrast") == 0) { + pd->privdata.m9550.contrast = 1; + } else { + pd->privdata.m9550.contrast = 0; + } + + return 1; +} + /* Mitsubishi 9550D/DW */ static const dyesub_resolution_t res_346dpi[] = { @@ -2816,7 +3593,7 @@ static void mitsu_cp9550_printer_init(stp_vars_t *v) stp_putc(0x08, v); stp_putc(0x03, v); dyesub_nputc(v, 0x00, 18); - stp_put16_be(1, v); /* Copies */ + stp_put16_be(pd->copies, v); dyesub_nputc(v, 0x00, 2); if (strcmp(pd->pagesize,"w288h432-div2") == 0) stp_putc(0x83, v); @@ -2960,7 +3737,7 @@ static void mitsu_cp9600_printer_init(stp_vars_t *v) stp_putc(0x00, v); stp_putc(0x03, v); dyesub_nputc(v, 0x00, 18); - stp_put16_be(1, v); /* Copies */ + stp_put16_be(pd->copies, v); dyesub_nputc(v, 0x00, 19); stp_putc(0x01, v); /* Parameters 2 */ @@ -3148,7 +3925,7 @@ static void mitsu_cp98xx_printer_init(stp_vars_t *v, int model) stp_putc(0x08, v); stp_putc(0x01, v); dyesub_nputc(v, 0x00, 18); - stp_put16_be(1, v); /* Copies */ + stp_put16_be(pd->copies, v); dyesub_nputc(v, 0x00, 8); stp_putc(pd->privdata.m9550.quality, v); dyesub_nputc(v, 0x00, 10); @@ -3295,7 +4072,7 @@ static const stp_parameter_t mitsu70x_parameters[] = }, #ifdef MITSU70X_8BPP { - "UseLUT", N_("Internal Color Correction"), "Color=No,Category=Advanced Printer Setup", + "UseLUT", N_("Internal Color Correction"), "Color=Yes,Category=Advanced Printer Setup", N_("Use Internal Color Correction"), STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 @@ -3345,6 +4122,7 @@ mitsu70x_load_parameters(const stp_vars_t *v, const char *name, #ifdef MITSU70X_8BPP else if (strcmp(name, "UseLUT") == 0) { + description->deflt.boolean = 0; description->is_active = 1; } else if (strcmp(name, "Sharpen") == 0) @@ -3607,6 +4385,7 @@ mitsu_k60_load_parameters(const stp_vars_t *v, const char *name, #ifdef MITSU70X_8BPP else if (strcmp(name, "UseLUT") == 0) { + description->deflt.boolean = 0; description->is_active = 1; } else if (strcmp(name, "Sharpen") == 0) @@ -3744,6 +4523,35 @@ static const dyesub_stringitem_t mitsu_d90_qualities[] = }; LIST(dyesub_stringlist_t, mitsu_d90_quality_list, dyesub_stringitem_t, mitsu_d90_qualities); +static const stp_parameter_t mitsu_d90_parameters[] = +{ + { + "PrintSpeed", N_("Print Speed"), "Color=No,Category=Advanced Printer Setup", + N_("Print Speed"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "UseLUT", N_("Internal Color Correction"), "Color=Yes,Category=Advanced Printer Setup", + N_("Use Internal Color Correction"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup", + N_("Sharpening to apply to image (0 is off, 1 is min, 9 is max"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "ComboWait", N_("Combo Print Wait Time"), "Color=No,Category=Advanced Printer Setup", + N_("How many seconds to wait for a second print before starting"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define mitsu_d90_parameter_count (sizeof(mitsu_d90_parameters) / sizeof(const stp_parameter_t)) + static int mitsu_d90_load_parameters(const stp_vars_t *v, const char *name, stp_parameter_t *description) @@ -3776,9 +4584,9 @@ mitsu_d90_load_parameters(const stp_vars_t *v, const char *name, description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; description->is_active = 1; } -#ifdef MITSU70X_8BPP else if (strcmp(name, "UseLUT") == 0) { + description->deflt.boolean = 0; description->is_active = 1; } else if (strcmp(name, "Sharpen") == 0) @@ -3788,7 +4596,13 @@ mitsu_d90_load_parameters(const stp_vars_t *v, const char *name, description->bounds.integer.upper = 9; description->is_active = 1; } -#endif + else if (strcmp(name, "ComboWait") == 0) + { + description->deflt.integer = 5; + description->bounds.integer.lower = 1; + description->bounds.integer.upper = 25; + description->is_active = 1; + } else { return 0; @@ -3814,10 +4628,9 @@ static int mitsu_d90_parse_parameters(stp_vars_t *v) pd->privdata.m70x.quality = 0; } -#ifdef MITSU70X_8BPP pd->privdata.m70x.use_lut = stp_get_boolean_parameter(v, "UseLUT"); pd->privdata.m70x.sharpen = stp_get_int_parameter(v, "Sharpen"); -#endif + pd->privdata.m70x.delay = stp_get_int_parameter(v, "ComboWait"); return 1; } @@ -3894,13 +4707,15 @@ static void mitsu_cpd90_printer_init(stp_vars_t *v) static void mitsu_cpd90_printer_end(stp_vars_t *v) { + dyesub_privdata_t *pd = get_privdata(v); + /* Wrap it up */ stp_putc(0x1b, v); stp_putc(0x42, v); stp_putc(0x51, v); stp_putc(0x31, v); stp_putc(0x00, v); - stp_putc(0x05, v); /* XXX seconds to wait for second print */ + stp_putc(pd->privdata.m70x.delay, v); } /* Fujifilm ASK-300 */ @@ -3947,8 +4762,6 @@ static const dyesub_pagesize_t shinko_chcs9045_page[] = DYESUB_PORTRAIT}, { "w283h425", "Sticker paper", PT(1092,300)+1, PT(1726,300)+1, 0, 0, 0, 0, DYESUB_LANDSCAPE}, - { "Custom", NULL, PT(1240,300)+1, PT(1844,300)+1, 0, 0, 0, 0, - DYESUB_LANDSCAPE}, }; LIST(dyesub_pagesize_list_t, shinko_chcs9045_page_list, dyesub_pagesize_t, shinko_chcs9045_page); @@ -3960,7 +4773,6 @@ static const dyesub_printsize_t shinko_chcs9045_printsize[] = { "300x300", "w360h504", 1548, 2140}, { "300x300", "w432h648", 1844, 2740}, { "300x300", "w283h425", 1092, 1726}, - { "300x300", "Custom", 1240, 1844}, }; LIST(dyesub_printsize_list_t, shinko_chcs9045_printsize_list, dyesub_printsize_t, shinko_chcs9045_printsize); @@ -4090,7 +4902,7 @@ static void shinko_chcs2145_printer_init(stp_vars_t *v) stp_put32_le(0x00, v); stp_put32_le(pd->w_size, v); /* Columns */ stp_put32_le(pd->h_size, v); /* Rows */ - stp_put32_le(0x01, v); /* Copies */ + stp_put32_le(pd->copies, v); /* Copies */ stp_put32_le(0x00, v); stp_put32_le(0x00, v); @@ -4164,6 +4976,103 @@ static const laminate_t shinko_chcs1245_laminate[] = LIST(laminate_list_t, shinko_chcs1245_laminate_list, laminate_t, shinko_chcs1245_laminate); +static const dyesub_stringitem_t shinko_chcs1245_dusts[] = +{ + { "PrinterDefault", N_ ("Printer Default") }, + { "Off", N_ ("Off") }, + { "On", N_ ("On") } +}; +LIST(dyesub_stringlist_t, shinko_chcs1245_dust_list, dyesub_stringitem_t, shinko_chcs1245_dusts); + +static const stp_parameter_t shinko_chcs1245_parameters[] = +{ + { + "DustRemoval", N_("Dust Removal"), "Color=No,Category=Advanced Printer Setup", + N_("Print Speed"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "MatteIntensity", N_("Matte Intensity"), "Color=No,Category=Advanced Printer Setup", + N_("Strengh of matte lamination pattern (-25 through +25)"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define shinko_chcs1245_parameter_count (sizeof(shinko_chcs1245_parameters) / sizeof(const stp_parameter_t)) + +static int +shinko_chcs1245_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "DustRemoval") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &shinko_chcs1245_dust_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } + else if (strcmp(name, "MatteIntensity") == 0) + { + description->deflt.integer = 0; + description->bounds.integer.lower = -25; + description->bounds.integer.upper = 25; + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int shinko_chcs1245_parse_parameters(stp_vars_t *v) +{ + const char *dust = stp_get_string_parameter(v, "DustRemoval"); + dyesub_privdata_t *pd = get_privdata(v); + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + /* Parse options */ + + if (strcmp(dust, "PrinterDefault") == 0) { + pd->privdata.s1245.dust_removal = 3; + } else if (strcmp(dust, "Off") == 0) { + pd->privdata.s1245.dust_removal = 1; + } else if (strcmp(dust, "On") == 0) { + pd->privdata.s1245.dust_removal = 2; + } else { + pd->privdata.s1245.dust_removal = 0; + } + + pd->privdata.s1245.matte_intensity = stp_get_int_parameter(v, "MatteIntensity"); + + return 1; +} + static void shinko_chcs1245_printer_init(stp_vars_t *v) { dyesub_privdata_t *pd = get_privdata(v); @@ -4209,15 +5118,15 @@ static void shinko_chcs1245_printer_init(stp_vars_t *v) stp_put32_le(0x00, v); if (((const unsigned char*)(pd->laminate->seq).data)[0] == 0x02 || ((const unsigned char*)(pd->laminate->seq).data)[0] == 0x03) { - stp_put32_le(0x07fffffff, v); /* Glossy */ + stp_put32_le(0x07fffffff, v); /* Glossy */ } else { - stp_put32_le(0x0, v); /* XXX matte intensity -25>0>+25 */ + stp_put32_le(pd->privdata.s1245.matte_intensity, v); /* matte intensity */ } - stp_put32_le(0x00, v); /* XXX "dust removal mode" -- 0x00 printer default, 0x02 on, 0x01 for off. */ + stp_put32_le(pd->privdata.s1245.dust_removal, v); /* Dust Removal Mode */ stp_put32_le(pd->w_size, v); /* Columns */ stp_put32_le(pd->h_size, v); /* Rows */ - stp_put32_le(0x01, v); /* Copies */ + stp_put32_le(pd->copies, v); /* Copies */ stp_put32_le(0x00, v); stp_put32_le(0x00, v); @@ -4324,7 +5233,7 @@ static void shinko_chcs6245_printer_init(stp_vars_t *v) stp_put32_le(0x00, v); stp_put32_le(pd->w_size, v); /* Columns */ stp_put32_le(pd->h_size, v); /* Rows */ - stp_put32_le(0x01, v); /* Copies */ + stp_put32_le(pd->copies, v); /* Copies */ stp_put32_le(0x00, v); stp_put32_le(0x00, v); @@ -4455,7 +5364,7 @@ static void shinko_chcs6145_printer_init(stp_vars_t *v) stp_put32_le(0x00, v); stp_put32_le(pd->w_size, v); /* Columns */ stp_put32_le(pd->h_size, v); /* Rows */ - stp_put32_le(0x01, v); /* Copies */ + stp_put32_le(pd->copies, v); /* Copies */ stp_put32_le(0x00, v); stp_put32_le(0x00, v); @@ -4574,7 +5483,7 @@ static void dnp_printer_start_common(stp_vars_t *v) (pd->laminate->seq).bytes, v); /* Lamination mode */ /* Set quantity.. Backend overrides as needed. */ - stp_zprintf(v, "\033PCNTRL QTY 000000080000001\r"); + stp_zprintf(v, "\033PCNTRL QTY 00000008%07d\r", pd->copies); } static void dnpds40_printer_start(stp_vars_t *v) @@ -4681,7 +5590,7 @@ static const dyesub_pagesize_t dnpds80_page[] = { "c8x10-div2", "8x5*2", PT(2560,300)+1, PT(3102,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "c8x10-w576h432_w576h288", "8x6+8x4", PT(2560,300)+1, PT(3102,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h792-w576h432_w576h360", "8x6+8x5", PT(2560,300)+1, PT(3402,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, - { "A4", "A4 Length", PT(2560,300)+1, PT(3544,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h842", "8x11.7", PT(2560,300)+1, PT(3544,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864", "8x12", PT(2560,300)+1, PT(3636,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864-div2", "8x6*2", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864-w576h576_w576h288", "8x8+8x4", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, @@ -4712,8 +5621,8 @@ static const dyesub_printsize_t dnpds80_printsize[] = { "300x600", "c8x10-w576h432_w576h288", 2560, 6204}, { "300x300", "w576h792-w576h432_w576h360", 2560, 3402}, { "300x600", "w576h792-w576h432_w576h360", 2560, 6804}, - { "300x300", "A4", 2560, 3544}, - { "300x600", "A4", 2560, 7088}, + { "300x300", "w576h842", 2560, 3544}, + { "300x600", "w576h842", 2560, 7088}, { "300x300", "w576h864", 2560, 3636}, { "300x600", "w576h864", 2560, 7272}, { "300x300", "w576h864-div2", 2560, 3702}, @@ -4760,7 +5669,7 @@ static int dnpds80_parse_parameters(stp_vars_t *v) multicut = 19; } else if (!strcmp(pagesize, "w576h864-div3")) { multicut = 20; - } else if (!strcmp(pagesize, "A4")) { + } else if (!strcmp(pagesize, "w576h842")) { multicut = 21; } else { stp_eprintf(v, _("Illegal print size selected for roll media!\n")); @@ -4802,14 +5711,12 @@ static int dnpds80dx_parse_parameters(stp_vars_t *v) const char *pagesize; const dyesub_media_t* media = NULL; const char* duplex_mode; - int page_number; dyesub_privdata_t *pd = get_privdata(v); int multicut = 0; pagesize = stp_get_string_parameter(v, "PageSize"); duplex_mode = stp_get_string_parameter(v, "Duplex"); media = dyesub_get_mediatype(v); - page_number = stp_get_int_parameter(v, "PageNumber"); if (!strcmp(media->name, "Roll")) { if (strcmp(duplex_mode, "None") && strcmp(duplex_mode, "Standard")) { @@ -4851,17 +5758,19 @@ static int dnpds80dx_parse_parameters(stp_vars_t *v) return 0; } + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + /* Add correct offset to multicut mode based on duplex state */ if (!strcmp(duplex_mode, "None") || !strcmp(duplex_mode, "Standard")) multicut += 100; /* Simplex */ - else if (page_number & 1) + else if (pd->page_number & 1) multicut += 300; /* Duplex, back */ else multicut += 200; /* Duplex, front */ - /* No need to set global params if there's no privdata yet */ - if (pd) - pd->privdata.dnp.multicut = multicut; + pd->privdata.dnp.multicut = multicut; return 1; } @@ -4888,7 +5797,7 @@ static const dyesub_pagesize_t dnpds80dx_page[] = { "w576h774-w576h756", "8x10.5", PT(2560,300)+1, PT(3186,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h774", "8x10.75", PT(2560,300)+1, PT(3186,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h792-w576h432_w576h360", "8x6+8x5", PT(2560,300)+1, PT(3402,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, - { "A4", "A4 Length", PT(2560,300)+1, PT(3544,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h842", "8x11.7", PT(2560,300)+1, PT(3544,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864", "8x12", PT(2560,300)+1, PT(3636,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864-div2", "8x6*2", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, { "w576h864-w576h576_w576h288", "8x8+8x4", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, @@ -4924,8 +5833,8 @@ static const dyesub_printsize_t dnpds80dx_printsize[] = { "300x600", "w576h774-w576h756", 2560, 6372}, { "300x300", "w576h792-w576h432_w576h360", 2560, 3402}, { "300x600", "w576h792-w576h432_w576h360", 2560, 6804}, - { "300x300", "A4", 2560, 3544}, - { "300x600", "A4", 2560, 7088}, + { "300x300", "w576h842", 2560, 3544}, + { "300x600", "w567h842", 2560, 7088}, { "300x300", "w576h864", 2560, 3636}, { "300x600", "w576h864", 2560, 7272}, { "300x300", "w576h864-div2", 2560, 3702}, @@ -5025,6 +5934,7 @@ static const laminate_t dnpds620_laminate[] = { {"Glossy", N_("Glossy"), {3, "000"}}, {"Matte", N_("Matte"), {3, "001"}}, + {"MatteFine", N_("Matte Fine"), {3, "021"}}, {"MatteLuster", N_("Matte Luster"), {3, "022"}}, }; @@ -5144,6 +6054,247 @@ static void dnpds620_printer_start(stp_vars_t *v) } } +/* Dai Nippon Printing DS820 */ + +/* Imaging area is wider than print size, we always must supply the + printer with the full imaging width. */ +static const dyesub_pagesize_t dnpds820_page[] = +{ + { "w288h576", "8x4", PT(1236,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w360h576", "8x5", PT(1536,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w432h576", "8x6", PT(1836,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w504h576", "8x7", PT(2136,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w576h576", "8x8", PT(2436,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w576h576-div2", "8x4*2", PT(2502,300)+1, PT(2560,300)+1, 0, 0, PT(56,300), PT(56,300), DYESUB_LANDSCAPE}, + { "w576h648", "8x9", PT(2560,300)+1, PT(2736,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h648-w576h360_w576h288", "8x5+8x4", PT(2560,300)+1, PT(2802,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "c8x10", "8x10", PT(2560,300)+1, PT(3036,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "c8x10-div2", "8x5*2", PT(2560,300)+1, PT(3102,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "c8x10-w576h432_w576h288", "8x6+8x4", PT(2560,300)+1, PT(3102,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h792-w576h432_w576h360", "8x6+8x5", PT(2560,300)+1, PT(3402,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h842", "8x11.7", PT(2560,300)+1, PT(3544,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h864", "8x12", PT(2560,300)+1, PT(3636,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h864-div2", "8x6*2", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h864-w576h576_w576h288", "8x8+8x4", PT(2560,300)+1, PT(3702,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + { "w576h864-div3", "8x4*3", PT(2560,300)+1, PT(3768,300)+1, PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT}, + + { "A4x4inch", "A4x4inch", PT(1236,300)+1, PT(2560,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_LANDSCAPE}, + { "A4x5inch", "A4x5inch", PT(1536,300)+1, PT(2560,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_LANDSCAPE}, + { "A5", "A5", PT(1784,300)+1, PT(2560,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_LANDSCAPE}, + { "A4x6inch", "A4x6inch", PT(1836,300)+1, PT(2560,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_LANDSCAPE}, + { "A4x8inch", "A4x8inch", PT(2436,300)+1, PT(2560,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_LANDSCAPE}, + { "A4x10inch", "A4x10inch", PT(2560,300)+1, PT(3036,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_PORTRAIT}, + { "A4x10inch-div2", "A4x5inch*2", PT(2560,300)+1, PT(3102,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_PORTRAIT}, + { "A4", "A4", PT(2560,300)+1, PT(3544,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_PORTRAIT}, + { "A4-div2", "A5*2", PT(2560,300)+1, PT(3598,300)+1, PT(16,300), PT(16,300), 0, 0, DYESUB_PORTRAIT}, +}; + +LIST(dyesub_pagesize_list_t, dnpds820_page_list, dyesub_pagesize_t, dnpds820_page); + +static const dyesub_printsize_t dnpds820_printsize[] = +{ + { "300x300", "w288h576", 1236, 2560}, + { "300x600", "w288h576", 2472, 2560}, + { "300x300", "w360h576", 1536, 2560}, + { "300x600", "w360h576", 3072, 2560}, + { "300x300", "w432h576", 1836, 2560}, + { "300x600", "w432h576", 3672, 2560}, + { "300x300", "w504h576", 2136, 2560}, + { "300x600", "w504h576", 4272, 2560}, + { "300x300", "w576h576", 2436, 2560}, + { "300x600", "w576h576", 4872, 2560}, + { "300x300", "w576h576-div2", 2502, 2560}, + { "300x600", "w576h576-div2", 5004, 2560}, + { "300x300", "w576h648", 2560, 2736}, + { "300x600", "w576h648", 2560, 5472}, + { "300x300", "w576h648-w576h360_w576h288", 2560, 2802}, + { "300x600", "w576h648-w576h360_w576h288", 2560, 5604}, + { "300x300", "c8x10", 2560, 3036}, + { "300x600", "c8x10", 2560, 6072}, + { "300x300", "c8x10-div2", 2560, 3102}, + { "300x600", "c8x10-div2", 2560, 6204}, + { "300x300", "c8x10-w576h432_w576h288", 2560, 3102}, + { "300x600", "c8x10-w576h432_w576h288", 2560, 6204}, + { "300x300", "w576h792-w576h432_w576h360", 2560, 3402}, + { "300x600", "w576h792-w576h432_w576h360", 2560, 6804}, + { "300x300", "w576h842", 2560, 3544}, + { "300x600", "w576h842", 2560, 7088}, + { "300x300", "w576h864", 2560, 3636}, + { "300x600", "w576h864", 2560, 7272}, + { "300x300", "w576h864-div2", 2560, 3702}, + { "300x600", "w576h864-div2", 2560, 7404}, + { "300x300", "w576h864-w576h576_w576h288", 2560, 3702}, + { "300x600", "w576h864-w576h576_w576h288", 2560, 7404}, + { "300x300", "w576h864-div3", 2560, 3768}, + { "300x600", "w576h864-div3", 2560, 7536}, + + { "300x300", "A4x4inch", 2560, 1236}, + { "300x600", "A4x4inch", 2560, 2472}, + { "300x300", "A4x5inch", 2560, 1536}, + { "300x600", "A4x5inch", 2560, 3072}, + { "300x300", "A5", 2560, 1784}, + { "300x600", "A5", 2560, 3568}, + { "300x300", "A4x6inch", 2560, 1836}, + { "300x600", "A4x6inch", 2560, 3672}, + { "300x300", "A4x8inch", 2560, 2436}, + { "300x600", "A4x8inch", 2560, 4872}, + { "300x300", "A4x10inch", 2560, 3036}, + { "300x600", "A4x10inch", 2560, 6072}, + { "300x300", "A4x10inch-div2", 2560, 3102}, + { "300x600", "A4x10inch-div2", 2560, 6204}, + { "300x300", "A4", 2560, 3544}, + { "300x600", "A4", 2560, 7088}, + { "300x300", "A4-div2", 2560, 3598}, + { "300x600", "A4-div2", 2560, 7196}, +}; + +LIST(dyesub_printsize_list_t, dnpds820_printsize_list, dyesub_printsize_t, dnpds820_printsize); + +static void dnpds820_printer_start(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* Common code */ + dnp_printer_start_common(v); + + /* Configure multi-cut/page size */ + stp_zprintf(v, "\033PIMAGE MULTICUT 00000008000000"); + + if (!strcmp(pd->pagesize, "c8x10")) { + stp_zprintf(v, "06"); + } else if (!strcmp(pd->pagesize, "w576h864")) { + stp_zprintf(v, "07"); + } else if (!strcmp(pd->pagesize, "w288h576")) { + stp_zprintf(v, "08"); + } else if (!strcmp(pd->pagesize, "w360h576")) { + stp_zprintf(v, "09"); + } else if (!strcmp(pd->pagesize, "w432h576")) { + stp_zprintf(v, "10"); + } else if (!strcmp(pd->pagesize, "w576h576")) { + stp_zprintf(v, "11"); + } else if (!strcmp(pd->pagesize, "w576h576-div2")) { + stp_zprintf(v, "13"); + } else if (!strcmp(pd->pagesize, "c8x10-div2")) { + stp_zprintf(v, "14"); + } else if (!strcmp(pd->pagesize, "w576h864-div2")) { + stp_zprintf(v, "15"); + } else if (!strcmp(pd->pagesize, "w576h648-w576h360_w576h288")) { + stp_zprintf(v, "16"); + } else if (!strcmp(pd->pagesize, "c8x10-w576h432_w576h288")) { + stp_zprintf(v, "17"); + } else if (!strcmp(pd->pagesize, "w576h792-w576h432_w576h360")) { + stp_zprintf(v, "18"); + } else if (!strcmp(pd->pagesize, "w576h864-w576h576_w576h288")) { + stp_zprintf(v, "19"); + } else if (!strcmp(pd->pagesize, "w576h864-div3")) { + stp_zprintf(v, "20"); + } else if (!strcmp(pd->pagesize, "w576h842")) { + stp_zprintf(v, "21"); + } else if (!strcmp(pd->pagesize, "w504h576")) { + stp_zprintf(v, "32"); + } else if (!strcmp(pd->pagesize, "w576h648")) { + stp_zprintf(v, "33"); + } else if (!strcmp(pd->pagesize, "A5")) { + stp_zprintf(v, "34"); + } else if (!strcmp(pd->pagesize, "A4x4inch")) { + stp_zprintf(v, "36"); + } else if (!strcmp(pd->pagesize, "A4x5inch")) { + stp_zprintf(v, "37"); + } else if (!strcmp(pd->pagesize, "A4x6inch")) { + stp_zprintf(v, "38"); + } else if (!strcmp(pd->pagesize, "A4x8inch")) { + stp_zprintf(v, "39"); + } else if (!strcmp(pd->pagesize, "A4x10inch")) { + stp_zprintf(v, "40"); + } else if (!strcmp(pd->pagesize, "A4x10inch-div2")) { + stp_zprintf(v, "43"); + } else if (!strcmp(pd->pagesize, "A4")) { + stp_zprintf(v, "41"); + } else if (!strcmp(pd->pagesize, "A4-div2")) { + stp_zprintf(v, "43"); + } else { + stp_zprintf(v, "00"); /* should not be possible */ + } + + if (!strcmp(pd->privdata.dnp.print_speed, "LowSpeed")) { + stp_zprintf(v, "\033PCNTRL PRINTSPEED 0000000800000020"); + } else if (!strcmp(pd->privdata.dnp.print_speed, "HighDensity")) { + stp_zprintf(v, "\033PCNTRL PRINTSPEED 0000000800000030"); + } +} + +static const dyesub_stringitem_t dnpds820_print_speeds[] = +{ + { "Normal", N_ ("Normal") }, + { "LowSpeed", N_ ("Low Speed") }, + { "HighDensity", N_ ("High Density") } +}; +LIST(dyesub_stringlist_t, dnpds820_printspeeds_list, dyesub_stringitem_t, dnpds820_print_speeds); + +static const stp_parameter_t ds820_parameters[] = +{ + { + "PrintSpeed", N_("Print Speed"), "Color=No,Category=Advanced Printer Setup", + N_("Print Speed"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define ds820_parameter_count (sizeof(ds820_parameters) / sizeof(const stp_parameter_t)) + +static int +ds820_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "PrintSpeed") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &dnpds820_printspeeds_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int ds820_parse_parameters(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + const char *print_speed; + + print_speed = stp_get_string_parameter(v, "PrintSpeed"); + + if (pd) { + pd->privdata.dnp.print_speed = print_speed; + } + + return 1; +} + /* Citizen CW-01 */ static const dyesub_resolution_t res_citizen_cw01_dpi[] = { @@ -5180,8 +6331,8 @@ static const dyesub_printsize_t citizen_cw01_printsize[] = { "334x600", "w360h504", 2048, 4276}, { "334x334", "w432h576", 2048, 2710}, { "334x600", "w432h576", 2048, 4870}, - { "334x334", "w432h576", 2048, 3050}, - { "334x600", "w432h576", 2048, 5480}, + { "334x334", "w432h648", 2048, 3050}, + { "334x600", "w432h648", 2048, 5480}, }; LIST(dyesub_printsize_list_t, citizen_cw01_printsize_list, dyesub_printsize_t, citizen_cw01_printsize); @@ -5213,7 +6364,7 @@ static void citizen_cw01_printer_start(stp_vars_t *v) } else { stp_putc(0x00, v); } - stp_putc(0x01, v); /* This is actually number of copies */ + stp_putc(pd->copies, v); stp_putc(0x00, v); /* Compute plane size */ @@ -5807,7 +6958,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, 0, NULL, NULL, }, - { /* Kodak Professional 9810 */ + { /* Kodak Professional 9810 (and 8800) */ 4006, &ymc_ink_list, &res_300dpi_list, @@ -5822,7 +6973,10 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &kodak_9810_laminate_list, NULL, NULL, NULL, - NULL, 0, NULL, NULL, + kodak_9810_parameters, + kodak_9810_parameter_count, + kodak_9810_load_parameters, + kodak_9810_parse_parameters, }, { /* Kodak 8810 */ 4007, @@ -5889,7 +7043,10 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &kodak_8500_laminate_list, &kodak_8500_media_list, NULL, NULL, - NULL, 0, NULL, NULL, + kodak_8500_parameters, + kodak_8500_parameter_count, + kodak_8500_load_parameters, + kodak_8500_parse_parameters, }, { /* Mitsubishi CP3020D/DU/DE */ 4101, @@ -6100,8 +7257,8 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &mitsu_cpd70x_laminate_list, NULL, NULL, NULL, - mitsu70x_parameters, - mitsu70x_parameter_count, + mitsu_d90_parameters, + mitsu_d90_parameter_count, mitsu_d90_load_parameters, mitsu_d90_parse_parameters, }, @@ -6193,6 +7350,46 @@ static const dyesub_cap_t dyesub_model_capabilities[] = mitsu9810_load_parameters, mitsu9810_parse_parameters, }, + { /* Mitsubishi P95D/DW */ + 4114, + &w_ink_list, + &res_325dpi_list, + &mitsu_p95d_page_list, + &mitsu_p95d_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_MONOCHROME, + &mitsu_p95d_printer_init, &mitsu_p95d_printer_end, + &mitsu_p95d_plane_start, NULL, + NULL, NULL, /* No block funcs */ + NULL, + NULL, &mitsu_p95d_media_list, + NULL, NULL, + mitsu_p95d_parameters, + mitsu_p95d_parameter_count, + mitsu_p95d_load_parameters, + mitsu_p95d_parse_parameters, + }, + { /* Mitsubishi CP9500D */ + 4115, + &bgr_ink_list, + &res_m9500_list, + &mitsu_cp9500_page_list, + &mitsu_cp9500_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, + &mitsu_cp9500_printer_init, &mitsu_cp9500_printer_end, + &mitsu_cp3020da_plane_init, NULL, + NULL, NULL, /* No block funcs */ + NULL, + NULL, NULL, + NULL, NULL, + mitsu9500_parameters, + mitsu9500_parameter_count, + mitsu9500_load_parameters, + mitsu9500_parse_parameters, + }, { /* Shinko CHC-S9045 (experimental) */ 5000, &rgb_ink_list, @@ -6239,7 +7436,10 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &shinko_chcs1245_laminate_list, NULL, NULL, NULL, - NULL, 0, NULL, NULL, + shinko_chcs1245_parameters, + shinko_chcs1245_parameter_count, + shinko_chcs1245_load_parameters, + shinko_chcs1245_parse_parameters, }, { /* Shinko/Sinfonia CHC-S6245 */ 5003, @@ -6391,6 +7591,26 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, 0, NULL, dnpds80dx_parse_parameters, }, + { /* Dai Nippon Printing DS820 */ + 6007, + &bgr_ink_list, + &res_dnpds40_dpi_list, + &dnpds820_page_list, + &dnpds820_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_WHITE_BORDER + | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_PLANE_LEFTTORIGHT, + &dnpds820_printer_start, &dnpds40_printer_end, + &dnpds40_plane_init, NULL, + NULL, NULL, + NULL, + &dnpds620_laminate_list, NULL, + NULL, NULL, + ds820_parameters, + ds820_parameter_count, + ds820_load_parameters, + ds820_parse_parameters, + }, }; static const stp_parameter_t the_parameters[] = @@ -6430,7 +7650,7 @@ static const stp_parameter_t the_parameters[] = /* better durability of output by covering it with transparent */ /* laminate surface. This surface can be of different patterns: */ /* common are matte, glossy or texture. */ - "Laminate", N_("Laminate Pattern"), "Color=Yes,Category=Advanced Printer Setup", + "Laminate", N_("Laminate Pattern"), "Color=No,Category=Advanced Printer Setup", N_("Laminate Pattern"), STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 0, STP_CHANNEL_NONE, 1, 0 @@ -6448,17 +7668,17 @@ static const stp_parameter_t the_parameters[] = STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, { - "NativeCopies", N_("Printer Generates Copies Natively"), "Color=No,Category=Advanced Printer Functionality", - N_("Printer Generates Copies"), - STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, - STP_PARAMETER_LEVEL_INTERNAL, 0, 0, STP_CHANNEL_NONE, 0, 1 - }, - { "Duplex", N_("Double-Sided Printing"), "Color=No,Category=Basic Printer Setup", N_("Duplex/Tumble Setting"), STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, + { + "NativeCopies", N_("Printer Generates Copies Natively"), "Color=No,Category=Job Mode", + N_("Printer Generates Copies"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_INTERNAL, 0, 0, STP_CHANNEL_NONE, 0, 1 + }, }; static int the_parameter_count = @@ -6763,8 +7983,12 @@ dyesub_parameters(const stp_vars_t *v, const char *name, else if (strcmp(name, "PrintingMode") == 0) { description->bounds.str = stp_string_list_create(); - stp_string_list_add_string - (description->bounds.str, "Color", _("Color")); + if (dyesub_feature(caps, DYESUB_FEATURE_MONOCHROME)) + stp_string_list_add_string(description->bounds.str, + "BW", _("Black and White")); + else + stp_string_list_add_string(description->bounds.str, + "Color", _("Color")); description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; } @@ -7370,6 +8594,15 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) if((pd->page_number & 1) && pd->duplex_mode && !strcmp(pd->duplex_mode,"DuplexNoTumble")) image = stpi_buffer_image(image,BUFFER_FLAG_FLIP_X | BUFFER_FLAG_FLIP_Y); + /* Check to see if we're to generate more than one copy */ + if (stp_check_boolean_parameter(v, "NativeCopies", STP_PARAMETER_ACTIVE) && + stp_get_boolean_parameter(v, "NativeCopies") && + stp_check_int_parameter(v, "NumCopies", STP_PARAMETER_ACTIVE)) + pd->copies = stp_get_int_parameter(v, "NumCopies"); + else + pd->copies = 1; + /* FIXME: What about Collation? Any special handling here? */ + pd->pagesize = stp_get_string_parameter(v, "PageSize"); if (caps->laminate) pd->laminate = dyesub_get_laminate_pattern(v); @@ -7470,7 +8703,7 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) pv.empty_byte[0] = 0xff; /* Y */ pv.empty_byte[1] = 0x80; /* Cb */ pv.empty_byte[2] = 0x80; /* Cr */ - } else if (strcmp(ink_type, "RGB") == 0 || strcmp(ink_type, "BGR") == 0) { + } else if (strcmp(ink_type, "RGB") == 0 || strcmp(ink_type, "BGR") == 0 || strcmp(ink_type, "Whitescale") == 0) { pv.empty_byte[0] = 0xff; pv.empty_byte[1] = 0xff; pv.empty_byte[2] = 0xff; diff --git a/src/main/print-pcl.c b/src/main/print-pcl.c index 0169c8b..9445b04 100644 --- a/src/main/print-pcl.c +++ b/src/main/print-pcl.c @@ -369,12 +369,6 @@ static const short standard_papersizes[] = -1, }; -static const short letter_only_papersizes[] = -{ - PCL_PAPERSIZE_LETTER, - -1 -}; - static const short letter_a4_papersizes[] = { PCL_PAPERSIZE_A4, @@ -1403,6 +1397,8 @@ static const pcl_cap_t pcl_model_capabilities[] = }, }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-const-variable" static const char standard_sat_adjustment[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" @@ -1418,6 +1414,7 @@ static const char standard_sat_adjustment[] = "</sequence>\n" "</curve>\n" "</gutenprint>\n"; +#pragma GCC diagnostic pop static const char standard_lum_adjustment[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" @@ -2566,8 +2563,6 @@ pcl_do_print(stp_vars_t *v, stp_image_t *image) the_left_margin; /* Corrected left margin */ int manual_feed_left_adjust = 0; int extra_left_margin = 0; - stp_curve_t *lum_adjustment; - stp_curve_t *hue_adjustment; double density; int label = 0; @@ -3226,13 +3221,30 @@ pcl_do_print(stp_vars_t *v, stp_image_t *image) if (!stp_check_curve_parameter(v, "HueMap", STP_PARAMETER_ACTIVE)) { - hue_adjustment = stp_curve_create_from_string(standard_hue_adjustment); + stp_curve_t *hue_adjustment = + stp_curve_create_from_string(standard_hue_adjustment); stp_set_curve_parameter(v, "HueMap", hue_adjustment); stp_curve_destroy(hue_adjustment); } if (!stp_check_curve_parameter(v, "LumMap", STP_PARAMETER_ACTIVE)) { - lum_adjustment = stp_curve_create_from_string(standard_lum_adjustment); + stp_curve_t *lum_adjustment = + stp_curve_create_from_string(standard_lum_adjustment); +#if 0 + /* + * This would represent a change to the PCL driver in 5.2.12 + * + * This call was missing and has represented a bug (if a clearly + * non-fatal one) in the PCL driver since time immemorial. The + * non-use of the variable was finally called out by gcc6. In my + * judgment, fixing the bug and changing the output of many PCL + * printers (even if it were for the better) would be more problematic + * than leaving the output as-is. + * + * - Robert Krawitz 2016-12-29 + */ + stp_set_curve_parameter(v, "LumMap", lum_adjustment); +#endif stp_curve_destroy(lum_adjustment); } |