summaryrefslogtreecommitdiff
path: root/src/main/print-dyesub.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/print-dyesub.c')
-rw-r--r--src/main/print-dyesub.c1546
1 files changed, 1418 insertions, 128 deletions
diff --git a/src/main/print-dyesub.c b/src/main/print-dyesub.c
index 70fcc39..cf4eb64 100644
--- a/src/main/print-dyesub.c
+++ b/src/main/print-dyesub.c
@@ -4,7 +4,7 @@
*
* Copyright 2003-2006 Michael Mraka (Michael.Mraka@linux.cz)
*
- * Copyright 2007-2018 Solomon Peachy (pizza@shaftnet.org)
+ * Copyright 2007-2019 Solomon Peachy (pizza@shaftnet.org)
*
* The plug-in is based on the code of the RAW plugin for the GIMP of
* Michael Sweet (mike@easysw.com) and Robert Krawitz (rlk@alum.mit.edu)
@@ -41,7 +41,7 @@
#define inline __inline__
#endif
-//#define S6145_YMC
+#define S6145_YMC /* Generate YMC data for S6145 family */
#define DYESUB_FEATURE_NONE 0x00000000
#define DYESUB_FEATURE_FULL_WIDTH 0x00000001
@@ -199,6 +199,17 @@ typedef struct
typedef struct
{
+ int gamma;
+ int unk_gg;
+ /* below are up-d897 only */
+ int dark;
+ int light;
+ int advance;
+ int sharp;
+} sonymd_privdata_t;
+
+typedef struct
+{
int quality;
int overcoat_offset;
int use_lut;
@@ -234,6 +245,7 @@ typedef struct
int contrast;
int sharpen;
int brightness;
+ char userlut[34];
char usercomment[40];
char commentbuf[19]; /* With one extra byte for null termination */
} mitsu_p95d_privdata_t;
@@ -289,6 +301,7 @@ typedef struct
shinko1245_privdata_t s1245;
mitsu_p95d_privdata_t m95d;
magicard_privdata_t magicard;
+ sonymd_privdata_t sonymd;
} privdata;
} dyesub_privdata_t;
@@ -1321,19 +1334,22 @@ static void updp10_printer_init_func(stp_vars_t *v)
{
dyesub_privdata_t *pd = get_privdata(v);
- stp_zfwrite("\x98\xff\xff\xff\xff\xff\xff\xff"
- "\x09\x00\x00\x00\x1b\xee\x00\x00"
- "\x00\x02\x00\x00\x01\x12\x00\x00"
- "\x00\x1b\xe1\x00\x00\x00\x0b\x00"
- "\x00\x04", 1, 34, v);
+ stp_zfwrite("\x98\xff\xff\xff"
+ "\xff\xff\xff\xff"
+ "\x09\x00\x00\x00"
+ "\x1b\xee\x00\x00"
+ "\x00\x02\x00", 1, 19, v);
+ stp_put16_be(pd->copies, v);
+ stp_zfwrite("\x12\x00\x00\x00"
+ "\x1b\xe1\x00\x00\x00\x0b\x00\x00\x04", 1, 13, v);
stp_zfwrite((pd->overcoat->seq).data, 1,
(pd->overcoat->seq).bytes, v); /*overcoat pattern*/
stp_zfwrite("\x00\x00\x00\x00", 1, 4, v);
stp_put16_be(pd->w_size, v);
stp_put16_be(pd->h_size, v);
- stp_zfwrite("\x14\x00\x00\x00\x1b\x15\x00\x00"
- "\x00\x0d\x00\x00\x00\x00\x00\x07"
- "\x00\x00\x00\x00", 1, 20, v);
+ stp_zfwrite("\x14\x00\x00\x00"
+ "\x1b\x15\x00\x00\x00\x0d\x00\x00"
+ "\x00\x00\x00\x07\x00\x00\x00\x00", 1, 20, v);
stp_put16_be(pd->w_size, v);
stp_put16_be(pd->h_size, v);
stp_put32_le(pd->w_size*pd->h_size*3+11, v);
@@ -1344,10 +1360,11 @@ static void updp10_printer_init_func(stp_vars_t *v)
static void updp10_printer_end_func(stp_vars_t *v)
{
- stp_zfwrite("\xff\xff\xff\xff\x07\x00\x00\x00"
- "\x1b\x0a\x00\x00\x00\x00\x00\xfd"
- "\xff\xff\xff\xff\xff\xff\xff"
- , 1, 23, v);
+ stp_zfwrite("\xff\xff\xff\xff"
+ "\x07\x00\x00\x00"
+ "\x1b\x0a\x00\x00\x00\x00\x00"
+ "\xfd\xff\xff\xff"
+ "\xff\xff\xff\xff", 1, 23, v);
}
static const overcoat_t updp10_overcoat[] =
@@ -1547,27 +1564,21 @@ static void updr150_200_printer_init_func(stp_vars_t *v, int updr200)
"\xed\xff\xff\xff"
"\x07\x00\x00\x00"
"\x1b\xee\x00\x00\x00\x02\x00"
- "\x02\x00\x00\x00"
- "\x00", 1, 43, v);
- stp_putc(pd->copies, v);
+ "\x02\x00\x00\x00", 1, 42, v);
+ stp_put16_be(pd->copies, v);
if (updr200) { /* UP-DR200-specific! */
stp_zfwrite("\x07\x00\x00\x00"
"\x1b\xc0\x00\x03\x00\x05\x00", 1, 11, v);
- }
- stp_zfwrite("\x05\x00\x00\x00"
- "\x02\x03\x00\x01", 1, 8, v);
+ stp_zfwrite("\x05\x00\x00\x00"
+ "\x02\x03\x00\x01", 1, 8, v);
- /* Multicut mode */
- if (updr200) {
if (!strcmp(pd->pagesize,"w288h432-div2") ||
!strcmp(pd->pagesize,"w360h504-div2") ||
!strcmp(pd->pagesize,"w432h576-div2"))
stp_putc(0x02, v);
else
stp_putc(0x00, v);
- } else {
- stp_putc(0x00, v);
}
stp_zfwrite("\x07\x00\x00\x00"
@@ -1605,8 +1616,10 @@ static void updr150_printer_init_func(stp_vars_t *v)
updr150_200_printer_init_func(v, 0);
}
-static void updr150_printer_end_func(stp_vars_t *v)
+static void updr150_200_printer_end_func(stp_vars_t *v, int updr200)
{
+ dyesub_privdata_t *pd = get_privdata(v);
+
stp_zfwrite("\xeb\xff\xff\xff"
"\xfc\xff\xff\xff"
"\xfa\xff\xff\xff",
@@ -1616,10 +1629,32 @@ static void updr150_printer_end_func(stp_vars_t *v)
"\x07\x00\x00\x00"
"\x1b\x17\x00\x00\x00\x00\x00",
1, 22, v);
+
+ /* Multicut mode */
+ if (updr200) {
+ if (!strcmp(pd->pagesize,"w288h432-div2") ||
+ !strcmp(pd->pagesize,"w360h504-div2") ||
+ !strcmp(pd->pagesize,"w432h576-div2")) {
+ stp_zfwrite("\x07\x00\x00\x00"
+ "\x1b\xc0\x00\x03\x00\x05\x00", 1, 11, v);
+ stp_zfwrite("\x05\x00\x00\x00"
+ "\x02\x03\x00\x01\x01", 1, 9, v);
+ }
+ }
stp_zfwrite("\xf3\xff\xff\xff",
1, 4, v);
}
+static void updr150_printer_end_func(stp_vars_t *v)
+{
+ updr150_200_printer_end_func(v, 0);
+}
+
+static void updr200_printer_end_func(stp_vars_t *v)
+{
+ updr150_200_printer_end_func(v, 1);
+}
+
/* Sony UP-DR200 */
static const dyesub_pagesize_t updr200_page[] =
{
@@ -1663,19 +1698,20 @@ static void updr200_printer_init_func(stp_vars_t *v)
}
/* Sony UP-CR10L / DNP SL10 */
+/* Note: This printer reverses the traditional X and Y axes. */
static const dyesub_pagesize_t upcr10_page[] =
{
- DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1248,300), PT1(1848,300), DYESUB_LANDSCAPE),
- DEFINE_PAPER_SIMPLE( "B7", "3.5x5", PT1(1100,300), PT1(1536,300), DYESUB_LANDSCAPE),
- DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1536,300), PT1(2148,300), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1848,300), PT1(1248,300), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "B7", "3.5x5", PT1(1536,300), PT1(1100,300), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1536,300), PT1(2148,300), DYESUB_LANDSCAPE),
};
LIST(dyesub_pagesize_list_t, upcr10_page_list, dyesub_pagesize_t, upcr10_page);
static const dyesub_printsize_t upcr10_printsize[] =
{
- { "300x300", "w288h432", 1248, 1848},
- { "300x300", "B7", 1100, 1536},
+ { "300x300", "w288h432", 1848, 1248},
+ { "300x300", "B7", 1536, 1100},
{ "300x300", "w360h504", 1536, 2148},
};
@@ -1685,11 +1721,23 @@ static void upcr10_printer_init_func(stp_vars_t *v)
{
dyesub_privdata_t *pd = get_privdata(v);
+ char pg = 0;
+
stp_zfwrite("\x60\xff\xff\xff"
- "\xf8\xff\xff\xff"
- "\xfd\xff\xff\xff\x14\x00\x00\x00"
+ "\xf8\xff\xff\xff", 1, 8, v);
+
+ if (strcmp(pd->pagesize,"B7") == 0)
+ pg = '\xff';
+ else if (strcmp(pd->pagesize,"w288h432") == 0)
+ pg = '\xfe';
+ else if (strcmp(pd->pagesize,"w360h504") == 0)
+ pg = '\xfd';
+
+ stp_putc(pg, v);
+ stp_zfwrite("\xff\xff\xff"
+ "\x14\x00\x00\x00"
"\x1b\x15\x00\x00\x00\x0d\x00\x00"
- "\x00\x00\x00\x07\x00\x00\x00\x00", 1, 32, v);
+ "\x00\x00\x00\x07\x00\x00\x00\x00", 1, 23, v);
stp_put16_be(pd->w_size, v);
stp_put16_be(pd->h_size, v);
stp_zfwrite("\xfb\xff\xff\xff"
@@ -1707,25 +1755,1004 @@ static void upcr10_printer_end_func(stp_vars_t *v)
stp_zfwrite("\xf3\xff\xff\xff"
"\x0f\x00\x00\x00"
"\x1b\xe5\x00\x00\x00\x08\x00\x00"
- "\x00\x00\x00\x00\x00\x0d\x00", 1, 23, v);
+ "\x00\x00\x00\x00\x00\x00\x00", 1, 23, v);
stp_zfwrite("\x12\x00\x00\x00\x1b\xe1\x00\x00"
- "\x000x0b\x00\x00\x80\x08\x00\x00"
+ "\x00\x0b\x00\x00\x80\x00\x00\x00"
"\x00\x00", 1, 18, v);
stp_put16_be(pd->w_size, v);
stp_put16_be(pd->h_size, v);
stp_zfwrite("\xfa\xff\xff\xff"
"\x09\x00\x00\x00"
- "\x1b\xee\x00\x00\x00\x02\x00\x00", 1, 16, v);
- stp_putc(pd->copies, v);
+ "\x1b\xee\x00\x00\x00\x02\x00", 1, 15, v);
+ stp_put16_be(pd->copies, v);
stp_zfwrite("\x07\x00\x00\x00"
- "\x1b\x17\x00\x00\x00\x00\x00", 1, 11, v);
+ "\x1b\x0a\x00\x00\x00\x00\x00", 1, 11, v);
stp_zfwrite("\xf9\xff\xff\xff"
"\xfc\xff\xff\xff"
"\x07\x00\x00\x00"
- "\x1b\x17\x00\x00\x00\x00\x00", 1, 19, v);
+ "\x1b\x17\x00\x00\x00\x00\x00", 1, 19, v);
stp_zfwrite("\xf7\xff\xff\xff", 1, 4, v);
}
+/* Sony UP-D895/897MD */
+/* Note: These printers reverse the traditional X and Y axes. 1280 is _always_ the Y axis. */
+static const dyesub_pagesize_t sony_d89x_page[] =
+{
+ DEFINE_PAPER_SIMPLE( "w213h284", "960x1280", PT1(960,325), PT1(1280,325), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w284h284", "1280x1280", PT1(1280,325), PT1(1280,325), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w426h284", "1920x1280", PT1(1920,325), PT1(1280,325), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w852h284", "3840x1280", PT1(3840,325), PT1(1280,325), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w907h284", "4096x1280", PT1(4096,325), PT1(1280,325), DYESUB_PORTRAIT),
+ /* A true "custom" size, printer will cut at the image boundary */
+ DEFINE_PAPER_SIMPLE( "Custom", "Custom", -1, PT1(1280,325), DYESUB_PORTRAIT),
+};
+
+LIST(dyesub_pagesize_list_t, sony_d89x_page_list, dyesub_pagesize_t, sony_d89x_page);
+
+static const dyesub_printsize_t sony_d89x_printsize[] =
+{
+ { "325x325", "w213h284", 960, 1280},
+ { "325x325", "w284h284", 1280, 1280},
+ { "325x325", "w426h284", 1920, 1280},
+ { "325x325", "w852h284", 3840, 1280},
+ { "325x325", "w907h284", 4096, 1280},
+ { "325x325", "Custom", 4096, 1280}, /* Maximum */
+};
+
+LIST(dyesub_printsize_list_t, sony_d89x_printsize_list, dyesub_printsize_t, sony_d89x_printsize);
+
+static const dyesub_stringitem_t sony_upd895_gammas[] =
+{
+ { "Soft", N_ ("Soft") },
+ { "Normal", N_ ("Normal") },
+ { "Hard", N_ ("Hard") },
+};
+LIST(dyesub_stringlist_t, sony_upd895_gamma_list, dyesub_stringitem_t, sony_upd895_gammas);
+
+static const stp_parameter_t sony_upd895_parameters[] =
+{
+ {
+ "SonyGamma", 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
+ },
+};
+#define sony_upd895_parameter_count (sizeof(sony_upd895_parameters) / sizeof(const stp_parameter_t))
+
+static int
+sony_upd895_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(v,
+ 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, "SonyGamma") == 0)
+ {
+ description->bounds.str = stp_string_list_create();
+
+ const dyesub_stringlist_t *mlist = &sony_upd895_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, 2)->name;
+ description->is_active = 1;
+ }
+ else
+ {
+ return 0;
+ }
+ return 1;
+}
+
+static int sony_upd895_parse_parameters(stp_vars_t *v)
+{
+ dyesub_privdata_t *pd = get_privdata(v);
+ const char *gamma = stp_get_string_parameter(v, "SonyGamma");
+
+ /* No need to set global params if there's no privdata yet */
+ if (!pd)
+ return 1;
+
+ pd->privdata.sonymd.unk_gg = 0x0; // XXX Likely it is "empty rows"
+
+ pd->privdata.sonymd.dark = 0;
+ pd->privdata.sonymd.light = 0;
+ pd->privdata.sonymd.advance = 0;
+ pd->privdata.sonymd.sharp = 0;
+
+ if (!strcmp(gamma, "Hard")) {
+ pd->privdata.sonymd.gamma = 0x03;
+ } else if (!strcmp(gamma, "Normal")) {
+ pd->privdata.sonymd.gamma = 0x02;
+ } else if (!strcmp(gamma, "Soft")) {
+ pd->privdata.sonymd.gamma = 0x01;
+ } else{
+ pd->privdata.sonymd.gamma = 0x00;
+ }
+}
+
+static void sony_upd89x_printer_init_func(stp_vars_t *v, int is_897)
+{
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ if (is_897)
+ {
+ stp_zfwrite("\x8e\xff\xff\xff\xfc\xff\xff\xff"
+ "\xfb\xff\xff\xff\xf5\xff\xff\xff"
+ "\xf1\xff\xff\xff\xf0\xff\xff\xff"
+ "\xef\xff\xff\xff", 1, 28, v);
+ }
+ else
+ {
+ stp_zfwrite("\x9c\xff\xff\xff"
+ "\x97\xff\xff\xff", 1, 8, v);
+ dyesub_nputc(v, 0x0, 12);
+ stp_put32_be(0xffffffff, v);
+ }
+
+ stp_put32_le(20, v);
+ stp_zfwrite("\x1b\x15\x00\x00\x00\x0d\x00\x00"
+ "\x00\x00\x00\x01\x00\x00", 1, 14, v);
+ stp_put16_be(pd->privdata.sonymd.unk_gg, v);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+
+ stp_put32_le(11, v);
+ stp_zfwrite("\x1b\xea\x00\x00\x00\x00", 1, 6, v);
+ stp_put32_be(pd->h_size * pd->w_size, v);
+ stp_putc(0x00, v);
+ stp_put32_le(pd->h_size * pd->w_size, v);
+}
+
+static void sony_upd895_printer_init_func(stp_vars_t *v)
+{
+ sony_upd89x_printer_init_func(v, 0);
+}
+
+static void sony_upd897_printer_init_func(stp_vars_t *v)
+{
+ sony_upd89x_printer_init_func(v, 1);
+}
+
+static void sony_upd89x_printer_end_func(stp_vars_t *v, int is_897)
+{
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ if (is_897)
+ {
+ stp_put32_be(0xeaffffff, v);
+ }
+ else
+ {
+ stp_put32_be(0xffffffff, v);
+ }
+
+ stp_put32_le(9, v);
+ stp_zfwrite("\x1b\xee\x00\x00\x00\x02\x00", 1, 7, v);
+ stp_put16_be(pd->copies, v);
+
+ if (is_897)
+ {
+ stp_put32_be(0xeeffffff, v);
+ stp_put32_be(1, v);
+ }
+
+ stp_put32_le(15, v);
+ stp_zfwrite("\x1b\xe5\x00\x00\x00\x08\x00\x00\x00\x00\x00", 1, 11, v);
+ stp_putc(pd->privdata.sonymd.dark, v);
+ stp_putc(pd->privdata.sonymd.light, v);
+ stp_putc(pd->privdata.sonymd.sharp, v);
+ stp_putc(pd->privdata.sonymd.advance, v);
+
+ if (is_897)
+ {
+ stp_put32_be(0xebffffff, v);
+ stp_put32_be(2, v); // Sharpness? 02 and 05 seen
+ }
+
+ stp_put32_le(12, v);
+ stp_zfwrite("\x1b\xc0\x00\x00\x00\x05\x00\x02", 1, 8, v);
+ stp_zfwrite("\x00\x00\x01", 1, 3, v);
+ stp_putc(pd->privdata.sonymd.gamma, v);
+
+ if (is_897)
+ {
+ stp_put32_be(0xecffffff, v);
+ stp_put32_be(1, v); // 00 01 02 seen
+ }
+
+ stp_put32_le(17, v);
+ stp_zfwrite("\x1b\xc0\x00\x01\x00\x0a\x00\x02", 1, 8, v);
+ stp_zfwrite("\x01\x00\x06", 1, 3, v);
+ dyesub_nputc(v, 0x0, 6);
+
+ if (is_897)
+ {
+ stp_put32_be(0xedffffff, v);
+ stp_put32_be(0, v);
+ }
+
+ stp_put32_le(18, v);
+ stp_zfwrite("\x1b\xe1\x00\x00\x00\x0b\x00\x00\x08\00", 1, 10, v);
+ stp_put16_be(0x00, v); // XXX GG GG, based on print size.
+ dyesub_nputc(v, 0x0, 2);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+
+ if (is_897)
+ {
+ stp_put32_be(0xfaffffff, v);
+ }
+
+ stp_put32_le(7, v);
+ stp_zfwrite("\x1b\x0a\x00\x00\x00\x00\x00", 1, 7, v);
+
+ if (is_897)
+ {
+ stp_zfwrite("\xfc\xff\xff\xff"
+ "\xfd\xff\xff\xff"
+ "\xff\xff\xff\xff", 1, 12, v);
+ stp_put32_le(7, v);
+ stp_zfwrite("\x1b\x17\x00\x00\x00\x00\x00", 1, 7, v);
+ stp_put32_be(0xf4ffffff, v);
+ }
+ else
+ {
+ stp_zfwrite("\xfd\xff\xff\xff"
+ "\xf7\xff\xff\xff"
+ "\xf8\xff\xff\xff", 1, 12, v);
+ }
+
+}
+
+static void sony_upd895_printer_end_func(stp_vars_t *v)
+{
+ sony_upd89x_printer_end_func(v, 0);
+}
+
+static void sony_upd897_printer_end_func(stp_vars_t *v)
+{
+ sony_upd89x_printer_end_func(v, 1);
+}
+
+static const dyesub_stringitem_t sony_upd897_gammas[] =
+{
+ { "Softest", N_ ("Softest") },
+ { "Soft", N_ ("Soft") },
+ { "Normal", N_ ("Normal") },
+ { "Hard", N_ ("Hard") },
+};
+LIST(dyesub_stringlist_t, sony_upd897_gamma_list, dyesub_stringitem_t, sony_upd897_gammas);
+
+static const stp_parameter_t sony_upd897_parameters[] =
+{
+ {
+ "SonyGamma", 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
+ },
+ {
+ "Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup",
+ N_("Sharpening to apply to image (0 is off, 14 is max"),
+ STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE,
+ STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0
+ },
+ {
+ "Darkness", N_("Darkness"), "Color=No,Category=Advanced Printer Setup",
+ N_("Printer Image Darkness Adjustment"),
+ STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE,
+ STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0
+ },
+ {
+ "Lightness", N_("Lightness"), "Color=No,Category=Advanced Printer Setup",
+ N_("Printer Image Lightness Adjustment"),
+ STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE,
+ STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0
+ },
+ {
+ "Advance", N_("Advance"), "Color=No,Category=Advanced Printer Setup",
+ N_("Printer Image Advance Adjustment"),
+ STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE,
+ STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0
+ },
+
+};
+#define sony_upd897_parameter_count (sizeof(sony_upd897_parameters) / sizeof(const stp_parameter_t))
+
+static int
+sony_upd897_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(v,
+ 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, "SonyGamma") == 0)
+ {
+ description->bounds.str = stp_string_list_create();
+
+ const dyesub_stringlist_t *mlist = &sony_upd897_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, 3)->name;
+ description->is_active = 1;
+ }
+ else if (strcmp(name, "Darkness") == 0)
+ {
+ description->deflt.integer = 0;
+ description->bounds.integer.lower = -64;
+ description->bounds.integer.upper = 64;
+ description->is_active = 1;
+ }
+ else if (strcmp(name, "Lightness") == 0)
+ {
+ description->deflt.integer = 0;
+ description->bounds.integer.lower = -64;
+ description->bounds.integer.upper = 64;
+ description->is_active = 1;
+ }
+ else if (strcmp(name, "Advance") == 0)
+ {
+ description->deflt.integer = 0;
+ description->bounds.integer.lower = -32;
+ description->bounds.integer.upper = 32;
+ description->is_active = 1;
+ }
+ else if (strcmp(name, "Sharpen") == 0)
+ {
+ description->deflt.integer = 2;
+ description->bounds.integer.lower = 0;
+ description->bounds.integer.upper = 14;
+ description->is_active = 1;
+ }
+ else
+ {
+ return 0;
+ }
+ return 1;
+}
+
+static int sony_upd897_parse_parameters(stp_vars_t *v)
+{
+ dyesub_privdata_t *pd = get_privdata(v);
+ const char *gamma = stp_get_string_parameter(v, "SonyGamma");
+
+ /* No need to set global params if there's no privdata yet */
+ if (!pd)
+ return 1;
+
+ pd->privdata.sonymd.unk_gg = 0xa2; // XXX Suspect it's empty rows
+ pd->privdata.sonymd.dark = stp_get_int_parameter(v, "Darkness");
+ pd->privdata.sonymd.light = stp_get_int_parameter(v, "Lightness");
+ pd->privdata.sonymd.advance = stp_get_int_parameter(v, "Advance");
+ pd->privdata.sonymd.sharp = stp_get_int_parameter(v, "Sharpen");
+
+ if (!strcmp(gamma, "Hard")) {
+ pd->privdata.sonymd.gamma = 0x03;
+ } else if (!strcmp(gamma, "Normal")) {
+ pd->privdata.sonymd.gamma = 0x02;
+ } else if (!strcmp(gamma, "Soft")) {
+ pd->privdata.sonymd.gamma = 0x01;
+ } else if (!strcmp(gamma, "Softer")) {
+ pd->privdata.sonymd.gamma = 0x04;
+ } else{
+ pd->privdata.sonymd.gamma = 0x00;
+ }
+}
+
+/* Sony UP-D898 family */
+static void sony_upd898_printer_init_func(stp_vars_t *v)
+{
+ char hdrbuf[256];
+ char buf[256];
+
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ int hdrlen;
+
+ /* Generate PJL header */
+ memset(buf, 0, sizeof(buf));
+ hdrlen = snprintf(buf, sizeof(buf),
+ "\x1b%%-12345X\r\n"
+ "@PJL JOB NAME=\"Gutenprint\" \r\n"
+ "@PJL ENTER LANGUAGE=SONY-PDL-DS2\r\n");
+ buf[255] = 0;
+
+ /* Generate block header */
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PJL-H,%d,%s,6,0,0,0",
+ hdrlen, pd->pagesize);
+
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+ /* Write PJL header */
+ stp_zfwrite(buf, 1, hdrlen, v);
+
+ /* Generate payload header */
+ hdrlen = pd->w_size * pd->h_size + 274 + 23;
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PDL,%d",
+ hdrlen);
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+
+ /* Write 274 bytes of payload header */
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x10, v);
+ stp_putc(0x0f, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1c, v);
+ dyesub_nputc(v, 0, 7);
+
+ dyesub_nputc(v, 0, 7);
+ stp_putc(0x01, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x09, v);
+ stp_putc(0x00, v);
+ stp_putc(pd->copies, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x11, v);
+
+ stp_putc(0x01, v);
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1a, v);
+ dyesub_nputc(v, 0, 4);
+ stp_put16_be(pd->w_size, v); // fixed at 0x500/1280
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x09, v);
+ stp_putc(0x00, v);
+ stp_putc(0x28, v);
+ stp_putc(0x01, v);
+
+ stp_putc(0x10, v);
+ stp_putc(0xd4, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x03, v);
+ stp_putc(0x58, v);
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x13, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x04, v);
+ stp_putc(0x00, v);
+ stp_putc(0x80, v);
+
+ stp_putc(0x00, v);
+ stp_putc(0x23, v);
+ stp_putc(0x00, v);
+ stp_putc(0x0c, v);
+ stp_putc(0x01, v);
+ stp_putc(0x09, v);
+ stp_put16_be(pd->w_size, v); // fixed at 0x500/1280
+ stp_put16_be(pd->h_size, v);
+ dyesub_nputc(v, 0, 4);
+ stp_putc(0x08, v);
+ stp_putc(0xff, v);
+
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x19, v);
+ dyesub_nputc(v, 0, 4);
+ stp_put16_be(pd->w_size, v); // fixed at 0x500/1280
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x81, v);
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+
+ stp_putc(0x8f, v);
+ stp_putc(0x00, v);
+ stp_putc(0xb8, v);
+ dyesub_nputc(v, 0, 13);
+
+ dyesub_nputc(v, 0, 16 * 9);
+
+ dyesub_nputc(v, 0, 11);
+ stp_putc(0xc0, v);
+ stp_putc(0x00, v);
+ stp_putc(0x82, v);
+ stp_put32_be(pd->w_size* pd->h_size, v);
+}
+
+static void sony_updneo_printer_end_func(stp_vars_t *v)
+{
+ /* write post-payload trailing stuff. */
+ dyesub_nputc(v, '\xff', 16);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x14, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x12, v);
+ stp_putc(0x00, v);
+
+ /* Write block header */
+ stp_zfwrite("JOBSIZE=PJL-T,302", 1, 17, v);
+ dyesub_nputc(v, 0, 256-17);
+
+ /* Write block */
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x8f, v);
+ stp_putc(0x01, v);
+ stp_putc(0x11, v);
+ dyesub_nputc(v, 0, 276);
+
+ /* And finally, the PJL footer */
+ stp_zfwrite("@PJL EOJ\r\n\\x1b%%-12345X\r\n", 1, 21, v);
+}
+
+/* Sony UP-CR20 family */
+static const dyesub_pagesize_t upcr20_page[] =
+{
+ DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1382,334), PT1(2048,334), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "B7", "3.5x5", PT1(1210,334), PT1(1728,334), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1728,334), PT1(2380,334), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w360h504-div2", "3.5x5*2", PT1(1728,334), PT1(2420,334), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(2048,334), PT1(2724,334), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w432h576-div2", "4x6*2", PT1(2048,334), PT1(2764,334), DYESUB_PORTRAIT),
+};
+
+LIST(dyesub_pagesize_list_t, upcr20_page_list, dyesub_pagesize_t, upcr20_page);
+
+static const dyesub_printsize_t upcr20_printsize[] =
+{
+ { "334x334", "w288h432", 1382, 2048},
+ { "334x334", "B7", 1210, 1728},
+ { "334x334", "w360h504", 1728, 2380},
+ { "334x334", "w360h504-div2", 1728, 2420},
+ { "334x334", "w432h576", 2048, 2724},
+ { "334x334", "w432h576-div2", 2048, 2764},
+};
+
+LIST(dyesub_printsize_list_t, upcr20_printsize_list, dyesub_printsize_t, upcr20_printsize);
+
+static const overcoat_t upcr20_overcoat[] =
+{
+ {"Glossy", N_("Glossy"), {1, "\x01"}},
+ {"Matte", N_("Matte"), {1, "\x03"}},
+};
+
+LIST(overcoat_list_t, upcr20_overcoat_list, overcoat_t, upcr20_overcoat);
+
+static void sony_upcr20_printer_init_func(stp_vars_t *v)
+{
+ char hdrbuf[256];
+ char buf[256];
+
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ int hdrlen;
+
+ /* Generate PJL header */
+ memset(buf, 0, sizeof(buf));
+ hdrlen = snprintf(buf, sizeof(buf),
+ "\x1b%%-12345X\r\n"
+ "@PJL JOB NAME=\"Gutenprint\" \r\n"
+ "@PJL ENTER LANGUAGE=SONY-PDL-DS2\r\n");
+ buf[255] = 0;
+
+ /* Generate block header */
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PJL-H,%d,%s,64,0,0,0",
+ hdrlen, pd->pagesize);
+
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+ /* Write PJL header */
+ stp_zfwrite(buf, 1, hdrlen, v);
+
+ /* Generate payload header */
+ hdrlen = pd->w_size * pd->h_size * 3 + 274 + 23;
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PDL,%d",
+ hdrlen);
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+
+ char pg = 0;
+ if (strcmp(pd->pagesize,"B7") == 0)
+ pg = 0x40;
+ else if (strcmp(pd->pagesize,"w288h432") == 0)
+ pg = 0x48;
+ else if (strcmp(pd->pagesize,"w360h504") == 0)
+ pg = 0x41;
+ else if (strcmp(pd->pagesize,"w360h504-div2") == 0)
+ pg = 0x41;
+ else if (strcmp(pd->pagesize,"w432h576") == 0)
+ pg = 0x49;
+ else if (strcmp(pd->pagesize,"w432h576-div2") == 0)
+ pg = 0x49;
+
+ /* Write 274 bytes of payload header */
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x10, v);
+ stp_putc(0x0f, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1c, v);
+ dyesub_nputc(v, 0, 7);
+
+ dyesub_nputc(v, 0, 4);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x16, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x09, v);
+
+ stp_putc(0x00, v);
+ stp_putc(pd->copies, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x06, v);
+ stp_putc(0x01, v);
+ stp_zfwrite((pd->overcoat->seq).data, 1,
+ (pd->overcoat->seq).bytes, v); /*overcoat pattern, 1 byte */
+ stp_putc(0x03, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1d, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ if (strcmp(pd->pagesize,"w360h504-div2") == 0 ||
+ strcmp(pd->pagesize,"w432h576-div2") == 0) {
+ stp_putc(0x03, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1e, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x02, v);
+ }
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x20, v);
+
+ stp_putc(0x01, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x27, v);
+ stp_putc(pg, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x11, v);
+ stp_putc(0x01, v);
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1a, v);
+ dyesub_nputc(v, 0, 4);
+
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x13, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x04, v);
+ stp_putc(0x00, v);
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x23, v);
+ stp_putc(0x00, v);
+ stp_putc(0x10, v);
+
+ stp_putc(0x03, v);
+ stp_putc(0x00, v);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ dyesub_nputc(v, 0, 4);
+ stp_putc(0x08, v);
+ stp_putc(0x08, v);
+ stp_putc(0x08, v);
+ stp_putc(0xff, v);
+ stp_putc(0xff, v);
+ stp_putc(0xff, v);
+
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x17, v);
+ stp_putc(0x00, v);
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x19, v);
+ dyesub_nputc(v, 0, 4);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+
+ stp_putc(0x00, v);
+ stp_putc(0x81, v);
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x8f, v);
+ stp_putc(0x00, v);
+ if (strcmp(pd->pagesize,"w360h504-div2") == 0 ||
+ strcmp(pd->pagesize,"w432h576-div2") == 0) {
+ stp_putc(0x9e, v);
+ dyesub_nputc(v, 0, 3);
+ } else {
+ stp_putc(0xa4, v);
+ dyesub_nputc(v, 0, 9);
+ }
+
+ dyesub_nputc(v, 0, 16 * 8);
+
+ dyesub_nputc(v, 0, 11);
+ stp_putc(0xc0, v);
+ stp_putc(0x00, v);
+ stp_putc(0x82, v);
+ stp_put32_be(pd->w_size* pd->h_size * 3, v);
+}
+
+/* Sony UP-DR80 family */
+static const dyesub_pagesize_t updr80md_page[] =
+{
+ DEFINE_PAPER_SIMPLE( "A4", "A4", PT1(2392,301), PT1(3400,301), DYESUB_PORTRAIT), /* Letter */
+ DEFINE_PAPER_SIMPLE( "Letter", "Letter", PT1(2464,301), PT1(3192,301), DYESUB_PORTRAIT), /* A4 */
+};
+
+LIST(dyesub_pagesize_list_t, updr80md_page_list, dyesub_pagesize_t, updr80md_page);
+
+static const dyesub_printsize_t updr80md_printsize[] =
+{
+ { "301x301", "A4", 2392, 3400},
+ { "301x301", "Letter", 2464, 3192},
+};
+
+LIST(dyesub_printsize_list_t, updr80md_printsize_list, dyesub_printsize_t, updr80md_printsize);
+
+static void sony_updr80md_printer_init_func(stp_vars_t *v)
+{
+ char hdrbuf[256];
+ char buf[256];
+
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ int hdrlen;
+
+ /* Generate PJL header */
+ memset(buf, 0, sizeof(buf));
+ hdrlen = snprintf(buf, sizeof(buf),
+ "\x1b%%-12345X\r\n"
+ "@PJL JOB NAME=\"Gutenprint\" \r\n"
+ "@PJL ENTER LANGUAGE=SONY-PDL-DS2\r\n");
+ buf[255] = 0;
+
+ /* Generate block header */
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PJL-H,%d,%s,4,0,0,0",
+ hdrlen, pd->pagesize);
+
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+ /* Write PJL header */
+ stp_zfwrite(buf, 1, hdrlen, v);
+
+ /* Generate payload header */
+ hdrlen = pd->w_size * pd->h_size * 3 + 296 + 23;
+ memset(hdrbuf, 0, sizeof(hdrbuf));
+ snprintf(hdrbuf, sizeof(hdrbuf), "JOBSIZE=PDL,%d",
+ hdrlen);
+ /* Write block header */
+ stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v);
+
+ char pg = 0;
+ if (strcmp(pd->pagesize,"Letter") == 0)
+ pg = 0x00;
+ else if (strcmp(pd->pagesize,"A4") == 0)
+ pg = 0x56;
+
+ /* Write 296 bytes of payload header */
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x10, v);
+ stp_putc(0x0f, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1c, v);
+ dyesub_nputc(v, 0, 7);
+
+ dyesub_nputc(v, 0, 7);
+ stp_putc(pg, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x16, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x15, v);
+
+ stp_putc(0x00, v);
+ stp_putc(0x12, v);
+ stp_putc(0x55, v);
+ stp_putc(0x50, v);
+ stp_putc(0x44, v);
+ stp_putc(0x52, v);
+ stp_putc(0x38, v);
+ stp_putc(0x30, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x4c, v);
+ stp_putc(0x55, v);
+ stp_putc(0x54, v);
+ stp_putc(0x30, v); // XXX 30 LUT0, 2f NO LUT
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v); // 00 XXX LUT0, ff NO LUT
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x09, v);
+ stp_putc(0x00, v);
+ stp_putc(pd->copies, v);
+ stp_putc(0x02, v);
+ stp_putc(0x00, v);
+ stp_putc(0x06, v);
+ stp_putc(0x01, v);
+ stp_putc(0x03, v);
+ stp_putc(0x04, v);
+ stp_putc(0x00, v);
+
+ stp_putc(0x1d, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x05, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x20, v);
+ stp_putc(0x00, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x11, v);
+ stp_putc(0x01, v);
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x1a, v);
+
+ dyesub_nputc(v, 0, 4);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x13, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x04, v);
+ stp_putc(0x00, v);
+ stp_putc(0x80, v);
+
+ stp_putc(0x00, v);
+ stp_putc(0x23, v);
+ stp_putc(0x00, v);
+ stp_putc(0x10, v);
+ stp_putc(0x03, v);
+ stp_putc(0x00, v);
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ dyesub_nputc(v, 0, 4);
+ stp_putc(0x08, v);
+ stp_putc(0x08, v);
+
+ stp_putc(0x08, v);
+ stp_putc(0xff, v);
+ stp_putc(0xff, v);
+ stp_putc(0xff, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x17, v);
+ stp_putc(0x00, v);
+ stp_putc(0x08, v);
+ stp_putc(0x00, v);
+ stp_putc(0x19, v);
+ dyesub_nputc(v, 0, 4);
+
+ stp_put16_be(pd->w_size, v);
+ stp_put16_be(pd->h_size, v);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x81, v);
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x8f, v);
+ stp_putc(0x00, v);
+ stp_putc(0xa6, v);
+ dyesub_nputc(v, 0, 5);
+
+ dyesub_nputc(v, 0, 16 * 10);
+
+ stp_putc(0x00, v);
+ stp_putc(0xc0, v);
+ stp_putc(0x00, v);
+ stp_putc(0x82, v);
+ stp_put32_be(pd->w_size* pd->h_size * 3, v);
+}
+
+static void sony_updr80md_printer_end_func(stp_vars_t *v)
+{
+ /* write post-payload trailing stuff. */
+// dyesub_nputc(v, '\xff', 16);
+ stp_putc(0x00, v);
+ stp_putc(0x00, v);
+ stp_putc(0x14, v);
+ stp_putc(0x01, v);
+ stp_putc(0x00, v);
+ stp_putc(0x12, v);
+ stp_putc(0x00, v);
+
+ /* Write block header */
+ stp_zfwrite("JOBSIZE=PJL-T,302", 1, 17, v);
+ dyesub_nputc(v, 0, 256-17);
+
+ /* Write block */
+ stp_putc(0x80, v);
+ stp_putc(0x00, v);
+ stp_putc(0x8f, v);
+ stp_putc(0x01, v);
+ stp_putc(0x11, v);
+ dyesub_nputc(v, 0, 276);
+
+ /* And finally, the PJL footer */
+ stp_zfwrite("@PJL EOJ\r\n\\x1b%%-12345X\r\n", 1, 21, v);
+}
+
/* Fujifilm CX-400 */
static const dyesub_pagesize_t cx400_page[] =
{
@@ -1851,16 +2878,28 @@ static void kodak_dock_plane_init(stp_vars_t *v)
/* Kodak 6800 */
static const dyesub_pagesize_t kodak_6800_page[] =
{
+ DEFINE_PAPER_SIMPLE( "w144h432", "2x6", PT1(636,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 2x6 */
+ DEFINE_PAPER_SIMPLE( "w216h432", "3x6", PT1(936,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 3x6 */
DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1240,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6 */
+ DEFINE_PAPER_SIMPLE( "w288h432-div2", "2x6*2", PT1(1282,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6-div2 */
+ DEFINE_PAPER_SIMPLE( "w432h432", "6x6", PT1(1836,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 6x6 */
+ DEFINE_PAPER_SIMPLE( "w432h432-div2", "3x6*2", PT1(1844,300), PT1(1882,300), DYESUB_PORTRAIT), /* 3x6*2 */
DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(1844,300), PT1(2434,300), DYESUB_PORTRAIT), /* 6x8 */
+ DEFINE_PAPER_SIMPLE( "w432h576-div2", "4x6 *2", PT1(1844,300), PT1(2490,300), DYESUB_PORTRAIT), /* 6x8-div2 */
};
LIST(dyesub_pagesize_list_t, kodak_6800_page_list, dyesub_pagesize_t, kodak_6800_page);
static const dyesub_printsize_t kodak_6800_printsize[] =
{
+ { "300x300", "w144h432", 636, 1844},
+ { "300x300", "w216h432", 936, 1844},
{ "300x300", "w288h432", 1240, 1844},
+ { "300x300", "w288h432-div2", 1282, 1844},
+ { "300x300", "w432h432", 1836, 1844},
+ { "300x300", "w432h432-div2", 1844, 1882},
{ "300x300", "w432h576", 1844, 2434},
+ { "300x300", "w432h576-div2", 1844, 2490},
};
LIST(dyesub_printsize_list_t, kodak_6800_printsize_list, dyesub_printsize_t, kodak_6800_printsize);
@@ -1876,18 +2915,30 @@ LIST(overcoat_list_t, kodak_6800_overcoat_list, overcoat_t, kodak_6800_overcoat)
/* Kodak 6850 */
static const dyesub_pagesize_t kodak_6850_page[] =
{
+ DEFINE_PAPER_SIMPLE( "w144h432", "2x6", PT1(636,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 2x6 */
+ DEFINE_PAPER_SIMPLE( "w216h432", "3x6", PT1(936,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 3x6 */
DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1240,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6 */
+ DEFINE_PAPER_SIMPLE( "w288h432-div2", "2x6*2", PT1(1282,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6-div2 */
DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1548,300), PT1(2140,300), DYESUB_PORTRAIT), /* 5x7 */
+ DEFINE_PAPER_SIMPLE( "w432h432", "6x6", PT1(1836,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 6x6 */
+ DEFINE_PAPER_SIMPLE( "w432h432-div2", "3x6*2", PT1(1844,300), PT1(1882,300), DYESUB_PORTRAIT), /* 3x6*2 */
DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(1844,300), PT1(2434,300), DYESUB_PORTRAIT), /* 6x8 */
+ DEFINE_PAPER_SIMPLE( "w432h576-div2", "4x6 *2", PT1(1844,300), PT1(2490,300), DYESUB_PORTRAIT), /* 6x8-div2 */
};
LIST(dyesub_pagesize_list_t, kodak_6850_page_list, dyesub_pagesize_t, kodak_6850_page);
static const dyesub_printsize_t kodak_6850_printsize[] =
{
+ { "300x300", "w144h432", 636, 1844},
+ { "300x300", "w216h432", 936, 1844},
{ "300x300", "w288h432", 1240, 1844},
+ { "300x300", "w288h432-div2", 1282, 1844},
{ "300x300", "w360h504", 1548, 2140},
+ { "300x300", "w432h432", 1836, 1844},
+ { "300x300", "w432h432-div2", 1844, 1882},
{ "300x300", "w432h576", 1844, 2434},
+ { "300x300", "w432h576-div2", 1844, 2490},
};
LIST(dyesub_printsize_list_t, kodak_6850_printsize_list, dyesub_printsize_t, kodak_6850_printsize);
@@ -1922,23 +2973,42 @@ static void kodak_68xx_printer_init(stp_vars_t *v)
stp_put16_be(pd->w_size, v);
stp_put16_be(pd->h_size, v);
- if (!strcmp(pd->pagesize,"w288h432"))
- stp_putc(0x00, v);
- else if (!strcmp(pd->pagesize,"w432h576"))
- stp_putc(0x06, v);
- else if (!strcmp(pd->pagesize,"w360h504"))
- stp_putc(0x07, v);
+ if (!strcmp(pd->pagesize,"w360h504"))
+ stp_putc(0x07, v); /* All 5" sizes */
else
- stp_putc(0x00, v); /* Just in case */
+ stp_putc(0x06, v); /* All others are 6" sizes */
stp_zfwrite((pd->overcoat->seq).data, 1,
(pd->overcoat->seq).bytes, v);
- stp_putc(0x00, v);
+
+ if (!strcmp(pd->pagesize,"w360h504"))
+ stp_putc(0x00, v);
+ else if (!strcmp(pd->pagesize,"w144h432"))
+ stp_putc(0x21, v);
+ else if (!strcmp(pd->pagesize,"w216h432"))
+ stp_putc(0x23, v);
+ else if (!strcmp(pd->pagesize,"w288h432"))
+ stp_putc(0x01, v);
+ else if (!strcmp(pd->pagesize,"w288h432-div2"))
+ stp_putc(0x20, v);
+ else if (!strcmp(pd->pagesize,"w432h432"))
+ stp_putc(0x00, v);
+ else if (!strcmp(pd->pagesize,"w432h432-div2"))
+ stp_putc(0x00, v);
+ else if (!strcmp(pd->pagesize,"w432h576"))
+ stp_putc(0x00, v);
+ else if (!strcmp(pd->pagesize,"w432h576-div2"))
+ stp_putc(0x02, v);
+ else
+ stp_putc(0x00, v); /* Catch-all, just in case */
+
}
/* Kodak 605 */
static const dyesub_pagesize_t kodak_605_page[] =
{
+ DEFINE_PAPER_SIMPLE( "w144h432", "2x6", PT1(636,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 2x6 */
+ DEFINE_PAPER_SIMPLE( "w216h432", "3x6", PT1(936,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 3x6 */
DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1240,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6 */
DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1500,300), PT1(2100,300), DYESUB_PORTRAIT), /* 5x7 */
DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(1844,300), PT1(2434,300), DYESUB_PORTRAIT), /* 6x8 */
@@ -1948,6 +3018,8 @@ LIST(dyesub_pagesize_list_t, kodak_605_page_list, dyesub_pagesize_t, kodak_605_p
static const dyesub_printsize_t kodak_605_printsize[] =
{
+ { "300x300", "w144h432", 636, 1844},
+ { "300x300", "w216h432", 936, 1844},
{ "300x300", "w288h432", 1240, 1844},
{ "300x300", "w360h504", 1500, 2100},
{ "300x300", "w432h576", 1844, 2434},
@@ -1961,18 +3033,21 @@ static void kodak_605_printer_init(stp_vars_t *v)
stp_zfwrite("\x01\x40\x0a\x00\x01", 1, 5, v);
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);
- if (!strcmp(pd->pagesize,"w288h432"))
+ if (!strcmp(pd->pagesize,"w144h432"))
+ stp_putc(0x12, v);
+ else if (!strcmp(pd->pagesize,"w216h432"))
+ stp_putc(0x14, v);
+ else if (!strcmp(pd->pagesize,"w288h432"))
stp_putc(0x01, v);
else if (!strcmp(pd->pagesize,"w432h576"))
stp_putc(0x03, v);
else if (!strcmp(pd->pagesize,"w360h504"))
stp_putc(0x02, v);
else
- stp_putc(0x01, v);
+ stp_putc(0x01, v); /* Just in case */
stp_zfwrite((pd->overcoat->seq).data, 1,
(pd->overcoat->seq).bytes, v);
@@ -2356,6 +3431,9 @@ static void kodak_9810_plane_init(stp_vars_t *v)
static const dyesub_pagesize_t kodak_8810_page[] =
{
DEFINE_PAPER_SIMPLE( "w288h576", "8x4", PT1(1208,300), PT1(2464,300), DYESUB_LANDSCAPE),
+// DEFINE_PAPER_SIMPLE( "w360h576", "8x5", PT1(1508,300), PT1(2464,300), DYESUB_LANDSCAPE).
+// DEFINE_PAPER_SIMPLE( "w432h576", "8x6", PT1(1808,300), PT1(2464,300), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "w576h576", "8x8", PT1(2408,300), PT1(2464,300), DYESUB_LANDSCAPE),
DEFINE_PAPER_SIMPLE( "c8x10", "8x10", PT1(2464,300), PT1(3024,300), DYESUB_PORTRAIT),
DEFINE_PAPER_SIMPLE( "A4", "203x297mm", PT1(2464,300), PT1(3531,300), DYESUB_PORTRAIT),
DEFINE_PAPER_SIMPLE( "w576h864", "8x12", PT1(2464,300), PT1(3624,300), DYESUB_PORTRAIT),
@@ -2365,6 +3443,9 @@ LIST(dyesub_pagesize_list_t, kodak_8810_page_list, dyesub_pagesize_t, kodak_8810
static const dyesub_printsize_t kodak_8810_printsize[] =
{
{ "300x300", "w288h576", 1208, 2464},
+// { "300x300", "w360h576", 1508, 2464},
+// { "300x300", "w432h576", 1808, 2464},
+ { "300x300", "w576h576", 2408, 2464},
{ "300x300", "c8x10", 2464, 3024},
{ "300x300", "A4", 2464, 3531},
{ "300x300", "w576h864", 2464, 3624},
@@ -2374,9 +3455,8 @@ LIST(dyesub_printsize_list_t, kodak_8810_printsize_list, dyesub_printsize_t, kod
static const overcoat_t kodak_8810_overcoat[] =
{
- {"Glossy", N_("Glossy"), {1, "\x03"}},
- {"Satin", N_("Satin"), {1, "\x02"}},
- {"None", N_("None"), {1, "\x01"}},
+ {"Glossy", N_("Glossy"), {1, "\x02"}},
+ {"Satin", N_("Satin"), {1, "\x03"}},
};
LIST(overcoat_list_t, kodak_8810_overcoat_list, overcoat_t, kodak_8810_overcoat);
@@ -2406,6 +3486,7 @@ static void kodak_8810_printer_init(stp_vars_t *v)
static const dyesub_pagesize_t kodak_7000_page[] =
{
DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1240,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6 */
+ DEFINE_PAPER_SIMPLE( "w432h432", "6x6", PT1(1836,300), PT1(1844,300), DYESUB_LANDSCAPE), /* 4x6 */
DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(1844,300), PT1(2434,300), DYESUB_PORTRAIT), /* 6x8 */
};
@@ -2414,6 +3495,7 @@ LIST(dyesub_pagesize_list_t, kodak_7000_page_list, dyesub_pagesize_t, kodak_7000
static const dyesub_printsize_t kodak_7000_printsize[] =
{
{ "300x300", "w288h432", 1240, 1844},
+ { "300x300", "w432h432", 1836, 1844},
{ "300x300", "w432h576", 1844, 2434},
};
@@ -2437,6 +3519,8 @@ static void kodak_70xx_printer_init(stp_vars_t *v)
if (!strcmp(pd->pagesize,"w288h432"))
stp_putc(0x01, v);
+ else if (!strcmp(pd->pagesize,"w432h432"))
+ stp_putc(0x0e, v);
else if (!strcmp(pd->pagesize,"w432h576"))
stp_putc(0x03, v);
else if (!strcmp(pd->pagesize,"w360h504"))
@@ -2788,6 +3872,12 @@ static const stp_parameter_t mitsu_p95d_parameters[] =
STP_PARAMETER_TYPE_RAW, STP_PARAMETER_CLASS_FEATURE,
STP_PARAMETER_LEVEL_ADVANCED, 0, 1, STP_CHANNEL_NONE, 1, 0
},
+ {
+ "UserLUT", N_("User LUT"), "Color=No,Category=Advanced Printer Setup",
+ N_("User-specified Lookup Table, must be exactly 34 bytes in 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))
@@ -2876,6 +3966,8 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name,
description->is_active = 1;
} else if (strcmp(name, "UserComment") == 0) {
description->is_active = 1;
+ } else if (strcmp(name, "UserLUT") == 0) {
+ description->is_active = 1;
}
else
{
@@ -2884,6 +3976,8 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name,
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 int mitsu_p95d_parse_parameters(stp_vars_t *v)
{
dyesub_privdata_t *pd = get_privdata(v);
@@ -2892,6 +3986,7 @@ static int mitsu_p95d_parse_parameters(stp_vars_t *v)
const char *cutter = stp_get_string_parameter(v, "MediaCut");
const char *comment = stp_get_string_parameter(v, "Comment");
const stp_raw_t *usercomment = NULL;
+ const stp_raw_t *userlut = NULL;
/* Sanity check */
if (stp_check_raw_parameter(v, "UserComment", STP_PARAMETER_ACTIVE)) {
@@ -2902,6 +3997,14 @@ static int mitsu_p95d_parse_parameters(stp_vars_t *v)
}
}
+ if (stp_check_raw_parameter(v, "UserLUT", STP_PARAMETER_ACTIVE)) {
+ userlut = stp_get_raw_parameter(v, "UserLUT");
+ if (usercomment->bytes != 34) {
+ stp_eprintf(v, _("StpUserLUT must be exactly 34 bytes!\n"));
+ return 0;
+ }
+ }
+
/* No need to set global params if there's no privdata yet */
if (!pd)
return 1;
@@ -2992,11 +4095,15 @@ static int mitsu_p95d_parse_parameters(stp_vars_t *v)
memset(pd->privdata.m95d.usercomment, 0x20, sizeof(pd->privdata.m95d.usercomment));
}
+ if (userlut) {
+ memcpy(pd->privdata.m95d.userlut, userlut->data, userlut->bytes);
+ } else {
+ memcpy(pd->privdata.m95d.userlut, p95d_lut, sizeof(pd->privdata.m95d.userlut));
+ }
+
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);
@@ -3078,7 +4185,7 @@ static void mitsu_p95d_printer_init(stp_vars_t *v)
stp_putc(0x00, v);
if (pd->privdata.m95d.gamma == 0x10) {
- stp_zfwrite(p95d_lut, 1, sizeof(p95d_lut), v); /* XXX only for K95HG? */
+ stp_zfwrite(pd->privdata.m95d.userlut, 1, sizeof(pd->privdata.m95d.userlut), v); /* XXX only for K95HG? */
} else {
dyesub_nputc(v, 0x00, 34);
}
@@ -3086,7 +4193,7 @@ static void mitsu_p95d_printer_init(stp_vars_t *v)
/* User Comment */
stp_putc(0x1b, v);
stp_putc(0x58, v);
- stp_zfwrite(pd->privdata.m95d.usercomment, 1, sizeof(pd->privdata.m95d.usercomment), v);
+ stp_zfwrite(pd->privdata.m95d.usercomment, 1, sizeof(pd->privdata.m95d.usercomment) - 6, v); /* 34 on P95, 40 on P93 */
}
static void mitsu_p95d_plane_start(stp_vars_t *v)
@@ -3184,7 +4291,7 @@ static const stp_parameter_t mitsu_p93d_parameters[] =
},
{
"Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup",
- N_("Sharpening to apply to image (1 is soft, 1 is normal, 2 is hard"),
+ N_("Sharpening to apply to image (0 is soft, 1 is normal, 2 is hard"),
STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE,
STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0
},
@@ -4844,8 +5951,12 @@ LIST(dyesub_printsize_list_t, mitsu_cpd80_printsize_list, dyesub_printsize_t, mi
/* Kodak 305 */
static const dyesub_pagesize_t kodak305_page[] =
{
+ DEFINE_PAPER_SIMPLE( "B7", "3.5x5", PT1(1076,300), PT1(1568,300), DYESUB_LANDSCAPE),
DEFINE_PAPER_SIMPLE( "w288h432", "4x6", PT1(1218,300), PT1(1864,300), DYESUB_LANDSCAPE),
DEFINE_PAPER_SIMPLE( "w288h432-div2", "2x6*2", PT1(1218,300), PT1(1864,300), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "w360h360", "5x5", PT1(1524,300), PT1(1568,300), DYESUB_LANDSCAPE),
+ DEFINE_PAPER_SIMPLE( "w360h504", "5x7", PT1(1568,300), PT1(2128,300), DYESUB_PORTRAIT),
+ DEFINE_PAPER_SIMPLE( "w360h504-div2", "3.5x5*2", PT1(1568,300), PT1(2190,300), DYESUB_PORTRAIT),
DEFINE_PAPER_SIMPLE( "w432h432", "6x6", PT1(1820,300), PT1(1864,300), DYESUB_LANDSCAPE),
DEFINE_PAPER_SIMPLE( "w432h576", "6x8", PT1(1864,300), PT1(2422,300), DYESUB_PORTRAIT),
DEFINE_PAPER_SIMPLE( "w432h576-div2", "4x6*2", PT1(1864,300), PT1(2454,300), DYESUB_PORTRAIT),
@@ -4855,8 +5966,12 @@ LIST(dyesub_pagesize_list_t, kodak305_page_list, dyesub_pagesize_t, kodak305_pag
static const dyesub_printsize_t kodak305_printsize[] =
{
+ { "300x300", "B7", 1076, 1568},
{ "300x300", "w288h432", 1218, 1864},
{ "300x300", "w288h432-div2", 1218, 1864},
+ { "300x300", "w360h360", 1524, 1568},
+ { "300x300", "w360h504", 1568, 2128},
+ { "300x300", "w360h504-div2", 1568, 2190},
{ "300x300", "w432h432", 1820, 1864},
{ "300x300", "w432h576", 1864, 2422},
{ "300x300", "w432h576-div2", 1864, 2454},
@@ -5868,6 +6983,88 @@ static void shinko_chcs6145_printer_init(stp_vars_t *v)
#endif
}
+static void shinko_chcs2245_printer_init(stp_vars_t *v)
+{
+ dyesub_privdata_t *pd = get_privdata(v);
+
+ int media = 0;
+
+ if (strcmp(pd->pagesize,"w288h432") == 0)
+ media = 0x00;
+ else if (strcmp(pd->pagesize,"w288h432-div2") == 0)
+ media = 0x00;
+ else if (strcmp(pd->pagesize,"w360h360") == 0)
+ media = 0x08;
+ else if (strcmp(pd->pagesize,"w360h504") == 0)
+ media = 0x03;
+ else if (strcmp(pd->pagesize,"w432h432") == 0)
+ media = 0x06;
+ else if (strcmp(pd->pagesize,"w432h576") == 0)
+ media = 0x06;
+ else if (strcmp(pd->pagesize,"w144h432") == 0)
+ media = 0x07;
+ else if (strcmp(pd->pagesize,"w432h576-w432h432_w432h144") == 0)
+ media = 0x06;
+ else if (strcmp(pd->pagesize,"w432h576-div2") == 0)
+ media = 0x06;
+ else if (strcmp(pd->pagesize,"w432h648") == 0)
+ media = 0x05;
+
+ stp_put32_le(0x10, v);
+ stp_put32_le(2245, v); /* Printer Model */
+ if (!strcmp(pd->pagesize,"w360h360") ||
+ !strcmp(pd->pagesize,"w360h504"))
+ stp_put32_le(0x02, v); /* 5" media */
+ else
+ stp_put32_le(0x03, v); /* 6" media */
+ stp_put32_le(0x01, v);
+
+ stp_put32_le(0x64, v);
+ stp_put32_le(0x00, v);
+ stp_put32_le(media, v); /* Media Type */
+ stp_put32_le(0x00, v);
+
+ if (strcmp(pd->pagesize,"w432h576-w432h432_w432h144") == 0) {
+ stp_put32_le(0x05, v);
+ } else if (strcmp(pd->pagesize,"w288h432-div2") == 0) {
+ stp_put32_le(0x04, v);
+ } else if (strcmp(pd->pagesize,"w432h576-div2") == 0) {
+ stp_put32_le(0x02, v);
+ } else {
+ stp_put32_le(0x00, v);
+ }
+ stp_put32_le(0x00, v); /* XXX quality; 00 == default, 0x01 == std */
+ stp_zfwrite((pd->overcoat->seq).data, 1,
+ (pd->overcoat->seq).bytes, v); /* Lamination */
+ stp_put32_le(0x00, 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(pd->copies, v); /* Copies */
+
+ stp_put32_le(0x00, v);
+ stp_put32_le(0x00, v);
+ stp_put32_le(0x00, v);
+ stp_put32_le(0xffffffce, v);
+
+ stp_put32_le(0x00, v);
+ stp_put32_le(0xffffffce, v);
+ stp_put32_le(pd->w_dpi, v); /* Dots Per Inch */
+ stp_put32_le(0xffffffce, v);
+
+ stp_put32_le(0x00, v);
+ stp_put32_le(0xffffffce, v);
+ stp_put32_le(0x00, v);
+ stp_put32_le(0x00, v);
+
+#ifdef S6145_YMC
+ stp_put32_le(0x01, v);
+#else
+ stp_put32_le(0x00, v);
+#endif
+}
+
/* Ciaat Brava 21 */
static const dyesub_pagesize_t ciaat_brava21_page[] =
{
@@ -6272,11 +7469,13 @@ static int dnpds80dx_parse_parameters(stp_vars_t *v)
dyesub_privdata_t *pd = get_privdata(v);
int multicut = 0;
int nocutwaste;
+ int pagenum;
pagesize = stp_get_string_parameter(v, "PageSize");
duplex_mode = stp_get_string_parameter(v, "Duplex");
media = dyesub_get_mediatype(v);
nocutwaste = stp_get_boolean_parameter(v, "NoCutWaste");
+ pagenum = stp_get_int_parameter(v, "PageNumber");
if (!strcmp(media->name, "Roll")) {
if (strcmp(duplex_mode, "None") && strcmp(duplex_mode, "Standard")) {
@@ -6325,7 +7524,7 @@ static int dnpds80dx_parse_parameters(stp_vars_t *v)
/* Add correct offset to multicut mode based on duplex state */
if (!strcmp(duplex_mode, "None") || !strcmp(duplex_mode, "Standard"))
multicut += 100; /* Simplex */
- else if (pd->page_number & 1)
+ else if (pagenum & 1)
multicut += 300; /* Duplex, back */
else
multicut += 200; /* Duplex, front */
@@ -6355,8 +7554,8 @@ static const dyesub_pagesize_t dnpds80dx_page[] =
DEFINE_PAPER( "c8x10", "8x10", PT1(2560,300), PT1(3036,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
DEFINE_PAPER( "c8x10-div2", "8x5*2", PT1(2560,300), PT1(3102,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
DEFINE_PAPER( "c8x10-w576h432_w576h288", "8x6+8x4", PT1(2560,300), PT1(3102,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
- DEFINE_PAPER( "w576h774-w576h756", "8x10.5", PT1(2560,300), PT1(3186,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
- DEFINE_PAPER( "w576h774", "8x10.75", PT1(2560,300), PT1(3186,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
+ DEFINE_PAPER( "w576h774-w576h756", "8x10.5 SHEET", PT1(2560,300), PT1(3186,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
+ DEFINE_PAPER( "w576h774", "8x10.75 SHEET", PT1(2560,300), PT1(3186,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
DEFINE_PAPER( "w576h792-w576h432_w576h360", "8x6+8x5", PT1(2560,300), PT1(3402,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
DEFINE_PAPER( "w576h842", "8x11.7", PT1(2560,300), PT1(3544,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
DEFINE_PAPER( "w576h864", "8x12", PT1(2560,300), PT1(3636,300), PT(56,300), PT(56,300), 0, 0, DYESUB_PORTRAIT),
@@ -6395,7 +7594,7 @@ static const dyesub_printsize_t dnpds80dx_printsize[] =
{ "300x300", "w576h792-w576h432_w576h360", 2560, 3402},
{ "300x600", "w576h792-w576h432_w576h360", 2560, 6804},
{ "300x300", "w576h842", 2560, 3544},
- { "300x600", "w567h842", 2560, 7088},
+ { "300x600", "w576h842", 2560, 7088},
{ "300x300", "w576h864", 2560, 3636},
{ "300x600", "w576h864", 2560, 7272},
{ "300x300", "w576h864-div2", 2560, 3702},
@@ -6576,70 +7775,58 @@ LIST(dyesub_printsize_list_t, dnpds620_printsize_list, dyesub_printsize_t, dnpds
static void dnpds620_printer_start(stp_vars_t *v)
{
dyesub_privdata_t *pd = get_privdata(v);
+ int trim = 0; /* XXX add another parameter to control this. 0 or 12-22 for intermediate scrap on fw >= 1.20. */
+ int cut1 = 0, cut2 = 0, cut3 = 0, cut4 = 0;
+ int multicut = 0;
/* Common code */
dnp_printer_start_common(v);
/* Multicut when 8x6 media is in use */
- if (!strcmp(pd->pagesize, "w432h576") ||
- !strcmp(pd->pagesize, "w432h648")) {
- stp_zprintf(v, "\033PCNTRL FULL_CUTTER_SET 00000016");
- stp_zprintf(v, "0000000000000000");
- } else if (!strcmp(pd->pagesize, "w432h576-div4")) {
- stp_zprintf(v, "\033PCNTRL FULL_CUTTER_SET 00000016");
- stp_zprintf(v, "0200200200200000");
+ if (!strcmp(pd->pagesize, "w432h576-div4")) {
+ cut1 = cut2 = cut3 = cut4 = 20;
} else if (!strcmp(pd->pagesize, "w432h576-w432h432_w432h144")) {
- stp_zprintf(v, "\033PCNTRL FULL_CUTTER_SET 00000016");
- stp_zprintf(v, "0600200000000000");
+ cut1 = 60;
+ cut2 = 20;
} else if (!strcmp(pd->pagesize, "w360h504-w360h360_w360h144")) {
- stp_zprintf(v, "\033PCNTRL FULL_CUTTER_SET 00000016");
- stp_zprintf(v, "050020000000000\r");
+ cut1 = 50;
+ cut2 = 20;
} else if (!strcmp(pd->pagesize, "w288h432-div2")) {
- stp_zprintf(v, "\033PCNTRL CUTTER 00000008");
- stp_zprintf(v, "00000120");
- } else if (pd->privdata.dnp.nocutwaste) {
- stp_zprintf(v, "\033PCNTRL CUTTER 00000008");
- stp_zprintf(v, "00000001");
- } else {
- stp_zprintf(v, "\033PCNTRL CUTTER 00000008");
- stp_zprintf(v, "00000000");
+ cut1 = cut2 = 20;
+ }
+
+ /* Cutter */
+ stp_zprintf(v, "\033PCNTRL CUTTER 00000008%08d", pd->privdata.dnp.nocutwaste ? 1 : 0);
+ if (cut1) {
+ stp_zprintf(v, "\033PCNTRL FULL_CUTTER_SET 00000016");
+ stp_zprintf(v, "%03d%03d%03d%03d%03d\r", cut1, cut2, cut3, cut4, trim);
}
/* Configure multi-cut/page size */
- stp_zprintf(v, "\033PIMAGE MULTICUT 00000008000000");
if (!strcmp(pd->pagesize, "B7")) {
- stp_zprintf(v, "01");
- } else if (!strcmp(pd->pagesize, "w288h432")) {
- stp_zprintf(v, "02");
- } else if (!strcmp(pd->pagesize, "w288h432-div2")) {
- stp_zprintf(v, "02");
+ multicut = 1;
+ } else if (!strcmp(pd->pagesize, "w288h432") || !strcmp(pd->pagesize, "w288h432-div2")) {
+ multicut = 2;
} else if (!strcmp(pd->pagesize, "w324h432")) {
- stp_zprintf(v, "30");
+ multicut = 30;
} else if (!strcmp(pd->pagesize, "w360h360")) {
- stp_zprintf(v, "29");
- } else if (!strcmp(pd->pagesize, "w360h504")) {
- stp_zprintf(v, "03");
- } else if (!strcmp(pd->pagesize, "w360h504-w360h360_w360h144")) {
- stp_zprintf(v, "03");
+ multicut = 29;
+ } else if (!strcmp(pd->pagesize, "w360h504") || !strcmp(pd->pagesize, "w360h504-w360h360_w360h144")) {
+ multicut = 3;
} else if (!strcmp(pd->pagesize, "w360h504-div2")) {
- stp_zprintf(v, "22");
+ multicut = 22;
} else if (!strcmp(pd->pagesize, "w432h432")) {
- stp_zprintf(v, "27");
- } else if (!strcmp(pd->pagesize, "w432h576")) {
- stp_zprintf(v, "04");
- } else if (!strcmp(pd->pagesize, "w432h576-w432h432_w432h144")) {
- stp_zprintf(v, "04");
- } else if (!strcmp(pd->pagesize, "w432h576-div4")) {
- stp_zprintf(v, "04");
+ multicut = 27;
+ } else if (!strcmp(pd->pagesize, "w432h576") || !strcmp(pd->pagesize, "w432h576-w432h432_w432h144") || !strcmp(pd->pagesize, "w432h576-div4")) {
+ multicut = 4;
} else if (!strcmp(pd->pagesize, "w432h576-div2")) {
- stp_zprintf(v, "12");
+ multicut = 12;
} else if (!strcmp(pd->pagesize, "w432h648")) {
- stp_zprintf(v, "05");
+ multicut = 5;
} else if (!strcmp(pd->pagesize, "w432h648-div2")) {
- stp_zprintf(v, "31");
- } else {
- stp_zprintf(v, "00"); /* Should be impossible */
+ multicut = 31;
}
+ stp_zprintf(v, "\033PIMAGE MULTICUT 00000008000000%02d", multicut);
}
/* Dai Nippon Printing DS820 */
@@ -6744,13 +7931,7 @@ static void dnpds820_printer_start(stp_vars_t *v)
dnp_printer_start_common(v);
/* No-cut waste */
- if (pd->privdata.dnp.nocutwaste) {
- stp_zprintf(v, "\033PCNTRL CUTTER 00000008");
- stp_zprintf(v, "00000001");
- } else {
- stp_zprintf(v, "\033PCNTRL CUTTER 00000008");
- stp_zprintf(v, "00000000");
- }
+ stp_zprintf(v, "\033PCNTRL CUTTER 00000008%08d", pd->privdata.dnp.nocutwaste ? 1 : 0);
/* Configure multi-cut/page size */
stp_zprintf(v, "\033PIMAGE MULTICUT 00000008000000");
@@ -7958,7 +9139,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
&updp10_printsize_list,
SHRT_MAX,
DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
- | DYESUB_FEATURE_BORDERLESS,
+ | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_NATIVECOPIES,
&updp10_printer_init_func, &updp10_printer_end_func,
NULL, NULL,
NULL, NULL,
@@ -8024,7 +9205,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
&updr200_printsize_list,
SHRT_MAX,
DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
- &updr200_printer_init_func, &updr150_printer_end_func,
+ &updr200_printer_init_func, &updr200_printer_end_func,
NULL, NULL,
NULL, NULL,
NULL,
@@ -8048,6 +9229,95 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
NULL, NULL,
NULL, 0, NULL, NULL,
},
+ { /* Sony UP-D895 Family */
+ 2006,
+ &w_ink_list,
+ &res_325dpi_list,
+ &sony_d89x_page_list,
+ &sony_d89x_printsize_list,
+ SHRT_MAX,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
+ | DYESUB_FEATURE_MONOCHROME | DYESUB_FEATURE_NATIVECOPIES,
+ &sony_upd895_printer_init_func, &sony_upd895_printer_end_func,
+ NULL, NULL,
+ NULL, NULL, /* No block funcs */
+ NULL,
+ NULL, NULL,
+ NULL, NULL,
+ sony_upd895_parameters,
+ sony_upd895_parameter_count,
+ sony_upd895_load_parameters,
+ sony_upd895_parse_parameters,
+ },
+ { /* Sony UP-D897 Family */
+ 2007,
+ &w_ink_list,
+ &res_325dpi_list,
+ &sony_d89x_page_list,
+ &sony_d89x_printsize_list,
+ SHRT_MAX,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
+ | DYESUB_FEATURE_MONOCHROME | DYESUB_FEATURE_NATIVECOPIES,
+ &sony_upd897_printer_init_func, &sony_upd897_printer_end_func,
+ NULL, NULL,
+ NULL, NULL, /* No block funcs */
+ NULL,
+ NULL, NULL,
+ NULL, NULL,
+ sony_upd897_parameters,
+ sony_upd897_parameter_count,
+ sony_upd897_load_parameters,
+ sony_upd897_parse_parameters,
+ },
+ { /* Sony UP-D898 Family */
+ 2008,
+ &w_ink_list,
+ &res_325dpi_list,
+ &sony_d89x_page_list,
+ &sony_d89x_printsize_list,
+ SHRT_MAX,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
+ | DYESUB_FEATURE_MONOCHROME | DYESUB_FEATURE_NATIVECOPIES,
+ &sony_upd898_printer_init_func, &sony_updneo_printer_end_func,
+ NULL, NULL,
+ NULL, NULL, /* No block funcs */
+ NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, 0, NULL, NULL,
+ },
+ { /* Sony UP-CR20L */
+ 2009,
+ &rgb_ink_list,
+ &res_334dpi_list,
+ &upcr20_page_list,
+ &upcr20_printsize_list,
+ SHRT_MAX,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
+ &sony_upcr20_printer_init_func, &sony_updneo_printer_end_func,
+ NULL, NULL,
+ NULL, NULL,
+ NULL,
+ &upcr20_overcoat_list, NULL,
+ NULL, NULL,
+ NULL, 0, NULL, NULL,
+ },
+ { /* Sony UP-DR80 series */
+ 2010,
+ &rgb_ink_list,
+ &res_301dpi_list,
+ &updr80md_page_list,
+ &updr80md_printsize_list,
+ SHRT_MAX,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
+ &sony_updr80md_printer_init_func, &sony_updr80md_printer_end_func,
+ NULL, NULL,
+ NULL, NULL,
+ NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, 0, NULL, NULL,
+ },
{ /* Fujifilm Printpix CX-400 */
3000,
&rgb_ink_list,
@@ -8221,13 +9491,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
},
{ /* Kodak 8810 */
4007,
- &bgr_ink_list,
+ &rgb_ink_list,
&res_300dpi_list,
&kodak_8810_page_list,
&kodak_8810_printsize_list,
SHRT_MAX,
- DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
- | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_NATIVECOPIES,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
&kodak_8810_printer_init, NULL,
NULL, NULL,
NULL, NULL, /* No block funcs */
@@ -8238,13 +9507,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
},
{ /* Kodak 7000/7010 */
4008,
- &bgr_ink_list,
+ &rgb_ink_list,
&res_300dpi_list,
&kodak_7000_page_list,
&kodak_7000_printsize_list,
SHRT_MAX,
- DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
- | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_NATIVECOPIES,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
&kodak_70xx_printer_init, NULL,
NULL, NULL,
NULL, NULL, /* No block funcs */
@@ -8255,13 +9523,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
},
{ /* Kodak 7015 */
4009,
- &bgr_ink_list,
+ &rgb_ink_list,
&res_300dpi_list,
&kodak_7015_page_list,
&kodak_7015_printsize_list,
SHRT_MAX,
- DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
- | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_NATIVECOPIES,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
&kodak_70xx_printer_init, NULL,
NULL, NULL,
NULL, NULL, /* No block funcs */
@@ -8615,12 +9882,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
},
{ /* Fujifilm ASK-2000/2500 */
4200,
- &bgr_ink_list,
+ &ymc_ink_list,
&res_300dpi_list,
&fuji_ask2000_page_list,
&fuji_ask2000_printsize_list,
SHRT_MAX,
- DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES | DYESUB_FEATURE_PLANE_INTERLACE,
&fuji_ask2000_printer_init, &fuji_ask2000_printer_end,
NULL, NULL,
NULL, NULL, /* No block funcs */
@@ -8631,12 +9898,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
},
{ /* Fujifilm ASK-4000 */
4201,
- &bgr_ink_list,
+ &ymc_ink_list,
&res_300dpi_list,
&fuji_ask4000_page_list,
&fuji_ask4000_printsize_list,
SHRT_MAX,
- DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES | DYESUB_FEATURE_PLANE_INTERLACE,
&fuji_ask4000_printer_init, &fuji_ask4000_printer_end,
NULL, NULL,
NULL, NULL, /* No block funcs */
@@ -8758,6 +10025,29 @@ static const dyesub_cap_t dyesub_model_capabilities[] =
NULL, NULL,
NULL, 0, NULL, NULL,
},
+ { /* Shinko/Sinfonia CHC-S2245 */
+ 5006,
+#ifdef S6145_YMC
+ &ymc_ink_list,
+#else
+ &rgb_ink_list,
+#endif
+ &res_300dpi_list,
+ &shinko_chcs6145_page_list,
+ &shinko_chcs6145_printsize_list,
+ SHRT_MAX,
+#ifdef S6145_YMC
+ DYESUB_FEATURE_PLANE_INTERLACE |
+#endif
+ DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_NATIVECOPIES,
+ &shinko_chcs2245_printer_init, &shinko_chcs2145_printer_end,
+ NULL, NULL, /* No planes */
+ NULL, NULL, /* No blocks */
+ NULL,
+ &shinko_chcs6145_overcoat_list, NULL,
+ NULL, NULL,
+ NULL, 0, NULL, NULL,
+ },
{ /* Dai Nippon Printing DS40 */
6000,
&bgr_ink_list,