diff options
author | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:17:32 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:17:32 +0000 |
commit | cda0fb3b8a7cb56045b24fd0af0ed36591b5d7eb (patch) | |
tree | 31ef197ec5c98ac9ac08714a2440a787c065d8c7 /src/main | |
parent | 92b02ddce00dec2787514568fa9d644d4f0350e9 (diff) |
Imported Upstream version 5.0.1
Diffstat (limited to 'src/main')
32 files changed, 7231 insertions, 5002 deletions
diff --git a/src/main/Makefile.am b/src/main/Makefile.am index aa19a62..55b2868 100644 --- a/src/main/Makefile.am +++ b/src/main/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.92 2005/11/21 11:16:23 rleigh Exp $ +## $Id: Makefile.am,v 1.92.10.1 2007/03/02 12:01:20 rlk Exp $ ## Copyright (C) 2000 Roger Leigh ## ## This program is free software; you can redistribute it and/or modify @@ -50,7 +50,14 @@ color_traditional_la_SOURCES = \ color_traditional_la_LDFLAGS = -module -avoid-version -print_canon_la_SOURCES = print-canon.c +print_canon_la_SOURCES = \ + print-canon.c \ + print-canon.h \ + canon-inks.h \ + canon-media.h \ + canon-modes.h \ + canon-printers.h + print_canon_la_LDFLAGS = -module -avoid-version print_escp2_la_SOURCES = \ @@ -124,6 +131,7 @@ libgutenprint_la_SOURCES = \ dither-predithered.c \ generic-options.c \ image.c \ + buffer-image.c \ module.c \ path.c \ print-dither-matrices.c \ diff --git a/src/main/Makefile.in b/src/main/Makefile.in index 0ef0165..1d50529 100644 --- a/src/main/Makefile.in +++ b/src/main/Makefile.in @@ -48,11 +48,12 @@ subdir = src/main ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -80,14 +81,16 @@ am__libgutenprint_la_SOURCES_DIST = array.c bit-ops.c channel.c \ color.c curve.c curve-cache.c dither-ed.c dither-eventone.c \ dither-inks.c dither-main.c dither-ordered.c \ dither-very-fast.c dither-predithered.c generic-options.c \ - image.c module.c path.c print-dither-matrices.c print-list.c \ - print-papers.c print-util.c print-vars.c print-version.c \ - print-weave.c printers.c sequence.c string-list.c xml.c \ - mxml-attr.c mxml-file.c mxml-node.c mxml-search.c \ - dither-impl.h dither-inlined-functions.h generic-options.h \ - gutenprint-internal.h util.h print-color.c color-conversion.h \ - color-conversions.c print-canon.c print-escp2.c escp2-driver.c \ - print-escp2.h print-escp2-data.c escp2-channels.c escp2-inks.c \ + image.c buffer-image.c module.c path.c print-dither-matrices.c \ + print-list.c print-papers.c print-util.c print-vars.c \ + print-version.c print-weave.c printers.c sequence.c \ + string-list.c xml.c mxml-attr.c mxml-file.c mxml-node.c \ + mxml-search.c dither-impl.h dither-inlined-functions.h \ + generic-options.h gutenprint-internal.h util.h print-color.c \ + color-conversion.h color-conversions.c print-canon.c \ + print-canon.h canon-inks.h canon-media.h canon-modes.h \ + canon-printers.h print-escp2.c escp2-driver.c print-escp2.h \ + print-escp2-data.c escp2-channels.c escp2-inks.c \ escp2-papers.c escp2-resolutions.c print-lexmark.c print-pcl.c \ print-ps.c print-olympus.c print-raw.c am__objects_1 = mxml-attr.lo mxml-file.lo mxml-node.lo mxml-search.lo @@ -110,11 +113,11 @@ am_libgutenprint_la_OBJECTS = array.lo bit-ops.lo channel.lo color.lo \ curve.lo curve-cache.lo dither-ed.lo dither-eventone.lo \ dither-inks.lo dither-main.lo dither-ordered.lo \ dither-very-fast.lo dither-predithered.lo generic-options.lo \ - image.lo module.lo path.lo print-dither-matrices.lo \ - print-list.lo print-papers.lo print-util.lo print-vars.lo \ - print-version.lo print-weave.lo printers.lo sequence.lo \ - string-list.lo xml.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_12) + image.lo buffer-image.lo module.lo path.lo \ + print-dither-matrices.lo print-list.lo print-papers.lo \ + print-util.lo print-vars.lo print-version.lo print-weave.lo \ + printers.lo sequence.lo string-list.lo xml.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_12) libgutenprint_la_OBJECTS = $(am_libgutenprint_la_OBJECTS) print_canon_la_LIBADD = am_print_canon_la_OBJECTS = print-canon.lo @@ -147,8 +150,8 @@ am_print_raw_la_OBJECTS = print-raw.lo print_raw_la_OBJECTS = $(am_print_raw_la_OBJECTS) @BUILD_MODULES_TRUE@am_print_raw_la_rpath = -rpath $(pkgmoduledir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -175,13 +178,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -207,6 +215,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -214,6 +224,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -226,12 +237,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -266,6 +279,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -361,14 +375,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -385,6 +402,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -402,17 +422,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -437,7 +461,14 @@ color_traditional_la_SOURCES = \ color-conversions.c color_traditional_la_LDFLAGS = -module -avoid-version -print_canon_la_SOURCES = print-canon.c +print_canon_la_SOURCES = \ + print-canon.c \ + print-canon.h \ + canon-inks.h \ + canon-media.h \ + canon-modes.h \ + canon-printers.h + print_canon_la_LDFLAGS = -module -avoid-version print_escp2_la_SOURCES = \ print-escp2.c \ @@ -501,6 +532,7 @@ libgutenprint_la_SOURCES = \ dither-predithered.c \ generic-options.c \ image.c \ + buffer-image.c \ module.c \ path.c \ print-dither-matrices.c \ @@ -554,9 +586,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/main/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/main/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/main/Makefile + $(AUTOMAKE) --gnu src/main/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -655,14 +687,75 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit-ops.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer-image.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color-conversions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve-cache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-ed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-eventone.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-inks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-ordered.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-predithered.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-very-fast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-channels.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-inks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-papers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-resolutions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-attr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-node.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-search.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-canon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-dither-matrices.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-escp2-data.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-escp2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-lexmark.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-olympus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-papers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-pcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-ps.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-raw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-vars.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-weave.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sequence.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml.Plo@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -826,6 +919,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-pkgmoduleLTLIBRARIES mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -852,6 +946,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/main/bit-ops.c b/src/main/bit-ops.c index 063348d..ab111ca 100644 --- a/src/main/bit-ops.c +++ b/src/main/bit-ops.c @@ -1,5 +1,5 @@ /* - * "$Id: bit-ops.c,v 1.9 2006/03/28 03:27:57 rlk Exp $" + * "$Id: bit-ops.c,v 1.9.8.2 2007/05/12 19:14:27 faust3 Exp $" * * Softweave calculator for Gutenprint. * @@ -73,6 +73,201 @@ stp_fold(const unsigned char *line, } } +void +stp_fold_3bit(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + int i; + memset(outbuf, 0, single_length * 3); + for (i = 0; i < single_length; i++) { + outbuf[0] = + ((line[0] & (1 << 7)) >> 2) | + ((line[0] & (1 << 6)) >> 4) | + ((line[single_length] & (1 << 7)) >> 1) | + ((line[single_length] & (1 << 6)) >> 3) | + ((line[single_length] & (1 << 5)) >> 5) | + ((line[2*single_length] & (1 << 7)) << 0) | + ((line[2*single_length] & (1 << 6)) >> 2) | + ((line[2*single_length] & (1 << 5)) >> 4); + outbuf[1] = + ((line[0] & (1 << 5)) << 2) | + ((line[0] & (1 << 4)) << 0) | + ((line[0] & (1 << 3)) >> 2) | + ((line[single_length] & (1 << 4)) << 1) | + ((line[single_length] & (1 << 3)) >> 1) | + ((line[2*single_length] & (1 << 4)) << 2) | + ((line[2*single_length] & (1 << 3)) << 0) | + ((line[2*single_length] & (1 << 2)) >> 2); + outbuf[2] = + ((line[0] & (1 << 2)) << 4) | + ((line[0] & (1 << 1)) << 2) | + ((line[0] & (1 << 0)) << 0) | + ((line[single_length] & (1 << 2)) << 5) | + ((line[single_length] & (1 << 1)) << 3) | + ((line[single_length] & (1 << 0)) << 1) | + ((line[2*single_length] & (1 << 1)) << 4) | + ((line[2*single_length] & (1 << 0)) << 2); + line++; + outbuf += 3; + } +} + +void +stp_fold_3bit_323(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + unsigned char A0,A1,A2,B0,B1,B2,C0,C1,C2; + const unsigned char *last= line+single_length; + memset(outbuf, 0, single_length * 3); + for (; line < last; line+=3, outbuf+=8) { + + A0= line[0]; B0= line[single_length]; C0= line[2*single_length]; + + if (line<last-2) { + A1= line[1]; B1= line[single_length+1]; C1= line[2*single_length+1]; + } else { + A1= 0; B1= 0; C1= 0; + } + if (line<last-1) { + A2= line[2]; B2= line[single_length+2]; C2= line[2*single_length+2]; + } else { + A2= 0; B2= 0; C2= 0; + } + + outbuf[0] = + ((C0 & 0x80) >> 0) | + ((B0 & 0x80) >> 1) | + ((A0 & 0x80) >> 2) | + ((B0 & 0x40) >> 2) | + ((A0 & 0x40) >> 3) | + ((C0 & 0x20) >> 3) | + ((B0 & 0x20) >> 4) | + ((A0 & 0x20) >> 5); + outbuf[1] = + ((C0 & 0x10) << 3) | + ((B0 & 0x10) << 2) | + ((A0 & 0x10) << 1) | + ((B0 & 0x08) << 1) | + ((A0 & 0x08) << 0) | + ((C0 & 0x04) >> 0) | + ((B0 & 0x04) >> 1) | + ((A0 & 0x04) >> 2); + outbuf[2] = + ((C0 & 0x02) << 6) | + ((B0 & 0x02) << 5) | + ((A0 & 0x02) << 4) | + ((B0 & 0x01) << 4) | + ((A0 & 0x01) << 3) | + ((C1 & 0x80) >> 5) | + ((B1 & 0x80) >> 6) | + ((A1 & 0x80) >> 7); + outbuf[3] = + ((C1 & 0x40) << 1) | + ((B1 & 0x40) << 0) | + ((A1 & 0x40) >> 1) | + ((B1 & 0x20) >> 1) | + ((A1 & 0x20) >> 2) | + ((C1 & 0x10) >> 2) | + ((B1 & 0x10) >> 3) | + ((A1 & 0x10) >> 4); + outbuf[4] = + ((C1 & 0x08) << 4) | + ((B1 & 0x08) << 3) | + ((A1 & 0x08) << 2) | + ((B1 & 0x04) << 2) | + ((A1 & 0x04) << 1) | + ((C1 & 0x02) << 1) | + ((B1 & 0x02) >> 0) | + ((A1 & 0x02) >> 1); + outbuf[5] = + ((C1 & 0x01) << 7) | + ((B1 & 0x01) << 6) | + ((A1 & 0x01) << 5) | + ((B2 & 0x80) >> 3) | + ((A2 & 0x80) >> 4) | + ((C2 & 0x40) >> 4) | + ((B2 & 0x40) >> 5) | + ((A2 & 0x40) >> 6); + outbuf[6] = + ((C2 & 0x20) << 2) | + ((B2 & 0x20) << 1) | + ((A2 & 0x20) << 0) | + ((B2 & 0x10) >> 0) | + ((A2 & 0x10) >> 1) | + ((C2 & 0x08) >> 1) | + ((B2 & 0x08) >> 2) | + ((A2 & 0x08) >> 3); + outbuf[7] = + ((C2 & 0x04) << 5) | + ((B2 & 0x04) << 4) | + ((A2 & 0x04) << 3) | + ((B2 & 0x02) << 3) | + ((A2 & 0x02) << 2) | + ((C2 & 0x01) << 2) | + ((B2 & 0x01) << 1) | + ((A2 & 0x01) << 0); + } +} + +void +stp_fold_4bit(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + int i; + memset(outbuf, 0, single_length * 4); + for (i = 0; i < single_length; i++){ + unsigned char l0 = line[0]; + unsigned char l1 = line[single_length]; + unsigned char l2 = line[single_length*2]; + unsigned char l3 = line[single_length*3]; + if(l0 || l1 || l2 || l3){ + outbuf[0] = + ((l3 & (1<<7)) >> 0)| + ((l2 & (1<<7)) >> 1)| + ((l1 & (1<<7)) >> 2)| + ((l0 & (1<<7)) >> 3)| + ((l3 & (1<<6)) >> 3)| + ((l2 & (1<<6)) >> 4)| + ((l1 & (1<<6)) >> 5)| + ((l0 & (1<<6)) >> 6); + + outbuf[1] = + ((l3 & (1<<5)) << 2)| + ((l2 & (1<<5)) << 1)| + ((l1 & (1<<5)) << 0)| + ((l0 & (1<<5)) >> 1)| + ((l3 & (1<<4)) >> 1)| + ((l2 & (1<<4)) >> 2)| + ((l1 & (1<<4)) >> 3)| + ((l0 & (1<<4)) >> 4); + + outbuf[2] = + ((l3 & (1<<3)) << 4)| + ((l2 & (1<<3)) << 3)| + ((l1 & (1<<3)) << 2)| + ((l0 & (1<<3)) << 1)| + ((l3 & (1<<2)) << 1)| + ((l2 & (1<<2)) << 0)| + ((l1 & (1<<2)) >> 1)| + ((l0 & (1<<2)) >> 2); + outbuf[3] = + ((l3 & (1<<1)) << 6)| + ((l2 & (1<<1)) << 5)| + ((l1 & (1<<1)) << 4)| + ((l0 & (1<<1)) << 3)| + ((l3 & (1<<0)) << 3)| + ((l2 & (1<<0)) << 2)| + ((l1 & (1<<0)) << 1)| + ((l0 & (1<<0)) << 0); + } + line++; + outbuf += 4; + } +} + static void stpi_split_2_1(int length, const unsigned char *in, @@ -950,27 +1145,30 @@ stpi_unpack_16_2(int length, if (tempin & 3) temp[7] |= ((tempin & 3) << 6) >> shift; - tempin = *in++; - - if (tempin & 192) - temp[8] |= (tempin & 192) >> shift; - if (tempin & 48) - temp[9] |= ((tempin & 48) << 2) >> shift; - if (tempin & 12) - temp[10] |= ((tempin & 12) << 4) >> shift; - if (tempin & 3) - temp[11] |= ((tempin & 3) << 6) >> shift; - - tempin = *in++; - - if (tempin & 192) - temp[12] |= (tempin & 192) >> shift; - if (tempin & 48) - temp[13] |= ((tempin & 48) << 2) >> shift; - if (tempin & 12) - temp[14] |= ((tempin & 12) << 4) >> shift; - if (tempin & 3) - temp[15] |= ((tempin & 3) << 6) >> shift; + if (length-- > 0) + { + tempin = *in++; + + if (tempin & 192) + temp[8] |= (tempin & 192) >> shift; + if (tempin & 48) + temp[9] |= ((tempin & 48) << 2) >> shift; + if (tempin & 12) + temp[10] |= ((tempin & 12) << 4) >> shift; + if (tempin & 3) + temp[11] |= ((tempin & 3) << 6) >> shift; + + tempin = *in++; + + if (tempin & 192) + temp[12] |= (tempin & 192) >> shift; + if (tempin & 48) + temp[13] |= ((tempin & 48) << 2) >> shift; + if (tempin & 12) + temp[14] |= ((tempin & 12) << 4) >> shift; + if (tempin & 3) + temp[15] |= ((tempin & 3) << 6) >> shift; + } if (shift < 6) shift += 2; diff --git a/src/main/buffer-image.c b/src/main/buffer-image.c new file mode 100644 index 0000000..030d398 --- /dev/null +++ b/src/main/buffer-image.c @@ -0,0 +1,153 @@ +/* + * Buffer an Image + * + * Copyright 2007 Sascha Sommer <saschasommer@freenet.de> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <gutenprint/gutenprint.h> +#include "gutenprint-internal.h" + +struct buffered_image_priv +{ + stp_image_t* image; + unsigned char** buf; + unsigned int flags; +}; + +static void +buffered_image_init(stp_image_t* image) +{ + struct buffered_image_priv *priv = image->rep; + if(priv->image->init) + priv->image->init(priv->image); +} + + +static int +buffered_image_width(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->width(priv->image); +} + +static int +buffered_image_height(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->height(priv->image); +} + +static const char * +buffered_image_get_appname(stp_image_t *image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->get_appname(priv->image); +} + + +static stp_image_status_t +buffered_image_get_row(stp_image_t* image,unsigned char *data, size_t byte_limit, int row) +{ + struct buffered_image_priv *priv = image->rep; + int width = buffered_image_width(image); + int height = buffered_image_height(image); + /* FIXME this will break with padding bytes */ + int bytes_per_pixel = byte_limit / width; + int inc = bytes_per_pixel; + unsigned char* src; + int i; + /* fill buffer */ + if(!priv->buf){ + priv->buf = stp_zalloc((sizeof(unsigned short*) + 1) * height); + if(!priv->buf){ + return STP_IMAGE_STATUS_ABORT; + } + for(i=0;i<height;i++){ + priv->buf[i] = stp_malloc(byte_limit); + if(STP_IMAGE_STATUS_OK != priv->image->get_row(priv->image,priv->buf[i],byte_limit,i)) + return STP_IMAGE_STATUS_ABORT; + } + } + if(priv->flags & BUFFER_FLAG_FLIP_Y) + row = height - row - 1; + + src = priv->buf[row]; + + if(priv->flags & BUFFER_FLAG_FLIP_X){ + src += byte_limit - bytes_per_pixel; + inc = -bytes_per_pixel; + } + + /* copy data */ + for( i = 0 ; i < width ; i++){ + memcpy(data,src,bytes_per_pixel); + src += inc; + data += bytes_per_pixel; + } + return STP_IMAGE_STATUS_OK; +} + +static void +buffered_image_conclude(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + if(priv->buf){ + int i = 0; + while(priv->buf[i]){ + stp_free(priv->buf[i]); + ++i; + } + stp_free(priv->buf); + priv->buf = NULL; + } + if(priv->image->conclude) + priv->image->conclude(priv->image); + +} + +stp_image_t* +stpi_buffer_image(stp_image_t* image, unsigned int flags) +{ + struct buffered_image_priv *priv; + stp_image_t* buffered_image = stp_zalloc(sizeof(stp_image_t)); + if(!buffered_image){ + return NULL; + } + priv = buffered_image->rep = stp_zalloc(sizeof(struct buffered_image_priv)); + if(!priv){ + stp_free(buffered_image); + return NULL; + } + + if(image->init) + buffered_image->init = buffered_image_init; + buffered_image->width = buffered_image_width; + buffered_image->height = buffered_image_height; + buffered_image->get_row = buffered_image_get_row; + priv->image = image; + priv->flags = flags; + if(image->get_appname) + buffered_image->get_appname = buffered_image_get_appname; + + + return buffered_image; +} + + diff --git a/src/main/canon-inks.h b/src/main/canon-inks.h new file mode 100644 index 0000000..458cb2a --- /dev/null +++ b/src/main/canon-inks.h @@ -0,0 +1,420 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 - 2007 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains definitions for the various inks +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_INKS_H +#define GUTENPRINT_INTERNAL_CANON_INKS_H + +/* ink definition: + * ink dots can be printed in various sizes + * one size is called level + * every level is represented by a bitcombination and a density + * the density ranges from 0 (no dot is printed) to 1.0 (maximum dot size) + * + * an ink is therefore defined by the number of bits used for the bitpattern (bitdepth) and the number of possible levels: + * a 1 bit ink can have 2 possible levels 0 and 1 + * a 2 bit ink can have 2*2=4 possible levels with the bitpatterns 0,1,2 and 3 + * a 3 bit ink can have 2*2*2=8 possible levels with the bitpatterns 0 to 7 + * ... + * some inks use less levels than possible with the given bitdepth + * some inks use special compressions to store for example 5 3 level pixels in 1 byte + * naming: + * dotsizes are named dotsizes_xl where x is the number of levels (number of dotsizes + 1) + * inks are named canon_xb_yl_ink where x is the number of bits representing the y possible ink levels + * inks that contain special (compression) flags are named canon_xb_yl_c_ink + * order: + * dotsizes are ordered ascending by the number of dots + * +*/ + + +typedef struct { + const int bits; /* bitdepth */ + const int flags; /* flags: */ +#define INK_FLAG_5pixel_in_1byte 0x1 /* use special compression where 5 3level pixels get stored in 1 byte */ + int numsizes; /* number of possible {bit,density} tuples */ + const stp_dotsize_t *dot_sizes; /* pointer to an array of {bit,density} tuples */ +} canon_ink_t; + +/* declare a standard ink */ +#define DECLARE_INK(bits,levels) \ +static const canon_ink_t canon_##bits##b_##levels##l_ink = { \ + bits,0, \ + sizeof(dotsizes_##levels##l)/sizeof(stp_dotsize_t), dotsizes_##levels##l \ +} + +/* declare an ink with flags */ +#define DECLARE_INK_EXTENDED(bits,levels,flags) \ +static const canon_ink_t canon_##bits##b_##levels##l_c_ink = { \ + bits,flags, \ + sizeof(dotsizes_##levels##l)/sizeof(stp_dotsize_t), dotsizes_##levels##l \ +} + + + +/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE + * + * Some of the bitpattern/density combinations were taken from print-escp2.c + * and do NOT represent the requirements of canon inks. Feel free to play + * with them and send a patch to gimp-print-devel@lists.sourceforge.net + */ + + +static const stp_dotsize_t dotsizes_2l[] = { + { 0x1, 1.0 } +}; + +DECLARE_INK(1,2); + + +static const stp_dotsize_t dotsizes_3l[] = { + { 0x1, 0.5 }, + { 0x2, 1.0 } +}; + +DECLARE_INK(2,3); + +DECLARE_INK_EXTENDED(2,3,INK_FLAG_5pixel_in_1byte); + +static const stp_dotsize_t dotsizes_4l[] = { + { 0x1, 0.45 }, + { 0x2, 0.68 }, + { 0x3, 1.0 } +}; + +DECLARE_INK(2,4); + +static const stp_dotsize_t dotsizes_7l[] = { + { 0x1, 0.45 }, + { 0x2, 0.55 }, + { 0x3, 0.66 }, + { 0x4, 0.77 }, + { 0x5, 0.88 }, + { 0x6, 1.0 } +}; + +DECLARE_INK(3,7); + +static const stp_dotsize_t dotsizes_8l[] = { + { 0x1, 0.14 }, + { 0x2, 0.29 }, + { 0x3, 0.43 }, + { 0x4, 0.58 }, + { 0x5, 0.71 }, + { 0x6, 0.86 }, + { 0x7, 1.00 } +}; + +DECLARE_INK(4,8); + +static const stp_dotsize_t dotsizes_16l[] = { + { 0x1, 0.07 }, + { 0x2, 0.13 }, + { 0x3, 0.20 }, + { 0x4, 0.27 }, + { 0x5, 0.33 }, + { 0x6, 0.40 }, + { 0x7, 0.47 }, + { 0x8, 0.53 }, + { 0x9, 0.60 }, + { 0xA, 0.67 }, + { 0xB, 0.73 }, + { 0xC, 0.80 }, + { 0xD, 0.87 }, + { 0xE, 0.93 }, + { 0xF, 1.00 } +}; + +DECLARE_INK(4,16); + + +/* A inkset is a list of inks and their (relative) densities + * For printers that use the extended SetImage command t) + * the inkset will be used to build the parameter list + * therefore invalid inksets will let the printer fallback + * to a default mode which will then lead to wrong output + * use {0,0.0,NULL} for undefined placeholder inks + * set density to 0.0 to disable certain inks + * the paramters will then still occure in the t) command + * + * names: + * inksets are named canon_X_ where X is the number of possible inks in the set + * followed by YZ combinations for every defined ink where Y is the letter + * representing the color and Z the maximum level of the color + * if an inkset contains one or more compressed inks a _c is appended + * the inkset name ends with _inkset + * see the examples below + * order: + * inksets are ordered by ascending number of possible inks, used inks, compression + * + */ + + +typedef struct { + const int channel; + const double density; + const canon_ink_t* ink; +} canon_inkset_t; + + +/* Inkset for printing in K and 1bit/pixel */ +static const canon_inkset_t canon_1_K2_inkset[] = { + {'K',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMY and 1bit/pixel */ +static const canon_inkset_t canon_3_C2M2Y2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink} +}; + + +/* Inkset for printing in CMY and 2bit/pixel */ +static const canon_inkset_t canon_3_C4M4Y4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink} +}; + +/* Inkset for printing in CMYK and 1bit/pixel */ +static const canon_inkset_t canon_4_C2M2Y2K2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMYK and 2bit/pixel */ +static const canon_inkset_t canon_4_C4M4Y4K4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_2b_4l_ink} +}; + +/* + * Dither ranges specifically for any Color and 3bit/pixel + * (see NOTE above) + * + * BIG NOTE: The bjc8200 has this kind of ink. One Byte seems to hold + * drop sizes for 3 pixels in a 3/2/2 bit fashion. + * Size values for 3bit-sized pixels range from 1 to 7, + * size values for 2bit-sized picels from 1 to 3 (kill msb). + * + * + */ + +/* Inkset for printing in CMYK and 3bit/pixel */ +static const canon_inkset_t canon_4_C7M7Y7K7_inkset[] = { + {'C',1.0,&canon_3b_7l_ink}, + {'M',1.0,&canon_3b_7l_ink}, + {'Y',1.0,&canon_3b_7l_ink}, + {'K',1.0,&canon_3b_7l_ink} +}; + +/* Inkset for printing in CMYKcm and 1bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C2M2Y2K2c2m2_inkset[] = { + {'C',0.25,&canon_1b_2l_ink}, + {'M',0.26,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',1.0,&canon_1b_2l_ink}, + {'m',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMYKcm and 2bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C4M4Y4K4c4m4_inkset[] = { + {'C',0.33,&canon_2b_4l_ink}, + {'M',0.33,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_2b_4l_ink}, + {'c',1.0,&canon_2b_4l_ink}, + {'m',1.0,&canon_2b_4l_ink} +}; + +/* Inkset for printing in CMYKcm and 3bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C7M7Y7K7c7m7_inkset[] = { + {'C',0.33,&canon_3b_7l_ink}, + {'M',0.33,&canon_3b_7l_ink}, + {'Y',1.0,&canon_3b_7l_ink}, + {'K',1.0,&canon_3b_7l_ink}, + {'c',1.0,&canon_3b_7l_ink}, + {'m',1.0,&canon_3b_7l_ink} +}; + +static const canon_inkset_t canon_9_C3M3Y2K2_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_9_C3M3Y2K2_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C3M3Y2K2k3_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_3l_c_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C4M4Y4K2c4m4k4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',0.5,&canon_2b_4l_ink}, + {'m',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {'k',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C8M8Y8c16m16k8_inkset[] = { + {'C',1.0,&canon_4b_8l_ink}, + {'M',1.0,&canon_4b_8l_ink}, + {'Y',1.0,&canon_4b_8l_ink}, + {0,0.0,NULL}, + {'c',0.5,&canon_4b_16l_ink}, + {'m',0.5,&canon_4b_16l_ink}, + {0,0.0,NULL}, + {'k',1.0,&canon_4b_8l_ink}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_13_C3M3Y2K2_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_19_C3M3Y3k3_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_2b_3l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_2b_3l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_22_C3M3Y2K2k3_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_3l_c_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_22_C4M4Y4K2c4m4k4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',0.5,&canon_2b_4l_ink}, + {'m',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_4l_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL}, + {0,0.0,NULL}, + {0xa3,0.0,&canon_2b_4l_ink}, + {0xad,0.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +#endif + diff --git a/src/main/canon-media.h b/src/main/canon-media.h new file mode 100644 index 0000000..d6ed971 --- /dev/null +++ b/src/main/canon-media.h @@ -0,0 +1,146 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains the definitions for the possible Media Types + TODO: Color Correction and Density adjustment +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_MEDIA_H +#define GUTENPRINT_INTERNAL_CANON_MEDIA_H + +/* media related structs */ + + +/* media slots */ + +typedef struct { + const char* name; + const char* text; + unsigned char code; +} canon_slot_t; + +typedef struct { + const char *name; + short count; + const canon_slot_t *slots; +} canon_slotlist_t; + +#define DECLARE_SLOTS(name) \ +static const canon_slotlist_t name##_slotlist = { \ + #name, \ + sizeof(name##_slots) / sizeof(canon_slot_t), \ + name##_slots \ +} + + +static const canon_slot_t canon_default_slots[] = { + { "Auto", N_ ("Auto Sheet Feeder"), 4 }, + { "Manual", N_ ("Manual with Pause"), 0 }, + { "ManualNP", N_ ("Manual without Pause"), 1 }, + { "Cassette", N_ ("Cassette"), 8 }, + { "CD", N_ ("CD tray"), 10 }, +}; +DECLARE_SLOTS(canon_default); + + +static const canon_slot_t canon_PIXMA_iP4000_slots[] = { + { "SelectKey", N_ ("Selected by Paper Select Key"), 3 }, + { "Auto", N_ ("Auto Sheet Feeder"), 4 }, + { "Cassette", N_ ("Cassette"), 0x8 }, + { "CD", N_ ("CD tray"), 10 }, + { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 15 }, +}; +DECLARE_SLOTS(canon_PIXMA_iP4000); + +/* media types */ + +typedef struct { + const char *name; /* Internal Name may not contain spaces */ + const char *text; /* Translateable name */ + unsigned char media_code_c; /* Media Code used for the ESC (c (SetColor) command */ + unsigned char media_code_l; /* Media Code used for the ESC (l (SetTray) command */ + unsigned int qualities; +#define Q0 0 /* lowest quality */ +#define Q1 1 +#define Q2 2 +#define Q3 4 +#define Q4 8 /* highest quality */ + double base_density; + double k_lower_scale; + double k_upper; + const char *hue_adjustment; + const char *lum_adjustment; + const char *sat_adjustment; +} canon_paper_t; + +typedef struct { + const char *name; + short count; + const canon_paper_t *papers; +} canon_paperlist_t; + +#define DECLARE_PAPERS(name) \ +static const canon_paperlist_t name##_paperlist = { \ + #name, \ + sizeof(name##_papers) / sizeof(canon_paper_t), \ + name##_papers \ +} + + +/* paperlists for the various printers. The first entry will be the default */ + +static const canon_paper_t canon_default_papers[] = { + { "Plain", N_ ("Plain Paper"), 0x00, 0x00,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02, 0x02,Q2,1.00, 1.00, 0.900, 0, 0, 0 }, + { "BackPrint", N_ ("Back Print Film"), 0x03, 0x03,Q2,1.00, 1.00, 0.900, 0, 0, 0 }, + { "Fabric", N_ ("Fabric Sheets"), 0x04, 0x04,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08, 0x08,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07, 0x07,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03, 0x03,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "GlossyFilm", N_ ("High Gloss Film"), 0x06, 0x06,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05, 0x05,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyCard", N_ ("Glossy Photo Cards"), 0x0a, 0x0a,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPro", N_ ("Photo Paper Pro"), 0x09, 0x09,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "Other", N_ ("Other"), 0x00, 0x00,Q2,0.50, 0.25, .5, 0, 0, 0 }, +}; +DECLARE_PAPERS(canon_default); + +static const canon_paper_t canon_PIXMA_iP4000_papers[] = { + { "Plain", N_ ("Plain Paper"), 0x00,0x00,Q0|Q1|Q2|Q3,1.00, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02,0x02,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03,0x03,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05,0x05,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07,0x07,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08,0x08,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPro", N_ ("Professional Photo Paper"), 0x09,0x0d,Q2|Q3|Q4,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperMatte", N_ ("Photo Paper Matte"), 0x0a,0x10,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlus", N_ ("Glossy Photo Paper Plus"), 0x0b,0x11,Q1|Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "CD", N_ ("CD"), 0x00,0x12,Q2|Q3|Q4,0.78, 0.25, 0.500, 0, 0, 0 }, + /* FIXME media code for c) should be 0x0c for CD but this will restrict CD printing to a single, not well supported, resolution */ + { "PhotopaperOther", N_ ("Other Photo Paper"), 0x0f,0x14,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlusDouble", N_ ("Photoper Plus Double-Sided"), 0x10,0x15,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, +}; +DECLARE_PAPERS(canon_PIXMA_iP4000); + +#endif + diff --git a/src/main/canon-modes.h b/src/main/canon-modes.h new file mode 100644 index 0000000..42e7f8b --- /dev/null +++ b/src/main/canon-modes.h @@ -0,0 +1,285 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 - 2007 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains definitions for the various printmodes +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_MODES_H +#define GUTENPRINT_INTERNAL_CANON_MODES_H + +/* delay settings + sometimes the raster data has to be sent + | K | + | C | + | M | + | Y | + instead of + | K + | C + | M + | Y + + following tables can be used to account for this + +*/ + +typedef struct { + unsigned char color; + unsigned int delay; +} canon_delay_t; + +/* delay settings for the different printmodes last entry has to be {0,0} */ +static const canon_delay_t delay_1440[] = {{'C',112},{'M',224},{'Y',336},{'c',112},{'m',224},{'y',336},{0,0}}; +static const canon_delay_t delay_S200[] = {{'C',0x30},{'M',0x50},{'Y',0x70},{0,0}}; + + + +/* + * A printmode is defined by its resolution (xdpi x ydpi), the inkset + * and the installed printhead. + * + * For a hereby defined printmode we specify the density and gamma multipliers + * and the ink definition with optional adjustments for lum, hue and sat + * + */ +typedef struct { + const int xdpi; /* horizontal resolution */ + const int ydpi; /* vertical resolution */ + const unsigned int ink_types; /* the used color channels */ + const char* name; /* internal name do not translate, must not contain spaces */ + const char* text; /* description */ + const int num_inks; + const canon_inkset_t *inks; /* ink definition */ + const unsigned int flags; +#define MODE_FLAG_WEAVE 0x1 /* this mode requires weaving */ +#define MODE_FLAG_EXTENDED_T 0x2 /* this mode requires extended color settings in the esc t) command */ +#define MODE_FLAG_CD 0x4 /* this mode can be used to print to cds */ + const canon_delay_t* delay; /* delay settings for this printmode */ + const double density; /* density multiplier */ + const double gamma; /* gamma multiplier */ + const char *lum_adjustment; /* optional lum adj. */ + const char *hue_adjustment; /* optional hue adj. */ + const char *sat_adjustment; /* optional sat adj. */ +} canon_mode_t; + +#define INKSET(a) sizeof(canon_##a##_inkset)/sizeof(canon_inkset_t),canon_##a##_inkset + + +typedef struct { + const char *name; + const short count; + const short default_mode; + const canon_mode_t *modes; +} canon_modelist_t; + +#define DECLARE_MODES(name,default_mode) \ +static const canon_modelist_t name##_modelist = { \ + #name, \ + sizeof(name##_modes) / sizeof(canon_mode_t), \ + default_mode, \ + name##_modes \ +} + + +/* modelist for every printer,modes ordered by ascending resolution ink_type and quality */ +static const canon_mode_t canon_BJC_30_modes[] = { + { 180, 180,CANON_INK_K,"180x180dpi",N_("180x180 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K,"360x360dpi",N_("360x360 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K,"720x360dpi",N_("720x360 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_30,0); + + +static const canon_mode_t canon_BJC_85_modes[] = { + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "720x360dpi",N_("720x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_85,0); + + +/* we treat the printers that can either print in K or CMY as CMYK printers here by assigning a CMYK inkset */ +static const canon_mode_t canon_BJC_210_modes[] = { + { 90, 90,CANON_INK_K | CANON_INK_CMY,"90x90dpi",N_("90x90 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 180, 180,CANON_INK_K | CANON_INK_CMY,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMY,"720x360dpi",N_("720x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_210,0); + + +static const canon_mode_t canon_BJC_240_modes[] = { + { 90, 90,CANON_INK_K | CANON_INK_CMY,"90x90dpi",N_("90x90 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 180, 180,CANON_INK_K | CANON_INK_CMY,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dmt",N_("360x360 DMT"),INKSET(4_C4M4Y4K4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMY,"720x360dpi",N_("720x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_240,0); + + +static const canon_mode_t canon_BJC_2000_modes[] = { + { 180, 180,CANON_INK_CMYK,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_2000,0); + + +static const canon_mode_t canon_BJC_3000_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_3000,0); + + +static const canon_mode_t canon_BJC_4300_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_4300,0); + + + +static const canon_mode_t canon_BJC_4400_modes[] = { + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "720x360dpi",N_("720x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_4400,0); + + +static const canon_mode_t canon_BJC_5500_modes[] = { + { 180, 180,CANON_INK_CMYK | CANON_INK_CcMmYK,"180x180dpi",N_("180x180 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_5500,0); + + +static const canon_mode_t canon_BJC_6000_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,0.5,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_6000,0); + + +static const canon_mode_t canon_BJC_7000_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYyK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,3.5,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 1200, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"1200x600dpi",N_("1200x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_7000,0); + + +static const canon_mode_t canon_BJC_7100_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYyK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1200, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"1200x600dpi",N_("1200x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_7100,0); + +static const canon_mode_t canon_BJC_8200_modes[] = { + { 300, 300,CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1200,1200,CANON_INK_CMYK,"1200x1200dpi",N_("1200x1200 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_8200,0); + + +static const canon_mode_t canon_BJC_8500_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_8500,0); + + +static const canon_mode_t canon_S200_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,delay_S200,2.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "720x720dpi",N_("720x720 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "1440x720dpi",N_("1440x720 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,0.5,1.0,NULL,NULL,NULL}, + { 1440,1440,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "1440x1440dpi",N_("1440x1440 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,0.3,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_S200,0); + + +static const canon_mode_t canon_PIXMA_iP2000_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP2000,0); + + +static const canon_mode_t canon_PIXMA_iP3000_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP3000,0); + + +static const canon_mode_t canon_PIXMA_iP4000_modes[] = { + { 300, 300,CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2k3_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +/* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(9_C4M4Y4K2c4m4k4),MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL},*/ /* this mode is used for CD printing, K is ignored by the printer then, the seperation between the small and large dot inks needs more work */ +/* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_superphoto",N_("600x600 DPI Superphoto"),INKSET(9_C8M8Y8c16m16k8),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, */ +}; +DECLARE_MODES(canon_PIXMA_iP4000,2); + + +static const canon_mode_t canon_PIXMA_iP4200_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(22_C3M3Y2K2k3_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, + /* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(22_C4M4Y4K2c4m4k4),MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL}, */ +}; +DECLARE_MODES(canon_PIXMA_iP4200,0); + + +static const canon_mode_t canon_PIXMA_iP6700_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(19_C3M3Y3k3),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP6700,0); + + +static const canon_mode_t canon_MULTIPASS_MP150_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(13_C3M3Y2K2),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_MULTIPASS_MP150,0); + + +static const canon_mode_t canon_MULTIPASS_MP830_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_MULTIPASS_MP830,0); + +#endif + diff --git a/src/main/canon-printers.h b/src/main/canon-printers.h new file mode 100644 index 0000000..82a0536 --- /dev/null +++ b/src/main/canon-printers.h @@ -0,0 +1,519 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains the capabilities of the various canon printers +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_PRINTERS_H +#define GUTENPRINT_INTERNAL_CANON_PRINTERS_H + + +typedef struct canon_caps { + int model; /* model number as used in printers.xml */ + int model_id; /* model ID code for use in commands */ + int max_width; /* maximum printable paper size */ + int max_height; + int border_left; /* left margin, points */ + int border_right; /* right margin, points */ + int border_top; /* absolute top margin, points */ + int border_bottom; /* absolute bottom margin, points */ + const canon_slotlist_t* slotlist; /*available paperslots */ + unsigned long features; /* special bjl settings */ + unsigned char ESC_r_arg; /* argument used for the ESC (r command during init */ + const char** control_cmdlist; + const canon_modelist_t* modelist; + const canon_paperlist_t* paperlist; + const char *lum_adjustment; + const char *hue_adjustment; + const char *sat_adjustment; +} canon_cap_t; + +static const char standard_sat_adjustment[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" +/* C */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* B */ +/* B */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* M */ +/* M */ "1.00 0.95 0.90 0.90 0.90 0.90 0.90 0.90 " /* R */ +/* R */ "0.90 0.95 0.95 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* G */ +/* G */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + +static const char standard_lum_adjustment[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" +/* C */ "0.65 0.67 0.70 0.72 0.77 0.80 0.82 0.85 " /* B */ +/* B */ "0.87 0.86 0.82 0.79 0.79 0.82 0.85 0.88 " /* M */ +/* M */ "0.92 0.95 0.96 0.97 0.97 0.97 0.96 0.96 " /* R */ +/* R */ "0.96 0.97 0.97 0.98 0.99 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 0.97 0.95 0.94 0.93 0.92 0.90 0.86 " /* G */ +/* G */ "0.79 0.76 0.71 0.68 0.68 0.68 0.68 0.66 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + +static const char standard_hue_adjustment[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"-6\" upper-bound=\"6\">\n" +/* C */ "0.00 0.06 0.10 0.10 0.06 -.01 -.09 -.17 " /* B */ +/* B */ "-.25 -.33 -.38 -.38 -.36 -.34 -.34 -.34 " /* M */ +/* M */ "-.34 -.34 -.36 -.40 -.50 -.40 -.30 -.20 " /* R */ +/* R */ "-.12 -.07 -.04 -.02 0.00 0.00 0.00 0.00 " /* Y */ +/* Y */ "0.00 0.00 0.00 -.05 -.10 -.15 -.22 -.24 " /* G */ +/* G */ "-.26 -.30 -.33 -.28 -.25 -.20 -.13 -.06 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + +static const char* control_cmd_ackshort[] = { + "AckTime=Short", + NULL +}; + +static const char* control_cmd_PIXMA_iP4000[] = { +/*"SetTime=20060722092503", */ /*what is this for?*/ + "SetSilent=OFF", + "PEdgeDetection=ON", + "SelectParallel=ECP", + NULL +}; + + +static const char* control_cmd_MULTIPASS_MP150[] = { + "AckTime=Short", + "MediaDetection=ON", + NULL +}; + +static const canon_cap_t canon_model_capabilities[] = +{ + /* ******************************** */ + /* */ + /* tested and color-adjusted models */ + /* */ + /* ******************************** */ + + + + + /* ************************************ */ + /* */ + /* tested models w/out color-adjustment */ + /* */ + /* ************************************ */ + + { /* Canon S200x *//* heads: BC-24 */ + 4202, 3, + 618, 936, /* 8.58" x 13 " */ + 10, 10, 9, 20, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_rr,0x61,NULL, + &canon_S200_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC S300 */ + 8201, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, + &canon_BJC_8500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJ 30 *//* heads: BC-10 */ + 30, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_30_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 85 *//* heads: BC-20 BC-21 BC-22 */ + 85, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_85_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 4300 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 4300, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_4300_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 4400 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 4400, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_4400_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6000 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6000, 3, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,control_cmd_ackshort, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6200 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6200, 3, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,control_cmd_ackshort, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6500, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,NULL, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 8200 *//* heads: BC-50 */ + 8200, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, + &canon_BJC_8200_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + + /* *************** */ + /* */ + /* untested models */ + /* */ + /* *************** */ + + { /* Canon BJC 210 *//* heads: BC-02 BC-05 BC-06 */ + 210, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_210_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 240 *//* heads: BC-02 BC-05 BC-06 */ + 240, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 250 *//* heads: BC-02 BC-05 BC-06 */ + 250, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 1000 *//* heads: BC-02 BC-05 BC-06 */ + 1000, 1, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 2000 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 2000, 1, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_2000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 3000 *//* heads: BC-30 BC-33 BC-34 */ + 3000, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, /*FIX? should have _r? */ + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 6100 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6100, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_a | CANON_CAP_r,0x61,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 7000 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ + 7000, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,NULL, + &canon_BJC_7000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 7100 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ + 7100, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_7100_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + /*****************************/ + /* */ + /* extremely fuzzy models */ + /* (might never work at all) */ + /* */ + /*****************************/ + + { /* Canon BJC 5100 *//* heads: BC-20 BC-21 BC-22 BC-23 BC-29 */ + 5100, 1, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 5500 *//* heads: BC-20 BC-21 BC-29 */ + 5500, 1, + 22*72, 34*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_5500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6500, 3, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_a,0,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 8500 *//* heads: BC-80/BC-81 BC-82/BC-81 */ + 8500, 3, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_8500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP2000 */ + 9001, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP2000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP3000 */ + 3999, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP3000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP4000 */ + 4000, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px /*,|CANON_CAP_I*/,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP4000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP4200 */ + 4200, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP4200_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP6700 */ + 4203, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP6700_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon MULTIPASS MP150 */ + 4201, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_MULTIPASS_MP150, /*features */ + &canon_MULTIPASS_MP150_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon MULTIPASS MP830 */ + 9000, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px,0,control_cmd_MULTIPASS_MP150, /*features */ + &canon_MULTIPASS_MP830_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, +}; + +#endif + diff --git a/src/main/curve.c b/src/main/curve.c index 03c2ede..3820dea 100644 --- a/src/main/curve.c +++ b/src/main/curve.c @@ -1,5 +1,5 @@ /* - * "$Id: curve.c,v 1.51 2005/04/10 22:57:40 rlk Exp $" + * "$Id: curve.c,v 1.52 2006/09/12 19:03:32 easysw Exp $" * * Print plug-in driver utility functions for the GIMP. * @@ -538,7 +538,7 @@ int stp_curve_set_gamma(stp_curve_t *curve, double fgamma) { check_curve(curve); - if (curve->wrap_mode || ! finite(fgamma) || fgamma == 0.0) + if (curve->wrap_mode || ! isfinite(fgamma) || fgamma == 0.0) return 0; clear_curve_data(curve); curve->gamma = fgamma; @@ -570,7 +570,7 @@ stp_curve_set_data(stp_curve_t *curve, size_t count, const double *data) /* Validate the data before we commit to it. */ stp_sequence_get_bounds(curve->seq, &low, &high); for (i = 0; i < count; i++) - if (! finite(data[i]) || data[i] < low || data[i] > high) + if (! isfinite(data[i]) || data[i] < low || data[i] > high) { stp_deprintf(STP_DBG_CURVE_ERRORS, "stp_curve_set_data: datum out of bounds: " @@ -620,7 +620,7 @@ stp_curve_set_data_points(stp_curve_t *curve, size_t count, stp_sequence_get_bounds(curve->seq, &low, &high); for (i = 0; i < count; i++) { - if (! finite(data[i].y) || data[i].y < low || data[i].y > high) + if (! isfinite(data[i].y) || data[i].y < low || data[i].y > high) { stp_deprintf(STP_DBG_CURVE_ERRORS, "stp_curve_set_data_points: datum out of bounds: " @@ -918,7 +918,7 @@ stp_curve_rescale(stp_curve_t *curve, double scale, } } - if (! finite(nbhi) || ! finite(nblo)) + if (! isfinite(nbhi) || ! isfinite(nblo)) return 0; count = get_point_count(curve); @@ -1302,7 +1302,7 @@ interpolate_points(stp_curve_t *a, stp_curve_t *b, pa += pb; else pa *= pb; - if (! finite(pa)) + if (! isfinite(pa)) { stp_deprintf(STP_DBG_CURVE_ERRORS, "interpolate_points: interpolated point %lu is invalid\n", diff --git a/src/main/escp2-channels.c b/src/main/escp2-channels.c index e12edbf..6b8fbfa 100644 --- a/src/main/escp2-channels.c +++ b/src/main/escp2-channels.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-channels.c,v 1.62 2006/06/01 23:49:33 rlk Exp $" + * "$Id: escp2-channels.c,v 1.62.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -768,6 +768,64 @@ static const physical_subchannel_t f360x_photo_magenta_subchannels[] = DECLARE_INK_CHANNEL(f360x_photo_magenta); +static const physical_subchannel_t claria_black_subchannels[] = +{ + { 0, 0, 0, "BlackDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_black); + +static const physical_subchannel_t claria_yellow_subchannels[] = +{ + { 4, 0, 2, "YellowDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_yellow); + +static const physical_subchannel_t claria_cyan_subchannels[] = +{ + { 2, 0, 0, "CyanDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_cyan); + +static const physical_subchannel_t claria_photo_cyan_subchannels[] = +{ + { 2, 0, 0, "CyanDensity", NULL }, + { 2, 1, 2, "CyanDensity", "LightCyanTransition" }, +}; + +DECLARE_INK_CHANNEL(claria_photo_cyan); + +static const physical_subchannel_t extended_claria_cyan_subchannels[] = +{ + { 2, 1, 2, "CyanDensity", "LightCyanTransition" }, +}; + +DECLARE_INK_CHANNEL(extended_claria_cyan); + +static const physical_subchannel_t claria_magenta_subchannels[] = +{ + { 1, 0, 2, "MagentaDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_magenta); + +static const physical_subchannel_t claria_photo_magenta_subchannels[] = +{ + { 1, 0, 2, "MagentaDensity", NULL }, + { 1, 1, 0, "MagentaDensity", "LightMagentaTransition" }, +}; + +DECLARE_INK_CHANNEL(claria_photo_magenta); + +static const physical_subchannel_t extended_claria_magenta_subchannels[] = +{ + { 1, 1, 0, "MagentaDensity", "LightMagentaTransition" }, +}; + +DECLARE_INK_CHANNEL(extended_claria_magenta); + #define DECLARE_CHANNEL_SET(name) \ static const channel_set_t name##_channel_set = \ @@ -815,7 +873,7 @@ static const ink_channel_t *const standard_black_channels[] = DECLARE_CHANNEL_SET(standard_black); -const escp2_inkname_t stpi_escp2_default_black_inkset = +static const escp2_inkname_t stpi_escp2_default_black_inkset = { "Gray", N_("Grayscale"), INKSET_CMYK, &standard_black_channel_set @@ -828,7 +886,7 @@ static const ink_channel_t *const standard_photo_black_channels[] = DECLARE_CHANNEL_SET(standard_photo_black); -const escp2_inkname_t stpi_escp2_default_photo_black_inkset = +static const escp2_inkname_t stpi_escp2_default_photo_black_inkset = { "Gray", N_("Grayscale"), INKSET_CMYK, &standard_photo_black_channel_set @@ -842,7 +900,7 @@ static const ink_channel_t *const standard_photo_gloss_black_channels[] = DECLARE_CHANNEL_SET(standard_photo_gloss_black); DECLARE_AUX_CHANNEL_SET(standard_photo_black, standard_gloss); -const escp2_inkname_t stpi_escp2_default_photo_gloss_black_inkset = +static const escp2_inkname_t stpi_escp2_default_photo_gloss_black_inkset = { "GrayG", N_("Grayscale"), INKSET_CMYK, &standard_photo_black_standard_gloss_channel_set @@ -1130,6 +1188,20 @@ static const escp2_inkname_t three_color_r2400_composite_inkset = &r2400_cmy_channel_set }; +static const ink_channel_t *const claria_cmy_channels[] = +{ + NULL, &claria_cyan_channel, + &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_cmy); + +static const escp2_inkname_t claria_three_color_composite_inkset = +{ + "RGB", N_("Three Color Composite"), INKSET_CMYK, + &claria_cmy_channel_set +}; + /* **************************************************************** * * @@ -1288,6 +1360,20 @@ static const escp2_inkname_t cx3650_four_color_standard_inkset = &cx3650_cmyk_channel_set }; +static const ink_channel_t *const claria_cmyk_channels[] = +{ + &claria_black_channel, &claria_cyan_channel, + &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_cmyk); + +static const escp2_inkname_t claria_four_color_standard_inkset = +{ + "CMYK", N_("Four Color Standard"), INKSET_CMYK, + &claria_cmyk_channel_set +}; + /* **************************************************************** @@ -1339,6 +1425,20 @@ static const escp2_inkname_t five_color_photo3_inkset = &five_color_photo3_channel_set }; +static const ink_channel_t *const claria_ccmmy_channels[] = +{ + NULL, &claria_photo_cyan_channel, + &claria_photo_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_ccmmy); + +static const escp2_inkname_t claria_five_color_photo_composite_inkset = +{ + "PhotoCMY", N_("Five Color Photo Composite"), INKSET_CcMmYK, + &claria_ccmmy_channel_set +}; + /* **************************************************************** @@ -1390,6 +1490,20 @@ static const escp2_inkname_t six_color_photo3_inkset = &six_color_photo3_channel_set }; +static const ink_channel_t *const claria_ccmmyk_channels[] = +{ + &claria_black_channel, &claria_photo_cyan_channel, + &claria_photo_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_ccmmyk); + +static const escp2_inkname_t claria_six_color_photo_inkset = +{ + "PhotoCMYK", N_("Six Color Photo"), INKSET_CcMmYK, + &claria_ccmmyk_channel_set +}; + /* **************************************************************** * * @@ -1830,6 +1944,19 @@ static const escp2_inkname_t cx3650_three_color_extended_inkset = &cx3650_three_color_extended_channel_set }; +static const ink_channel_t *const claria_three_color_extended_channels[] = +{ + &claria_cyan_channel, &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_three_color_extended); + +static const escp2_inkname_t claria_three_color_extended_inkset = +{ + "PhysicalCMY", N_("Three Color Raw"), INKSET_EXTENDED, + &claria_three_color_extended_channel_set +}; + static const escp2_inkname_t four_color_extended_inkset = { @@ -1873,6 +2000,12 @@ static const escp2_inkname_t cx3650_four_color_extended_inkset = &cx3650_cmyk_channel_set }; +static const escp2_inkname_t claria_four_color_extended_inkset = +{ + "PhysicalCMYK", N_("Four Color Raw"), INKSET_EXTENDED, + &claria_cmyk_channel_set +}; + static const escp2_inkname_t four_color_r800_extended_inkset = { "PhysicalCMYKGloss", N_("Four Color Raw"), INKSET_EXTENDED, @@ -1914,6 +2047,20 @@ static const escp2_inkname_t f360_five_color_extended_inkset = &f360_five_color_extended_channel_set }; +static const ink_channel_t *const claria_five_color_extended_channels[] = +{ + &claria_cyan_channel, &extended_claria_cyan_channel, + &claria_magenta_channel, &extended_claria_magenta_channel, + &claria_yellow_channel +}; +DECLARE_CHANNEL_SET(claria_five_color_extended); + +static const escp2_inkname_t claria_five_color_extended_inkset = +{ + "PhysicalCcMmYK", N_("Six Color Raw"), INKSET_EXTENDED, + &claria_five_color_extended_channel_set +}; + static const ink_channel_t *const six_color_extended_channels[] = { @@ -1963,6 +2110,22 @@ static const escp2_inkname_t six_color_r800_photo_gloss_extended_inkset = &six_color_r800_photo_gloss_channel_set }; +static const ink_channel_t *const claria_six_color_extended_channels[] = +{ + &claria_black_channel, + &claria_cyan_channel, &extended_claria_cyan_channel, + &claria_magenta_channel, &extended_claria_magenta_channel, + &claria_yellow_channel +}; +DECLARE_CHANNEL_SET(claria_six_color_extended); + +static const escp2_inkname_t claria_six_color_extended_inkset = +{ + "PhysicalCcMmYK", N_("Six Color Raw"), INKSET_EXTENDED, + &claria_six_color_extended_channel_set +}; + + static const ink_channel_t *const j_seven_color_extended_channels[] = { &photo_black_channel, @@ -2176,14 +2339,26 @@ static const shade_set_t quadtone_shades = /* Some kind of quadtone ink */ { 1, { 1.0 }}, }; +static const shade_set_t claria_shades = /* Stylus R260 and newer */ +{ + { 1, { 1.0 }}, + { 2, { 1.0, 0.35 }}, + { 2, { 1.0, 0.33 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, +}; + #define DECLARE_INKLIST(tname, name, inks, text, papers, adjustments, shades) \ static const inklist_t name##_inklist = \ { \ tname, \ text, \ inks##_ink_types, \ - &stpi_escp2_##papers##_paper_list, \ - &stpi_escp2_##adjustments##_paper_adjustment_list, \ + #papers, \ + #adjustments, \ &shades##_shades, \ sizeof(inks##_ink_types) / sizeof(escp2_inkname_t *), \ } @@ -2209,6 +2384,8 @@ static const escp2_inkname_t *const standard_ink_types[] = DECLARE_INKLIST("None", standard, standard, N_("EPSON Standard Inks"), standard, standard, standard); +DECLARE_INKLIST("None", photo_gen3_4, standard, N_("EPSON Standard Inks"), + standard, photo3, standard); static const escp2_inkname_t *const quadtone_ink_types[] = { @@ -2351,6 +2528,22 @@ static const escp2_inkname_t *const f360_photo_ink_types[] = DECLARE_INKLIST("None", f360_photo, f360_photo, N_("EPSON Standard Inks"), standard, sp960, esp960); +static const escp2_inkname_t *const claria_ink_types[] = +{ + &claria_six_color_photo_inkset, + &claria_five_color_photo_composite_inkset, + &claria_four_color_standard_inkset, + &claria_three_color_composite_inkset, + &one_color_extended_inkset, + &claria_three_color_extended_inkset, + &claria_four_color_extended_inkset, + &claria_five_color_extended_inkset, + &claria_six_color_extended_inkset, +}; + +DECLARE_INKLIST("None", claria, claria, N_("EPSON Standard Inks"), + standard, claria, claria); + static const escp2_inkname_t *const f360_photo7_japan_ink_types[] = { &f360_j_seven_color_enhanced_inkset, @@ -2483,7 +2676,7 @@ DECLARE_INKLIST("picturemate", picturemate, picturemate_photo, #define DECLARE_INKGROUP(name) \ -const inkgroup_t stpi_escp2_##name##_inkgroup = \ +static const inkgroup_t name##_inkgroup = \ { \ #name, \ name##_group, \ @@ -2576,6 +2769,14 @@ static const inklist_t *const photo_gen3_group[] = DECLARE_INKGROUP(photo_gen3); +static const inklist_t *const photo_gen3_4_group[] = +{ + &photo_gen3_4_inklist, + &quadtone_inklist +}; + +DECLARE_INKGROUP(photo_gen3_4); + static const inklist_t *const photo_pigment_group[] = { &pigment_inklist @@ -2635,3 +2836,236 @@ static const inklist_t *const picturemate_group[] = }; DECLARE_INKGROUP(picturemate); + +static const inklist_t *const claria_group[] = +{ + &claria_inklist, +}; + +DECLARE_INKGROUP(claria); + +typedef struct +{ + const char *name; + const inkgroup_t *inkgroup; +} ink_t; + +static const ink_t the_inks[] = +{ + { "cmy", &cmy_inkgroup }, + { "standard", &standard_inkgroup }, + { "c80", &c80_inkgroup }, + { "c82", &c82_inkgroup }, + { "c64", &c64_inkgroup }, + { "f360", &f360_inkgroup }, + { "cx3650", &cx3650_inkgroup }, + { "x80", &x80_inkgroup }, + { "photo_gen1", &photo_gen1_inkgroup }, + { "photo_gen2", &photo_gen2_inkgroup }, + { "photo_gen3", &photo_gen3_inkgroup }, + { "photo_gen3_4", &photo_gen3_4_inkgroup }, + { "photo_pigment", &photo_pigment_inkgroup }, + { "ultrachrome", &ultrachrome_inkgroup }, + { "f360_photo", &f360_photo_inkgroup }, + { "f360_photo7_japan", &f360_photo7_japan_inkgroup }, + { "f360_ultrachrome", &f360_ultrachrome_inkgroup }, + { "f360_ultrachrome_k3", &f360_ultrachrome_k3_inkgroup }, + { "cmykrb", &cmykrb_inkgroup }, + { "picturemate", &picturemate_inkgroup }, + { "claria", &claria_inkgroup }, +}; + +const inkgroup_t * +stpi_escp2_get_inkgroup_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_inks) / sizeof(ink_t); i++) + { + if (strcmp(n, the_inks[i].name) == 0) + return the_inks[i].inkgroup; + } + return NULL; +} + +const escp2_inkname_t * +stpi_escp2_get_default_black_inkset(void) +{ + return &stpi_escp2_default_black_inkset; +} + + +#define DECLARE_CHANNEL_LIST(name) \ +static const channel_name_t name##_channel_name_list = \ +{ \ + #name, \ + sizeof(name##_channel_names) / sizeof(const char *), \ + name##_channel_names \ +} + +static const char *standard_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow") +}; + +DECLARE_CHANNEL_LIST(standard); + +static const char *cx3800_channel_names[] = +{ + N_("Cyan"), + N_("Yellow"), + N_("Magenta"), + N_("Black") +}; + +DECLARE_CHANNEL_LIST(cx3800); + +static const char *mfp2005_channel_names[] = +{ + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Black") +}; + +DECLARE_CHANNEL_LIST(mfp2005); + +static const char *photo_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), +}; + +DECLARE_CHANNEL_LIST(photo); + +static const char *rx700_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Light Cyan"), + N_("Magenta"), + N_("Light Magenta"), + N_("Yellow"), +}; + +DECLARE_CHANNEL_LIST(rx700); + +static const char *sp2200_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Light Black"), +}; + +DECLARE_CHANNEL_LIST(sp2200); + +static const char *pm_950c_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Dark Yellow"), +}; + +DECLARE_CHANNEL_LIST(pm_950c); + +static const char *sp960_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Black"), +}; + +DECLARE_CHANNEL_LIST(sp960); + +static const char *r800_channel_names[] = +{ + N_("Yellow"), + N_("Magenta"), + N_("Cyan"), + N_("Matte Black"), + N_("Photo Black"), + N_("Red"), + N_("Blue"), + N_("Gloss Optimizer"), +}; + +DECLARE_CHANNEL_LIST(r800); + +static const char *picturemate_channel_names[] = +{ + N_("Yellow"), + N_("Magenta"), + N_("Cyan"), + N_("Black"), + N_("Red"), + N_("Blue"), +}; + +DECLARE_CHANNEL_LIST(picturemate); + +static const char *r2400_channel_names[] = +{ + N_("Light Light Black"), + N_("Light Magenta"), + N_("Light Cyan"), + N_("Light Black"), + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), +}; + +DECLARE_CHANNEL_LIST(r2400); + +typedef struct +{ + const char *name; + const channel_name_t *channel_name; +} channel_t; + +static const channel_t the_channels[] = +{ + { "cx3800", &cx3800_channel_name_list }, + { "mfp2005", &mfp2005_channel_name_list }, + { "photo", &photo_channel_name_list }, + { "picturemate", &picturemate_channel_name_list }, + { "pm_950c", &pm_950c_channel_name_list }, + { "r2400", &r2400_channel_name_list }, + { "r800", &r800_channel_name_list }, + { "rx700", &rx700_channel_name_list }, + { "sp2200", &sp2200_channel_name_list }, + { "sp960", &sp960_channel_name_list }, + { "standard", &standard_channel_name_list }, +}; + +const channel_name_t * +stpi_escp2_get_channel_names_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_channels) / sizeof(channel_t); i++) + { + if (strcmp(n, the_channels[i].name) == 0) + return the_channels[i].channel_name; + } + return NULL; +} diff --git a/src/main/escp2-driver.c b/src/main/escp2-driver.c index 24ef1c1..2141cfc 100644 --- a/src/main/escp2-driver.c +++ b/src/main/escp2-driver.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-driver.c,v 1.30 2006/07/22 20:28:13 rlk Exp $" + * "$Id: escp2-driver.c,v 1.30.6.1 2007/03/02 12:01:25 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -114,6 +114,7 @@ print_debug_params(stp_vars_t *v) print_remote_int_param(v, "Page_height", pd->page_height); print_remote_int_param(v, "Page_true_height", pd->page_true_height); print_remote_int_param(v, "Page_extra_height", pd->page_extra_height); + print_remote_int_param(v, "Paper_extra_bottom", pd->paper_extra_bottom); print_remote_int_param(v, "Image_left", pd->image_left); print_remote_int_param(v, "Image_top", pd->image_top); print_remote_int_param(v, "Image_width", pd->image_width); @@ -240,22 +241,12 @@ escp2_set_remote_sequence(stp_vars_t *v) stp_send_command(v, "SN", "bccc", 0, 0, feed_sequence); if (stp_get_boolean_parameter(v, "FullBleed")) { - stp_send_command(v, "FP", "bch", 0, 0xffb0); -#if 0 - /* These commands do not appear to do anything on the */ - /* 2200. Need to test on R800. */ - /* From the R1800 manual -- bottom margin borderless */ - stp_send_command(v, "PM", "bcc", 0, 0); - stp_send_command(v, "DP", "bcc", 0, 0); - stp_send_command(v, "SN", "bc", 0); - stp_send_command(v, "MI", "bccc", 1, 0xb, 1); - stp_send_command(v, "US", "bccc", 0, 0, 2); - stp_send_command(v, "US", "bccc", 0, 1, 0); - /* This command means "check paper size - no" */ - stp_send_command(v, "US", "bccc", 0, 2, 0); - stp_send_command(v, "DR", "bcccc", 0, 0, 0, 0); - stp_send_command(v, "PP", "bccc", 0, 1, 0xff); -#endif + stp_send_command(v, "FP", "bch", 0, + (unsigned short) -pd->zero_margin_offset); + if (pd->borderless_sequence) + stp_zfwrite(pd->borderless_sequence->data, + pd->borderless_sequence->bytes, + 1, v); } } if (pd->input_slot) @@ -387,7 +378,8 @@ static void escp2_set_page_height(stp_vars_t *v) { escp2_privdata_t *pd = get_privdata(v); - int l = pd->page_management_units * pd->page_true_height / 72; + int l = (pd->page_true_height + pd->paper_extra_bottom) * + pd->page_management_units / 72; if (pd->use_extended_commands) stp_send_command(v, "\033(C", "bl", l); else @@ -402,6 +394,8 @@ escp2_set_margins(stp_vars_t *v) int top = pd->page_management_units * pd->page_top / 72; top += pd->initial_vertical_offset; + top -= pd->page_extra_height; + bot += pd->page_extra_height; if (pd->use_extended_commands && (pd->command_set == MODEL_COMMAND_2000 || pd->command_set == MODEL_COMMAND_PRO)) @@ -411,21 +405,14 @@ escp2_set_margins(stp_vars_t *v) } static void -escp2_set_form_factor(stp_vars_t *v) +escp2_set_paper_dimensions(stp_vars_t *v) { escp2_privdata_t *pd = get_privdata(v); if (pd->advanced_command_set) { - int w = pd->page_width * pd->page_management_units / 72; - int h = (pd->page_true_height + pd->page_extra_height) * + int w = pd->page_true_width * pd->page_management_units / 72; + int h = (pd->page_true_height + pd->paper_extra_bottom) * pd->page_management_units / 72; - - if (stp_get_boolean_parameter(v, "FullBleed")) - /* Make the page 160/360" wider for full bleed printing. */ - /* Per the Epson manual, the margin should be expanded by 80/360" */ - /* so we need to do this on the left and the right */ - w += 320 * pd->page_management_units / 720; - stp_send_command(v, "\033(S", "bll", w, h); } } @@ -599,7 +586,7 @@ stpi_escp2_init_printer(stp_vars_t *v) escp2_set_printhead_resolution(v); escp2_set_page_height(v); escp2_set_margins(v); - escp2_set_form_factor(v); + escp2_set_paper_dimensions(v); } void diff --git a/src/main/escp2-inks.c b/src/main/escp2-inks.c index 6a5ee2e..309a40e 100644 --- a/src/main/escp2-inks.c +++ b/src/main/escp2-inks.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-inks.c,v 1.46 2006/01/07 02:43:28 rlk Exp $" + * "$Id: escp2-inks.c,v 1.46.10.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -135,6 +135,64 @@ static const escp2_dropsize_t escp2_r300_2880_dropsizes = static const escp2_dropsize_t escp2_r300_2880_1440_dropsizes = { "r300_2880_1440", 1, { 1.0 } }; +/* Claria inks */ + +/* + * Tested relative drop sizes: + * S M L + * + * 0x21 3 4 5 + * 0x23 2 3 4 + * 0x24 1 3 5 + * 0x25 1 2 3 + * 0x26 2 3 5 + * 0x33 1 3 5 + * + * Therefore, there's no real point to use drop sizes other than 0x24 + * and 0x25. The economy settings (0x10 and 0x0) don't provide any + * bigger drops. We get quite smooth output at 720x360 and 360 DPI, and + * even 360x180 is surprisingly smooth. + * Roy Harrington estimates the drop sizes are: + * + * 1 1.5 pl + * 2 2.4 pl + * 3 6.3 pl + * 4 12 pl (rlk estimate) + * 5 21 pl + */ + +static const escp2_dropsize_t escp2_claria_720_dropsizes = + { "claria_720", 3, { 0.071, 0.3, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1440_dropsizes = + { "claria_1440", 3, { 0.23, 0.37, 1.0 } }; +static const escp2_dropsize_t escp2_claria_2880_dropsizes = + { "claria_2880", 2, { 0.62, 1.0 } }; +static const escp2_dropsize_t escp2_claria_5760_dropsizes = + { "claria_5760", 1, { 1.0 } }; + +/* Stylus Photo 1400 */ + +/* + * Tested relative drop sizes: +* S M L +* +* 0x21 3 4 5 +* 0x25 1 2 3 +* 0x33 1 3 5 +* 0x34 2 3 5 +*/ + +static const escp2_dropsize_t escp2_claria_1400_720_dropsizes = + { "claria_1400_720", 3, { 0.3, 0.57, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_1440_720_dropsizes = + { "claria_1400_1440_720", 3, { 0.071, 0.3, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_1440_dropsizes = + { "claria_1400_1440", 3, { 0.23, 0.37, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_2880_dropsizes = + { "claria_1400_2880", 2, { 0.62, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_5760_dropsizes = + { "claria_1400_5760", 1, { 1.0 } }; + /* Stylus Photo R2400 */ static const escp2_dropsize_t escp2_r2400_360_dropsizes = { "r2400_360", 1, { 1 } }; @@ -193,7 +251,7 @@ static const escp2_dropsize_t escp2_ultrachrome_2880_dropsizes = static const escp2_dropsize_t escp2_spro10000_dropsizes = { "spro10000", 2, { 0.661, 1.0 } }; -const escp2_drop_list_t stpi_escp2_simple_drops = +static const escp2_drop_list_t simple_drops = { &escp2_single_dropsizes, &escp2_single_dropsizes, @@ -206,7 +264,7 @@ const escp2_drop_list_t stpi_escp2_simple_drops = &escp2_single_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_6pl_drops = +static const escp2_drop_list_t variable_6pl_drops = { &escp2_6pl_dropsizes, &escp2_6pl_dropsizes, @@ -219,7 +277,7 @@ const escp2_drop_list_t stpi_escp2_variable_6pl_drops = &escp2_6pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_x80_6pl_drops = +static const escp2_drop_list_t variable_x80_6pl_drops = { &escp2_x80_low_dropsizes, &escp2_x80_low_dropsizes, @@ -232,7 +290,7 @@ const escp2_drop_list_t stpi_escp2_variable_x80_6pl_drops = &escp2_x80_2880_6pl_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_1440_4pl_drops = +static const escp2_drop_list_t variable_1440_4pl_drops = { &escp2_low_dropsizes, &escp2_low_dropsizes, @@ -245,7 +303,7 @@ const escp2_drop_list_t stpi_escp2_variable_1440_4pl_drops = &escp2_4pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2880_4pl_drops = +static const escp2_drop_list_t variable_2880_4pl_drops = { &escp2_new_low_dropsizes, &escp2_new_low_dropsizes, @@ -258,7 +316,7 @@ const escp2_drop_list_t stpi_escp2_variable_2880_4pl_drops = &escp2_4pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_drops = +static const escp2_drop_list_t variable_3pl_drops = { &escp2_low_dropsizes, &escp2_low_dropsizes, @@ -271,7 +329,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_drops = &escp2_3pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2pl_drops = +static const escp2_drop_list_t variable_2pl_drops = { &escp2_2pl_360_dropsizes, &escp2_2pl_360_dropsizes, @@ -284,7 +342,7 @@ const escp2_drop_list_t stpi_escp2_variable_2pl_drops = &escp2_2pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pmg_drops = +static const escp2_drop_list_t variable_3pl_pmg_drops = { &escp2_r300_360_dropsizes, &escp2_r300_360_dropsizes, @@ -297,7 +355,33 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pmg_drops = &escp2_r300_2880_1440_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_r2400_drops = +static const escp2_drop_list_t claria_drops = +{ + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_1440_dropsizes, + &escp2_claria_1440_dropsizes, + &escp2_claria_2880_dropsizes, + &escp2_claria_5760_dropsizes, +}; + +static const escp2_drop_list_t claria_1400_drops = +{ + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_720_dropsizes, + &escp2_claria_1400_720_dropsizes, + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_1440_dropsizes, + &escp2_claria_1400_1440_dropsizes, + &escp2_claria_1400_2880_dropsizes, + &escp2_claria_1400_5760_dropsizes, +}; + +static const escp2_drop_list_t variable_r2400_drops = { &escp2_r2400_360_dropsizes, &escp2_r2400_360_dropsizes, @@ -310,7 +394,7 @@ const escp2_drop_list_t stpi_escp2_variable_r2400_drops = &escp2_r2400_2880_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_picturemate_drops = +static const escp2_drop_list_t variable_picturemate_drops = { &escp2_picturemate_1440_dropsizes, &escp2_picturemate_1440_dropsizes, @@ -323,7 +407,7 @@ const escp2_drop_list_t stpi_escp2_variable_picturemate_drops = &escp2_picturemate_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_1_5pl_drops = +static const escp2_drop_list_t variable_1_5pl_drops = { &escp2_1_5pl_360_dropsizes, &escp2_1_5pl_360_dropsizes, @@ -336,7 +420,7 @@ const escp2_drop_list_t stpi_escp2_variable_1_5pl_drops = &escp2_1_5pl_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2000p_drops = +static const escp2_drop_list_t variable_2000p_drops = { &escp2_2000p_dropsizes, &escp2_2000p_dropsizes, @@ -349,7 +433,7 @@ const escp2_drop_list_t stpi_escp2_variable_2000p_drops = &escp2_2000p_dropsizes }; -const escp2_drop_list_t stpi_escp2_variable_ultrachrome_drops = +static const escp2_drop_list_t variable_ultrachrome_drops = { &escp2_ultrachrome_low_dropsizes, &escp2_ultrachrome_low_dropsizes, @@ -362,7 +446,7 @@ const escp2_drop_list_t stpi_escp2_variable_ultrachrome_drops = &escp2_ultrachrome_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_drops = +static const escp2_drop_list_t variable_3pl_pigment_drops = { &escp2_economy_pigment_dropsizes, &escp2_low_pigment_dropsizes, @@ -375,7 +459,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_drops = &escp2_3pl_pigment_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_c66_drops = +static const escp2_drop_list_t variable_3pl_pigment_c66_drops = { &escp2_economy_pigment_c66_dropsizes, &escp2_low_pigment_c66_dropsizes, @@ -388,7 +472,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_c66_drops = &escp2_3pl_pigment_c66_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_spro10000_drops = +static const escp2_drop_list_t spro10000_drops = { &escp2_spro10000_dropsizes, &escp2_spro10000_dropsizes, @@ -400,3 +484,45 @@ const escp2_drop_list_t stpi_escp2_spro10000_drops = &escp2_spro10000_dropsizes, &escp2_spro10000_dropsizes }; + + +typedef struct +{ + const char *name; + const escp2_drop_list_t *const drop_list; +} drop_list_t; + +static const drop_list_t the_drop_lists[] = +{ + { "simple", &simple_drops }, + { "spro10000", &spro10000_drops }, + { "variable_1_5pl", &variable_1_5pl_drops }, + { "variable_2pl", &variable_2pl_drops }, + { "variable_3pl", &variable_3pl_drops }, + { "variable_3pl_pigment", &variable_3pl_pigment_drops }, + { "variable_3pl_pigment_c66", &variable_3pl_pigment_c66_drops }, + { "variable_3pl_pmg", &variable_3pl_pmg_drops }, + { "variable_claria", &claria_drops }, + { "variable_claria_1400", &claria_1400_drops }, + { "variable_r2400", &variable_r2400_drops }, + { "variable_picturemate", &variable_picturemate_drops }, + { "variable_1440_4pl", &variable_1440_4pl_drops }, + { "variable_ultrachrome", &variable_ultrachrome_drops }, + { "variable_2880_4pl", &variable_2880_4pl_drops }, + { "variable_6pl", &variable_6pl_drops }, + { "variable_2000p", &variable_2000p_drops }, + { "variable_x80_6pl", &variable_x80_6pl_drops }, +}; + +const escp2_drop_list_t * +stpi_escp2_get_drop_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_drop_lists) / sizeof(drop_list_t); i++) + { + if (strcmp(n, the_drop_lists[i].name) == 0) + return the_drop_lists[i].drop_list; + } + return NULL; +} diff --git a/src/main/escp2-papers.c b/src/main/escp2-papers.c index c32e51f..03f9edc 100644 --- a/src/main/escp2-papers.c +++ b/src/main/escp2-papers.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-papers.c,v 1.99 2006/05/31 23:15:22 rlk Exp $" + * "$Id: escp2-papers.c,v 1.99.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -167,6 +167,53 @@ static const char photo3_hue_adj[] = "</gutenprint>\n"; + +static const char claria_sat_adj[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" +/* C */ "1.00 1.05 1.15 1.25 1.35 1.45 1.50 1.50 " /* B */ +/* B */ "1.50 1.50 1.50 1.50 1.50 1.50 1.50 1.50 " /* M */ +/* M */ "1.50 1.40 1.30 1.20 1.10 1.00 1.00 1.00 " /* R */ +/* R */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.10 1.30 1.55 1.80 1.95 2.00 2.00 " /* G */ +/* G */ "2.00 2.00 2.00 1.95 1.80 1.55 1.30 1.10 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + +static const char claria_lum_adj[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" +/* C */ "0.66 0.67 0.69 0.73 0.77 0.83 0.87 0.89 " /* B */ +/* B */ "0.91 0.88 0.84 0.78 0.78 0.80 0.82 0.85 " /* M */ +/* M */ "0.87 0.90 0.94 0.97 1.00 1.00 1.00 1.00 " /* R */ +/* R */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.00 0.99 0.98 0.96 0.94 0.92 0.88 " /* G */ +/* G */ "0.84 0.72 0.69 0.67 0.66 0.66 0.66 0.66 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + +static const char claria_hue_adj[] = +"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +"<gutenprint>\n" +"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" +"<sequence count=\"48\" lower-bound=\"-6\" upper-bound=\"6\">\n" +/* C */ "0.00 -.01 -.03 -.06 -.10 -.15 -.20 -.25 " /* B */ +/* B */ "-.30 -.35 -.38 -.40 -.42 -.46 -.49 -.52 " /* M */ +/* M */ "-.55 -.57 -.57 -.55 -.52 -.48 -.40 -.30 " /* R */ +/* R */ "-.12 -.07 -.04 -.02 0.00 0.00 0.00 0.00 " /* Y */ +/* Y */ "0.00 -.00 -.00 -.00 -.02 -.04 -.08 -.13 " /* G */ +/* G */ "-.18 -.18 -.19 -.16 -.13 -.10 -.07 -.03 " /* C */ +"</sequence>\n" +"</curve>\n" +"</gutenprint>\n"; + + static const char sp960_sat_adj[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<gutenprint>\n" @@ -531,20 +578,20 @@ static const char r800_glossy_hue_adj[] = "</curve>\n" "</gutenprint>\n"; -#define DECLARE_PAPERS(name) \ -const paperlist_t stpi_escp2_##name##_paper_list = \ -{ \ - #name, \ - sizeof(name##_papers) / sizeof(paper_t), \ - name##_papers \ +#define DECLARE_PAPERS(name) \ +static const paperlist_t name##_paper_list = \ +{ \ + #name, \ + sizeof(name##_papers) / sizeof(paper_t), \ + name##_papers \ } -#define DECLARE_PAPER_ADJUSTMENTS(name) \ -const paper_adjustment_list_t stpi_escp2_##name##_paper_adjustment_list = \ -{ \ - #name, \ - sizeof(name##_adjustments) / sizeof(paper_adjustment_t), \ - name##_adjustments \ +#define DECLARE_PAPER_ADJUSTMENTS(name) \ +static const paper_adjustment_list_t name##_paper_adjustment_list = \ +{ \ + #name, \ + sizeof(name##_adjustments) / sizeof(paper_adjustment_t), \ + name##_adjustments \ } static const paper_adjustment_t standard_adjustments[] = @@ -723,6 +770,50 @@ static const paper_adjustment_t photo3_adjustments[] = DECLARE_PAPER_ADJUSTMENTS(photo3); +static const paper_adjustment_t claria_adjustments[] = +{ + { "Plain", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "PlainFast", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Postcard", 0.692, .25, 0.5, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyFilm", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Transparency", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Envelope", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "BackFilm", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Matte", 0.833, .25, 0.6, .15, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "MatteHeavy", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Inkjet", 0.709, .25, 0.75, .15, .75, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Coated", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Photo", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyPhoto", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Semigloss", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Luster", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyPaper", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Ilford", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "ColorLife", 0.833, .25, 0.75, .2, .9, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Other", 0.540, .25, 0.5, .1, .5, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, +}; + +DECLARE_PAPER_ADJUSTMENTS(claria); + static const paper_adjustment_t sp960_adjustments[] = { { "Plain", 0.86, .2, 0.4, .1, .9, .9, 1, 1, 1, 1, 1, @@ -1440,3 +1531,471 @@ static const paper_t picturemate_papers[] = }; DECLARE_PAPERS(picturemate); + +typedef struct +{ + const char *name; + const paperlist_t *paper_list; +} paperl_t; + +static const paperl_t the_papers[] = +{ + { "standard", &standard_paper_list }, + { "durabrite", &durabrite_paper_list }, + { "durabrite2", &durabrite2_paper_list }, + { "ultrachrome", &ultrachrome_paper_list }, + { "ultrachrome_k3", &ultrachrome_k3_paper_list }, + { "r800", &r800_paper_list }, + { "picturemate", &picturemate_paper_list }, +}; + +const paperlist_t * +stpi_escp2_get_paperlist_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_papers) / sizeof(paperl_t); i++) + { + if (strcmp(n, the_papers[i].name) == 0) + return the_papers[i].paper_list; + } + return NULL; +} + +typedef struct +{ + const char *name; + const paper_adjustment_list_t *paper_list; +} paperadj_t; + +static const paperadj_t the_adjustments[] = +{ + { "standard", &standard_paper_adjustment_list }, + { "durabrite", &durabrite_paper_adjustment_list }, + { "durabrite2", &durabrite2_paper_adjustment_list }, + { "photo", &photo_paper_adjustment_list }, + { "photo2", &photo2_paper_adjustment_list }, + { "photo3", &photo3_paper_adjustment_list }, + { "sp960", &sp960_paper_adjustment_list }, + { "ultrachrome_photo", &ultrachrome_photo_paper_adjustment_list }, + { "ultrachrome_matte", &ultrachrome_matte_paper_adjustment_list }, + { "ultrachrome_k3_photo", &ultrachrome_k3_photo_paper_adjustment_list }, + { "ultrachrome_k3_matte", &ultrachrome_k3_matte_paper_adjustment_list }, + { "r800_photo", &r800_photo_paper_adjustment_list }, + { "r800_matte", &r800_matte_paper_adjustment_list }, + { "picturemate", &picturemate_paper_adjustment_list }, + { "claria", &claria_paper_adjustment_list }, +}; + +const paper_adjustment_list_t * +stpi_escp2_get_paper_adjustment_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_adjustments) / sizeof(paperadj_t); i++) + { + if (strcmp(n, the_adjustments[i].name) == 0) + return the_adjustments[i].paper_list; + } + return NULL; +} + + +#define DECLARE_INPUT_SLOT(name) \ +static const input_slot_list_t name##_input_slot_list = \ +{ \ + #name, \ + name##_input_slots, \ + sizeof(name##_input_slots) / sizeof(const input_slot_t), \ +} + +static const input_slot_t standard_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(standard_roll_feed); + +static const input_slot_t cutter_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "RollCutPage", + N_("Roll Feed (cut each page)"), + 0, + 1, + ROLL_FEED_CUT_ALL, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + }, + { + "RollCutNone", + N_("Roll Feed (do not cut)"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cutter_roll_feed); + +static const input_slot_t cd_cutter_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Manual", + N_("Manual Feed"), + 0, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "RollCutPage", + N_("Roll Feed (cut each page)"), + 0, + 1, + ROLL_FEED_CUT_ALL, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + }, + { + "RollCutNone", + N_("Roll Feed (do not cut)"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cd_cutter_roll_feed); + +static const input_slot_t cd_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Manual", + N_("Manual Feed"), + 0, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cd_roll_feed); + +static const input_slot_t r2400_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Velvet", + N_("Manual Sheet Guide"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Matte", + N_("Manual Feed (Front)"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(r2400); + +static const input_slot_t r1800_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Velvet", + N_("Manual Sheet Guide"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Matte", + N_("Manual Feed (Front)"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, + { 6, "IR\002\000\000\002" } + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, +}; + +DECLARE_INPUT_SLOT(r1800); + +static const input_slot_t rx700_input_slots[] = +{ + { + "Rear", + N_("Rear Tray"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Front", + N_("Front Tray"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "PhotoBoard", + N_("Photo Board"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, +}; + +DECLARE_INPUT_SLOT(rx700); + +static const input_slot_t pro_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\000" }, + { 0, "" } + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + 0, + { 7, "PP\003\000\000\003\000" }, + { 0, "" } + } +}; + +DECLARE_INPUT_SLOT(pro_roll_feed); + +static const input_slot_t spro5000_input_slots[] = +{ + { + "CutSheet1", + N_("Cut Sheet Bin 1"), + 0, + 0, + 0, + { 7, "PP\003\000\000\001\001" }, + { 0, "" } + }, + { + "CutSheet2", + N_("Cut Sheet Bin 2"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\001" }, + { 0, "" } + }, + { + "CutSheetAuto", + N_("Cut Sheet Autoselect"), + 0, + 0, + 0, + { 7, "PP\003\000\000\001\377" }, + { 0, "" } + }, + { + "ManualSelect", + N_("Manual Selection"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\001" }, + { 0, "" } + } +}; + +DECLARE_INPUT_SLOT(spro5000); + +static const input_slot_list_t default_input_slot_list = +{ + "Standard", + NULL, + 0, +}; + +typedef struct +{ + const char *name; + const input_slot_list_t *input_slots; +} inslot_t; + +static const inslot_t the_slots[] = +{ + { "cd_cutter_roll_feed", &cd_cutter_roll_feed_input_slot_list }, + { "cd_roll_feed", &cd_roll_feed_input_slot_list }, + { "cutter_roll_feed", &cutter_roll_feed_input_slot_list }, + { "default", &default_input_slot_list }, + { "pro_roll_feed", &pro_roll_feed_input_slot_list }, + { "r1800", &r1800_input_slot_list }, + { "r2400", &r2400_input_slot_list }, + { "rx700", &rx700_input_slot_list }, + { "spro5000", &spro5000_input_slot_list }, + { "standard_roll_feed", &standard_roll_feed_input_slot_list }, +}; + +const input_slot_list_t * +stpi_escp2_get_input_slot_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_slots) / sizeof(inslot_t); i++) + { + if (strcmp(n, the_slots[i].name) == 0) + return the_slots[i].input_slots; + } + return NULL; +} diff --git a/src/main/escp2-resolutions.c b/src/main/escp2-resolutions.c index 9dfe8e7..22db6c7 100644 --- a/src/main/escp2-resolutions.c +++ b/src/main/escp2-resolutions.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-resolutions.c,v 1.33 2006/05/06 21:30:59 rlk Exp $" + * "$Id: escp2-resolutions.c,v 1.33.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -31,163 +31,154 @@ static const res_t r_360x90dpi = { "360x90dpi", N_("360 x 90 DPI Fast Economy"), - 360, 90, 360, 90, 0, 0, 1 }; + 360, 90, 360, 90, 360, 90, 0, 0, 1 }; static const res_t r_360x90sw = { "360x90sw", N_("360 x 90 DPI Fast Economy"), - 360, 90, 360, 90, 1, 0, 1 }; + 360, 90, 360, 90, 360, 90, 1, 0, 1 }; static const res_t r_360x120dpi = { "360x120dpi", N_("360 x 120 DPI Economy"), - 360, 120, 360, 120, 0, 0, 1 }; + 360, 120, 360, 120, 360, 120, 0, 0, 1 }; static const res_t r_360x120sw = { "360x120sw", N_("360 x 120 DPI Economy"), - 360, 120, 360, 120, 1, 0, 1 }; + 360, 120, 360, 120, 360, 120, 1, 0, 1 }; static const res_t r_180dpi = { "180dpi", N_("180 DPI Economy"), - 180, 180, 180, 180, 0, 0, 1 }; + 180, 180, 180, 180, 180, 180, 0, 0, 1 }; static const res_t r_180sw = { "180sw", N_("180 DPI Economy"), - 180, 180, 180, 180, 1, 0, 1 }; + 180, 180, 180, 180, 180, 180, 1, 0, 1 }; static const res_t r_360x180dpi = { "360x180dpi", N_("360 x 180 DPI Draft"), - 360, 180, 360, 180, 0, 0, 1 }; + 360, 180, 360, 180, 360, 180, 0, 0, 1 }; static const res_t r_360x180sw = { "360x180sw", N_("360 x 180 DPI Draft"), - 360, 180, 360, 180, 1, 0, 1 }; + 360, 180, 360, 180, 360, 180, 1, 0, 1 }; static const res_t r_360x240dpi = { "360x240dpi", N_("360 x 240 DPI Draft"), - 360, 240, 360, 240, 0, 0, 1 }; + 360, 240, 360, 240, 360, 240, 0, 0, 1 }; static const res_t r_360x240sw = { "360x240sw", N_("360 x 240 DPI Draft"), - 360, 240, 360, 240, 1, 0, 1 }; + 360, 240, 360, 240, 360, 240, 1, 0, 1 }; static const res_t r_360mw = { "360mw", N_("360 DPI High Quality"), - 360, 360, 360, 360, 0, 1, 1 }; + 360, 360, 360, 360, 360, 360, 0, 1, 1 }; static const res_t r_360pro = { "360pro", N_("360 DPI"), - 360, 360, 360, 360, 0, 1, 1 }; + 360, 360, 360, 360, 360, 360, 0, 1, 1 }; static const res_t r_360 = { "360", N_("360 DPI"), - 360, 360, 360, 360, 0, 0, 1 }; + 360, 360, 360, 360, 360, 360, 0, 0, 1 }; static const res_t r_360sw = { "360sw", N_("360 DPI"), - 360, 360, 360, 360, 1, 0, 1 }; + 360, 360, 360, 360, 360, 360, 1, 0, 1 }; static const res_t r_720x360mw = { "720x360mw", N_("720 x 360 DPI"), - 720, 360, 720, 360, 0, 1, 1 }; + 720, 360, 720, 360, 720, 360, 0, 1, 1 }; static const res_t r_720x360sw = { "720x360sw", N_("720 x 360 DPI"), - 720, 360, 720, 360, 1, 0, 1 }; + 720, 360, 720, 360, 720, 360, 1, 0, 1 }; +static const res_t r_720x360un = +{ "720x360un", N_("720 x 360 DPI Enhanced"), + 720, 360, 1440, 720, 720, 360, 1, 0, 1 }; static const res_t r_720mw = { "720mw", N_("720 DPI"), - 720, 720, 720, 720, 0, 1, 1 }; + 720, 720, 720, 720, 720, 720, 0, 1, 1 }; static const res_t r_720sw = { "720sw", N_("720 DPI"), - 720, 720, 720, 720, 1, 0, 1 }; + 720, 720, 720, 720, 720, 720, 1, 0, 1 }; +static const res_t r_720un = +{ "720un", N_("720 DPI High Quality"), + 720, 720, 1440, 720, 720, 720, 1, 0, 1 }; static const res_t r_720hq = { "720hq", N_("720 DPI High Quality"), - 720, 720, 720, 720, 1, 0, 2 }; + 720, 720, 720, 720, 720, 720, 1, 0, 2 }; static const res_t r_720hq2 = { "720hq2", N_("720 DPI Highest Quality"), - 720, 720, 720, 720, 1, 0, 4 }; + 720, 720, 720, 720, 720, 720, 1, 0, 4 }; static const res_t r_720x720oov = { "720x720oov", N_("720 x 720 DPI"), - 2880, 720, 720, 720, 1, 0, 1 }; + 2880, 720, 2880, 720, 720, 720, 1, 0, 1 }; static const res_t r_1440x720mw = { "1440x720mw", N_("1440 x 720 DPI"), - 1440, 720, 1440, 720, 0, 1, 1 }; + 1440, 720, 1440, 720, 1440, 720, 0, 1, 1 }; static const res_t r_1440x720sw = { "1440x720sw", N_("1440 x 720 DPI"), - 1440, 720, 1440, 720, 1, 0, 1 }; + 1440, 720, 1440, 720, 1440, 720, 1, 0, 1 }; static const res_t r_1440x720hq2 = { "1440x720hq2", N_("1440 x 720 DPI Highest Quality"), - 1440, 720, 1440, 720, 1, 0, 2 }; + 1440, 720, 1440, 720, 1440, 720, 1, 0, 2 }; static const res_t r_720x1440sw = { "720x1440sw", N_("1440 x 720 DPI Transposed"), - 720, 1440, 720, 1440, 1, 0, 1 }; + 720, 1440, 720, 1440, 720, 1440, 1, 0, 1 }; static const res_t r_720x1440ov = { "720x1440ov", N_("1440 x 720 DPI Transposed"), - 1440, 1440, 720, 1440, 1, 0, 1}; + 1440, 1440, 1440, 1440, 720, 1440, 1, 0, 1}; static const res_t r_1440x720ov = { "1440x720ov", N_("1440 x 720 DPI"), - 2880, 720, 1440, 720, 1, 0, 1 }; + 2880, 720, 2880, 720, 1440, 720, 1, 0, 1 }; static const res_t r_2880x720mw = { "2880x720mw", N_("2880 x 720 DPI"), - 2880, 720, 2880, 720, 0, 1, 1}; + 2880, 720, 2880, 720, 2880, 720, 0, 1, 1}; static const res_t r_2880x720sw = { "2880x720sw", N_("2880 x 720 DPI"), - 2880, 720, 2880, 720, 1, 0, 1}; + 2880, 720, 2880, 720, 2880, 720, 1, 0, 1}; static const res_t r_2880x720hq2 = { "2880x720hq2", N_("2880 x 720 DPI Highest Quality"), - 2880, 720, 2880, 720, 1, 0, 2 }; + 2880, 720, 2880, 720, 2880, 720, 1, 0, 2 }; static const res_t r_1440x1440mw = { "1440x1440mw", N_("1440 x 1440 DPI"), - 1440, 1440, 1440, 1440, 0, 1, 1}; + 1440, 1440, 1440, 1440, 1440, 1440, 0, 1, 1}; static const res_t r_1440x1440sw = { "1440x1440sw", N_("1440 x 1440 DPI"), - 1440, 1440, 1440, 1440, 1, 0, 1}; + 1440, 1440, 1440, 1440, 1440, 1440, 1, 0, 1}; static const res_t r_1440x1440ov = { "1440x1440ov", N_("1440 x 1440 DPI"), - 2880, 1440, 1440, 1440, 1, 0, 1}; -static const res_t r_1440x1440sw3650 = -{ "1440x1440ov", N_("1440 x 1440"), - 1440, 1440, 1440, 1440, 1, 0, 1}; -static const res_t r_1440x1440sw3650hq = -{ "2880x1440sw", N_("1440 x 1440 DPI High Quality"), - 1440, 1440, 1440, 1440, 1, 0, 2}; -static const res_t r_1440x1440sw3650hq2 = -{ "5760x1440sw", N_("1440 x 1440 DPI Highest Quality"), - 1440, 1440, 1440, 1440, 1, 0, 4}; + 2880, 1440, 2880, 1440, 1440, 1440, 1, 0, 1}; static const res_t r_2880x1440mw = { "2880x1440mw", N_("2880 x 1440 DPI"), - 2880, 1440, 2880, 1440, 0, 1, 1}; + 2880, 1440, 2880, 1440, 2880, 1440, 0, 1, 1}; static const res_t r_2880x1440sw = { "2880x1440sw", N_("2880 x 1440 DPI"), - 2880, 1440, 2880, 1440, 1, 0, 1}; + 2880, 1440, 2880, 1440, 2880, 1440, 1, 0, 1}; static const res_t r_1440x2880sw = { "1440x2880sw", N_("2880 x 1440 DPI Transposed"), - 1440, 2880, 1440, 2880, 1, 0, 1}; + 1440, 2880, 1440, 2880, 1440, 2880, 1, 0, 1}; static const res_t r_2880x1440sw2400 = { "2880x1440sw", N_("2880 x 1440 DPI"), - 1440, 2880, 1440, 2880, 1, 0, 1}; -static const res_t r_2880x1440sw2400hq = -{ "2880x2880sw", N_("2880 x 1440 DPI High Quality"), - 1440, 2880, 1440, 2880, 1, 0, 2}; -static const res_t r_2880x1440sw2400hq2 = -{ "5760x2880sw", N_("2880 x 1440 DPI Highest Quality"), - 1440, 2880, 1440, 2880, 1, 0, 4}; + 1440, 2880, 1440, 2880, 1440, 2880, 1, 0, 1}; static const res_t r_5760x1440sw = { "5760x1440sw", N_("5760 x 1440 DPI"), - 5760, 1440, 5760, 1440, 1, 0, 1}; + 5760, 1440, 5760, 1440, 5760, 1440, 1, 0, 1}; static const res_t r_2880x2880mw = { "2880x2880mw", N_("2880 x 2880 DPI"), - 2880, 2880, 2880, 2880, 0, 1, 1}; + 2880, 2880, 2880, 2880, 2880, 2880, 0, 1, 1}; static const res_t r_2880x2880sw = { "2880x2880sw", N_("2880 x 2880 DPI"), - 2880, 2880, 2880, 2880, 1, 0, 1}; + 2880, 2880, 2880, 2880, 2880, 2880, 1, 0, 1}; static const res_t r_5760x2880mw = { "5760x2880mw", N_("5760 x 2880 DPI"), - 5760, 2880, 5760, 2880, 0, 1, 1}; + 5760, 2880, 5760, 2880, 5760, 2880, 0, 1, 1}; static const res_t r_5760x2880sw = { "5760x2880sw", N_("5760 x 2880 DPI"), - 5760, 2880, 5760, 2880, 1, 0, 1}; + 5760, 2880, 5760, 2880, 5760, 2880, 1, 0, 1}; -const res_t *const stpi_escp2_720dpi_reslist[] = +static const res_t *const stpi_escp2_720dpi_reslist[] = { &r_360x90dpi, @@ -209,7 +200,7 @@ const res_t *const stpi_escp2_720dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_1440dpi_reslist[] = +static const res_t *const stpi_escp2_1440dpi_reslist[] = { &r_360x90sw, @@ -234,7 +225,7 @@ const res_t *const stpi_escp2_1440dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_2880dpi_reslist[] = +static const res_t *const stpi_escp2_2880dpi_reslist[] = { &r_360x90sw, @@ -261,7 +252,7 @@ const res_t *const stpi_escp2_2880dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_2880_1440dpi_reslist[] = +static const res_t *const stpi_escp2_2880_1440dpi_reslist[] = { &r_360x90sw, @@ -280,21 +271,19 @@ const res_t *const stpi_escp2_2880_1440dpi_reslist[] = &r_720sw, &r_1440x720sw, - &r_720x1440sw, &r_2880x720sw, &r_1440x1440sw, &r_2880x1440sw, - &r_1440x2880sw, &r_2880x2880sw, NULL }; -const res_t *const stpi_escp2_g3_reslist[] = +static const res_t *const stpi_escp2_g3_reslist[] = { &r_360x90dpi, @@ -320,8 +309,10 @@ const res_t *const stpi_escp2_g3_reslist[] = NULL }; -const res_t *const stpi_escp2_superfine_reslist[] = +static const res_t *const stpi_escp2_superfine_reslist[] = { + &r_360x90sw, + &r_360x120sw, &r_360x180sw, @@ -335,12 +326,12 @@ const res_t *const stpi_escp2_superfine_reslist[] = &r_720sw, &r_1440x720sw, - &r_720x1440sw, &r_1440x1440ov, &r_2880x1440sw, - &r_1440x2880sw, + + &r_5760x1440sw, &r_2880x2880sw, @@ -349,9 +340,9 @@ const res_t *const stpi_escp2_superfine_reslist[] = NULL }; -const res_t *const stpi_escp2_r2400_reslist[] = +static const res_t *const stpi_escp2_claria_1400_reslist[] = { - &r_360x120sw, + &r_360x90sw, &r_360x180sw, @@ -361,45 +352,28 @@ const res_t *const stpi_escp2_r2400_reslist[] = &r_720x360sw, - &r_720sw, - - &r_1440x720sw, - &r_720x1440sw, - - &r_1440x1440sw, - - &r_2880x1440sw2400, - &r_2880x1440sw2400hq, - &r_2880x1440sw2400hq2, + &r_720x360un, - NULL -}; + &r_720sw, -const res_t *const stpi_escp2_cx3650_reslist[] = -{ - &r_360x120sw, + &r_720un, - &r_360x180sw, - - &r_360x240sw, + &r_1440x720sw, - &r_360sw, + &r_1440x1440ov, - &r_720x360sw, + &r_2880x1440sw, - &r_720sw, + &r_5760x1440sw, - &r_1440x720sw, - &r_720x1440sw, + &r_2880x2880sw, - &r_1440x1440sw3650, - &r_1440x1440sw3650hq, - &r_1440x1440sw3650hq2, + &r_5760x2880sw, NULL }; -const res_t *const stpi_escp2_picturemate_reslist[] = +static const res_t *const stpi_escp2_picturemate_reslist[] = { &r_720x720oov, @@ -417,7 +391,7 @@ const res_t *const stpi_escp2_picturemate_reslist[] = NULL }; -const res_t *const stpi_escp2_sc500_reslist[] = +static const res_t *const stpi_escp2_sc500_reslist[] = { &r_360x90dpi, @@ -439,7 +413,7 @@ const res_t *const stpi_escp2_sc500_reslist[] = NULL }; -const res_t *const stpi_escp2_g3_720dpi_reslist[] = +static const res_t *const stpi_escp2_g3_720dpi_reslist[] = { &r_360x90dpi, @@ -463,7 +437,7 @@ const res_t *const stpi_escp2_g3_720dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_720dpi_soft_reslist[] = +static const res_t *const stpi_escp2_720dpi_soft_reslist[] = { &r_360x90dpi, @@ -486,7 +460,7 @@ const res_t *const stpi_escp2_720dpi_soft_reslist[] = NULL }; -const res_t *const stpi_escp2_sc640_reslist[] = +static const res_t *const stpi_escp2_sc640_reslist[] = { &r_360x90dpi, @@ -507,7 +481,7 @@ const res_t *const stpi_escp2_sc640_reslist[] = NULL }; -const res_t *const stpi_escp2_pro_reslist[] = +static const res_t *const stpi_escp2_pro_reslist[] = { &r_360x90dpi, @@ -534,11 +508,47 @@ const res_t *const stpi_escp2_pro_reslist[] = NULL }; +typedef struct +{ + const char *name; + const res_t *const *const res_list; +} resolution_t; + +static const resolution_t the_resolutions[] = +{ + { "superfine", stpi_escp2_superfine_reslist }, + { "claria_1400", stpi_escp2_claria_1400_reslist }, + { "pro", stpi_escp2_pro_reslist }, + { "720dpi", stpi_escp2_720dpi_reslist }, + { "720dpi_soft", stpi_escp2_720dpi_soft_reslist }, + { "g3_720dpi", stpi_escp2_g3_720dpi_reslist }, + { "1440dpi", stpi_escp2_1440dpi_reslist }, + { "2880dpi", stpi_escp2_2880dpi_reslist }, + { "2880_1440dpi", stpi_escp2_2880_1440dpi_reslist }, + { "g3", stpi_escp2_g3_reslist }, + { "sc500", stpi_escp2_sc500_reslist }, + { "sc640", stpi_escp2_sc640_reslist }, + { "picturemate", stpi_escp2_picturemate_reslist }, +}; + +const res_t *const * +stpi_escp2_get_reslist_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_resolutions) / sizeof(resolution_t); i++) + { + if (strcmp(n, the_resolutions[i].name) == 0) + return the_resolutions[i].res_list; + } + return NULL; +} + #define DECLARE_PRINTER_WEAVES(name) \ -const printer_weave_list_t stpi_escp2_##name##_printer_weave_list = \ +static const printer_weave_list_t name##_printer_weave_list = \ { \ #name, \ - sizeof(name##_printer_weaves) / sizeof(printer_weave_t), \ + sizeof(name##_printer_weaves) / sizeof(printer_weave_t), \ name##_printer_weaves \ } @@ -585,3 +595,108 @@ static const printer_weave_t pro7600_printer_weaves[] = }; DECLARE_PRINTER_WEAVES(pro7600); + +typedef struct +{ + const char *name; + const printer_weave_list_t *weave_list; +} weave_t; + +static const weave_t the_weaves[] = +{ + { "standard", &standard_printer_weave_list }, + { "pro7000", &pro7000_printer_weave_list }, + { "pro7500", &pro7500_printer_weave_list }, + { "pro7600", &pro7600_printer_weave_list }, +}; + +const printer_weave_list_t * +stpi_escp2_get_printer_weaves_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_weaves) / sizeof(weave_t); i++) + { + if (strcmp(n, the_weaves[i].name) == 0) + return the_weaves[i].weave_list; + } + return NULL; +} + + +#define DECLARE_QUALITY_LIST(name) \ +static const quality_list_t name##_quality_list = \ +{ \ + #name, \ + name##_qualities, \ + sizeof(name##_qualities) / sizeof(const quality_t), \ +} + +static const quality_t standard_qualities[] = +{ + { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, + { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, + { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, + { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, + { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, + { "Photo", N_("Photo"), 1440, 720, 2880, 720, 1440, 720 }, + { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, + { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, +}; + +DECLARE_QUALITY_LIST(standard); + +static const quality_t p1_5_qualities[] = +{ + { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, + { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, + { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, + { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, + { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, + { "Photo", N_("Photo"), 1440, 720, 1440, 720, 1440, 720 }, + { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, + { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, +}; + +DECLARE_QUALITY_LIST(p1_5); + +static const quality_t picturemate_qualities[] = +{ + { "Draft", N_("Draft"), 1440, 720, 1440, 720, 1440, 720 }, + { "Standard", N_("Standard"), 1440, 1440, 1440, 1440, 1440, 1440 }, + { "Photo", N_("Photo"), 1440, 1440, 1440, 1440, 1440, 1440 }, + { "High", N_("High"), 2880, 1440, 2880, 1440, 2880, 1440 }, + { "HighPhoto", N_("Super Photo"), 2880, 1440, 2880, 1440, 2880, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 5760, 1440, 5760, 1440, 5760, 1440 }, + { "Best", N_("Best"), 5760, 1440, 5760, 1440, 5760, 1440 }, +}; + +DECLARE_QUALITY_LIST(picturemate); + +typedef struct +{ + const char *name; + const quality_list_t *quality_list; +} qual_t; + +static const qual_t the_qualities[] = +{ + { "standard", &standard_quality_list }, + { "p1_5", &p1_5_quality_list }, + { "picturemate", &picturemate_quality_list }, +}; + +const quality_list_t * +stpi_escp2_get_quality_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_qualities) / sizeof(qual_t); i++) + { + if (strcmp(n, the_qualities[i].name) == 0) + return the_qualities[i].quality_list; + } + return NULL; +} diff --git a/src/main/papers.xml b/src/main/papers.xml index 4f2bacd..c8a017b 100644 --- a/src/main/papers.xml +++ b/src/main/papers.xml @@ -4,7 +4,7 @@ XML description of papers known to libgutenprint. It should be edited by hand. - "$Id: papers.xml,v 1.21 2006/04/20 00:33:41 rlk Exp $" + "$Id: papers.xml,v 1.21.8.1 2007/03/02 12:01:26 rlk Exp $" --> <!-- @@ -68,6 +68,13 @@ <height value="184"/> <unit value="english"/> </paper> + <paper name="CDCustom"> + <description value="CD - Custom"/> + <comment value="CD, custom diameter"/> + <width value="337"/> + <height value="337"/> + <unit value="english"/> + </paper> <paper name="w216h360"> <description value="3x5"/> <width value="216"/> @@ -940,11 +947,11 @@ <height value="337"/> <unit value="metric-extended"/> </paper> - <paper name="w244h155"> + <paper name="w155h244"> <description value="Card"/> <comment value="86mm x 54mm"/> - <width value="244"/> - <height value="155"/> + <width value="155"/> + <height value="244"/> <unit value="metric-extended"/> </paper> <paper name="w283h566"> diff --git a/src/main/print-canon.c b/src/main/print-canon.c index 5104c40..06e3b49 100644 --- a/src/main/print-canon.c +++ b/src/main/print-canon.c @@ -1,5 +1,5 @@ /* - * "$Id: print-canon.c,v 1.174 2006/05/28 16:59:04 rlk Exp $" + * "$Id: print-canon.c,v 1.190.2.3 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in CANON BJL driver for the GIMP. * @@ -7,6 +7,8 @@ * Robert Krawitz (rlk@alum.mit.edu) and * Andy Thaller (thaller@ph.tum.de) * + * Copyright (c) 2006 - 2007 Sascha Sommer (saschasommer@freenet.de) + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) @@ -38,7 +40,6 @@ * * adjust the colors of all supported models * */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -56,102 +57,22 @@ #include <limits.h> #endif #include <math.h> -/* Solaris with gcc has problems because gcc's limits.h doesn't #define */ -/* this */ -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif -#if (0) -#define EXPERIMENTAL_STUFF 0 -#endif +#include "print-canon.h" + +#ifndef MIN +# define MIN(a,b) (((a)<(b)) ? (a) : (b)) +#endif /* !MIN */ +#ifndef MAX +# define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif /* !MAX */ + + + + +#define RASTER_LINES_PER_BLOCK 8 /* number of raster lines in every F) command */ -#define MAX_CARRIAGE_WIDTH 13 /* This really needs to go away */ -/* - * We really need to get away from this silly static nonsense... - */ -#define MAX_PHYSICAL_BPI 1440 -#define MAX_OVERSAMPLED 8 -#define MAX_BPP 4 -#define COMPBUFWIDTH (MAX_PHYSICAL_BPI * MAX_OVERSAMPLED * MAX_BPP * \ - MAX_CARRIAGE_WIDTH / CHAR_BIT) - -#define MIN(a,b) (((a)<(b)) ? (a) : (b)) -#define MAX(a, b) ((a) > (b) ? (a) : (b)) - -/* the PIXMA iP4000 and maybe other printers use following table to store - 5 pixels with 3 levels in 1 byte, All possible pixel combinations are given - numbers from 0 (=00,00,00,00,00) to 242 (=10,10,10,10,10) - combinations where the value of one of the pixels would be 3 are skipped -*/ -static const unsigned char tentoeight[] = -{ - 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 0, 0, 0, 0, - 9, 10, 11, 0, 12, 13, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, - 18, 19, 20, 0, 21, 22, 23, 0, 24, 25, 26, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 27, 28, 29, 0, 30, 31, 32, 0, 33, 34, 35, 0, 0, 0, 0, 0, - 36, 37, 38, 0, 39, 40, 41, 0, 42, 43, 44, 0, 0, 0, 0, 0, - 45, 46, 47, 0, 48, 49, 50, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 55, 56, 0, 57, 58, 59, 0, 60, 61, 62, 0, 0, 0, 0, 0, - 63, 64, 65, 0, 66, 67, 68, 0, 69, 70, 71, 0, 0, 0, 0, 0, - 72, 73, 74, 0, 75, 76, 77, 0, 78, 79, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 82, 83, 0, 84, 85, 86, 0, 87, 88, 89, 0, 0, 0, 0, 0, - 90, 91, 92, 0, 93, 94, 95, 0, 96, 97, 98, 0, 0, 0, 0, 0, - 99,100,101, 0,102,103,104, 0,105,106,107, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108,109,110, 0,111,112,113, 0,114,115,116, 0, 0, 0, 0, 0, - 117,118,119, 0,120,121,122, 0,123,124,125, 0, 0, 0, 0, 0, - 126,127,128, 0,129,130,131, 0,132,133,134, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 135,136,137, 0,138,139,140, 0,141,142,143, 0, 0, 0, 0, 0, - 144,145,146, 0,147,148,149, 0,150,151,152, 0, 0, 0, 0, 0, - 153,154,155, 0,156,157,158, 0,159,160,161, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 162,163,164, 0,165,166,167, 0,168,169,170, 0, 0, 0, 0, 0, - 171,172,173, 0,174,175,176, 0,177,178,179, 0, 0, 0, 0, 0, - 180,181,182, 0,183,184,185, 0,186,187,188, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 189,190,191, 0,192,193,194, 0,195,196,197, 0, 0, 0, 0, 0, - 198,199,200, 0,201,202,203, 0,204,205,206, 0, 0, 0, 0, 0, - 207,208,209, 0,210,211,212, 0,213,214,215, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 216,217,218, 0,219,220,221, 0,222,223,224, 0, 0, 0, 0, 0, - 225,226,227, 0,228,229,230, 0,231,232,233, 0, 0, 0, 0, 0, - 234,235,236, 0,237,238,239, 0,240,241,242, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; static int pack_pixels(unsigned char* buf,int len) @@ -184,641 +105,7 @@ pack_pixels(unsigned char* buf,int len) return write_pos; } -static const int channel_color_map[] = -{ - STP_ECOLOR_K, STP_ECOLOR_C, STP_ECOLOR_M, STP_ECOLOR_Y, STP_ECOLOR_C, STP_ECOLOR_M, STP_ECOLOR_Y -}; - -static const int subchannel_color_map[] = -{ - 0, 0, 0, 0, 1, 1, 1 -}; - -/* K,C,M,Y */ -static const double ink_darknesses[] = -{ - 1.0, 0.31 / .5, 0.61 / .97, 0.08 -}; - -#define USE_3BIT_FOLD_TYPE 323 - -/* - * For each printer, we can select from a variety of dot sizes. - * For single dot size printers, the available sizes are usually 0, - * which is the "default", and some subset of 1-4. For simple variable - * dot size printers (with only one kind of variable dot size), the - * variable dot size is specified as 0x10. For newer printers, there - * is a choice of variable dot sizes available, 0x10, 0x11, and 0x12 in - * order of increasing size. - * - * Normally, we want to specify the smallest dot size that lets us achieve - * a density of less than .8 or thereabouts (above that we start to get - * some dither artifacts). This needs to be tested for each printer and - * resolution. - * - * An entry of -1 in a slot means that this resolution is not available. - * 0 standard dot sizes are used. - * 1 drop modulation is used. - */ - -/* We know a per-model base resolution (like 180dpi or 150dpi) - * and multipliers for the base resolution in the dotsize-, densities- - * and inklist: - * for 180dpi base resolution we would have - * s_r11_4 for 4color ink @180dpi - * s_r22_4 for 4color ink @360dpi - * s_r33_4 for 4color ink @720dpi - * s_r43_4 for 4color ink @1440x720dpi - */ - -typedef struct canon_dot_sizes -{ - int dot_r11; /* 180x180 or 150x150 */ - int dot_r22; /* 360x360 or 300x300 */ - int dot_r33; /* 720x720 or 600x600 */ - int dot_r43; /* 1440x720 or 1200x600 */ - int dot_r44; /* 1440x1440 or 1200x1200 */ - int dot_r55; /* 2880x2880 or 2400x2400 */ -} canon_dot_size_t; - -/* - * Specify the base density for each available resolution. - * - */ - -typedef struct canon_densities -{ - double d_r11; /* 180x180 or 150x150 */ - double d_r22; /* 360x360 or 300x300 */ - double d_r33; /* 720x720 or 600x600 */ - double d_r43; /* 1440x720 or 1200x600 */ - double d_r44; /* 1440x1440 or 1200x1200 */ - double d_r55; /* 2880x2880 or 2400x2400 */ -} canon_densities_t; - - - -/* - * Definition of the multi-level inks available to a given printer. - * Each printer may use a different kind of ink droplet for variable - * and single drop size for each supported horizontal resolution and - * type of ink (4 or 6 color). - * - * Recall that 6 color ink is treated as simply another kind of - * multi-level ink, but the driver offers the user a choice of 4 and - * 6 color ink, so we need to define appropriate inksets for both - * kinds of ink. - * - * Stuff like the MIS 4 and 6 "color" monochrome inks doesn't fit into - * this model very nicely, so we'll either have to special case it - * or find some way of handling it in here. - */ - -typedef struct canon_variable_ink -{ - double density; - const stp_shade_t *shades; - int numshades; -} canon_variable_ink_t; - -typedef struct canon_variable_inkset -{ - const canon_variable_ink_t *c; - const canon_variable_ink_t *m; - const canon_variable_ink_t *y; - const canon_variable_ink_t *k; -} canon_variable_inkset_t; - -/* - * currenty unaccounted for are the 7color printers and the 3color ones - * (which use CMY only printheads) - * - */ - -typedef struct canon_variable_inklist -{ - const int bits; - const int colors; - const canon_variable_inkset_t *r11; /* 180x180 or 150x150 */ - const canon_variable_inkset_t *r22; /* 360x360 or 300x300 */ - const canon_variable_inkset_t *r33; /* 720x720 or 600x600 */ - const canon_variable_inkset_t *r43; /* 1440x720 or 1200x600 */ - const canon_variable_inkset_t *r44; /* 1440x1440 or 1200x1200 */ - const canon_variable_inkset_t *r55; /* 2880x2880 or 2400x2400 */ -} canon_variable_inklist_t; - - -#ifdef EXPERIMENTAL_STUFF -/* - * A printmode is defined by its resolution (xdpi x ydpi), the bits per pixel - * and the installed printhead. - * - * For a hereby defined printmode we specify the density and gamma multipliers - * and the ink definition with optional adjustments for lum, hue and sat - * - */ -typedef struct canon_variable_printmode -{ - const int xdpi; /* horizontal resolution */ - const int ydpi; /* vertical resolution */ - const int bits; /* bits per pixel */ - const int printhead; /* installed printhead */ - const int quality; /* maximum init-quality */ - const double density; /* density multiplier */ - const double gamma; /* gamma multiplier */ - const canon_variable_inkset_t *inks; /* ink definition */ - const char *lum_adjustment; /* optional lum adj. */ - const char *hue_adjustment; /* optional hue adj. */ - const char *sat_adjustment; /* optional sat adj. */ -} canon_variable_printmode_t; -#endif - -/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE - * - * The following dither ranges were taken from print-escp2.c and do NOT - * represent the requirements of canon inks. Feel free to play with them - * accoring to the escp2 part of doc/README.new-printer and send me a patch - * if you get better results. Please send mail to thaller@ph.tum.de - */ - -#define DECLARE_INK(name, density) \ -static const canon_variable_ink_t name##_ink = \ -{ \ - density, \ - name##_shades, \ - sizeof(name##_shades) / sizeof(stp_shade_t) \ -} - -#define SHADE(density, name) \ -{ density, sizeof(name)/sizeof(stp_dotsize_t), name } - -/* - * Dither ranges specifically for Cyan/LightCyan (see NOTE above) - * - */ - -static const stp_dotsize_t single_dotsize[] = -{ - { 0x1, 1.0 } -}; - -static const stp_shade_t canon_Cc_1bit_shades[] = -{ - SHADE(1.0, single_dotsize), - SHADE(0.25, single_dotsize), -}; - -DECLARE_INK(canon_Cc_1bit, 0.75); - -/* - * Dither ranges specifically for Magenta/LightMagenta (see NOTE above) - * - */ - -static const stp_shade_t canon_Mm_1bit_shades[] = -{ - SHADE(1.0, single_dotsize), - SHADE(0.26, single_dotsize), -}; - -DECLARE_INK(canon_Mm_1bit, 0.75); - -/* - * Dither ranges specifically for any Color and 2bit/pixel (see NOTE above) - * - */ -static const stp_dotsize_t two_bit_dotsize[] = -{ - { 0x1, 0.45 }, - { 0x2, 0.68 }, - { 0x3, 1.0 } -}; - -static const stp_shade_t canon_X_2bit_shades[] = -{ - SHADE(1.0, two_bit_dotsize) -}; - -DECLARE_INK(canon_X_2bit, 1.0); - -static const stp_dotsize_t two_bit_3level_dotsize[] = -{ - { 0x1, 0.5 }, - { 0x2, 1.0 } -}; - -static const stp_shade_t canon_X_2bit_3level_shades[] = -{ - SHADE(1.0, two_bit_3level_dotsize) -}; -DECLARE_INK(canon_X_2bit_3level,0.75); - -/* - * Dither ranges for black 1bit/pixel (even though photo black - * is not used parameters for it have to be set in the t) command - */ - -static const stp_shade_t canon_K_1bit_pixma_shades[] = -{ - SHADE(1.0, single_dotsize), - SHADE(0.0, two_bit_3level_dotsize), -}; -DECLARE_INK(canon_K_1bit_pixma,1.0); - -static const stp_dotsize_t two_bit_4level_dotsize[] = -{ - { 0x1, 0.25 }, - { 0x2, 0.50 }, - { 0x3, 1.00 } -}; - -static const stp_shade_t canon_X_2bit_4level_shades[] = -{ - SHADE(1.0, two_bit_4level_dotsize) -}; -DECLARE_INK(canon_X_2bit_4level,0.75); - -/* - * Dither ranges specifically for any Color/LightColor and 2bit/pixel - * (see NOTE above) - */ -static const stp_shade_t canon_Xx_2bit_shades[] = -{ - SHADE(1.0, two_bit_dotsize), - SHADE(0.33, two_bit_dotsize), -}; - -DECLARE_INK(canon_Xx_2bit, 1.0); - -/* - * Dither ranges specifically for any Color and 3bit/pixel - * (see NOTE above) - * - * BIG NOTE: The bjc8200 has this kind of ink. One Byte seems to hold - * drop sizes for 3 pixels in a 3/2/2 bit fashion. - * Size values for 3bit-sized pixels range from 1 to 7, - * size values for 2bit-sized picels from 1 to 3 (kill msb). - * - * - */ -static const stp_dotsize_t three_bit_dotsize[] = -{ - { 0x1, 0.45 }, - { 0x2, 0.55 }, - { 0x3, 0.66 }, - { 0x4, 0.77 }, - { 0x5, 0.88 }, - { 0x6, 1.0 } -}; - -static const stp_shade_t canon_X_3bit_shades[] = -{ - SHADE(1.0, three_bit_dotsize) -}; - -DECLARE_INK(canon_X_3bit, 1.0); - -/* - * Dither ranges specifically for any Color/LightColor and 3bit/pixel - * (see NOTE above) - */ -static const stp_shade_t canon_Xx_3bit_shades[] = -{ - SHADE(1.0, three_bit_dotsize), - SHADE(0.33, three_bit_dotsize), -}; - -DECLARE_INK(canon_Xx_3bit, 1.0); - - -/* Inkset for printing in CMY and 1bit/pixel */ -static const canon_variable_inkset_t ci_CMY_1 = -{ - NULL, - NULL, - NULL, - NULL -}; - -/* Inkset for printing in CMY and 2bit/pixel */ -static const canon_variable_inkset_t ci_CMY_2 = -{ - &canon_X_2bit_ink, - &canon_X_2bit_ink, - &canon_X_2bit_ink, - NULL -}; - -/* Inkset for printing in CMYK and 1bit/pixel */ -static const canon_variable_inkset_t ci_CMYK_1 = -{ - NULL, - NULL, - NULL, - NULL -}; - -/* Inkset for printing in CMYK and 3level 2bit/pixel - for C and M, 1bit/pixel for K and Y */ -static const canon_variable_inkset_t ci_CMYK_pixma_1 = -{ - &canon_X_2bit_3level_ink, - &canon_X_2bit_3level_ink, - NULL, - &canon_K_1bit_pixma_ink, -}; - -/* Inkset for printing in CcMmYK and 1bit/pixel */ -static const canon_variable_inkset_t ci_CcMmYK_1 = -{ - &canon_Cc_1bit_ink, - &canon_Mm_1bit_ink, - NULL, - NULL -}; - -/* Inkset for printing in CMYK and 2bit/pixel */ -static const canon_variable_inkset_t ci_CMYK_2 = -{ - &canon_X_2bit_ink, - &canon_X_2bit_ink, - &canon_X_2bit_ink, - &canon_X_2bit_ink -}; - -/* Inkset for printing in CcMmYK and 2bit/pixel */ -static const canon_variable_inkset_t ci_CcMmYK_2 = -{ - &canon_Xx_2bit_ink, - &canon_Xx_2bit_ink, - &canon_X_2bit_ink, - &canon_X_2bit_ink -}; - -/* Inkset for printing in CMYK and 3bit/pixel */ -static const canon_variable_inkset_t ci_CMYK_3 = -{ - &canon_X_3bit_ink, - &canon_X_3bit_ink, - &canon_X_3bit_ink, - &canon_X_3bit_ink -}; - -/* Inkset for printing in CcMmYK and 3bit/pixel */ -static const canon_variable_inkset_t ci_CcMmYK_3 = -{ - &canon_Xx_3bit_ink, - &canon_Xx_3bit_ink, - &canon_X_3bit_ink, - &canon_X_3bit_ink, -}; - - -typedef canon_variable_inklist_t* canon_variable_inklist_p; - -/* Ink set should be applicable for any CMYK based model */ -static const canon_variable_inklist_t canon_ink_standard[] = -{ - { - 1,4, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - }, -}; - -/* Ink set for normal quality on PIXMA iP4000 */ -static const canon_variable_inklist_t canon_ink_standard_pixma[] = -{ - { - 1,4, /* FIXME we have different bit depth for different colors!! */ - &ci_CMYK_pixma_1, &ci_CMYK_pixma_1, &ci_CMYK_pixma_1, - &ci_CMYK_pixma_1, &ci_CMYK_pixma_1, &ci_CMYK_pixma_1, - }, -}; - -/* Ink set for printers using CMY and CMY photo printing, 1 or 2bit/pixel */ -static const canon_variable_inklist_t canon_ink_oldphoto[] = -{ - { - 1,3, - &ci_CMY_1, &ci_CMY_1, &ci_CMY_1, - &ci_CMY_1, &ci_CMY_1, &ci_CMY_1, - }, - { - 2,3, - &ci_CMY_2, &ci_CMY_2, - &ci_CMY_2, &ci_CMY_2, - &ci_CMY_2, &ci_CMY_2, - }, -}; - -/* Ink set for printers using CMYK and CcMmYK printing, 1 or 2bit/pixel */ -static const canon_variable_inklist_t canon_ink_standardphoto[] = -{ - { - 1,4, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - }, - { - 2,4, - &ci_CMYK_2, &ci_CMYK_2, - &ci_CMYK_2, &ci_CMYK_2, - &ci_CMYK_2, &ci_CMYK_2, - }, - { - 1,6, - &ci_CcMmYK_1, &ci_CcMmYK_1, &ci_CcMmYK_1, - &ci_CcMmYK_1, &ci_CcMmYK_1, &ci_CcMmYK_1, - }, - { - 2,6, - &ci_CcMmYK_2, &ci_CcMmYK_2, &ci_CcMmYK_2, - &ci_CcMmYK_2, &ci_CcMmYK_2, &ci_CcMmYK_2, - }, - { - 1,7, - &ci_CcMmYK_1, &ci_CcMmYK_1, &ci_CcMmYK_1, - &ci_CcMmYK_1, &ci_CcMmYK_1, &ci_CcMmYK_1, - }, - { - 2,7, - &ci_CcMmYK_2, &ci_CcMmYK_2, &ci_CcMmYK_2, - &ci_CcMmYK_2, &ci_CcMmYK_2, &ci_CcMmYK_2, - }, -}; - -/* Ink set for printers using CMYK and CcMmYK printing, 1 or 3bit/pixel */ -static const canon_variable_inklist_t canon_ink_superphoto[] = -{ - { - 1,4, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - &ci_CMYK_1, &ci_CMYK_1, &ci_CMYK_1, - }, - { - 3,4, - &ci_CMYK_3, &ci_CMYK_3, &ci_CMYK_3, - &ci_CMYK_3, &ci_CMYK_3, &ci_CMYK_3, - }, - { - 3,6, - &ci_CcMmYK_3, &ci_CcMmYK_3, &ci_CcMmYK_3, - &ci_CcMmYK_3, &ci_CcMmYK_3, &ci_CcMmYK_3, - }, - { - 3,7, - &ci_CcMmYK_3, &ci_CcMmYK_3, &ci_CcMmYK_3, - &ci_CcMmYK_3, &ci_CcMmYK_3, &ci_CcMmYK_3, - }, -}; - - -static const char standard_sat_adjustment[] = -"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" -"<gutenprint>\n" -"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" -"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" -/* C */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* B */ -/* B */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* M */ -/* M */ "1.00 0.95 0.90 0.90 0.90 0.90 0.90 0.90 " /* R */ -/* R */ "0.90 0.95 0.95 1.00 1.00 1.00 1.00 1.00 " /* Y */ -/* Y */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* G */ -/* G */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* C */ -"</sequence>\n" -"</curve>\n" -"</gutenprint>\n"; - -static const char standard_lum_adjustment[] = -"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" -"<gutenprint>\n" -"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" -"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" -/* C */ "0.65 0.67 0.70 0.72 0.77 0.80 0.82 0.85 " /* B */ -/* B */ "0.87 0.86 0.82 0.79 0.79 0.82 0.85 0.88 " /* M */ -/* M */ "0.92 0.95 0.96 0.97 0.97 0.97 0.96 0.96 " /* R */ -/* R */ "0.96 0.97 0.97 0.98 0.99 1.00 1.00 1.00 " /* Y */ -/* Y */ "1.00 0.97 0.95 0.94 0.93 0.92 0.90 0.86 " /* G */ -/* G */ "0.79 0.76 0.71 0.68 0.68 0.68 0.68 0.66 " /* C */ -"</sequence>\n" -"</curve>\n" -"</gutenprint>\n"; - -static const char standard_hue_adjustment[] = -"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" -"<gutenprint>\n" -"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" -"<sequence count=\"48\" lower-bound=\"-6\" upper-bound=\"6\">\n" -/* C */ "0.00 0.06 0.10 0.10 0.06 -.01 -.09 -.17 " /* B */ -/* B */ "-.25 -.33 -.38 -.38 -.36 -.34 -.34 -.34 " /* M */ -/* M */ "-.34 -.34 -.36 -.40 -.50 -.40 -.30 -.20 " /* R */ -/* R */ "-.12 -.07 -.04 -.02 0.00 0.00 0.00 0.00 " /* Y */ -/* Y */ "0.00 0.00 0.00 -.05 -.10 -.15 -.22 -.24 " /* G */ -/* G */ "-.26 -.30 -.33 -.28 -.25 -.20 -.13 -.06 " /* C */ -"</sequence>\n" -"</curve>\n" -"</gutenprint>\n"; - -typedef enum { - COLOR_MONOCHROME = 1, - COLOR_CMY = 3, - COLOR_CMYK = 4, - COLOR_CCMMYK= 6, - COLOR_CCMMYYK= 7 -} colormode_t; - -typedef struct canon_caps { - int model; /* model number as used in printers.xml */ - int model_id; /* model ID code for use in commands */ - int max_width; /* maximum printable paper size */ - int max_height; - int base_res; /* base resolution - shall be 150 or 180 */ - int max_xdpi; /* maximum horizontal resolution */ - int max_ydpi; /* maximum vertical resolution */ - int max_quality; - int border_left; /* left margin, points */ - int border_right; /* right margin, points */ - int border_top; /* absolute top margin, points */ - int border_bottom; /* absolute bottom margin, points */ - int inks; /* installable cartridges (CANON_INK_*) */ - int slots; /* available paperslots */ - unsigned long features; /* special bjl settings */ -#ifdef EXPERIMENTAL_STUFF - const canon_variable_printmode_t *printmodes; - int printmodes_cnt; -#else - int dummy; - const canon_dot_size_t dot_sizes; /* Vector of dot sizes for resolutions */ - const canon_densities_t densities; /* List of densities for each printer */ - const canon_variable_inklist_t *inxs; /* Choices of inks for this printer */ - int inxs_cnt; /* number of ink definitions in inxs */ -#endif - const char *lum_adjustment; - const char *hue_adjustment; - const char *sat_adjustment; -} canon_cap_t; - -typedef struct __attribute__((__packed__)) { - unsigned char info; - unsigned char dummy; - unsigned char level; -} color_info_t; - -typedef struct -{ - const canon_cap_t *caps; - unsigned char *cols[7]; - int delay[7]; - int delay_max; - int buf_length; - int length; - int out_width; - int left; - int emptylines; - int bits; - int ydpi; - color_info_t color_info[9]; /* C,M,Y,K,c,m,y,k,? */ - int ncolors; /* number of colors to print with */ - int physical_xdpi, nozzle_ydpi, stepper_ydpi; - int nozzles; /* count of inkjets for one pass */ - int nozzle_separation; - int horizontal_passes; - int vertical_passes; - int vertical_oversample; - int *head_offset; - int last_pass_offset; - int bidirectional; /* tells us if we are allowed to print bidirectional */ - int direction; /* stores the last direction of the print head */ - -} canon_privdata_t; - -static void canon_write_line(stp_vars_t *v); - - -/* Codes for possible ink-tank combinations. - * Each combo is represented by the colors that can be used with - * the installed ink-tank(s) - * Combinations of the codes represent the combinations allowed for a model - * Note that only preferrable combinations should be used - */ -#define CANON_INK_K 1 -#define CANON_INK_CMY 2 -#define CANON_INK_CMYK 4 -#define CANON_INK_CcMmYK 8 -#define CANON_INK_CcMmYyK 16 - -#define CANON_INK_BLACK_MASK (CANON_INK_K|CANON_INK_CMYK|CANON_INK_CcMmYK) - -#define CANON_INK_PHOTO_MASK (CANON_INK_CcMmYK|CANON_INK_CcMmYyK) - -/* document feeding */ -#define CANON_SLOT_ASF1 1 -#define CANON_SLOT_ASF2 2 -#define CANON_SLOT_MAN1 4 -#define CANON_SLOT_MAN2 8 - /* model peculiarities */ -#define CANON_CAP_DMT 0x01ul /* Drop Modulation Technology */ #define CANON_CAP_MSB_FIRST 0x02ul /* how to send data */ #define CANON_CAP_a 0x04ul #define CANON_CAP_b 0x08ul @@ -831,12 +118,9 @@ static void canon_write_line(stp_vars_t *v); #define CANON_CAP_l 0x400ul #define CANON_CAP_r 0x800ul #define CANON_CAP_g 0x1000ul -#define CANON_CAP_ACKSHORT 0x2000ul +#define CANON_CAP_px 0x2000ul #define CANON_CAP_rr 0x4000ul -#define CANON_CAP_WEAVE 0x8000ul /* S200 has to be fed with weaved data */ - /* for Resolutions above 360dpi */ -#define CANON_CAP_extended_t 0x10000ul /* detailed level and bitdepth settings for every ink*/ -#define CANON_CAP_5pixelin1byte 0x20000ul /* 5 pixel with 3 levels in 1 byte compression */ +#define CANON_CAP_I 0x8000ul #define CANON_CAP_DUPLEX 0x40000ul #define CANON_CAP_STD0 (CANON_CAP_b|CANON_CAP_c|CANON_CAP_d|\ @@ -845,623 +129,68 @@ static void canon_write_line(stp_vars_t *v); #define CANON_CAP_STD1 (CANON_CAP_b|CANON_CAP_c|CANON_CAP_d|CANON_CAP_l|\ CANON_CAP_m|CANON_CAP_p|CANON_CAP_q|CANON_CAP_t) -#ifdef EXPERIMENTAL_STUFF -#define CANON_MODES(A) A,sizeof(A)/sizeof(canon_variable_printmode_t*) -#else -#define CANON_MODES(A) 0 -#endif - -#define CANON_INK(A) A,sizeof(A)/sizeof(canon_variable_inklist_t) - - -#ifdef EXPERIMENTAL_STUFF - -#define BC_10 CANON_INK_K /* b/w */ -#define BC_11 CANON_INK_CMYK /* color */ -#define BC_12 CANON_INK_CMYK /* photo */ -#define BC_20 CANON_INK_K /* b/w */ -#define BC_21 CANON_INK_CMYK /* color */ -#define BC_22 CANON_INK_CMYK /* photo */ -#define BC_29 0 /* neon! */ -#define BC_3031 CANON_INK_CMYK /* color */ -#define BC_3231 CANON_INK_CcMmYK /* photo */ - - -static const canon_variable_printmode_t canon_nomodes[] = -{ - {0,0,0,0,0,0,0,0,0,0} -}; - -static const canon_variable_printmode_t canon_modes_30[] = { - { 180, 180, 1, BC_10, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 1, BC_10, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 720, 360, 1, BC_10, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, -}; - -static const canon_variable_printmode_t canon_modes_85[] = { - { 360, 360, 1, BC_10, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 1, BC_11, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 2, BC_11, 2, 1.0, 1.0, &ci_CMYK_2, 0,0,0 }, - { 360, 360, 1, BC_21, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 2, BC_21, 2, 1.0, 1.0, &ci_CMYK_2, 0,0,0 }, -}; - -static const canon_variable_printmode_t canon_modes_2x00[] = { - { 360, 360, 1, BC_20, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 1, BC_21, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 1, BC_22, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, -}; - -static const canon_variable_printmode_t canon_modes_6x00[] = { - { 360, 360, 1, BC_3031, 2, 1.8, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 2, BC_3031, 2, 1.8, 1.0, &ci_CMYK_2, 0,0,0 }, - { 720, 720, 1, BC_3031, 2, 1.0, 1.0, &ci_CMYK_1, 0,0,0 }, - { 1440, 720, 1, BC_3031, 2, 0.5, 1.0, &ci_CMYK_1, 0,0,0 }, - { 360, 360, 1, BC_3231, 2, 1.8, 1.0, &ci_CcMmYK_1, 0,0,0 }, - { 360, 360, 2, BC_3231, 2, 1.8, 1.0, &ci_CcMmYK_2, 0,0,0 }, - { 720, 720, 1, BC_3231, 2, 1.0, 1.0, &ci_CcMmYK_1, 0,0,0 }, - { 1440, 720, 1, BC_3231, 2, 0.5, 1.0, &ci_CcMmYK_1, 0,0,0 }, -}; -#endif - -static const canon_cap_t canon_model_capabilities[] = -{ - /* default settings for unknown models */ - - { -1, 17*72/2,842,180,180,20,20,20,20, CANON_INK_K, CANON_SLOT_ASF1, 0 }, - - /* ******************************** */ - /* */ - /* tested and color-adjusted models */ - /* */ - /* ******************************** */ - - - - - /* ************************************ */ - /* */ - /* tested models w/out color-adjustment */ - /* */ - /* ************************************ */ - - { /* Canon S200x *//* heads: BC-24 */ - 4202, 3, - 618, 936, /* 8.58" x 13 " */ - 180, 2880, 2880, 4, - 10, 10, 9, 20, - CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, - CANON_SLOT_ASF1, - CANON_CAP_STD1 | CANON_CAP_rr | CANON_CAP_WEAVE, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF -/* 2880dpi Resolutions: TBD */ -/* 180x180 360x360 720x720 1440x720 1440x1440 2880x2880 */ - {-1, 0, 0, 0, 0, -1}, -/*------- 360x360 720x720 1440x720 1440x1440 ---------*/ - { 1, 2, 1, 0.5, 0.3, 0.2}, - CANON_INK(canon_ink_standard), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJ 30 *//* heads: BC-10 */ - 30, 1, - 9.5*72, 14*72, - 90, 360, 360, 2, - 11, 9, 10, 18, - CANON_INK_K, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a, - CANON_MODES(canon_modes_30), -#ifndef EXPERIMENTAL_STUFF - {-1,0,0,0,-1,-1}, /*090x090 180x180 360x360 720x360 720x720 1440x1440*/ - {1,1,1,1,1,1}, /*------- 180x180 360x360 720x360 ------- ---------*/ - CANON_INK(canon_ink_standard), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 85 *//* heads: BC-20 BC-21 BC-22 */ - 85, 1, - 9.5*72, 14*72, - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_DMT, - CANON_MODES(canon_modes_85), -#ifndef EXPERIMENTAL_STUFF - {-1,-1,1,0,-1,-1},/*090x090 180x180 360x360 720x360 720x720 1440x1440*/ - {1,1,1,1,1,1}, /*------- ------- 360x360 720x360 ------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, +#include "canon-inks.h" +#include "canon-modes.h" +#include "canon-media.h" +#include "canon-printers.h" - { /* Canon BJC 4300 *//* heads: BC-20 BC-21 BC-22 BC-29 */ - 4300, 1, - 618, 936, /* 8.58" x 13 " */ - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD0 | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 4400 *//* heads: BC-20 BC-21 BC-22 BC-29 */ - 4400, 1, - 9.5*72, 14*72, - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,-1,0,0,-1,-1},/*090x090 180x180 360x360 720x360 720x720 1440x1440*/ - {1,1,1,1,1,1}, /*------- ------- 360x360 720x360 ------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 6000 *//* heads: BC-30/BC-31 BC-32/BC-31 */ - 6000, 3, - 618, 936, /* 8.58" x 13 " */ - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD1 | CANON_CAP_DMT | CANON_CAP_ACKSHORT, - CANON_MODES(canon_modes_6x00), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1.8,1,0.5,1,1},/*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 6200 *//* heads: BC-30/BC-31 BC-32/BC-31 */ - 6200, 3, - 618, 936, /* 8.58" x 13 " */ - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD1 | CANON_CAP_DMT | CANON_CAP_ACKSHORT, - CANON_MODES(canon_modes_6x00), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {0,1.8,1,.5,0,0}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ - 6500, 3, - 842, 17*72, - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD1 | CANON_CAP_DMT, - CANON_MODES(canon_modes_6x00), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {0,1.8,1,.5,0,0}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - { /* Canon BJC 8200 *//* heads: BC-50 */ - 8200, 3, - 842, 17*72, - 150, 1200,1200, 4, - 11, 9, 10, 18, - CANON_INK_CMYK, /* | CANON_INK_CcMmYK */ - CANON_SLOT_ASF1, - CANON_CAP_STD1 | CANON_CAP_r | CANON_CAP_DMT | CANON_CAP_ACKSHORT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,0,0,-1,0,-1}, /*150x150 300x300 600x600 1200x600 1200x1200 2400x2400*/ - {1,1,1,1,1,1}, /*------- 300x300 600x600 -------- 1200x1200 ---------*/ - CANON_INK(canon_ink_superphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - - /* *************** */ - /* */ - /* untested models */ - /* */ - /* *************** */ - - - { /* Canon BJC 210 *//* heads: BC-02 BC-05 BC-06 */ - 210, 1, - 618, 936, /* 8.58" x 13 " */ - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMY, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD0, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,0,0,-1,-1},/*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_standard), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 240 *//* heads: BC-02 BC-05 BC-06 */ - 240, 1, - 618, 936, /* 8.58" x 13 " */ - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMY, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD0 | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,1,0,-1,-1},/*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_oldphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 250 *//* heads: BC-02 BC-05 BC-06 */ - 250, 1, - 618, 936, /* 8.58" x 13 " */ - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMY, - CANON_SLOT_ASF1 | CANON_SLOT_MAN1, - CANON_CAP_STD0 | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,1,0,-1,-1},/*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_oldphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 1000 *//* heads: BC-02 BC-05 BC-06 */ - 1000, 1, - 842, 17*72, - 90, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_K | CANON_INK_CMY, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_DMT | CANON_CAP_a, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,1,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_oldphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 2000 *//* heads: BC-20 BC-21 BC-22 BC-29 */ - 2000, 1, - 842, 17*72, - 180, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_CMYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,-1,-1,-1,-1},/*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_standard), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 3000 *//* heads: BC-30 BC-33 BC-34 */ - 3000, 3, - 842, 17*72, - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_DMT, /*FIX? should have _r? */ - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 6100 *//* heads: BC-30/BC-31 BC-32/BC-31 */ - 6100, 3, - 842, 17*72, - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD1 | CANON_CAP_a | CANON_CAP_r | CANON_CAP_DMT, - CANON_MODES(canon_modes_6x00), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 7000 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ - 7000, 3, - 842, 17*72, - 150, 1200, 600, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYyK, - CANON_SLOT_ASF1, - CANON_CAP_STD1, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,0,0,0,-1,-1}, /*150x150 300x300 600x600 1200x600 1200x1200 2400x2400*/ - {1,3.5,1.8,1,1,1},/*------- 300x300 600x600 1200x600 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 7100 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ - 7100, 3, - 842, 17*72, - 150, 1200, 600, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYyK, - CANON_SLOT_ASF1, - CANON_CAP_STD0, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,0,0,0,-1,-1}, /*150x150 300x300 600x600 1200x600 1200x1200 2400x2400*/ - {1,1,1,1,1,1}, /*------- 300x300 600x600 1200x600 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - - /*****************************/ - /* */ - /* extremely fuzzy models */ - /* (might never work at all) */ - /* */ - /*****************************/ - - { /* Canon BJC 5100 *//* heads: BC-20 BC-21 BC-22 BC-23 BC-29 */ - 5100, 1, - 17*72, 22*72, - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 5500 *//* heads: BC-20 BC-21 BC-29 */ - 5500, 1, - 22*72, 34*72, - 180, 720, 360, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0 | CANON_CAP_a, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {0,0,-1,-1,-1,-1},/*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*180x180 360x360 ------- -------- --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ - 6500, 3, - 17*72, 22*72, - 180, 1440, 720, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD1 | CANON_CAP_a | CANON_CAP_DMT, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,1,0,0,-1,-1}, /*180x180 360x360 720x720 1440x720 1440x1440 2880x2880*/ - {1,1,1,1,1,1}, /*------- 360x360 720x720 1440x720 --------- ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon BJC 8500 *//* heads: BC-80/BC-81 BC-82/BC-81 */ - 8500, 3, - 17*72, 22*72, - 150, 1200,1200, 2, - 11, 9, 10, 18, - CANON_INK_CMYK | CANON_INK_CcMmYK, - CANON_SLOT_ASF1, - CANON_CAP_STD0, - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,0,0,-1,0,-1}, /*150x150 300x300 600x600 1200x600 1200x1200 2400x2400*/ - {1,1,1,1,1,1}, /*------- 300x300 600x600 -------- 1200x1200 ---------*/ - CANON_INK(canon_ink_standardphoto), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, - { /* Canon PIXMA iP4000 */ - 4000, 3, /*model, model_id*/ - 842, 17*72, /* max paper width and height */ - 150, 600, 600, 2, /*base resolution,max_xdpi,max_ydpi,max_quality */ - 11, 9, 10, 18, /*border_left, border_right, border_top, border_bottom */ - CANON_INK_CMYK /*| CANON_INK_CcMmYyK*/, /*canon inks */ - CANON_SLOT_ASF1, /*paper slot */ - CANON_CAP_STD0|CANON_CAP_extended_t|CANON_CAP_5pixelin1byte|CANON_CAP_DUPLEX, /*features */ - CANON_MODES(canon_nomodes), -#ifndef EXPERIMENTAL_STUFF - {-1,-1,0,-1,-1,-1}, /*150x150 300x300 600x600 1200x600 1200x1200 2400x2400*/ - {1,1,1,1,1,1}, /*------- 300x300 600x600 1200x600 --------- ---------*/ - CANON_INK(canon_ink_standard_pixma), -#endif - standard_lum_adjustment, - standard_hue_adjustment, - standard_sat_adjustment - }, -}; typedef struct { - int x; - int y; - const char *name; - const char *text; - const char *name_dmt; - const char *text_dmt; -} canon_res_t; - -static const canon_res_t canon_resolutions[] = { - { 90, 90, "90x90dpi", N_("90x90 DPI"), "90x90dmt", N_("90x90 DPI DMT") }, - { 180, 180, "180x180dpi", N_("180x180 DPI"), "180x180dmt", N_("180x180 DPI DMT") }, - { 360, 360, "360x360dpi", N_("360x360 DPI"), "360x360dmt", N_("360x360 DPI DMT") }, - { 720, 360, "720x360dpi", N_("720x360 DPI"), "720x360dmt", N_("720x360 DPI DMT") }, - { 720, 720, "720x720dpi", N_("720x720 DPI"), "720x720dmt", N_("720x720 DPI DMT") }, - { 1440, 720, "1440x720dpi", N_("1440x720 DPI"), "1440x720dmt", N_("1440x720 DPI DMT") }, - { 1440, 1440, "1440x1440dpi", N_("1440x1440 DPI"), "1440x1440dmt", N_("1440x1440 DPI DMT") }, - { 2880, 2880, "2880x2880dpi", N_("2880x2880 DPI"), "2880x2880dmt", N_("2880x2880 DPI DMT") }, - { 150, 150, "150x150dpi", N_("150x150 DPI"), "150x150dmt", N_("150x150 DPI DMT") }, - { 300, 300, "300x300dpi", N_("300x300 DPI"), "300x300dmt", N_("300x300 DPI DMT") }, - { 600, 300, "600x300dpi", N_("600x300 DPI"), "600x300dmt", N_("600x300 DPI DMT") }, - { 600, 600, "600x600dpi", N_("600x600 DPI"), "600x600dmt", N_("600x600 DPI DMT") }, - { 1200, 600, "1200x600dpi", N_("1200x600 DPI"), "1200x600dmt", N_("1200x600 DPI DMT") }, - { 1200, 1200, "1200x1200dpi", N_("1200x1200 DPI"), "1200x1200dmt", N_("1200x1200 DPI DMT") }, - { 2400, 2400, "2400x2400dpi", N_("2400x2400 DPI"), "2400x2400dmt", N_("2400x2400 DPI DMT") }, - { 0, 0, NULL, NULL, NULL, NULL } -}; + char name; + const canon_ink_t* props; + unsigned char* buf; + unsigned char* comp_buf_offset; + unsigned int buf_length; + unsigned int delay; +} canon_channel_t; -static const char plain_paper_lum_adjustment[] = -"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" -"<gutenprint>\n" -"<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n" -"<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n" -"1.20 1.22 1.28 1.34 1.39 1.42 1.45 1.48 " /* C */ -"1.50 1.40 1.30 1.25 1.20 1.10 1.05 1.05 " /* B */ -"1.05 1.05 1.05 1.05 1.05 1.05 1.05 1.05 " /* M */ -"1.05 1.05 1.05 1.10 1.10 1.10 1.10 1.10 " /* R */ -"1.10 1.15 1.30 1.45 1.60 1.75 1.90 2.00 " /* Y */ -"2.10 2.00 1.80 1.70 1.60 1.50 1.40 1.30 " /* G */ -"</sequence>\n" -"</curve>\n" -"</gutenprint>\n"; -typedef struct { - const char *name; - const char *text; - int media_code; - double base_density; - double k_lower_scale; - double k_upper; - const char *hue_adjustment; - const char *lum_adjustment; - const char *sat_adjustment; -} paper_t; -typedef struct { +typedef struct +{ + const canon_mode_t* mode; + const canon_slot_t* slot; + const canon_paper_t *pt; + unsigned int used_inks; + int num_channels; + canon_channel_t* channels; + char* channel_order; const canon_cap_t *caps; - int printing_color; - int is_first_page; - const paper_t *pt; - int print_head; - int colormode; - const char *source_str; - const char *duplex_str; - int xdpi; - int ydpi; + unsigned char *comp_buf; + unsigned char *fold_buf; + int delay_max; + int buf_length_max; + int length; + int out_width; + int out_height; int page_width; int page_height; int top; int left; - int bits; - color_info_t color_info[9]; /* C,M,Y,K,c,m,y,k,? */ -} canon_init_t; - -static const paper_t canon_paper_list[] = { - { "Plain", N_ ("Plain Paper"), 0x00, 0.50, 0.25, 0.500, 0, 0, 0 }, - { "PlainPIXMA", N_ ("Plain Paper PIXMA"), 0x00, 0.78, 0.25, 0.500, 0, 0, 0 }, - { "Transparency", N_ ("Transparencies"), 0x02, 1.00, 1.00, 0.900, 0, 0, 0 }, - { "BackPrint", N_ ("Back Print Film"), 0x03, 1.00, 1.00, 0.900, 0, 0, 0 }, - { "Fabric", N_ ("Fabric Sheets"), 0x04, 0.50, 0.25, 0.500, 0, 0, 0 }, - { "Envelope", N_ ("Envelope"), 0x08, 0.50, 0.25, 0.500, 0, 0, 0 }, - { "Coated", N_ ("High Resolution Paper"), 0x07, 0.78, 0.25, 0.500, 0, 0, 0 }, - { "TShirt", N_ ("T-Shirt Transfers"), 0x03, 0.50, 0.25, 0.500, 0, 0, 0 }, - { "GlossyFilm", N_ ("High Gloss Film"), 0x06, 1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05, 1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyCard", N_ ("Glossy Photo Cards"), 0x0a, 1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyPro", N_ ("Photo Paper Pro"), 0x09, 1.00, 1.00, 0.999, 0, 0, 0 }, - { "Other", N_ ("Other"), 0x00, 0.50, 0.25, .5, 0, 0, 0 }, -}; + int emptylines; + int ncolors; /* number of colors to print with */ + int physical_xdpi, nozzle_ydpi, stepper_ydpi; + int nozzles; /* count of inkjets for one pass */ + int nozzle_separation; + int horizontal_passes; + int vertical_passes; + int vertical_oversample; + int *head_offset; + int last_pass_offset; + int bidirectional; /* tells us if we are allowed to print bidirectional */ + int direction; /* stores the last direction of the print head */ + int weave_bits[4]; + const char *duplex_str; + int is_first_page; + double cd_inner_radius; + double cd_outer_radius; +} canon_privdata_t; + +static void canon_write_line(stp_vars_t *v); -static const int paper_type_count = sizeof(canon_paper_list) / sizeof(paper_t); static void canon_advance_paper(stp_vars_t *, int); static void canon_flush_pass(stp_vars_t *, int, int); +static void canon_write_multiraster(stp_vars_t *v,canon_privdata_t* pd,int y); static const stp_parameter_t the_parameters[] = { @@ -1484,6 +213,36 @@ static const stp_parameter_t the_parameters[] = STP_PARAMETER_LEVEL_BASIC, 1, 1, -1, 1, 0 }, { + "CDInnerRadius", N_("CD Hub Size"), N_("Basic Printer Setup"), + N_("Print only outside of the hub of the CD, or all the way to the hole"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, -1, 1, 0 + }, + { + "CDOuterDiameter", N_("CD Size (Custom)"), N_("Basic Printer Setup"), + N_("Variable adjustment for the outer diameter of CD"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { + "CDInnerDiameter", N_("CD Hub Size (Custom)"), N_("Basic Printer Setup"), + N_("Variable adjustment to the inner hub of the CD"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { + "CDXAdjustment", N_("CD Horizontal Fine Adjustment"), N_("Advanced Printer Setup"), + N_("Fine adjustment to horizontal position for CD printing"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { + "CDYAdjustment", N_("CD Vertical Fine Adjustment"), N_("Advanced Printer Setup"), + N_("Fine adjustment to horizontal position for CD printing"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { "Resolution", N_("Resolution"), N_("Basic Printer Setup"), N_("Resolution and quality of the print"), STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, @@ -1512,7 +271,7 @@ static const stp_parameter_t the_parameters[] = N_("Duplex/Tumble Setting"), STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, -1, 1, 0 - } + }, }; static const int the_parameter_count = @@ -1595,32 +354,30 @@ sizeof(float_parameters) / sizeof(const float_param_t); * Duplex support - modes available * Note that the internal names MUST match those in cups/genppd.c else the * PPD files will not be generated correctly - * - * TODO: Support for DuplexNoTumble, the image has to be rotated */ static const stp_param_string_t duplex_types[] = { { "None", N_ ("Off") }, -/* { "DuplexNoTumble", N_ ("Long Edge (Standard)") } , */ + { "DuplexNoTumble", N_ ("Long Edge (Standard)") }, { "DuplexTumble", N_ ("Short Edge (Flip)") } }; #define NUM_DUPLEX (sizeof (duplex_types) / sizeof (stp_param_string_t)) -static const paper_t * -get_media_type(const char *name) +static const canon_paper_t * +get_media_type(const canon_cap_t* caps,const char *name) { int i; - if (name) - for (i = 0; i < paper_type_count; i++) + if (name && caps->paperlist) + for (i = 0; i < caps->paperlist->count; i++) { /* translate paper_t.name */ - if (!strcmp(name, canon_paper_list[i].name)) - return &(canon_paper_list[i]); + if (!strcmp(name, caps->paperlist->papers[i].name)) + return &(caps->paperlist->papers[i]); } - return NULL; + return &(caps->paperlist->papers[0]); } @@ -1637,69 +394,81 @@ static const canon_cap_t * canon_get_model_capabilities(int model) return &(canon_model_capabilities[0]); } -static int +static const canon_slot_t * canon_source_type(const char *name, const canon_cap_t * caps) { - /* used internally: do not translate */ - if (name) - { - if (!strcmp(name,"Auto")) return 4; - if (!strcmp(name,"Manual")) return 0; - if (!strcmp(name,"ManualNP")) return 1; - if (!strcmp(name,"Cassette")) return 8; - if (!strcmp(name,"CD")) return 10; + if(name){ + int i; + for(i=0; i<caps->slotlist->count; i++){ + if( !strcmp(name,caps->slotlist->slots[i].name)) + return &(caps->slotlist->slots[i]); + } } - - stp_deprintf(STP_DBG_CANON,"canon: Unknown source type '%s' - reverting to auto\n",name); - return 4; + return &(caps->slotlist->slots[0]); } -static int -canon_printhead_type(const char *name, const canon_cap_t * caps) -{ - /* used internally: do not translate */ - if (name) - { - if (!strcmp(name,"Gray")) return 0; - if (!strcmp(name,"RGB")) return 1; - if (!strcmp(name,"CMYK")) return 2; - if (!strcmp(name,"PhotoCMY")) return 3; - if (!strcmp(name,"Photo")) return 4; - if (!strcmp(name,"PhotoCMYK")) return 5; + +/* function returns the current set printmode (specified by resolution) */ +/* if no mode is set the default mode will be returned */ +static const canon_mode_t* canon_get_current_mode(const stp_vars_t *v){ + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + const char *resolution = stp_get_string_parameter(v, "Resolution"); + const canon_cap_t * caps = canon_get_model_capabilities(stp_get_model_id(v)); + const canon_mode_t* mode = NULL; + int i; + if(resolution){ + for(i=0;i<caps->modelist->count;i++){ + if(!strcmp(resolution,caps->modelist->modes[i].name)){ + mode = &caps->modelist->modes[i]; + break; + } + } } - if (name && *name == 0) { - if (caps->inks & CANON_INK_CMYK) return 2; - if (caps->inks & CANON_INK_CMY) return 1; - if (caps->inks & CANON_INK_K) return 0; - } + if(!mode) + mode = &caps->modelist->modes[caps->modelist->default_mode]; - stp_deprintf(STP_DBG_CANON,"canon: Unknown head combo '%s' - reverting to black\n",name); - return 0; +#if 0 + /* only some modes can print to cd */ + if(input_slot && !strcmp(input_slot,"CD") && !(mode->flags & MODE_FLAG_CD)){ + for(i=0;i<caps->modelist->count;i++){ + if(caps->modelist->modes[i].flags & MODE_FLAG_CD){ + mode = &caps->modelist->modes[i]; + break; + } + } + } +#endif + + + + + + return mode; } -static colormode_t -canon_printhead_colors(const char *name, const canon_cap_t * caps) +/* function returns the best ink_type for the current mode */ +static unsigned int +canon_printhead_colors(const stp_vars_t*v) { - /* used internally: do not translate */ - if (name) - { - if (!strcmp(name,"Gray")) return COLOR_MONOCHROME; - if (!strcmp(name,"RGB")) return COLOR_CMY; - if (!strcmp(name,"CMYK")) return COLOR_CMYK; - if (!strcmp(name,"PhotoCMY")) return COLOR_CCMMYK; - if (!strcmp(name,"PhotoCMYK")) return COLOR_CCMMYYK; - } + int i; + const canon_mode_t* mode; + const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); + const char *ink_type = stp_get_string_parameter(v, "InkType"); + if(print_mode && strcmp(print_mode, "BW") == 0) + return CANON_INK_K; - if (caps->inks & CANON_INK_CcMmYyK) - return COLOR_CCMMYYK; - else if (caps->inks & CANON_INK_CcMmYK) - return COLOR_CCMMYK; - else if (caps->inks & CANON_INK_CMYK) - return COLOR_CMYK; - else if (caps->inks & CANON_INK_CMY) - return COLOR_CMY; - else - return COLOR_MONOCHROME; + if(ink_type){ + for(i=0;i<sizeof(canon_inktypes)/sizeof(canon_inktypes[0]);i++){ + if(ink_type && !strcmp(canon_inktypes[i].name,ink_type)) + return canon_inktypes[i].ink_type; + } + } + mode = canon_get_current_mode(v); + for(i=0;i<sizeof(canon_inktypes)/sizeof(canon_inktypes[0]);i++){ + if(mode->ink_types & canon_inktypes[i].ink_type) + return canon_inktypes[i].ink_type; + } + return CANON_INK_K; } static unsigned char @@ -1732,199 +501,26 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) return 0; } -#ifndef EXPERIMENTAL_STUFF -static int canon_res_code(const canon_cap_t * caps, int xdpi, int ydpi) -{ - int x, y, res= 0; - - for (x=1; x<6; x++) if ((xdpi/caps->base_res) == (1<<(x-1))) res= (x<<4); - for (y=1; y<6; y++) if ((ydpi/caps->base_res) == (1<<(y-1))) res|= y; - - return res; -} -#else -static const canon_variable_printmode_t *canon_printmode(const canon_cap_t * caps, - int xdpi, int ydpi, - int bpp, int head) -{ - const canon_variable_printmode_t *modes; - int modes_cnt; - int i; - if (!caps) return 0; - modes= caps->printmodes; - modes_cnt= caps->printmodes_cnt; - /* search for the right printmode: */ - for (i=0; i<modes_cnt; i++) { - if ((modes[i].xdpi== xdpi) && (modes[i].ydpi== ydpi) && - (modes[i].bits== bpp) && (modes[i].printhead== head)) - { - return &(modes[i]); - } - } - /* nothing found -> either return 0 or apply some policy to - * get a fallback printmode - */ - if (modes[0].xdpi) return modes; - return 0; -} -#endif - -static int -canon_ink_type(const canon_cap_t * caps, int res_code) -{ -#ifndef EXPERIMENTAL_STUFF - switch (res_code) - { - case 0x11: return caps->dot_sizes.dot_r11; - case 0x22: return caps->dot_sizes.dot_r22; - case 0x33: return caps->dot_sizes.dot_r33; - case 0x43: return caps->dot_sizes.dot_r43; - case 0x44: return caps->dot_sizes.dot_r44; - case 0x55: return caps->dot_sizes.dot_r55; - } - return -1; -#else - return -1; -#endif -} - -static const char * -canon_lum_adjustment(int model) -{ - const canon_cap_t * caps= canon_get_model_capabilities(model); - return (caps->lum_adjustment); -} - -static const char * -canon_hue_adjustment(int model) -{ - const canon_cap_t * caps= canon_get_model_capabilities(model); - return (caps->hue_adjustment); -} - -static const char * -canon_sat_adjustment(int model) -{ - const canon_cap_t * caps= canon_get_model_capabilities(model); - return (caps->sat_adjustment); -} - -static double -canon_density(const canon_cap_t * caps, int res_code) -{ -#ifndef EXPERIMENTAL_STUFF - switch (res_code) - { - case 0x11: return caps->densities.d_r11; - case 0x22: return caps->densities.d_r22; - case 0x33: return caps->densities.d_r33; - case 0x43: return caps->densities.d_r43; - case 0x44: return caps->densities.d_r44; - case 0x55: return caps->densities.d_r55; - default: - stp_deprintf(STP_DBG_CANON,"no such res_code 0x%x in density of model %d\n", - res_code,caps->model); - return 0.2; - } -#else - return 0.2; -#endif -} - -static const canon_variable_inkset_t * -canon_inks(const canon_cap_t * caps, int res_code, int colors, int bits) -{ -#ifndef EXPERIMENTAL_STUFF - const canon_variable_inklist_t *inks = caps->inxs; - int i; - - if (!inks) - return NULL; - - for (i=0; i<caps->inxs_cnt; i++) { - stp_deprintf(STP_DBG_CANON,"hmm, trying ink for resolution code " - "%x, %d bits, %d colors\n",res_code,inks[i].bits,inks[i].colors); - if ((inks[i].bits==bits) && (inks[i].colors==colors)) { - stp_deprintf(STP_DBG_CANON,"wow, found ink for resolution code " - "%x, %d bits, %d colors\n",res_code,bits,colors); - switch (res_code) - { - case 0x11: return inks[i].r11; - case 0x22: return inks[i].r22; - case 0x33: return inks[i].r33; - case 0x43: return inks[i].r43; - case 0x44: return inks[i].r44; - case 0x55: return inks[i].r55; - } - } - } - stp_deprintf(STP_DBG_CANON,"ooo, found no ink for resolution code " - "%x, %d bits, %d colors in all %d defs!\n", - res_code,bits,colors,caps->inxs_cnt); - return NULL; -#else - return NULL; -#endif -} - static void canon_describe_resolution(const stp_vars_t *v, int *x, int *y) { - const char *resolution = stp_get_string_parameter(v, "Resolution"); - const canon_res_t *res = canon_resolutions; - while (res->x > 0) - { - if (strcmp(resolution, res->name) == 0 || - strcmp(resolution, res->name_dmt) == 0) - { - *x = res->x; - *y = res->y; - return; - } - res++; - } - *x = -1; - *y = -1; + const canon_mode_t* mode = canon_get_current_mode(v); + *x = mode->xdpi; + *y = mode->ydpi; } static const char * canon_describe_output(const stp_vars_t *v) { - int model = stp_get_model_id(v); - const canon_cap_t *caps = canon_get_model_capabilities(model); - const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); - const char *ink_type = stp_get_string_parameter(v, "InkType"); - colormode_t colormode = canon_printhead_colors(ink_type,caps); - int printhead= canon_printhead_type(ink_type,caps); + unsigned int ink_type = canon_printhead_colors(v); - if ((print_mode && strcmp(print_mode, "BW") == 0) || - printhead == 0 || caps->inks == CANON_INK_K) - colormode = COLOR_MONOCHROME; - - switch (colormode) - { - case COLOR_CMY: - return "CMY"; - case COLOR_CMYK: - case COLOR_CCMMYK: - case COLOR_CCMMYYK: - return "CMYK"; - case COLOR_MONOCHROME: - default: - return "Grayscale"; - } + if(ink_type & CANON_INK_CMYK_MASK) + return "CMYK"; + if(ink_type & CANON_INK_CMY_MASK) + return "CMY"; + return "Grayscale"; } -static const stp_param_string_t media_sources[] = - { - { "Auto", N_ ("Auto Sheet Feeder") }, - { "Manual", N_ ("Manual with Pause") }, - { "ManualNP", N_ ("Manual without Pause") }, - { "Cassette", N_ ("Cassette") }, - { "CD", N_ ("CD tray") } - }; - - /* * 'canon_parameters()' - Return the parameter values for the given parameter. */ @@ -1957,21 +553,14 @@ canon_parameters(const stp_vars_t *v, const char *name, for (i = 0; i < float_parameter_count; i++) if (strcmp(name, float_parameters[i].param.name) == 0) { - const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); - const char *ink_type = stp_get_string_parameter(v, "InkType"); - colormode_t colormode = canon_printhead_colors(ink_type,caps); - int printhead= canon_printhead_type(ink_type,caps); - - if ((print_mode && strcmp(print_mode, "BW") == 0) || - printhead == 0 || caps->inks == CANON_INK_K) - colormode = COLOR_MONOCHROME; + unsigned int ink_type = canon_printhead_colors(v); stp_fill_parameter_settings(description, &(float_parameters[i].param)); description->deflt.dbl = float_parameters[i].defval; description->bounds.dbl.upper = float_parameters[i].max; description->bounds.dbl.lower = float_parameters[i].min; - if (colormode != COLOR_MONOCHROME || !float_parameters[i].color_only) + if (ink_type != CANON_INK_K || !float_parameters[i].color_only) description->is_active = 1; else description->is_active = 0; @@ -1985,101 +574,135 @@ canon_parameters(const stp_vars_t *v, const char *name, break; } if (strcmp(name, "PageSize") == 0) - { - int height_limit, width_limit; - int papersizes = stp_known_papersizes(); - description->bounds.str = stp_string_list_create(); - - width_limit = caps->max_width; - height_limit = caps->max_height; - - for (i = 0; i < papersizes; i++) { - const stp_papersize_t *pt = stp_get_papersize_by_index(i); - if (strlen(pt->name) > 0 && - pt->width <= width_limit && pt->height <= height_limit) - { - if (stp_string_list_count(description->bounds.str) == 0) - description->deflt.str = pt->name; - stp_string_list_add_string(description->bounds.str, + { + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + int height_limit, width_limit; + int papersizes = stp_known_papersizes(); + description->bounds.str = stp_string_list_create(); + + width_limit = caps->max_width; + height_limit = caps->max_height; + + if(input_slot && !strcmp(input_slot,"CD")){ + stp_string_list_add_string + (description->bounds.str, "CD5Inch", _("CD - 5 inch")); + stp_string_list_add_string + (description->bounds.str, "CD3Inch", _("CD - 3 inch")); + stp_string_list_add_string + (description->bounds.str, "CDCustom", _("CD - Custom")); + }else{ + for (i = 0; i < papersizes; i++) { + const stp_papersize_t *pt = stp_get_papersize_by_index(i); + if (strlen(pt->name) > 0 && + pt->width <= width_limit && pt->height <= height_limit){ + stp_string_list_add_string(description->bounds.str, pt->name, gettext(pt->text)); + } + } + } + description->deflt.str = + stp_string_list_param(description->bounds.str, 0)->name; + } + else if (strcmp(name, "CDInnerRadius") == 0 ) + { + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + description->bounds.str = stp_string_list_create(); + if (input_slot && !strcmp(input_slot,"CD") && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") != 0)) + { + stp_string_list_add_string + (description->bounds.str, "None", _("Normal")); + stp_string_list_add_string + (description->bounds.str, "Small", _("Print To Hub")); + description->deflt.str = + stp_string_list_param(description->bounds.str, 0)->name; } + else + description->is_active = 0; + } + else if (strcmp(name, "CDInnerDiameter") == 0 ) + { + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + description->bounds.dimension.lower = 16 * 10 * 72 / 254; + description->bounds.dimension.upper = 43 * 10 * 72 / 254; + description->deflt.dimension = 43 * 10 * 72 / 254; + if (input_slot && !strcmp(input_slot,"CD") && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") == 0)) + description->is_active = 1; + else + description->is_active = 0; + } + else if (strcmp(name, "CDOuterDiameter") == 0 ) + { + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + description->bounds.dimension.lower = 65 * 10 * 72 / 254; + description->bounds.dimension.upper = 120 * 10 * 72 / 254; + description->deflt.dimension = 329; + if (input_slot && !strcmp(input_slot,"CD") && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") == 0)) + description->is_active = 1; + else + description->is_active = 0; + } + else if (strcmp(name, "CDXAdjustment") == 0 || + strcmp(name, "CDYAdjustment") == 0) + { + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + description->bounds.dimension.lower = -15; + description->bounds.dimension.upper = 15; + description->deflt.dimension = 0; + if (input_slot && !strcmp(input_slot,"CD")) + description->is_active = 1; + else + description->is_active = 0; } - } else if (strcmp(name, "Resolution") == 0) { - int x,y; - int t; + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); description->bounds.str= stp_string_list_create(); description->deflt.str = NULL; + for(i=0;i<caps->modelist->count;i++){ +#if 0 + if(!(input_slot && !strcmp(input_slot,"CD") && !(caps->modelist->modes[i].flags & MODE_FLAG_CD))) +#endif + stp_string_list_add_string(description->bounds.str, + caps->modelist->modes[i].name, gettext(caps->modelist->modes[i].text)); + stp_deprintf(STP_DBG_CANON,"supports mode '%s'\n", + caps->modelist->modes[i].name); + if(i == caps->modelist->default_mode) + description->deflt.str=caps->modelist->modes[i].name; + - for (x=1; x<6; x++) { - for (y=x-1; y<x+1; y++) { - if ((t= canon_ink_type(caps,(x<<4)|y)) > -1) { - int xx = (1<<x)/2*caps->base_res; - int yy = (1<<y)/2*caps->base_res; - const canon_res_t *res = canon_resolutions; - while (res->x > 0) { - if (xx == res->x && yy == res->y) { - stp_string_list_add_string(description->bounds.str, - res->name, gettext(res->text)); - stp_deprintf(STP_DBG_CANON,"supports mode '%s'\n", - res->name); - if (xx >= 300 && yy >= 300 && description->deflt.str == NULL) - description->deflt.str = res->name; - if (t == 1) { - stp_string_list_add_string(description->bounds.str, - res->name_dmt, gettext(res->text_dmt)); - stp_deprintf(STP_DBG_CANON,"supports mode '%s'\n", - res->name_dmt); - } - break; - } - res++; - } - } - } } } else if (strcmp(name, "InkType") == 0) { + const canon_mode_t* mode = canon_get_current_mode(v); description->bounds.str= stp_string_list_create(); - /* used internally: do not translate */ - if ((caps->inks & CANON_INK_CcMmYyK)) - stp_string_list_add_string(description->bounds.str, - "PhotoCMYK", _("Photo CcMmYK Color")); - if ((caps->inks & CANON_INK_CcMmYK)) - stp_string_list_add_string(description->bounds.str, - "PhotoCMY", _("Photo CcMmY Color")); - if ((caps->inks & CANON_INK_CMYK)) - stp_string_list_add_string(description->bounds.str, - "CMYK", _("CMYK Color")); - if ((caps->inks & CANON_INK_CMY)) - stp_string_list_add_string(description->bounds.str, - "RGB", _("CMY Color")); - if ((caps->inks & CANON_INK_K)) - stp_string_list_add_string(description->bounds.str, - "Gray", _("Black")); - description->deflt.str = - stp_string_list_param(description->bounds.str, 0)->name; + for(i=0;i<sizeof(canon_inktypes)/sizeof(canon_inktypes[0]);i++){ + if(mode->ink_types & canon_inktypes[i].ink_type){ + stp_string_list_add_string(description->bounds.str,canon_inktypes[i].name,_(canon_inktypes[i].text)); + } + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; } else if (strcmp(name, "InkChannels") == 0) { - if (caps->inks & CANON_INK_CcMmYyK) - description->deflt.integer = 7; - else if (caps->inks & CANON_INK_CcMmYK) - description->deflt.integer = 6; - else if (caps->inks & CANON_INK_CMYK) - description->deflt.integer = 4; - else if (caps->inks & CANON_INK_CMY) - description->deflt.integer = 3; - else - description->deflt.integer = 1; + unsigned int ink_type = canon_printhead_colors(v); + for(i=0;i<sizeof(canon_inktypes)/sizeof(canon_inktypes[0]);i++){ + if(ink_type == canon_inktypes[i].ink_type) + description->deflt.integer = canon_inktypes[i].num_channels; + } description->bounds.integer.lower = -1; description->bounds.integer.upper = -1; } else if (strcmp(name, "MediaType") == 0) { - int count = sizeof(canon_paper_list) / sizeof(canon_paper_list[0]); + const canon_paper_t * canon_paper_list = caps->paperlist->papers; + int count = caps->paperlist->count; description->bounds.str= stp_string_list_create(); description->deflt.str= canon_paper_list[0].name; @@ -2090,18 +713,21 @@ canon_parameters(const stp_vars_t *v, const char *name, } else if (strcmp(name, "InputSlot") == 0) { - int count = sizeof(media_sources)/sizeof(media_sources[0]); + const canon_slot_t * canon_slot_list = caps->slotlist->slots; + int count = caps->slotlist->count; description->bounds.str= stp_string_list_create(); - description->deflt.str= media_sources[0].name; + description->deflt.str= canon_slot_list[0].name; + for (i = 0; i < count; i ++) stp_string_list_add_string(description->bounds.str, - media_sources[i].name, - gettext(media_sources[i].text)); + canon_slot_list[i].name, + gettext(canon_slot_list[i].text)); } else if (strcmp(name, "PrintingMode") == 0) { + const canon_mode_t* mode = canon_get_current_mode(v); description->bounds.str = stp_string_list_create(); - if (caps->inks != CANON_INK_K) + if (mode->ink_types != CANON_INK_K) stp_string_list_add_string (description->bounds.str, "Color", _("Color")); stp_string_list_add_string @@ -2159,10 +785,15 @@ internal_imageable_area(const stp_vars_t *v, /* I */ int right_margin = 0; int bottom_margin = 0; int top_margin = 0; + int cd = 0; const canon_cap_t * caps= canon_get_model_capabilities(stp_get_model_id(v)); const char *media_size = stp_get_string_parameter(v, "PageSize"); const stp_papersize_t *pt = NULL; + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + + if(input_slot && !strcmp(input_slot,"CD")) + cd = 1; if (media_size && use_paper_margins) pt = stp_get_papersize_by_name(media_size); @@ -2175,10 +806,13 @@ internal_imageable_area(const stp_vars_t *v, /* I */ bottom_margin = pt->bottom; top_margin = pt->top; } - left_margin = MAX(left_margin, caps->border_left); - right_margin = MAX(right_margin, caps->border_right); - top_margin = MAX(top_margin, caps->border_top); - bottom_margin = MAX(bottom_margin, caps->border_bottom); + /* ignore printer margins for the cd print, margins get adjusted in do_print */ + if(!cd){ + left_margin = MAX(left_margin, caps->border_left); + right_margin = MAX(right_margin, caps->border_right); + top_margin = MAX(top_margin, caps->border_top); + bottom_margin = MAX(bottom_margin, caps->border_bottom); + } *left = left_margin; *right = width - right_margin; @@ -2252,26 +886,36 @@ canon_cmd(const stp_vars_t *v, /* I - the printer */ #define ESC5b "\033\133" #define ESC40 "\033\100" +static void canon_control_cmd(const stp_vars_t*v,const char* cmd){ + canon_cmd(v,ESC5b,0x4b, 2, 0x00,0x1f); + stp_puts("BJLSTART\nControlMode=Common\n",v); + stp_puts(cmd,v); + stp_putc('\n',v); + stp_puts("BJLEND\n",v); +} + + /* ESC [K -- -- reset printer: */ static void -canon_init_resetPrinter(const stp_vars_t *v, canon_init_t *init) +canon_init_resetPrinter(const stp_vars_t *v, const canon_privdata_t *init) { - unsigned long f=init->caps->features; - if (f & (CANON_CAP_ACKSHORT)) - { - canon_cmd(v,ESC5b,0x4b, 2, 0x00,0x1f); - stp_puts("BJLSTART\nControlMode=Common\n",v); - if (f & CANON_CAP_ACKSHORT) stp_puts("AckTime=Short\n",v); - stp_puts("BJLEND\n",v); + if ( init->caps->control_cmdlist ){ + int i=0; + while(init->caps->control_cmdlist[i]){ + canon_control_cmd(v,init->caps->control_cmdlist[i]); + ++i; } + } + if(!strcmp(init->slot->name,"CD")) + canon_control_cmd(v,"MediaDetection=ON"); canon_cmd(v,ESC5b,0x4b, 2, 0x00,0x0f); } /* ESC ($ -- 0x24 -- cmdSetDuplex --: */ static void -canon_init_setDuplex(const stp_vars_t *v, canon_init_t *init) +canon_init_setDuplex(const stp_vars_t *v, const canon_privdata_t *init) { if (!(init->caps->features & CANON_CAP_DUPLEX)) return; @@ -2285,7 +929,7 @@ canon_init_setDuplex(const stp_vars_t *v, canon_init_t *init) /* ESC (a -- 0x61 -- cmdSetPageMode --: */ static void -canon_init_setPageMode(const stp_vars_t *v, canon_init_t *init) +canon_init_setPageMode(const stp_vars_t *v, const canon_privdata_t *init) { if (!(init->caps->features & CANON_CAP_a)) return; @@ -2297,7 +941,7 @@ canon_init_setPageMode(const stp_vars_t *v, canon_init_t *init) /* ESC (b -- 0x62 -- -- set data compression: */ static void -canon_init_setDataCompression(const stp_vars_t *v, canon_init_t *init) +canon_init_setDataCompression(const stp_vars_t *v, const canon_privdata_t *init) { if (!(init->caps->features & CANON_CAP_b)) return; @@ -2308,7 +952,7 @@ canon_init_setDataCompression(const stp_vars_t *v, canon_init_t *init) /* ESC (c -- 0x63 -- cmdSetColor --: */ static void -canon_init_setColor(const stp_vars_t *v, canon_init_t *init) +canon_init_setColor(const stp_vars_t *v, const canon_privdata_t *init) { unsigned char numargs, arg_63[6]; @@ -2325,10 +969,10 @@ canon_init_setColor(const stp_vars_t *v, canon_init_t *init) break; /* tbd */ case 1: /* 360 dpi series - BJC-4000, BJC-210, BJC-70 and their descendants */ - if (!init->printing_color) + if (init->used_inks == CANON_INK_K) arg_63[0]|= 0x01; /* PRINT_COLOUR */ - arg_63[1] = ((init->pt ? init->pt->media_code : 0) << 4) /* PRINT_MEDIA */ + arg_63[1] = ((init->pt ? init->pt->media_code_c : 0) << 4) /* PRINT_MEDIA */ + 1; /* hardcode to High quality for now */ /* PRINT_QUALITY */ canon_cmd(v,ESC28,0x63, 2, arg_63[0], arg_63[1]); @@ -2338,24 +982,24 @@ canon_init_setColor(const stp_vars_t *v, canon_init_t *init) break; case 3: /* 720 dpi series - BJC-3000 and descendants */ - if (!init->printing_color) + if (init->used_inks == CANON_INK_K) arg_63[0]|= 0x01; /* colour mode */ - arg_63[1] = (init->pt) ? init->pt->media_code : 0; /* print media type */ + arg_63[1] = (init->pt) ? init->pt->media_code_c : 0; /* print media type */ if (init->caps->model == 4202) /* S200 */ { - if ((init->xdpi == 720) && (init->ydpi == 720 )) + if ((init->mode->xdpi == 720) && (init->mode->ydpi == 720 )) arg_63[2] = 1; else arg_63[2] = 4; /* hardcoded: quality 3 (may be 0...4) */ /* bidirectional is controlled via quality: 0..2 is bidi, 3 and 4 uni */ /* not every combination works, no idea about the principle */ - if ( (init->xdpi > 360) || (init->ydpi > 360) ) + if ( (init->mode->xdpi > 360) || (init->mode->ydpi > 360) ) { numargs = 6; arg_63[3] = 0x10; arg_63[4] = 6; arg_63[5] = 8; /* arg5 makes a vert. offset for K */ - if (!init->printing_color) + if (init->used_inks == CANON_INK_K) arg_63[4] = 1; } } @@ -2374,17 +1018,17 @@ canon_init_setColor(const stp_vars_t *v, canon_init_t *init) /* ESC (d -- 0x64 -- -- set raster resolution: */ static void -canon_init_setResolution(const stp_vars_t *v, canon_init_t *init) +canon_init_setResolution(const stp_vars_t *v, const canon_privdata_t *init) { if (!(init->caps->features & CANON_CAP_d)) return; - if (init->caps->model != 4202 || (init->xdpi <= 360)) + if (init->caps->model != 4202 || (init->mode->xdpi <= 360)) canon_cmd(v,ESC28,0x64, 4, - (init->ydpi >> 8 ), (init->ydpi & 255), - (init->xdpi >> 8 ), (init->xdpi & 255)); + (init->mode->ydpi >> 8 ), (init->mode->ydpi & 255), + (init->mode->xdpi >> 8 ), (init->mode->xdpi & 255)); else - if (init->xdpi < 2880) + if (init->mode->xdpi < 2880) canon_cmd(v,ESC28,0x64, 4, (720 >> 8), (720 & 255), (720 >> 8), (720 & 255)); @@ -2397,7 +1041,7 @@ canon_init_setResolution(const stp_vars_t *v, canon_init_t *init) /* ESC (g -- 0x67 -- cmdSetPageMargins --: */ static void -canon_init_setPageMargins(const stp_vars_t *v, canon_init_t *init) +canon_init_setPageMargins(const stp_vars_t *v, const canon_privdata_t *init) { /* TOFIX: what exactly is to be sent? * Is it the printable length or the bottom border? @@ -2424,35 +1068,30 @@ canon_init_setPageMargins(const stp_vars_t *v, canon_init_t *init) /* ESC (l -- 0x6c -- cmdSetTray --: */ static void -canon_init_setTray(const stp_vars_t *v, canon_init_t *init) +canon_init_setTray(const stp_vars_t *v, const canon_privdata_t *init) { unsigned char arg_6c_1 = 0x00, arg_6c_2 = 0x00; /* plain paper */ - /* int media= canon_media_type(media_str,caps); */ - int source= canon_source_type(init->source_str,init->caps); - if (!(init->caps->features & CANON_CAP_l)) return; arg_6c_1 = init->caps->model_id << 4; - arg_6c_1|= (source & 0x0f); + arg_6c_1|= (init->slot->code & 0x0f); - if (init->pt) arg_6c_2= init->pt->media_code; - if (!strcmp("CD",init->source_str)) { - stp_deprintf(STP_DBG_CANON,"canon: sending special cd setTray command\n"); - canon_cmd(v,ESC28,0x6c, 3, 0x3a,0x12,0); - } else { + if (init->pt) arg_6c_2= init->pt->media_code_l; + if(init->caps->model_id >= 3) + canon_cmd(v,ESC28,0x6c, 3, arg_6c_1, arg_6c_2, 0); + else canon_cmd(v,ESC28,0x6c, 2, arg_6c_1, arg_6c_2); - } } /* ESC (m -- 0x6d -- -- : */ static void -canon_init_setPrintMode(const stp_vars_t *v, canon_init_t *init) +canon_init_setPrintMode(const stp_vars_t *v, const canon_privdata_t *init) { unsigned char arg_6d_1 = 0x03, /* color printhead? */ @@ -2469,13 +1108,17 @@ canon_init_setPrintMode(const stp_vars_t *v, canon_init_t *init) if (!arg_6d_a) arg_6d_b= 1; - if (init->print_head==0) - arg_6d_1= 0x03; - else if (init->print_head<=2) - arg_6d_1= 0x02; - else if (init->print_head<=4) arg_6d_1= 0x04; - if (!init->printing_color) + if ((init->caps->model==7000) && (init->used_inks == CANON_INK_K || init->used_inks == CANON_INK_CcMmYK || init->used_inks == CANON_INK_CcMmYyK)) + arg_6d_1= 0x03; + + if (((init->caps->model==8200 || init->caps->model==4202) && init->used_inks == CANON_INK_K) || init->used_inks == CANON_INK_CMYK) + arg_6d_1= 0x02; + + if(init->caps->model == 4202 && init->used_inks == CANON_INK_CMY) + arg_6d_1= 0x02; + + if (init->used_inks == CANON_INK_K) arg_6d_2= 0x02; if (init->caps->model==8200 || init->caps->model==4202) @@ -2489,13 +1132,12 @@ canon_init_setPrintMode(const stp_vars_t *v, canon_init_t *init) /* ESC (p -- 0x70 -- cmdSetPageMargins2 --: */ static void -canon_init_setPageMargins2(const stp_vars_t *v, canon_init_t *init) +canon_init_setPageMargins2(const stp_vars_t *v, const canon_privdata_t *init) { /* TOFIX: what exactly is to be sent? * Is it the printable length or the bottom border? * Is is the printable width or the right border? */ - int printable_width= init->page_width*5/6; int printable_length= init->page_height*5/6; @@ -2503,24 +1145,44 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_init_t *init) unsigned char arg_70_2= (printable_length) & 0xff; unsigned char arg_70_3= (printable_width >> 8) & 0xff; unsigned char arg_70_4= (printable_width) & 0xff; + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + + if (!(init->caps->features & CANON_CAP_px) && !(init->caps->features & CANON_CAP_p)) + return; - if (!(init->caps->features & CANON_CAP_p)) + if ((init->caps->features & CANON_CAP_px) && !(input_slot && !strcmp(input_slot,"CD"))) + { + unsigned int unit = init->mode->xdpi; + stp_zfwrite(ESC28,2,1,v); /* ESC( */ + stp_putc(0x70,v); /* p */ + stp_put16_le(46, v); /* len */ + stp_put16_be(printable_length,v); + stp_put16_be(0,v); + stp_put16_be(printable_width,v); + stp_put16_be(0,v); + stp_put32_be(0,v); + stp_put16_be(unit,v); + + stp_put32_be(init->caps->border_left * unit / 72,v); /* area_right */ + stp_put32_be(init->caps->border_top * unit / 72,v); /* area_top */ + stp_put32_be(init->page_width * unit / 72,v); /* area_width */ + stp_put32_be(init->page_height * unit / 72,v); /* area_length */ + stp_put32_be(0,v); /* paper_right */ + stp_put32_be(0,v); /* paper_top */ + stp_put32_be((init->page_width + init->caps->border_left + init->caps->border_right) * unit / 72,v); /* paper_width */ + stp_put32_be((init->page_height + init->caps->border_top + init->caps->border_bottom) * unit / 72,v); /* paper_height */ return; - if (!strcmp(init->source_str,"CD")) { - canon_cmd(v,ESC28,0x70, 8, 0x00, 0x2a, 0xb0, 0x00, - 0x00, 0x01, 0xe0, 0x00); - stp_deprintf(STP_DBG_CANON,"sending cd margins\n"); - } else { - canon_cmd(v,ESC28,0x70, 8, + } + + canon_cmd(v,ESC28,0x70, 8, arg_70_1, arg_70_2, 0x00, 0x00, arg_70_3, arg_70_4, 0x00, 0x00); - } } /* ESC (q -- 0x71 -- setPageID -- : */ static void -canon_init_setPageID(const stp_vars_t *v, canon_init_t *init) +canon_init_setPageID(const stp_vars_t *v, const canon_privdata_t *init) { if (!(init->caps->features & CANON_CAP_q)) return; @@ -2531,7 +1193,7 @@ canon_init_setPageID(const stp_vars_t *v, canon_init_t *init) /* ESC (r -- 0x72 -- -- : */ static void -canon_init_setX72(const stp_vars_t *v, canon_init_t *init) +canon_init_setX72(const stp_vars_t *v, const canon_privdata_t *init) { if ( !( (init->caps->features & CANON_CAP_r) || (init->caps->features & CANON_CAP_rr) ) ) @@ -2539,7 +1201,7 @@ canon_init_setX72(const stp_vars_t *v, canon_init_t *init) if ( (init->caps->features & CANON_CAP_r) || (init->caps->features & CANON_CAP_rr) ) - canon_cmd(v,ESC28,0x72, 1, 0x61); /* whatever for - 8200/S200 need it */ + canon_cmd(v,ESC28,0x72, 1, init->caps->ESC_r_arg); /* whatever for - 8200/S200 need it */ if (init->caps->features & CANON_CAP_rr) canon_cmd(v,ESC28,0x72, 3, 0x63, 1, 0); /* whatever for - S200 needs it */ /* probably to set the print direction of the head */ @@ -2556,7 +1218,7 @@ canon_set_X72(const stp_vars_t *v, int x72arg) /* ESC (t -- 0x74 -- cmdSetImage --: */ static void -canon_init_setImage(const stp_vars_t *v, canon_init_t *init) +canon_init_setImage(const stp_vars_t *v, const canon_privdata_t *init) { unsigned char arg_74_1 = 0x01, /* 1 bit per pixel */ @@ -2565,6 +1227,33 @@ canon_init_setImage(const stp_vars_t *v, canon_init_t *init) if (!(init->caps->features & CANON_CAP_t)) return; + + if(init->mode->flags & MODE_FLAG_EXTENDED_T) /*code requires extended mode settings*/ + { + int i; + int length = init->mode->num_inks*3 + 3; + unsigned char* buf = stp_zalloc(length); + buf[0]=0x80; + buf[1]=0x80; + buf[2]=0x01; + for(i=0;i<init->mode->num_inks;i++){ + if(init->mode->inks[i].ink){ + if(init->mode->inks[i].ink->flags & INK_FLAG_5pixel_in_1byte) + buf[3+i*3+0]=(1<<5)|init->mode->inks[i].ink->bits; /*info*/ + else + buf[3+i*3+0]=init->mode->inks[i].ink->bits; + buf[3+i*3+2]= init->mode->inks[i].ink->numsizes+1;/*level*/ + } + } + stp_zfwrite(ESC28,2,1,v); + stp_putc(0x74,v); + stp_put16_le(length,v); + stp_zfwrite((char*)buf,length,1,v); + stp_free(buf); + return; + } + + /* other models mostly hardcoded stuff not really understood ;( */ if (init->caps->model==4202) /* 1 bit per pixel (arg 4,7,10,13); */ /* 2 level per pixel (arg 6,9,12,15) for each color */ /* though we print only 1bit/pixel - but this is how */ @@ -2574,50 +1263,59 @@ canon_init_setImage(const stp_vars_t *v, canon_init_t *init) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } - if(init->caps->features & CANON_CAP_extended_t) - { - unsigned char buf[30] = {0x80,0x80,0x1,}; - memcpy(buf + 3,init->color_info,sizeof(color_info_t) * 9); - stp_zfwrite(ESC28,2,1,v); - stp_putc(0x74,v); - stp_put16_le(30,v); - stp_zfwrite((char*)buf,30,1,v); - return; - } - if (init->xdpi==1440) arg_74_2= 0x04; - if (init->ydpi>=720) arg_74_3= 0x09; + if (init->mode->xdpi==1440) arg_74_2= 0x04; + if (init->mode->ydpi>=720) arg_74_3= 0x09; - if (init->bits>1) { + if (init->mode->inks[0].ink->bits>1) { arg_74_1= 0x02; arg_74_2= 0x80; arg_74_3= 0x09; - if (init->colormode == COLOR_CMY) arg_74_3= 0x02; /* for BC-06 cartridge!!! */ + if (init->used_inks == CANON_INK_CMY) arg_74_3= 0x02; /* for BC-06 cartridge!!! */ } /* workaround for the bjc8200 in 6color mode - not really understood */ if (init->caps->model==8200) { - if (init->colormode==COLOR_CCMMYK) { + if (init->used_inks == CANON_INK_CcMmYK) { arg_74_1= 0xff; arg_74_2= 0x90; arg_74_3= 0x04; - init->bits=3; - if (init->ydpi>600) arg_74_3= 0x09; + if (init->mode->ydpi>600) arg_74_3= 0x09; } else { arg_74_1= 0x01; arg_74_2= 0x00; arg_74_3= 0x01; - if (init->ydpi>600) arg_74_3= 0x09; + if (init->mode->ydpi>600) arg_74_3= 0x09; } } canon_cmd(v,ESC28,0x74, 3, arg_74_1, arg_74_2, arg_74_3); } +/* ESC (I (J (L + */ static void -canon_init_printer(const stp_vars_t *v, canon_init_t *init) +canon_init_setMultiRaster(const stp_vars_t *v, const canon_privdata_t *init){ + + if(!(init->caps->features & CANON_CAP_I)) + return; + + canon_cmd(v,ESC28,0x49, 1, 0x1); /* enable MultiLine Raster? */ + canon_cmd(v,ESC28,0x4a, 1, RASTER_LINES_PER_BLOCK); /* set number of lines per raster block */ + + /* set the color sequence */ + stp_zfwrite("\033(L", 3, 1, v); + stp_put16_le(init->num_channels, v); + stp_zfwrite((const char *)init->channel_order,init->num_channels, 1, v); +} + + + + +static void +canon_init_printer(const stp_vars_t *v, const canon_privdata_t *init) { - int mytop; + unsigned int mytop; /* init printer */ if (init->is_first_page) { canon_init_resetPrinter(v,init); /* ESC [K */ @@ -2634,15 +1332,21 @@ canon_init_printer(const stp_vars_t *v, canon_init_t *init) canon_init_setPageMargins2(v,init); /* ESC (p */ canon_init_setTray(v,init); /* ESC (l */ canon_init_setX72(v,init); /* ESC (r */ + canon_init_setMultiRaster(v,init); /* ESC (I (J (L */ /* some linefeeds */ - mytop= (init->top*init->ydpi)/72; - canon_cmd(v,ESC28,0x65, 2, (mytop >> 8 ),(mytop & 255)); + mytop= (init->top*init->mode->ydpi)/72; + + if(init->caps->features & CANON_CAP_I) + mytop /= RASTER_LINES_PER_BLOCK; + + if(mytop) + canon_cmd(v,ESC28,0x65, 2, (mytop >> 8 ),(mytop & 255)); } static void -canon_deinit_printer(const stp_vars_t *v, canon_init_t *init) +canon_deinit_printer(const stp_vars_t *v, const canon_privdata_t *init) { /* eject page */ stp_putc(0x0c,v); @@ -2682,19 +1386,13 @@ canon_advance_buffer(unsigned char *buf, int len, int num) } static void -setup_column(canon_privdata_t *privdata, int col, int buf_length) -{ - privdata->cols[col] = stp_zalloc(buf_length * (privdata->delay[col] + 1)); -} - -static void canon_printfunc(stp_vars_t *v) { int i; canon_privdata_t *pd = (canon_privdata_t *) stp_get_component_data(v, "Driver"); canon_write_line(v); - for (i = 0; i < 7; i++) - canon_advance_buffer(pd->cols[i], pd->buf_length, pd->delay[i]); + for (i = 0; i < pd->num_channels ; i++) + canon_advance_buffer(pd->channels[i].buf, pd->length, pd->channels[i].delay); } @@ -2707,62 +1405,7 @@ get_double_param(stp_vars_t *v, const char *param) return 1.0; } -static void -set_ink_ranges(stp_vars_t *v, const canon_variable_ink_t *ink, int color, - const char *channel_param, const char *subchannel_param) -{ - int num_shades; - if (!ink) - return; - - /* ignore small dot shades with zero density */ - if(ink->numshades > 1 && ink->shades[1].value == 0.0) - num_shades = 1; - else - num_shades = ink->numshades; - stp_dither_set_inks_full(v, color, num_shades, ink->shades, 1.0, - ink_darknesses[color]); - stp_channel_set_density_adjustment - (v, color, 1, (get_double_param(v, channel_param) * - get_double_param(v, subchannel_param) * - get_double_param(v, "Density"))); -} - -/* this function sets the info - entry in the color_info_t struct */ -static void -set_bit_info(const canon_cap_t * caps,color_info_t* color) -{ - unsigned char bit_depth; - if(color->level < 2) - bit_depth = 0; - else if(color->level < 3) - bit_depth = 1; - else if(color->level < 5) - bit_depth = 2; - else - bit_depth = 4; - if((color->level == 3) && (caps->features & CANON_CAP_5pixelin1byte)) - color->info = (1 << 5) | bit_depth; - else - color->info = bit_depth; -} -/* function sets the level and bit depth in the color_info_t struct according to the ink settings */ -static void -set_color_info(const canon_cap_t * caps,const canon_variable_ink_t* ink,color_info_t* large,color_info_t* small) -{ - if(ink) - { - large->level = ink->shades[0].numsizes + 1; - if(ink->numshades > 1) - small->level = ink->shades[1].numsizes + 1; - } - else /* default to 2 level, bit depth 1*/ - large->level = 2; - set_bit_info(caps,large); - set_bit_info(caps,small); -} static void set_mask(unsigned char *cd_mask, int x_center, int scaled_x_where, @@ -2811,10 +1454,193 @@ set_mask(unsigned char *cd_mask, int x_center, int scaled_x_where, } -#define CD_X_OFFSET 0 -#define CD_Y_OFFSET 230 -#define CD_OUTER_RADIUS (329/2) -#define CD_INNER_RADIUS 56 +/* get delay settings for the specified color and mode */ +static int canon_get_delay(canon_privdata_t* privdata,char color){ + int i=0; + int delay = 0; + const canon_delay_t* delaylist = privdata->mode->delay; + + while(delaylist && delaylist[i].color){ + if(delaylist[i].color == color){ + delay = delaylist[i].delay; + break; + } + ++i; + } + if(delay > privdata->delay_max) + privdata->delay_max = delay; + return delay; +} + + +/* add a single channel to the dither engine */ +static int canon_setup_channel(stp_vars_t *v,canon_privdata_t* privdata,int channel,int subchannel,const canon_inkset_t* ink,stp_shade_t** shades){ + if(ink->channel && ink->density > 0.0){ + int delay = canon_get_delay(privdata,ink->channel); + canon_channel_t* current; + /* create a new channel */ + privdata->channels = stp_realloc(privdata->channels,sizeof(canon_channel_t) * (privdata->num_channels + 1)); + privdata->channel_order = stp_realloc(privdata->channel_order,privdata->num_channels + 2); + /* update channel order */ + privdata->channel_order[privdata->num_channels]=ink->channel; + privdata->channel_order[privdata->num_channels+1]='\0'; + current = &(privdata->channels[privdata->num_channels]); + ++privdata->num_channels; + /* fill ink properties */ + current->name = ink->channel; + current->props = ink->ink; + current->delay = delay; + /* calculate buffer length */ + current->buf_length = ((privdata->length * current->props->bits)+1)*(delay + 1); + /* update maximum buffer length */ + if(current->buf_length > privdata->buf_length_max) + privdata->buf_length_max = current->buf_length; + /* allocate buffer for the raster data */ + current->buf = stp_zalloc(current->buf_length + 1); + /* add channel to the dither engine */ + stp_dither_add_channel(v, current->buf , channel , subchannel); + + /* add shades to the shades array */ + *shades = stp_realloc(*shades,(subchannel + 1) * sizeof(stp_shade_t)); + /* move previous shades up one position as set_inks_full expects the subchannels first */ + if(subchannel) + memcpy(*shades + 1,*shades,sizeof(stp_shade_t) * subchannel); + (*shades)[0].value = ink->density; + (*shades)[0].numsizes = ink->ink->numsizes; + (*shades)[0].dot_sizes = ink->ink->dot_sizes; + return 1; + } + return 0; +} + + + + + +/* setup the dither channels */ +static void canon_setup_channels(stp_vars_t *v,canon_privdata_t* privdata){ + /* codes for the primary channels */ + const char primary[STP_NCOLORS] = {'K','C','M','Y',}; + /* codes for the subchannels */ + const char secondary[STP_NCOLORS] = {'k','c','m','y'}; + /* names of the density adjustment controls */ + const char *primary_density_control[STP_NCOLORS] = {"BlackDensity","CyanDensity","MagentaDensity","YellowDensity"}; + const char *secondary_density_control[STP_NCOLORS] = {NULL,"LightCyanTransition","LightMagentaTransition","LightYellowTransition"}; + /* ink darkness for every channel */ + const double ink_darkness[] = {1.0, 0.31 / .5, 0.61 / .97, 0.08}; + + int channel; + + + /* loop through the dither channels */ + for(channel=0; channel < STP_NCOLORS ; channel++){ + int i; + unsigned int subchannel = 0; + stp_shade_t* shades = NULL; + if(channel == STP_ECOLOR_K && privdata->used_inks & CANON_INK_K_MASK){ /* black channel */ + /* find K and k inks */ + for(i=0;i<privdata->mode->num_inks;i++){ + const canon_inkset_t* ink = &privdata->mode->inks[i]; + if(ink->channel == primary[channel] || ink->channel == secondary[channel]) + subchannel += canon_setup_channel(v,privdata,channel,subchannel,ink,&shades); + } + stp_channel_set_black_channel(v, STP_ECOLOR_K); + }else if(channel != STP_ECOLOR_K && privdata->used_inks & CANON_INK_CMY_MASK){ /* color channels */ + for(i=0;i<privdata->mode->num_inks;i++){ + const canon_inkset_t* ink = &privdata->mode->inks[i]; + if(ink->channel == primary[channel] || ((privdata->used_inks & CANON_INK_CcMmYyKk_MASK) && (ink->channel == secondary[channel]))) + subchannel += canon_setup_channel(v,privdata,channel,subchannel,ink,&shades); + } + } + + /* set inks and density */ + if(shades){ + stp_dither_set_inks_full(v,channel, subchannel, shades, 1.0,ink_darkness[channel]); + for(i=0;i<subchannel;i++){ + double density = get_double_param(v, primary_density_control[channel]) * get_double_param(v, "Density"); + if(i > 0 && secondary_density_control[channel]) + density *= get_double_param(v, secondary_density_control[channel]); + stp_channel_set_density_adjustment(v,channel,subchannel,density); + } + stp_free(shades); + } + } + +} + + + + + + + +/* FIXME move this to printercaps */ +#define CANON_CD_X 176 +#define CANON_CD_Y 405 + +static void setup_page(stp_vars_t* v,canon_privdata_t* privdata){ + const char *media_source = stp_get_string_parameter(v, "InputSlot"); + const char *cd_type = stp_get_string_parameter(v, "PageSize"); + int print_cd= (media_source && (!strcmp(media_source, "CD"))); + int page_left, + page_top, + page_right, + page_bottom; + int hub_size = 0; + + + if (cd_type && (strcmp(cd_type, "CDCustom") == 0 )) + { + int outer_diameter = stp_get_dimension_parameter(v, "CDOuterDiameter"); + stp_set_page_width(v, outer_diameter); + stp_set_page_height(v, outer_diameter); + stp_set_width(v, outer_diameter); + stp_set_height(v, outer_diameter); + hub_size = stp_get_dimension_parameter(v, "CDInnerDiameter"); + } + else + { + const char *inner_radius_name = stp_get_string_parameter(v, "CDInnerRadius"); + hub_size = 43 * 10 * 72 / 254; /* 43 mm standard CD hub */ + + if (inner_radius_name && strcmp(inner_radius_name, "Small") == 0) + hub_size = 16 * 10 * 72 / 254; /* 15 mm prints to the hole - play it + safe and print 16 mm */ + } + + privdata->top = stp_get_top(v); + privdata->left = stp_get_left(v); + privdata->out_width = stp_get_width(v); + privdata->out_height = stp_get_height(v); + + internal_imageable_area(v, 0, &page_left, &page_right, + &page_bottom, &page_top); + if (print_cd) { + privdata->cd_inner_radius = hub_size / 2; + privdata->cd_outer_radius = stp_get_width(v) / 2; + privdata->left = CANON_CD_X - privdata->cd_outer_radius + stp_get_dimension_parameter(v, "CDXAdjustment");; + privdata->top = CANON_CD_Y - privdata->cd_outer_radius + stp_get_dimension_parameter(v, "CDYAdjustment"); + privdata->page_width = privdata->left + privdata->out_width; + privdata->page_height = privdata->top + privdata->out_height; + } else { + privdata->left -= page_left; + privdata->top -= page_top; + privdata->page_width = page_right - page_left; + privdata->page_height = page_bottom - page_top; + } + +} + + + + + + + + + + + /* * 'canon_print()' - Print an image to a CANON printer. */ @@ -2824,311 +1650,80 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) int i; int status = 1; int model = stp_get_model_id(v); - const char *resolution = stp_get_string_parameter(v, "Resolution"); const char *media_source = stp_get_string_parameter(v, "InputSlot"); - const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); const char *duplex_mode =stp_get_string_parameter(v, "Duplex"); int page_number = stp_get_int_parameter(v, "PageNumber"); - - int printing_color = 0; - const char *ink_type = stp_get_string_parameter(v, "InkType"); - int top = stp_get_top(v); - int left = stp_get_left(v); + const canon_cap_t * caps= canon_get_model_capabilities(model); int y; /* Looping vars */ - int xdpi, ydpi; /* Resolution */ - int n; /* Output number */ canon_privdata_t privdata; - int page_width, /* Width of page */ - page_height, /* Length of page */ - page_left, - page_top, - page_right, - page_bottom, - page_true_height, /* True length of page */ - out_width, /* Width of image on page */ - out_height, /* Length of image on page */ - out_channels, /* Output bytes per pixel */ - length, /* Length of raster data */ - errdiv, /* Error dividend */ + int errdiv, /* Error dividend */ errmod, /* Error modulus */ errval, /* Current error value */ errline, /* Current raster line */ - errlast; /* Last raster line loaded */ + errlast, /* Last raster line loaded */ + out_channels; /* Output bytes per pixel */ unsigned zero_mask; - int bits= 1; - int max_bits = 0; + int print_cd= (media_source && (!strcmp(media_source, "CD"))); int image_height, image_width; - int res_code; - int use_6color= 0; - int print_cd= (media_source && (!strcmp(media_source, "CD"))); double k_upper, k_lower; unsigned char *cd_mask = NULL; double outer_r_sq = 0; double inner_r_sq = 0; - - stp_curve_t *lum_adjustment = NULL; - stp_curve_t *hue_adjustment = NULL; - stp_curve_t *sat_adjustment = NULL; - - canon_init_t init; - const canon_cap_t * caps= canon_get_model_capabilities(model); - int printhead= canon_printhead_type(ink_type,caps); - colormode_t colormode = canon_printhead_colors(ink_type,caps); - const paper_t *pt; - const canon_variable_inkset_t *inks; - const canon_res_t *res = canon_resolutions; + unsigned char* weave_cols[4] ; /* TODO clean up weaving code to be more generic */ if (!stp_verify(v)) { stp_eprintf(v, "Print options not verified; cannot print.\n"); return 0; } - if (strcmp(print_mode, "Color") == 0) - printing_color = 1; - - PUT("top ",top,72); - PUT("left ",left,72); - /* * Setup a read-only pixel region for the entire image... */ stp_image_init(image); - /* force grayscale if image is grayscale - * or single black cartridge installed - */ - if (printhead == 0 || caps->inks == CANON_INK_K) - { - printing_color = 0; - stp_set_string_parameter(v, "PrintingMode", "BW"); - } + /* rotate even pages for DuplexNoTumble */ + if((page_number & 1) && duplex_mode && !strcmp(duplex_mode,"DuplexNoTumble")) + image = stpi_buffer_image(image,BUFFER_FLAG_FLIP_X | BUFFER_FLAG_FLIP_Y); - if (!printing_color) - colormode = COLOR_MONOCHROME; + memset(&privdata,0,sizeof(canon_privdata_t)); + privdata.caps = caps; - /* - * Figure out the output resolution... - */ + /* find the wanted print mode */ + privdata.mode = canon_get_current_mode(v); - xdpi = -1; - ydpi = -1; - while (res->x > 0) { - if (strcmp(resolution, res->name) == 0 || - strcmp(resolution, res->name_dmt) == 0) - { - xdpi = res->x; - ydpi = res->y; - break; - } - res++; - } - stp_deprintf(STP_DBG_CANON,"canon: resolution=%dx%d\n",xdpi,ydpi); - stp_deprintf(STP_DBG_CANON," rescode =0x%x\n",canon_res_code(caps,xdpi,ydpi)); - res_code= canon_res_code(caps,xdpi,ydpi); - if (strcmp(resolution, res->name_dmt) == 0 && - (caps->features & CANON_CAP_DMT)) { - bits= 2; - stp_deprintf(STP_DBG_CANON,"canon: using drop modulation technology\n"); - } - - /* - * Compute the output size... - */ + /* force grayscale if image is grayscale + * or single black cartridge installed + */ + privdata.used_inks = canon_printhead_colors(v); + if (privdata.used_inks == CANON_INK_K) + stp_set_string_parameter(v, "PrintingMode", "BW"); - out_width = stp_get_width(v); - out_height = stp_get_height(v); + setup_page(v,&privdata); - internal_imageable_area(v, 0, &page_left, &page_right, - &page_bottom, &page_top); - if (print_cd) { - left += CD_X_OFFSET; - top += CD_Y_OFFSET; - /*page_width = CD_OUTER_RADIUS*2; - page_height = CD_OUTER_RADIUS*2; */ - stp_default_media_size(v, &page_width, &page_height); - out_width = page_width; - out_height = page_height; - } else { - left -= page_left; - top -= page_top; - page_width = page_right - page_left; - page_height = page_bottom - page_top; - } image_height = stp_image_height(image); image_width = stp_image_width(image); - stp_default_media_size(v, &n, &page_true_height); - - PUT("top ",top,72); - PUT("left ",left,72); - PUT("page_true_height",page_true_height,72); - PUT("out_width ", out_width,xdpi); - PUT("out_height", out_height,ydpi); - - PUT("top ",top,72); - PUT("left ",left,72); - - pt = get_media_type(stp_get_string_parameter(v, "MediaType")); - - init.caps = caps; - init.printing_color = printing_color; - init.pt = pt; - init.print_head = printhead; - init.colormode = colormode; - init.source_str = media_source; - init.duplex_str = duplex_mode; - init.is_first_page = (page_number == 0); - init.xdpi = xdpi; - init.ydpi = ydpi; - init.page_width = page_width; - init.page_height = page_height; - init.top = top; - init.left = left; - init.bits = bits; - - if ((inks = canon_inks(caps, res_code, colormode, bits)) != 0) - { - if(caps->features & CANON_CAP_extended_t) - { - memset(init.color_info,0,sizeof(init.color_info)); - set_color_info(caps,inks->c,&(init.color_info[0]),&(init.color_info[4])); - set_color_info(caps,inks->m,&(init.color_info[1]),&(init.color_info[5])); - set_color_info(caps,inks->y,&(init.color_info[2]),&(init.color_info[6])); - set_color_info(caps,inks->k,&(init.color_info[3]),&(init.color_info[7])); - /* duplicate the info as it is needed later, too */ - memcpy(privdata.color_info,init.color_info,sizeof(init.color_info)); - } - } - - canon_init_printer(v, &init); - - /* possibly changed during initialitation - * to enforce valid modes of operation: - */ - bits= init.bits; - xdpi= init.xdpi; - ydpi= init.ydpi; + privdata.pt = get_media_type(caps,stp_get_string_parameter(v, "MediaType")); + privdata.slot = canon_source_type(media_source,caps); + privdata.duplex_str = duplex_mode; + privdata.is_first_page = (page_number == 0); /* * Convert image size to printer resolution... */ - out_width = xdpi * out_width / 72; - out_height = ydpi * out_height / 72; - - PUT("out_width ", out_width,xdpi); - PUT("out_height", out_height,ydpi); - - left = xdpi * left / 72; - - PUT("leftskip",left,xdpi); - - for (i = 0; i < 7; i++) - privdata.cols[i] = NULL; - - if((xdpi == 1440) && (model != 4202)){ - privdata.delay[0] = 0; - privdata.delay[1] = 112; - privdata.delay[2] = 224; - privdata.delay[3] = 336; - privdata.delay[4] = 112; - privdata.delay[5] = 224; - privdata.delay[6] = 336; - privdata.delay_max = 336; - stp_deprintf(STP_DBG_CANON,"canon: delay on!\n"); - } else if (model ==4202 ){ - privdata.delay[0]= 0; - privdata.delay[1]= 0x30; - privdata.delay[2]= 0x50; - privdata.delay[3]= 0x70; - privdata.delay[4]= 0; - privdata.delay[5]= 0; - privdata.delay[6]= 0; - privdata.delay_max= 0x70; - stp_deprintf(STP_DBG_CANON,"canon: delay for S200 on!\n"); - } else { - for (i = 0; i < 7; i++) - privdata.delay[i] = 0; - privdata.delay_max = 0; - stp_deprintf(STP_DBG_CANON,"canon: delay off!\n"); - } - - /* - * Allocate memory for the raster data... - */ - - length = (out_width + 7) / 8; - - max_bits=bits; + privdata.out_width = privdata.mode->xdpi * privdata.out_width / 72; + privdata.out_height = privdata.mode->ydpi * privdata.out_height / 72; - /* when using the extended settings in the t) command every color might have - its own bit depth */ - if(caps->features & CANON_CAP_extended_t) - { - for(i = 0; i < sizeof(init.color_info) / sizeof(init.color_info[0]);i++) - { - if((init.color_info[i].info & 3) > max_bits) - max_bits = init.color_info[i].info & 3; - } - } - - /* buffer length + 1 extra byte for offset data that might get added in canon_write */ - privdata.buf_length = length * max_bits + 1; - privdata.length = length; - privdata.left = left; - privdata.bits = bits; - privdata.out_width = out_width; - privdata.caps = caps; - privdata.ydpi = ydpi; - - stp_deprintf(STP_DBG_CANON,"canon: buflength is %d!\n",privdata.buf_length); - - if (colormode==COLOR_MONOCHROME) { - setup_column(&privdata, 0, privdata.buf_length); - } else { - setup_column(&privdata, 1, privdata.buf_length); - setup_column(&privdata, 2, privdata.buf_length); - setup_column(&privdata, 3, privdata.buf_length); - - if (colormode!=COLOR_CMY) - setup_column(&privdata, 0, privdata.buf_length); - - if (colormode==COLOR_CCMMYK || colormode==COLOR_CCMMYYK) { - use_6color= 1; - setup_column(&privdata, 4, privdata.buf_length); - setup_column(&privdata, 5, privdata.buf_length); - if (colormode==CANON_INK_CcMmYyK) - setup_column(&privdata, 6, privdata.buf_length); - } - } - - if (privdata.cols[0]) - { - if (privdata.cols[1]) - stp_set_string_parameter(v, "STPIOutputType", "KCMY"); - else - stp_set_string_parameter(v, "STPIOutputType", "Grayscale"); - } - else - stp_set_string_parameter(v, "STPIOutputType", "CMY"); - - stp_deprintf(STP_DBG_CANON, - "canon: driver will use colors %s%s%s%s%s%s%s\n", - privdata.cols[0] ? "K" : "", - privdata.cols[1] ? "C" : "", - privdata.cols[2] ? "M" : "", - privdata.cols[3] ? "Y" : "", - privdata.cols[4] ? "c" : "", - privdata.cols[5] ? "m" : "", - privdata.cols[6] ? "y" : ""); + privdata.left = privdata.mode->xdpi * privdata.left / 72; stp_deprintf(STP_DBG_CANON,"density is %f\n", - stp_get_float_parameter(v, "Density")); + stp_get_float_parameter(v, "Density")); /* * Compute the LUT. For now, it's 8 bit, but that may eventually @@ -3140,116 +1735,108 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) stp_set_float_parameter_active(v, "Density", STP_PARAMETER_ACTIVE); stp_set_float_parameter(v, "Density", 1.0); } - if (pt) - stp_scale_float_parameter(v, "Density", pt->base_density); - else /* Can't find paper type? Assume plain */ - stp_scale_float_parameter(v, "Density", .5); - stp_scale_float_parameter(v, "Density", canon_density(caps, res_code)); + + stp_scale_float_parameter(v, "Density", privdata.pt->base_density); + stp_scale_float_parameter(v, "Density",privdata.mode->density); + if (stp_get_float_parameter(v, "Density") > 1.0) stp_set_float_parameter(v, "Density", 1.0); - if (colormode == COLOR_MONOCHROME) + + if (privdata.used_inks == CANON_INK_K) stp_scale_float_parameter(v, "Gamma", 1.25); stp_deprintf(STP_DBG_CANON,"density is %f\n", - stp_get_float_parameter(v, "Density")); + stp_get_float_parameter(v, "Density")); + + if(privdata.used_inks & CANON_INK_CMYK_MASK) + stp_set_string_parameter(v, "STPIOutputType", "KCMY"); + else if(privdata.used_inks & CANON_INK_CMY_MASK) + stp_set_string_parameter(v, "STPIOutputType", "CMY"); + else + stp_set_string_parameter(v, "STPIOutputType", "Grayscale"); + + privdata.length = (privdata.out_width + 7) / 8; + + stp_dither_init(v, image, privdata.out_width, privdata.mode->xdpi, privdata.mode->ydpi); + + canon_setup_channels(v,&privdata); + + + stp_deprintf(STP_DBG_CANON, + "canon: driver will use colors %s\n",privdata.channel_order); + + /* Allocate compression buffer */ + if(caps->features & CANON_CAP_I) + privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2 * RASTER_LINES_PER_BLOCK * privdata.num_channels); /* for multiraster we need to buffer 8 lines for every color */ + else + privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2); + /* Allocate fold buffer */ + privdata.fold_buf = stp_zalloc(privdata.buf_length_max); + + /* * Output the page... */ + /* FIXME this is probably broken, kept for backward compatibility */ + if(privdata.num_channels > 4){ + k_lower = 0.4 / privdata.channels[4].props->bits + .1; + }else + k_lower = 0.25; + + k_lower *= privdata.pt->k_lower_scale; + k_upper = privdata.pt->k_upper; - if (use_6color) - k_lower = .4 / bits + .1; - else - k_lower = .25 / bits; - if (pt) - { - k_lower *= pt->k_lower_scale; - k_upper = pt->k_upper; - } - else - { - k_lower *= .5; - k_upper = .5; - } if (!stp_check_float_parameter(v, "GCRLower", STP_PARAMETER_ACTIVE)) stp_set_default_float_parameter(v, "GCRLower", k_lower); if (!stp_check_float_parameter(v, "GCRUpper", STP_PARAMETER_ACTIVE)) stp_set_default_float_parameter(v, "GCRUpper", k_upper); - stp_dither_init(v, image, out_width, xdpi, ydpi); - for (i = 0; i < 7; i++) - { - if (privdata.cols[i]) - { - stp_dither_add_channel(v, privdata.cols[i], channel_color_map[i], - subchannel_color_map[i]); - if (channel_color_map[i] == STP_ECOLOR_K) - stp_channel_set_black_channel(v, STP_ECOLOR_K); - } - } - if ((inks = canon_inks(caps, res_code, colormode, bits))!=0) - { - set_ink_ranges(v, inks->c, STP_ECOLOR_C, "CyanDensity", - "LightCyanTransition"); - set_ink_ranges(v, inks->m, STP_ECOLOR_M, "MagentaDensity", - "LightMagentaTransition"); - set_ink_ranges(v, inks->y, STP_ECOLOR_Y, "YellowDensity", - "LightYellowTransition"); - set_ink_ranges(v, inks->k, STP_ECOLOR_K, "BlackDensity", NULL); - } - stp_channel_set_density_adjustment - (v, STP_ECOLOR_C, 0, - get_double_param(v, "CyanDensity") * get_double_param(v, "Density")); - stp_channel_set_density_adjustment - (v, STP_ECOLOR_M, 0, - get_double_param(v, "MagentaDensity") * get_double_param(v, "Density")); - stp_channel_set_density_adjustment - (v, STP_ECOLOR_Y, 0, - get_double_param(v, "YellowDensity") * get_double_param(v, "Density")); - stp_channel_set_density_adjustment - (v, STP_ECOLOR_K, 0, - get_double_param(v, "BlackDensity") * get_double_param(v, "Density")); - - /* initialize weaving for S200 for resolutions > 360dpi */ - if ( (init.caps->features & CANON_CAP_WEAVE) && (xdpi > 360) ) + /* init the printer */ + canon_init_printer(v, &privdata); + + /* initialize weaving for S200 for resolutions > 360dpi */ + if (privdata.mode->flags & MODE_FLAG_WEAVE) { + char weave_color_order[] = "KCMY"; + privdata.stepper_ydpi = 720; privdata.nozzle_ydpi = 360; - if (xdpi == 2880) + if (privdata.mode->xdpi == 2880) privdata.physical_xdpi = 2880; else privdata.physical_xdpi = 720; stp_deprintf(STP_DBG_CANON,"canon: adjust leftskip: old=%d,\n", privdata.left); - privdata.left = (int)( (float)privdata.left * (float)privdata.physical_xdpi / (float)xdpi ); /* adjust left margin */ + privdata.left = (int)( (float)privdata.left * (float)privdata.physical_xdpi / (float)privdata.mode->xdpi ); /* adjust left margin */ stp_deprintf(STP_DBG_CANON,"canon: adjust leftskip: new=%d,\n", privdata.left); privdata.ncolors = 4; privdata.head_offset = stp_zalloc(sizeof(int) * privdata.ncolors); memset(privdata.head_offset, 0, sizeof(privdata.head_offset)); - if ( colormode == COLOR_MONOCHROME ) + if ( privdata.used_inks == CANON_INK_K ) privdata.nozzles = 64; /* black nozzles */ else privdata.nozzles = 24; /* color nozzles */ - if (colormode == COLOR_MONOCHROME) + if ( privdata.used_inks == CANON_INK_K ) { privdata.ncolors = 1; privdata.head_offset[0] = 0; /* K starts at 0 */ privdata.head_offset[1] = 0 ;/* how far C starts after K */ privdata.head_offset[2] = 0;/* how far M starts after K */ privdata.head_offset[3] = 0;/* how far Y starts after K */ - top += 11; + privdata.top += 11; } - else if (colormode == COLOR_CMYK) + else if ( privdata.used_inks == CANON_INK_CMYK ) { privdata.head_offset[0] = 0; /* K starts at 0 */ privdata.head_offset[1] = 144 ;/* how far C starts after K */ privdata.head_offset[2] = 144 + 64;/* how far M starts after K */ privdata.head_offset[3] = 144 + 64 + 64;/* how far Y starts after K */ - top += 5; + privdata.top += 5; } else /* colormode == CMY */ { @@ -3257,13 +1844,13 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) privdata.head_offset[1] = 0 ;/* how far C starts after K */ privdata.head_offset[2] = 64;/* how far M starts after K */ privdata.head_offset[3] = 128;/* how far Y starts after K */ - top += 18; + privdata.top += 18; } privdata.nozzle_separation = privdata.stepper_ydpi / privdata.nozzle_ydpi; - privdata.horizontal_passes = xdpi / privdata.physical_xdpi; + privdata.horizontal_passes = privdata.mode->xdpi / privdata.physical_xdpi; privdata.vertical_passes = 1; - privdata.vertical_oversample = privdata.ydpi / privdata.stepper_ydpi; + privdata.vertical_oversample = privdata.mode->ydpi / privdata.stepper_ydpi; privdata.bidirectional = 1; /* 1: bidirectional; 0: unidirectional printing */ privdata.direction = 1; stp_allocate_component_data(v, "Driver", NULL, NULL, &privdata); @@ -3275,8 +1862,8 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) privdata.nozzles, privdata.nozzle_separation, privdata.horizontal_passes, privdata.vertical_passes, privdata.vertical_oversample, privdata.ncolors, - out_width, out_height, - top * privdata.stepper_ydpi / 72, page_height * privdata.stepper_ydpi / 72, + privdata.out_width, privdata.out_height, + privdata.top * privdata.stepper_ydpi / 72, privdata.page_height * privdata.stepper_ydpi / 72, privdata.head_offset[0],privdata.head_offset[1], privdata.head_offset[2],privdata.head_offset[3]); @@ -3284,9 +1871,9 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) privdata.horizontal_passes, privdata.vertical_passes, privdata.vertical_oversample, privdata.ncolors, 1, - out_width, out_height, - top * privdata.stepper_ydpi / 72, - page_height * privdata.stepper_ydpi / 72, + privdata.out_width, privdata.out_height, + privdata.top * privdata.stepper_ydpi / 72, + privdata.page_height * privdata.stepper_ydpi / 72, privdata.head_offset, STP_WEAVE_ZIGZAG, canon_flush_pass, @@ -3294,41 +1881,54 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) stp_pack_uncompressed, stp_compute_uncompressed_linewidth); privdata.last_pass_offset = 0; - } - errdiv = image_height / out_height; - errmod = image_height % out_height; + for(i=0;i<4;i++){ + int x; + for(x=0;x<privdata.num_channels;x++){ + if(weave_color_order[i] == privdata.channel_order[x]) + weave_cols[i] = privdata.channels[x].buf; + privdata.weave_bits[i] = privdata.channels[x].props->bits; + } + } + } + + + errdiv = image_height / privdata.out_height; + errmod = image_height % privdata.out_height; errval = 0; errlast = -1; errline = 0; - - if (!stp_check_curve_parameter(v, "HueMap", STP_PARAMETER_ACTIVE) && - pt->hue_adjustment) + + if (!stp_check_curve_parameter(v, "HueMap", STP_PARAMETER_ACTIVE)) { - hue_adjustment = stp_read_and_compose_curves - (canon_hue_adjustment(model), - pt ? pt->hue_adjustment : NULL, STP_CURVE_COMPOSE_ADD, 384); - stp_set_curve_parameter(v, "HueMap", hue_adjustment); - stp_curve_destroy(hue_adjustment); + stp_curve_t* hue_adjustment = stp_read_and_compose_curves + (caps->hue_adjustment,privdata.pt->hue_adjustment, + STP_CURVE_COMPOSE_ADD, 384); + if(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) && - pt->lum_adjustment) + if (!stp_check_curve_parameter(v, "LumMap", STP_PARAMETER_ACTIVE)) { - lum_adjustment = stp_read_and_compose_curves - (canon_lum_adjustment(model), - pt ? pt->lum_adjustment : NULL, STP_CURVE_COMPOSE_MULTIPLY, 384); - stp_set_curve_parameter(v, "LumMap", lum_adjustment); - stp_curve_destroy(lum_adjustment); + stp_curve_t* lum_adjustment = stp_read_and_compose_curves + (caps->lum_adjustment,privdata.pt->lum_adjustment, + STP_CURVE_COMPOSE_MULTIPLY, 384); + if(lum_adjustment){ + stp_set_curve_parameter(v, "LumMap", lum_adjustment); + stp_curve_destroy(lum_adjustment); + } } - if (!stp_check_curve_parameter(v, "SatMap", STP_PARAMETER_ACTIVE) && - pt->sat_adjustment) + if (!stp_check_curve_parameter(v, "SatMap", STP_PARAMETER_ACTIVE)) { - sat_adjustment = stp_read_and_compose_curves - (canon_sat_adjustment(model), - pt ? pt->sat_adjustment : NULL, STP_CURVE_COMPOSE_MULTIPLY, 384); - stp_set_curve_parameter(v, "SatMap", sat_adjustment); - stp_curve_destroy(sat_adjustment); + stp_curve_t* sat_adjustment = stp_read_and_compose_curves + (caps->sat_adjustment,privdata.pt->sat_adjustment, + STP_CURVE_COMPOSE_MULTIPLY, 384); + if(sat_adjustment){ + stp_set_curve_parameter(v, "SatMap", sat_adjustment); + stp_curve_destroy(sat_adjustment); + } } out_channels = stp_color_init(v, image, 65536); @@ -3336,11 +1936,11 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) privdata.emptylines = 0; if (print_cd) { - cd_mask = stp_malloc(1 + (out_width + 7) / 8); - outer_r_sq = (double)CD_OUTER_RADIUS * (double)CD_OUTER_RADIUS; - inner_r_sq = (double)CD_INNER_RADIUS * (double)CD_INNER_RADIUS; + cd_mask = stp_malloc(1 + (privdata.out_width + 7) / 8); + outer_r_sq = (double)privdata.cd_outer_radius * (double)privdata.cd_outer_radius; + inner_r_sq = (double)privdata.cd_inner_radius * (double)privdata.cd_inner_radius; } - for (y = 0; y < out_height; y ++) + for (y = 0; y < privdata.out_height; y ++) { int duplicate_line = 1; @@ -3356,44 +1956,46 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) } if (print_cd) { - int x_center = CD_OUTER_RADIUS * xdpi / 72; + int x_center = privdata.cd_outer_radius * privdata.mode->xdpi / 72; int y_distance_from_center = - CD_OUTER_RADIUS - (y * 72 / ydpi); + privdata.cd_outer_radius - (y * 72 / privdata.mode->ydpi); if (y_distance_from_center < 0) y_distance_from_center = -y_distance_from_center; - memset(cd_mask, 0, (out_width + 7) / 8); - if (y_distance_from_center < CD_OUTER_RADIUS) + memset(cd_mask, 0, (privdata.out_width + 7) / 8); + if (y_distance_from_center < privdata.cd_outer_radius) { double y_sq = (double) y_distance_from_center * (double) y_distance_from_center; int x_where = sqrt(outer_r_sq - y_sq) + .5; - int scaled_x_where = x_where * xdpi / 72; + int scaled_x_where = x_where * privdata.mode->xdpi / 72; set_mask(cd_mask, x_center, scaled_x_where, - out_width, 1, 0); - if (y_distance_from_center < CD_INNER_RADIUS) + privdata.out_width, 1, 0); + if (y_distance_from_center < privdata.cd_inner_radius) { x_where = sqrt(inner_r_sq - y_sq) + .5; - scaled_x_where = x_where * ydpi / 72; + scaled_x_where = x_where * privdata.mode->ydpi / 72; set_mask(cd_mask, x_center, scaled_x_where, - out_width, 1, 1); + privdata.out_width, 1, 1); } } } stp_dither(v, y, duplicate_line, zero_mask, cd_mask); - if ( (init.caps->features & CANON_CAP_WEAVE) && (xdpi > 360) ) - stp_write_weave(v, privdata.cols); + if ( privdata.mode->flags & MODE_FLAG_WEAVE ) + stp_write_weave(v, weave_cols); + else if ( caps->features & CANON_CAP_I) + canon_write_multiraster(v,&privdata,y); else canon_printfunc(v); errval += errmod; errline += errdiv; - if (errval >= out_height) + if (errval >= privdata.out_height) { - errval -= out_height; + errval -= privdata.out_height; errline ++; } } - if ( (init.caps->features & CANON_CAP_WEAVE) && (xdpi > 360) ) + if ( privdata.mode->flags & MODE_FLAG_WEAVE ) { stp_flush_all(v); canon_advance_paper(v, 5); @@ -3411,9 +2013,9 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) for (y= 0; y<privdata.delay_max; y++) { canon_write_line(v); - for (i = 0; i < 7; i++) - canon_advance_buffer(privdata.cols[i], privdata.buf_length, - privdata.delay[i]); + for (i = 0; i < privdata.num_channels; i++) + canon_advance_buffer(privdata.channels[i].buf, privdata.length, + privdata.channels[i].delay); } } } @@ -3423,14 +2025,26 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) * Cleanup... */ - for (i = 0; i < 7; i++) - if (privdata.cols[i]) - stp_free(privdata.cols[i]); - + stp_free(privdata.fold_buf); + stp_free(privdata.comp_buf); + if(cd_mask) stp_free(cd_mask); - canon_deinit_printer(v, &init); + + canon_deinit_printer(v, &privdata); + + for(i=0;i< privdata.num_channels;i++) + if(privdata.channels[i].buf) + stp_free(privdata.channels[i].buf); + if(privdata.channels) + stp_free(privdata.channels); + + stp_free(privdata.channel_order); + if (privdata.head_offset) + stp_free(privdata.head_offset); + + return status; } @@ -3461,155 +2075,6 @@ static const stp_printfuncs_t print_canon_printfuncs = canon_end_job }; -#ifndef USE_3BIT_FOLD_TYPE -#error YOU MUST CHOOSE A VALUE FOR USE_3BIT_FOLD_TYPE -#endif - -#if USE_3BIT_FOLD_TYPE == 333 - -static void -canon_fold_3bit(const unsigned char *line, - int single_length, - unsigned char *outbuf) -{ - int i; - for (i = 0; i < single_length; i++) { - outbuf[0] = - ((line[0] & (1 << 7)) >> 2) | - ((line[0] & (1 << 6)) >> 4) | - ((line[single_length] & (1 << 7)) >> 1) | - ((line[single_length] & (1 << 6)) >> 3) | - ((line[single_length] & (1 << 5)) >> 5) | - ((line[2*single_length] & (1 << 7)) << 0) | - ((line[2*single_length] & (1 << 6)) >> 2) | - ((line[2*single_length] & (1 << 5)) >> 4); - outbuf[1] = - ((line[0] & (1 << 5)) << 2) | - ((line[0] & (1 << 4)) << 0) | - ((line[0] & (1 << 3)) >> 2) | - ((line[single_length] & (1 << 4)) << 1) | - ((line[single_length] & (1 << 3)) >> 1) | - ((line[2*single_length] & (1 << 4)) << 2) | - ((line[2*single_length] & (1 << 3)) << 0) | - ((line[2*single_length] & (1 << 2)) >> 2); - outbuf[2] = - ((line[0] & (1 << 2)) << 4) | - ((line[0] & (1 << 1)) << 2) | - ((line[0] & (1 << 0)) << 0) | - ((line[single_length] & (1 << 2)) << 5) | - ((line[single_length] & (1 << 1)) << 3) | - ((line[single_length] & (1 << 0)) << 1) | - ((line[2*single_length] & (1 << 1)) << 4) | - ((line[2*single_length] & (1 << 0)) << 2); - line++; - outbuf += 3; - } -} - -#elif USE_3BIT_FOLD_TYPE == 323 - -static void -canon_fold_3bit(const unsigned char *line, - int single_length, - unsigned char *outbuf) -{ - unsigned char A0,A1,A2,B0,B1,B2,C0,C1,C2; - const unsigned char *last= line+single_length; - - for (; line < last; line+=3, outbuf+=8) { - - A0= line[0]; B0= line[single_length]; C0= line[2*single_length]; - - if (line<last-2) { - A1= line[1]; B1= line[single_length+1]; C1= line[2*single_length+1]; - } else { - A1= 0; B1= 0; C1= 0; - } - if (line<last-1) { - A2= line[2]; B2= line[single_length+2]; C2= line[2*single_length+2]; - } else { - A2= 0; B2= 0; C2= 0; - } - - outbuf[0] = - ((C0 & 0x80) >> 0) | - ((B0 & 0x80) >> 1) | - ((A0 & 0x80) >> 2) | - ((B0 & 0x40) >> 2) | - ((A0 & 0x40) >> 3) | - ((C0 & 0x20) >> 3) | - ((B0 & 0x20) >> 4) | - ((A0 & 0x20) >> 5); - outbuf[1] = - ((C0 & 0x10) << 3) | - ((B0 & 0x10) << 2) | - ((A0 & 0x10) << 1) | - ((B0 & 0x08) << 1) | - ((A0 & 0x08) << 0) | - ((C0 & 0x04) >> 0) | - ((B0 & 0x04) >> 1) | - ((A0 & 0x04) >> 2); - outbuf[2] = - ((C0 & 0x02) << 6) | - ((B0 & 0x02) << 5) | - ((A0 & 0x02) << 4) | - ((B0 & 0x01) << 4) | - ((A0 & 0x01) << 3) | - ((C1 & 0x80) >> 5) | - ((B1 & 0x80) >> 6) | - ((A1 & 0x80) >> 7); - outbuf[3] = - ((C1 & 0x40) << 1) | - ((B1 & 0x40) << 0) | - ((A1 & 0x40) >> 1) | - ((B1 & 0x20) >> 1) | - ((A1 & 0x20) >> 2) | - ((C1 & 0x10) >> 2) | - ((B1 & 0x10) >> 3) | - ((A1 & 0x10) >> 4); - outbuf[4] = - ((C1 & 0x08) << 4) | - ((B1 & 0x08) << 3) | - ((A1 & 0x08) << 2) | - ((B1 & 0x04) << 2) | - ((A1 & 0x04) << 1) | - ((C1 & 0x02) << 1) | - ((B1 & 0x02) >> 0) | - ((A1 & 0x02) >> 1); - outbuf[5] = - ((C1 & 0x01) << 7) | - ((B1 & 0x01) << 6) | - ((A1 & 0x01) << 5) | - ((B2 & 0x80) >> 3) | - ((A2 & 0x80) >> 4) | - ((C2 & 0x40) >> 4) | - ((B2 & 0x40) >> 5) | - ((A2 & 0x40) >> 6); - outbuf[6] = - ((C2 & 0x20) << 2) | - ((B2 & 0x20) << 1) | - ((A2 & 0x20) << 0) | - ((B2 & 0x10) >> 0) | - ((A2 & 0x10) >> 1) | - ((C2 & 0x08) >> 1) | - ((B2 & 0x08) >> 2) | - ((A2 & 0x08) >> 3); - outbuf[7] = - ((C2 & 0x04) << 5) | - ((B2 & 0x04) << 4) | - ((A2 & 0x04) << 3) | - ((B2 & 0x02) << 3) | - ((A2 & 0x02) << 2) | - ((C2 & 0x01) << 2) | - ((B2 & 0x01) << 1) | - ((A2 & 0x01) << 0); - } -} - -#else -#error 3BIT FOLD TYPE NOT IMPLEMENTED -#endif - static void canon_shift_buffer(unsigned char *line,int length,int bits) { @@ -3622,46 +2087,16 @@ canon_shift_buffer(unsigned char *line,int length,int bits) } } -#if 0 -static void -canon_shift_buffer2(unsigned char *line,int length,int bits) -{ - int i; - for (i=length-1; i>0; i--) { - line[i]= (line[i] >> bits) | (line[i-1] << (8-bits)); - } - line[0] = line[0] >> bits; -} -#endif -/* - * 'canon_write()' - Send graphics using TIFF packbits compression. - */ - -static int -canon_write(stp_vars_t *v, /* I - Print file or command */ - const canon_cap_t * caps, /* I - Printer model */ - unsigned char *line, /* I - Output bitmap data */ - int length, /* I - Length of bitmap data */ - int coloridx, /* I - Which color */ - int ydpi, /* I - Vertical resolution */ - int *empty, /* IO- Preceeding empty lines */ - int width, /* I - Printed width */ - int offset, /* I - Offset from left side */ - int bits) +/* fold, apply 5 pixel in 1 byte compression, pack tiff and return the compressed length */ +static int canon_compress(stp_vars_t *v, canon_privdata_t *pd, unsigned char* line,int length,int offset,unsigned char* comp_buf,int bits, int ink_flags) { unsigned char - comp_buf[COMPBUFWIDTH + COMPBUFWIDTH / 4], /* Compression buffer */ - in_fold[COMPBUFWIDTH], *in_ptr= line, *comp_ptr, *comp_data; - int newlength; int offset2,bitoffset; - unsigned char color; - canon_privdata_t *pd = - (canon_privdata_t *) stp_get_component_data(v, "Driver"); - /* Don't send blank lines... */ + /* Don't send blank lines... */ if (line[0] == 0 && memcmp(line, line + 1, length - 1) == 0) return 0; @@ -3672,23 +2107,22 @@ canon_write(stp_vars_t *v, /* I - Print file or command */ /* fold lsb/msb pairs if drop modulation is active */ - if (bits==2) { int pixels_per_byte = 4; - if((caps->features & CANON_CAP_5pixelin1byte) && (pd->color_info[coloridx].level == 3)) + if(ink_flags & INK_FLAG_5pixel_in_1byte) pixels_per_byte = 5; - stp_fold(line,length,in_fold); - in_ptr= in_fold; + + stp_fold(line,length,pd->fold_buf); + in_ptr= pd->fold_buf; length= (length*8/4); /* 4 pixels in 8bit */ /* calculate the number of compressed bytes that can be sent directly */ offset2 = offset / pixels_per_byte; /* calculate the number of (uncompressed) bits that have to be added to the raster data */ bitoffset = (offset % pixels_per_byte) * 2; } - if (bits==3) { - memset(in_fold,0,length); - canon_fold_3bit(line,length,in_fold); - in_ptr= in_fold; + else if (bits==3) { + stp_fold_3bit_323(line,length,pd->fold_buf); + in_ptr= pd->fold_buf; length= (length*8)/3; offset2 = offset/3; #if 0 @@ -3700,11 +2134,19 @@ canon_write(stp_vars_t *v, /* I - Print file or command */ #endif bitoffset= 0; } + else if (bits==4) { + stp_fold_4bit(line,length,pd->fold_buf); + in_ptr= pd->fold_buf; + length= (length*8)/2; + offset2 = offset / 2; + bitoffset= offset % 2; + } + /* pack left border rounded to multiples of 8 dots */ comp_data= comp_buf; while (offset2>0) { - unsigned char toffset = offset2 > 128 ? 128 : offset2; + unsigned char toffset = offset2 > 127 ? 127 : offset2; comp_data[0] = 1 - toffset; comp_data[1] = 0; comp_data += 2; @@ -3726,13 +2168,37 @@ canon_write(stp_vars_t *v, /* I - Print file or command */ "bitoffset=%d!!\n",bitoffset); } - - if((caps->features & CANON_CAP_5pixelin1byte) && (pd->color_info[coloridx].level == 3)) - length = pack_pixels(in_ptr,length); + if(ink_flags & INK_FLAG_5pixel_in_1byte) + length = pack_pixels(in_ptr,length); stp_pack_tiff(v, in_ptr, length, comp_data, &comp_ptr, NULL, NULL); - newlength= comp_ptr - comp_buf; + return comp_ptr - comp_buf; +} + +/* + * 'canon_write()' - Send graphics using TIFF packbits compression. + */ + +static int +canon_write(stp_vars_t *v, /* I - Print file or command */ + canon_privdata_t *pd, /* privdata */ + const canon_cap_t * caps, /* I - Printer model */ + unsigned char *line, /* I - Output bitmap data */ + int length, /* I - Length of bitmap data */ + int coloridx, /* I - Which color */ + int ydpi, /* I - Vertical resolution */ + int *empty, /* IO- Preceeding empty lines */ + int width, /* I - Printed width */ + int offset, /* I - Offset from left side */ + int bits, + int ink_flags) +{ + + unsigned char color; + int newlength = canon_compress(v,pd,line,length,offset,pd->comp_buf,bits,ink_flags); + if(!newlength) + return 0; /* send packed empty lines if any */ if (*empty) { @@ -3745,10 +2211,10 @@ canon_write(stp_vars_t *v, /* I - Print file or command */ stp_zfwrite("\033\050\101", 3, 1, v); stp_put16_le(newlength + 1, v); - color= "CMYKcmy"[coloridx]; + color= "CMYKcmyk"[coloridx]; if (!color) color= 'K'; stp_putc(color,v); - stp_zfwrite((const char *)comp_buf, newlength, 1, v); + stp_zfwrite((const char *)pd->comp_buf, newlength, 1, v); stp_putc('\015', v); return 1; } @@ -3759,24 +2225,30 @@ canon_write_line(stp_vars_t *v) { canon_privdata_t *pd = (canon_privdata_t *) stp_get_component_data(v, "Driver"); - static const int write_sequence[] = { 0, 3, 2, 1, 6, 5, 4 }; - static const int write_number[] = { 3, 2, 1, 0, 6, 5, 4 }; + char write_sequence[] = "KYMCymck"; + static const int write_number[] = { 3, 2, 1, 0, 6, 5, 4, 7 }; /* KYMCymc */ int i; int written= 0; - - for (i = 0; i < 7; i++) + for (i = 0; i < strlen(write_sequence) ; i++) { - int col = write_sequence[i]; + int x; + const canon_channel_t* channel=NULL; int num = write_number[i]; - int bits=pd->bits; - if(pd->caps->features & CANON_CAP_extended_t) - bits = pd->color_info[num].info & 3; - if (pd->cols[col]) - written += canon_write(v, pd->caps, - pd->cols[col] + pd->delay[col] * pd->buf_length, - pd->length, num, pd->ydpi, - &(pd->emptylines), pd->out_width, - pd->left, bits); + + /* TODO optimize => move reorder code to do_print */ + for(x=0;x < pd->num_channels; x++){ + if(pd->channels[x].name == write_sequence[i]){ + channel = &(pd->channels[x]); + break; + } + } + if(channel){ + written += canon_write(v, pd, pd->caps, + channel->buf + channel->delay * pd->length /*buf_length[i]*/, + pd->length, num, pd->mode->ydpi, + &(pd->emptylines), pd->out_width, + pd->left, channel->props->bits, channel->props->flags); + } } if (written) stp_zfwrite("\033\050\145\002\000\000\001", 7, 1, v); @@ -3784,6 +2256,57 @@ canon_write_line(stp_vars_t *v) pd->emptylines += 1; } + +/* write one multiraster block */ +static void canon_write_block(stp_vars_t* v,canon_privdata_t* pd,unsigned char* start, unsigned char* end){ + unsigned int length = end - start; + if(!length) + return; + stp_zfwrite("\033(F", 3, 1, v); + stp_put16_le(length, v); + stp_zfwrite((const char *)start, length, 1, v); +} + + +static void canon_write_multiraster(stp_vars_t *v,canon_privdata_t* pd,int y){ + int i; + unsigned int max_length = 2*pd->buf_length_max * RASTER_LINES_PER_BLOCK; + /* a new raster block begins */ + if(!(y % RASTER_LINES_PER_BLOCK)){ + if(y != 0){ + /* write finished blocks */ + for(i=0;i<pd->num_channels;i++) + canon_write_block(v,pd,pd->comp_buf + i * max_length,pd->channels[i].comp_buf_offset); + } + /* reset start offsets */ + for(i=0;i<pd->num_channels;i++) + pd->channels[i].comp_buf_offset = pd->comp_buf + i * max_length; + } + /* compress lines and add them to the buffer */ + for(i=0;i<pd->num_channels;i++){ + pd->channels[i].comp_buf_offset += canon_compress(v,pd, pd->channels[i].buf,pd->length,pd->left,pd->channels[i].comp_buf_offset,pd->channels[i].props->bits, pd->channels[i].props->flags); + *(pd->channels[i].comp_buf_offset) = 0x80; /* terminate the line */ + ++pd->channels[i].comp_buf_offset; + } + if(y == pd->out_height - 1){ + /* we just compressed our last line */ + if(pd->out_height % RASTER_LINES_PER_BLOCK){ + /* but our raster block is not finished yet */ + int missing = RASTER_LINES_PER_BLOCK - (pd->out_height % RASTER_LINES_PER_BLOCK); /* calculate missing lines */ + for(i=0;i<pd->num_channels;i++){ + /* add missing empty lines and write blocks */ + int x; + for(x=0;x < missing ; x++){ + *(pd->channels[i].comp_buf_offset) = 0x80; /* terminate the line */ + ++pd->channels[i].comp_buf_offset; + } + canon_write_block(v,pd,pd->comp_buf + i * max_length,pd->channels[i].comp_buf_offset); + } + } + } +} + + static void canon_advance_paper(stp_vars_t *v, int advance) { @@ -3854,11 +2377,11 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass) } } - written += canon_write(v, pd->caps, + written += canon_write(v, pd, pd->caps, (unsigned char *)(bufs[0].v[color] + line * linelength), - linelength, idx[color], pd->ydpi, + linelength, idx[color], pd->mode->ydpi, &(pd->emptylines), pd->out_width, - pd->left, pd->bits); + pd->left, pd->weave_bits[color],0); if (written) stp_deprintf(STP_DBG_CANON," --written color %d,\n", color); } diff --git a/src/main/print-canon.h b/src/main/print-canon.h new file mode 100644 index 0000000..812d3c1 --- /dev/null +++ b/src/main/print-canon.h @@ -0,0 +1,138 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 Sascha Sommer + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef GUTENPRINT_INTERNAL_CANON_H +#define GUTENPRINT_INTERNAL_CANON_H + + + +/* Codes for possible ink-tank combinations. + * Each combo is represented by the colors that can be used with + * the installed ink-tank(s) + * Combinations of the codes represent the combinations allowed for a model + * Note that only preferrable combinations should be used + */ +#define CANON_INK_K 1 +#define CANON_INK_CMY 2 +#define CANON_INK_CMYK 4 +#define CANON_INK_CcMmYK 8 +#define CANON_INK_CcMmYyK 16 + +#define CANON_INK_CcMmYyKk_MASK (CANON_INK_CcMmYK|CANON_INK_CcMmYyK) /* Ink is CcMmYyKk */ +#define CANON_INK_CMYK_MASK (CANON_INK_CMYK|CANON_INK_CcMmYyKk_MASK) /* Ink is CMYK */ +#define CANON_INK_CMY_MASK (CANON_INK_CMY|CANON_INK_CMYK_MASK) /* Ink is CMY */ +#define CANON_INK_K_MASK (CANON_INK_K|CANON_INK_CMYK_MASK) /* Ink is K */ + + + +/* FIXME someday we will have to fix the internal names (will break the ppds ;( +* List of possible ink settings ordered by descending ink count +*the driver will check if the current print mode supports the ink combination before offering it +*/ +static struct canon_inktype_s { + const unsigned int ink_type; + const unsigned int num_channels; + const char* name; + const char* text; +} canon_inktypes[] = { + {CANON_INK_CcMmYyK,7,"PhotoCMYK","Photo CcMmYyK Color"}, + {CANON_INK_CcMmYK,6,"PhotoCMY", "Photo CcMmYK Color"}, + {CANON_INK_CMYK,4,"CMYK","CMYK Color"}, + {CANON_INK_CMY,3,"RGB","CMY Color"}, + {CANON_INK_K,1,"Gray","Black"} +}; + +/* the PIXMA iP4000 and maybe other printers use following table to store + 5 pixels with 3 levels in 1 byte, All possible pixel combinations are given + numbers from 0 (=00,00,00,00,00) to 242 (=10,10,10,10,10) + combinations where the value of one of the pixels would be 3 are skipped +*/ +static const unsigned char tentoeight[] = +{ + 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 0, 0, 0, 0, + 9, 10, 11, 0, 12, 13, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, + 18, 19, 20, 0, 21, 22, 23, 0, 24, 25, 26, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 27, 28, 29, 0, 30, 31, 32, 0, 33, 34, 35, 0, 0, 0, 0, 0, + 36, 37, 38, 0, 39, 40, 41, 0, 42, 43, 44, 0, 0, 0, 0, 0, + 45, 46, 47, 0, 48, 49, 50, 0, 51, 52, 53, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 54, 55, 56, 0, 57, 58, 59, 0, 60, 61, 62, 0, 0, 0, 0, 0, + 63, 64, 65, 0, 66, 67, 68, 0, 69, 70, 71, 0, 0, 0, 0, 0, + 72, 73, 74, 0, 75, 76, 77, 0, 78, 79, 80, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 81, 82, 83, 0, 84, 85, 86, 0, 87, 88, 89, 0, 0, 0, 0, 0, + 90, 91, 92, 0, 93, 94, 95, 0, 96, 97, 98, 0, 0, 0, 0, 0, + 99,100,101, 0,102,103,104, 0,105,106,107, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108,109,110, 0,111,112,113, 0,114,115,116, 0, 0, 0, 0, 0, + 117,118,119, 0,120,121,122, 0,123,124,125, 0, 0, 0, 0, 0, + 126,127,128, 0,129,130,131, 0,132,133,134, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 135,136,137, 0,138,139,140, 0,141,142,143, 0, 0, 0, 0, 0, + 144,145,146, 0,147,148,149, 0,150,151,152, 0, 0, 0, 0, 0, + 153,154,155, 0,156,157,158, 0,159,160,161, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 162,163,164, 0,165,166,167, 0,168,169,170, 0, 0, 0, 0, 0, + 171,172,173, 0,174,175,176, 0,177,178,179, 0, 0, 0, 0, 0, + 180,181,182, 0,183,184,185, 0,186,187,188, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 189,190,191, 0,192,193,194, 0,195,196,197, 0, 0, 0, 0, 0, + 198,199,200, 0,201,202,203, 0,204,205,206, 0, 0, 0, 0, 0, + 207,208,209, 0,210,211,212, 0,213,214,215, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 216,217,218, 0,219,220,221, 0,222,223,224, 0, 0, 0, 0, 0, + 225,226,227, 0,228,229,230, 0,231,232,233, 0, 0, 0, 0, 0, + 234,235,236, 0,237,238,239, 0,240,241,242, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#endif diff --git a/src/main/print-color.c b/src/main/print-color.c index 733789b..592c90c 100644 --- a/src/main/print-color.c +++ b/src/main/print-color.c @@ -1,5 +1,5 @@ /* - * "$Id: print-color.c,v 1.135 2006/05/28 16:59:04 rlk Exp $" + * "$Id: print-color.c,v 1.135.8.1 2007/05/29 01:47:29 rlk Exp $" * * Gutenprint color management module - traditional Gutenprint algorithm. * @@ -785,6 +785,8 @@ compute_gcr_curve(const stp_vars_t *vars) k_trans = stp_get_float_parameter(vars, "BlackTrans"); k_upper *= lut->steps; k_lower *= lut->steps; + stp_dprintf(STP_DBG_LUT, vars, " k_lower %.3f\n", k_lower); + stp_dprintf(STP_DBG_LUT, vars, " k_upper %.3f\n", k_upper); if (k_lower > lut->steps) k_lower = lut->steps; diff --git a/src/main/print-escp2-data.c b/src/main/print-escp2-data.c index 43f496b..1327e7f 100644 --- a/src/main/print-escp2-data.c +++ b/src/main/print-escp2-data.c @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2-data.c,v 1.202 2006/07/22 20:28:13 rlk Exp $" + * "$Id: print-escp2-data.c,v 1.202.6.2 2007/05/29 01:47:29 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -76,6 +76,12 @@ static const escp2_dot_size_t p3pl_dotsizes = static const escp2_dot_size_t p1_5pl_dotsizes = { 0x10, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x13, 0x13 }; +static const escp2_dot_size_t claria_dotsizes = +{ 0x33, 0x33, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, 0x25 }; + +static const escp2_dot_size_t claria_1400_dotsizes = +{ 0x33, 0x33, 0x21, 0x21, 0x33, 0x25, 0x25, 0x25, 0x25 }; + static const escp2_dot_size_t c2pl_dotsizes = { 0x12, 0x12, 0x12, 0x11, 0x13, -1, 0x10, 0x10, 0x10 }; @@ -198,6 +204,9 @@ static const escp2_base_resolutions_t c1_8_base_res = static const escp2_base_resolutions_t c1_5_base_res = { 360, 360, 720, 720, 720, 720, 720, 720, 720 }; +static const escp2_base_resolutions_t claria_1400_base_res = +{ 360, 360, 720, 720, 360, 720, 720, 720, 720 }; + static const escp2_base_resolutions_t stc900_base_res = { 360, 360, 360, 360, 180, 180, 360, 360, 360 }; @@ -253,6 +262,12 @@ static const escp2_densities_t p3pl_densities = static const escp2_densities_t p1_5pl_densities = { 2.8, 1.4, 1.00, 1.000, 0.869, 0.942, 0.471, 0.500, 0.530 }; +static const escp2_densities_t claria_densities = +{ 2.8, 1.4, 2.00, 1.000, 0.500, 0.812, 0.406, 0.546, 0.440 }; + +static const escp2_densities_t claria_1400_densities = +{ 2.8, 1.4, 2.00, 1.000, 0.500, 0.812, 0.406, 0.546, 0.440 }; + static const escp2_densities_t p3_5pl_densities = { 2.8, 1.4, 1.77, 0.886, 0.443, 0.221, 0.240, 0.293, 0.146 }; @@ -296,575 +311,68 @@ static const escp2_densities_t picturemate_densities = { 0, 0, 0, 0, 1.596, 0.798, 0.650, 0.530, 0.0 }; -#define DECLARE_INPUT_SLOT(name) \ -static const input_slot_list_t name##_input_slot_list = \ -{ \ - #name, \ - name##_input_slots, \ - sizeof(name##_input_slots) / sizeof(const input_slot_t), \ -} - -static const input_slot_t standard_roll_feed_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Roll", - N_("Roll Feed"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, - { 6, "IR\002\000\000\002" } - } -}; - -DECLARE_INPUT_SLOT(standard_roll_feed); - -static const input_slot_t cutter_roll_feed_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "RollCutPage", - N_("Roll Feed (cut each page)"), - 0, - 1, - ROLL_FEED_CUT_ALL, - { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, - { 6, "IR\002\000\000\002" } - }, - { - "RollCutNone", - N_("Roll Feed (do not cut)"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, - { 6, "IR\002\000\000\002" } - } -}; - -DECLARE_INPUT_SLOT(cutter_roll_feed); - -static const input_slot_t cd_cutter_roll_feed_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\000"} - }, - { - "Manual", - N_("Manual Feed"), - 0, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "CD", - N_("Print to CD"), - 1, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "RollCutPage", - N_("Roll Feed (cut each page)"), - 0, - 1, - ROLL_FEED_CUT_ALL, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\002" } - }, - { - "RollCutNone", - N_("Roll Feed (do not cut)"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\002" } - } -}; - -DECLARE_INPUT_SLOT(cd_cutter_roll_feed); - -static const input_slot_t cd_roll_feed_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\000"} - }, - { - "Manual", - N_("Manual Feed"), - 0, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "CD", - N_("Print to CD"), - 1, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "Roll", - N_("Roll Feed"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\002" } - } -}; - -DECLARE_INPUT_SLOT(cd_roll_feed); - -static const input_slot_t r2400_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\000"} - }, - { - "Velvet", - N_("Manual Sheet Guide"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Matte", - N_("Manual Feed (Front)"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Roll", - N_("Roll Feed"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, - { 6, "IR\002\000\000\002" } - } -}; - -DECLARE_INPUT_SLOT(r2400); - -static const input_slot_t r1800_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, - { 6, "IR\002\000\000\000"} - }, - { - "Velvet", - N_("Manual Sheet Guide"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Matte", - N_("Manual Feed (Front)"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Roll", - N_("Roll Feed"), - 0, - 1, - ROLL_FEED_DONT_EJECT, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, - { 6, "IR\002\000\000\002" } - }, - { - "CD", - N_("Print to CD"), - 1, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, -}; - -DECLARE_INPUT_SLOT(r1800); - -static const input_slot_t rx700_input_slots[] = -{ - { - "Rear", - N_("Rear Tray"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\000" }, - { 6, "IR\002\000\000\000"} - }, - { - "Front", - N_("Front Tray"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "CD", - N_("Print to CD"), - 1, - 0, - 0, - { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, - { 6, "IR\002\000\000\000"} - }, - { - "PhotoBoard", - N_("Photo Board"), - 0, - 0, - 0, - { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, - { 6, "IR\002\000\000\000"} - }, -}; - -DECLARE_INPUT_SLOT(rx700); - -static const input_slot_t pro_roll_feed_input_slots[] = -{ - { - "Standard", - N_("Standard"), - 0, - 0, - 0, - { 7, "PP\003\000\000\002\000" }, - { 0, "" } - }, - { - "Roll", - N_("Roll Feed"), - 0, - 1, - 0, - { 7, "PP\003\000\000\003\000" }, - { 0, "" } - } -}; - -DECLARE_INPUT_SLOT(pro_roll_feed); - -static const input_slot_t spro5000_input_slots[] = -{ - { - "CutSheet1", - N_("Cut Sheet Bin 1"), - 0, - 0, - 0, - { 7, "PP\003\000\000\001\001" }, - { 0, "" } - }, - { - "CutSheet2", - N_("Cut Sheet Bin 2"), - 0, - 0, - 0, - { 7, "PP\003\000\000\002\001" }, - { 0, "" } - }, - { - "CutSheetAuto", - N_("Cut Sheet Autoselect"), - 0, - 0, - 0, - { 7, "PP\003\000\000\001\377" }, - { 0, "" } - }, - { - "ManualSelect", - N_("Manual Selection"), - 0, - 0, - 0, - { 7, "PP\003\000\000\002\001" }, - { 0, "" } - } -}; - -DECLARE_INPUT_SLOT(spro5000); - -static const input_slot_list_t default_input_slot_list = -{ - "Standard", - NULL, - 0, -}; - -static const stp_raw_t new_init_sequence = -{ - 29, "\0\0\0\033\001@EJL 1284.4\n@EJL \n\033@" -}; - -static const stp_raw_t je_deinit_sequence = -{ - 5, "JE\001\000\000" -}; - -#define INCH(x) (72 * x) +static const stp_raw_t new_init_sequence = STP_RAW_STRING("\0\0\0\033\001@EJL 1284.4\n@EJL \n\033@"); -#define DECLARE_QUALITY_LIST(name) \ -static const quality_list_t name##_quality_list = \ -{ \ - #name, \ - name##_qualities, \ - sizeof(name##_qualities) / sizeof(const quality_t), \ -} +static const stp_raw_t je_deinit_sequence = STP_RAW_STRING("JE\001\000\000"); -static const quality_t standard_qualities[] = -{ - { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, - { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, - { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, - { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, - { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, - { "Photo", N_("Photo"), 1440, 720, 2880, 720, 1440, 720 }, - { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, - { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, - { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, -}; +/* These sequences provided by Epson. No, I don't know what + most of them mean. */ -DECLARE_QUALITY_LIST(standard); +static const stp_raw_t bsc64_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\000\260\004\352\004\064\001\016\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\020\010"); -static const quality_t p1_5_qualities[] = -{ - { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, - { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, - { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, - { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, - { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, - { "Photo", N_("Photo"), 1440, 720, 1440, 720, 1440, 720 }, - { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, - { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, - { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, -}; +static const stp_raw_t bsc66_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\000\260\004\352\004\064\001\016\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\020\010"); -DECLARE_QUALITY_LIST(p1_5); +static const stp_raw_t bsc68_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\000\260\004\352\004\064\001\016\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\020\010"); -static const quality_t picturemate_qualities[] = -{ - { "Draft", N_("Draft"), 1440, 720, 1440, 720, 1440, 720 }, - { "Standard", N_("Standard"), 1440, 1440, 1440, 1440, 1440, 1440 }, - { "Photo", N_("Photo"), 1440, 1440, 1440, 1440, 1440, 1440 }, - { "High", N_("High"), 2880, 1440, 2880, 1440, 2880, 1440 }, - { "HighPhoto", N_("Super Photo"), 2880, 1440, 2880, 1440, 2880, 1440 }, - { "UltraPhoto", N_("Ultra Photo"), 5760, 1440, 5760, 1440, 5760, 1440 }, - { "Best", N_("Best"), 5760, 1440, 5760, 1440, 5760, 1440 }, -}; +static const stp_raw_t bsc82_borderless_sequence = STP_RAW_STRING("SN\062\000\000\006\013\000\000\000\000\000\000\000\001\002\026\003\276\000\064\007\000\000\154\007\352\011\352\011\226\000\000\000\226\000\064\007\023\020\025\031\001\021\004\021\021\021\001\001\000\000\174\005"); -DECLARE_QUALITY_LIST(picturemate); +static const stp_raw_t bsc84_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\027\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\370\007"); -#define DECLARE_CHANNEL_LIST(name) \ -static const channel_name_t name##_channel_name_list = \ -{ \ - #name, \ - sizeof(name##_channel_names) / sizeof(const char *), \ - name##_channel_names \ -} +static const stp_raw_t bsc86_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\027\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\370\007"); -static const char *standard_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow") -}; +static const stp_raw_t bsc88_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\027\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\370\007"); -DECLARE_CHANNEL_LIST(standard); +static const stp_raw_t cx6400_borderless_sequence = STP_RAW_STRING("SN\062\000\000\006\026\000\000\000\000\000\000\001\000\000\027\003\276\000\077\007\000\000\334\005\366\011\366\011\226\000\000\000\226\000\077\007\031\030\031\031\004\031\004\031\031\031\004\004\000\000\135\006"); -static const char *cx3800_channel_names[] = -{ - N_("Cyan"), - N_("Yellow"), - N_("Magenta"), - N_("Black") -}; +static const stp_raw_t cx6600_borderless_sequence = STP_RAW_STRING("SN\062\000\000\006\026\000\000\000\000\000\000\001\000\000\027\003\276\000\077\007\000\000\334\005\366\011\366\011\226\000\000\000\226\000\077\007\031\030\031\031\004\031\004\031\031\031\004\004\000\000\135\006"); -DECLARE_CHANNEL_LIST(cx3800); +static const stp_raw_t pm830c_borderless_sequence = STP_RAW_STRING("SN\054\000\000\001\027\000\000\000\000\000\000\001\003\000\243\156\000\223\170\220\065\002\000\000\005\277\001\270\006\144\000\164\016\032\004\042\005\310\031\000\100\000\022\143\102\007"); -static const char *mfp2005_channel_names[] = -{ - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Black") -}; +static const stp_raw_t pm930c_borderless_sequence = STP_RAW_STRING("SN\070\000\000\007\027\000\000\000\000\000\000\001\003\000\330\006\124\001\264\015\042\013\110\007\060\011\316\022\054\001\251\013\054\001\002\003\363\027\031\030\031\031\031\031\004\031\031\031\001\004\103\000\000\001\001\001\360\006"); -DECLARE_CHANNEL_LIST(mfp2005); +static const stp_raw_t pm970c_borderless_sequence = STP_RAW_STRING("SN\070\000\000\007\033\000\000\000\000\000\000\001\003\000\330\006\124\001\264\015\054\013\110\007\060\011\316\022\054\001\251\013\054\001\002\003\363\027\031\030\031\031\031\031\004\031\031\031\001\004\103\000\000\001\001\001\364\006"); -static const char *photo_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Light Cyan"), - N_("Light Magenta"), -}; +static const stp_raw_t sp1280_borderless_sequence = STP_RAW_STRING("SN\003\000\000\011\001"); -DECLARE_CHANNEL_LIST(photo); +static const stp_raw_t sp780_borderless_sequence = STP_RAW_STRING("SN\003\000\000\000\002SN\003\000\000\001\001SN\003\000\000\011\001"); -static const char *rx700_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Light Cyan"), - N_("Magenta"), - N_("Light Magenta"), - N_("Yellow"), -}; +static const stp_raw_t sp820_borderless_sequence = STP_RAW_STRING("SN\003\000\000\011\001"); -DECLARE_CHANNEL_LIST(rx700); +static const stp_raw_t sp820u_borderless_sequence = STP_RAW_STRING("SN\003\000\000\011\001"); -static const char *sp2200_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Light Cyan"), - N_("Light Magenta"), - N_("Light Black"), -}; +static const stp_raw_t sp825_borderless_sequence = STP_RAW_STRING("SN\003\000\000\011\001"); -DECLARE_CHANNEL_LIST(sp2200); +static const stp_raw_t sp890_borderless_sequence = STP_RAW_STRING("SN\003\000\000\000\010SN\003\000\000\001\001SN\003\000\000\002\000SN\003\000\000\007\000SN\003\000\000\011\001"); -static const char *pm_950c_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Light Cyan"), - N_("Light Magenta"), - N_("Dark Yellow"), -}; +static const stp_raw_t sp900_borderless_sequence = STP_RAW_STRING("SN\064\000\000\003\026\000\000\000\000\000\000\001\003\000\007\144\050\002\152\215\000\063\344\000\040\120\000\207\150\020\212\003\070\002\360\001\324\100\000\001\010\001\142\141\141\140\141\024\002\025\027\061\132\011"); -DECLARE_CHANNEL_LIST(pm_950c); +static const stp_raw_t sp925_borderless_sequence = STP_RAW_STRING("SN\054\000\000\001\027\000\000\000\000\000\000\001\003\000\243\156\000\223\170\220\065\002\000\000\005\277\001\270\006\144\000\024\036\032\004\042\005\310\031\000\100\000\022\143\362\006"); -static const char *sp960_channel_names[] = -{ - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Light Cyan"), - N_("Light Magenta"), - N_("Black"), -}; +static const stp_raw_t sp960_borderless_sequence = STP_RAW_STRING("SN\064\000\000\002\027\000\000\000\000\000\000\001\003\000\204\003\252\000\204\006\270\004\364\006\166\005\230\011\226\000\304\004\226\000\206\002\270\012\031\030\031\031\031\031\004\064\064\064\004\001\000\000\040\011"); -DECLARE_CHANNEL_LIST(sp960); +static const stp_raw_t spr300_borderless_sequence = STP_RAW_STRING("SN\120\000\000\014\027\000\000\000\000\000\000\000\003\000\001\001\130\002\320\004\107\001\107\002\000\000\000\000\120\010\204\020\030\025\310\031\340\075\240\017\214\012\060\005\214\000\012\001\054\001\000\000\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\017\017\000\000\001\001\000\001\060\010"); -static const char *r800_channel_names[] = -{ - N_("Yellow"), - N_("Magenta"), - N_("Cyan"), - N_("Matte Black"), - N_("Photo Black"), - N_("Red"), - N_("Blue"), - N_("Gloss Optimizer"), -}; +static const stp_raw_t spr320_borderless_sequence = STP_RAW_STRING("SN\120\000\000\014\027\000\000\000\000\000\000\000\003\000\001\001\130\002\320\004\107\001\107\002\000\000\000\000\120\010\204\020\030\025\310\031\340\075\240\017\214\012\060\005\214\000\012\001\054\001\000\000\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\017\017\000\000\001\001\000\001\060\010"); -DECLARE_CHANNEL_LIST(r800); +static const stp_raw_t spr800_borderless_sequence = STP_RAW_STRING("SN\124\000\000\012\033\000\000\000\000\000\000\001\003\000\001\001\235\007\124\001\120\012\252\000\363\006\077\002\120\012\277\007\050\002\045\013\054\001\253\000\037\001\041\000\040\001\322\000\241\000\000\000\017\000\036\000\030\031\031\031\031\031\031\031\003\033\033\143\143\143\143\143\143\143\143\143\143\143\002\000\001\000\001\001\362\014"); -static const char *picturemate_channel_names[] = -{ - N_("Yellow"), - N_("Magenta"), - N_("Cyan"), - N_("Black"), - N_("Red"), - N_("Blue"), -}; +static const stp_raw_t sprx500_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\367\007"); -DECLARE_CHANNEL_LIST(picturemate); +static const stp_raw_t sprx600_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\367\007"); -static const char *r2400_channel_names[] = -{ - N_("Light Light Black"), - N_("Light Magenta"), - N_("Light Cyan"), - N_("Light Black"), - N_("Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), -}; +static const stp_raw_t sprx620_borderless_sequence = STP_RAW_STRING("SN\114\000\000\011\026\000\000\000\000\000\000\000\003\000\000\001\260\004\336\004\064\001\000\002\000\000\000\000\064\010\150\020\030\025\310\031\340\075\314\020\214\012\024\005\214\000\012\001\054\001\000\000\017\017\017\017\017\017\017\017\004\012\004\017\017\017\017\017\006\004\000\001\001\001\000\000\367\007"); -DECLARE_CHANNEL_LIST(r2400); +#define INCH(x) (72 * x) const stpi_escp2_printer_t stpi_escp2_model_capabilities[] = { @@ -872,1332 +380,1536 @@ const stpi_escp2_printer_t stpi_escp2_model_capabilities[] = /* 0: Stylus Color */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 15, 1, 4, 15, 1, 4, 15, 1, 4, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g1_dotsizes, g1_densities, &stpi_escp2_simple_drops, - stpi_escp2_720dpi_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g1_dotsizes, g1_densities, "simple", + "720dpi", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 1: Stylus Color 400/500 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g2_dotsizes, g1_densities, &stpi_escp2_simple_drops, - stpi_escp2_sc500_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g2_dotsizes, g1_densities, "simple", + "sc500", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 2: Stylus Color 1500 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17), INCH(44), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g1_dotsizes, sc1500_densities, &stpi_escp2_simple_drops, - stpi_escp2_sc500_reslist, &stpi_escp2_cmy_inkgroup, - standard_bits, standard_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g1_dotsizes, sc1500_densities, "simple", + "sc500", "cmy", + standard_bits, standard_base_res, "standard_roll_feed", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 3: Stylus Color 600 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 32, 1, 4, 32, 1, 4, 32, 1, 4, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 8, 9, 0, 30, 8, 9, 0, 30, 8, 9, 0, 0, 8, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - sc600_dotsizes, g3_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + sc600_dotsizes, g3_densities, "simple", + "g3", "standard", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 4: Stylus Color 800 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 64, 1, 2, 64, 1, 2, 64, 1, 2, 4, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 4, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 4, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 8, 9, 9, 40, 8, 9, 9, 40, 8, 9, 0, 0, 8, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g3_dotsizes, g3_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g3_dotsizes, g3_densities, "simple", + "g3", "standard", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 5: Stylus Color 850 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 64, 1, 2, 64, 1, 2, 64, 1, 2, 4, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 4, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 4, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g3_dotsizes, g3_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g3_dotsizes, g3_densities, "simple", + "g3", "standard", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 6: Stylus Color 1520 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 64, 1, 2, 64, 1, 2, 64, 1, 2, 4, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 4, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 4, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17), INCH(44), INCH(2), INCH(2), 8, 9, 9, 40, 8, 9, 9, 40, 8, 9, 0, 0, 8, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g3_dotsizes, g3_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, g3_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g3_dotsizes, g3_densities, "simple", + "g3", "standard", + standard_bits, g3_base_res, "standard_roll_feed", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* SECOND GENERATION PRINTERS */ /* 7: Stylus Photo 700 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 32, 1, 4, 32, 1, 4, 32, 1, 4, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 30, 9, 9, 0, 30, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 15, 0, 0, /* Is it really 15 pairs??? */ - sp700_dotsizes, sp700_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &photo_channel_name_list + sp700_dotsizes, sp700_densities, "simple", + "g3", "photo_gen1", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "photo" }, /* 8: Stylus Photo EX */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_NO | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 32, 1, 4, 32, 1, 4, 32, 1, 4, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(118 / 10), INCH(44), INCH(2), INCH(2), 9, 9, 0, 30, 9, 9, 0, 30, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - sp700_dotsizes, sp700_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &photo_channel_name_list + sp700_dotsizes, sp700_densities, "simple", + "g3", "photo_gen1", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "photo" }, /* 9: Stylus Photo */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 32, 1, 4, 32, 1, 4, 32, 1, 4, 6, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 30, 9, 9, 0, 30, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - sp700_dotsizes, sp700_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_720dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, g3_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &photo_channel_name_list + sp700_dotsizes, sp700_densities, "simple", + "g3_720dpi", "photo_gen1", + standard_bits, g3_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "photo" }, /* THIRD GENERATION PRINTERS */ /* 10: Stylus Color 440/460 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 21, 1, 4, 21, 1, 4, 21, 1, 4, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 15, 0, 0, - sc440_dotsizes, sc440_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_720dpi_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + sc440_dotsizes, sc440_densities, "simple", + "g3_720dpi", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 11: Stylus Color 640 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 32, 1, 4, 32, 1, 4, 32, 1, 4, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 15, 0, 0, - sc640_dotsizes, sc440_densities, &stpi_escp2_simple_drops, - stpi_escp2_sc640_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + sc640_dotsizes, sc440_densities, "simple", + "sc640", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 12: Stylus Color 740/Stylus Scan 2000/Stylus Scan 2500 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c6pl_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + c6pl_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 13: Stylus Color 900 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 96, 1, 2, 192, 1, 1, 192, 1, 1, 4, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c3pl_dotsizes, c3pl_densities, &stpi_escp2_variable_3pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, stc900_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_dotsizes, c3pl_densities, "variable_3pl", + "1440dpi", "standard", + variable_bits, stc900_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 14: Stylus Photo 750 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c6pl_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c6pl_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "photo_gen1", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 15: Stylus Photo 1200 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c6pl_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - variable_bits, variable_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c6pl_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "photo_gen1", + variable_bits, variable_base_res, "standard_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 16: Stylus Color 860 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_1440_4pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_1440_4pl", + "1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 17: Stylus Color 1160 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_1440_4pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_1440_4pl", + "1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 18: Stylus Color 660 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 32, 1, 4, 32, 1, 4, 32, 1, 4, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 8, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 8, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 9, 9, 9, 9, 9, 26, 9, 9, 9, 0, 9, 9, 9, 0, -1, -1, 0, 0, 0, 1, 15, 0, 0, - sc660_dotsizes, sc660_densities, &stpi_escp2_simple_drops, - stpi_escp2_sc640_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc660_dotsizes, sc660_densities, "simple", + "sc640", "standard", + standard_bits, standard_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 19: Stylus Color 760 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_1440_4pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_1440_4pl", + "1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 20: Stylus Photo 720 (Australia) */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 32, 1, 4, 32, 1, 4, 32, 1, 4, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sp720_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + sp720_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "photo_gen1", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 21: Stylus Color 480 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_YES | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, 360, 720, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, 360, 720, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sc480_dotsizes, sc480_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_720dpi_soft_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc480_dotsizes, sc480_densities, "variable_x80_6pl", + "720dpi_soft", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 22: Stylus Photo 870/875 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 97, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_1440_4pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_1440_4pl", + "1440dpi", "photo_gen2", + variable_bits, variable_base_res, "standard_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 23: Stylus Photo 1270 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 97, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_1440_4pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_1440_4pl", + "1440dpi", "photo_gen2", + variable_bits, variable_base_res, "standard_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 24: Stylus Color 3000 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 64, 1, 2, 64, 1, 2, 64, 1, 2, 4, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 4, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 4, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17), INCH(44), INCH(2), INCH(2), 8, 9, 9, 40, 8, 9, 9, 40, 8, 9, 0, 0, 8, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g3_dotsizes, g3_densities, &stpi_escp2_simple_drops, - stpi_escp2_g3_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, g3_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g3_dotsizes, g3_densities, "simple", + "g3", "standard", + standard_bits, g3_base_res, "standard_roll_feed", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 25: Stylus Color 670 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 32, 1, 4, 64, 1, 2, 64, 1, 2, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sc670_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc670_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 26: Stylus Photo 2000P */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 2, 15, 0, 0, - sp2000_dotsizes, sp2000_densities, &stpi_escp2_variable_2000p_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_pigment_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + sp2000_dotsizes, sp2000_densities, "variable_2000p", + "1440dpi", "photo_pigment", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 27: Stylus Pro 5000 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 64, 1, 2, 64, 1, 2, 64, 1, 2, 6, - 360, 14400, -1, 1440, 720, 180, 180, 0, 1, 0, 0, 0, 0, 4, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 180, 180, + 0, 1, 0, 0, 0, 0, 0, 4, 1, 28800, 720 * 720, INCH(13), INCH(44), INCH(2), INCH(2), 9, 9, 0, 30, 9, 9, 0, 30, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro5000_dotsizes, sp700_densities, &stpi_escp2_simple_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, g3_base_res, &spro5000_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &photo_channel_name_list + spro5000_dotsizes, sp700_densities, "simple", + "1440dpi", "photo_gen1", + standard_bits, g3_base_res, "spro5000", + "standard", NULL, NULL, + NULL, NULL, "photo" }, /* 28: Stylus Pro 7000 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(24), INCH(1200), INCH(7), INCH(7), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 9, 9, 9, 9, 9, 9, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro_dye_dotsizes, spro_dye_densities, &stpi_escp2_simple_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7000_printer_weave_list, &photo_channel_name_list + spro_dye_dotsizes, spro_dye_densities, "simple", + "pro", "photo_gen1", + standard_bits, pro_base_res, "pro_roll_feed", + "standard", NULL, NULL, + NULL, "pro7000", "photo" }, /* 29: Stylus Pro 7500 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(24), INCH(1200), INCH(7), INCH(7), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 9, 9, 9, 9, 9, 9, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro_pigment_dotsizes, spro_pigment_densities, &stpi_escp2_simple_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_pigment_inkgroup, - standard_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7500_printer_weave_list, &photo_channel_name_list + spro_pigment_dotsizes, spro_pigment_densities, "simple", + "pro", "photo_pigment", + standard_bits, pro_base_res, "pro_roll_feed", + "standard", NULL, NULL, + NULL, "pro7500", "photo" }, /* 30: Stylus Pro 9000 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(44), INCH(1200), INCH(7), INCH(7), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 9, 9, 9, 9, 9, 9, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro_dye_dotsizes, spro_dye_densities, &stpi_escp2_simple_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_gen1_inkgroup, - standard_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7000_printer_weave_list, &photo_channel_name_list + spro_dye_dotsizes, spro_dye_densities, "simple", + "pro", "photo_gen1", + standard_bits, pro_base_res, "pro_roll_feed", + "standard", NULL, NULL, + NULL, "pro7000", "photo" }, /* 31: Stylus Pro 9500 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(44), INCH(1200), INCH(7), INCH(7), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 9, 9, 9, 9, 9, 9, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro_pigment_dotsizes, spro_pigment_densities, &stpi_escp2_simple_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_pigment_inkgroup, - standard_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7500_printer_weave_list, &photo_channel_name_list + spro_pigment_dotsizes, spro_pigment_densities, "simple", + "pro", "photo_pigment", + standard_bits, pro_base_res, "pro_roll_feed", + "standard", NULL, NULL, + NULL, "pro7500", "photo" }, /* 32: Stylus Color 777/680 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 33: Stylus Color 880/83/C60 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 34: Stylus Color 980 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 96, 1, 2, 192, 1, 1, 192, 1, 1, 4, - 360, 14400, -1, 2880, 720, 180, 180, 38, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 180, 180, + 38, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c3pl_dotsizes, sc980_densities, &stpi_escp2_variable_3pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_dotsizes, sc980_densities, "variable_3pl", + "2880dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, - /* 35: Stylus Photo 780/790/810/820 */ + /* 35: Stylus Photo 780/790 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "photo_gen2", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp780_borderless_sequence, NULL, "photo" }, /* 36: Stylus Photo 785/890/895/915/935 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "photo_gen2", + variable_bits, variable_base_res, "standard_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp890_borderless_sequence, NULL, "photo" }, /* 37: Stylus Photo 1280/1290 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &standard_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "photo_gen2", + variable_bits, variable_base_res, "standard_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp1280_borderless_sequence, NULL, "photo" }, /* 38: Stylus Color 580 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_YES | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, 360, 1440, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, 360, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sc480_dotsizes, sc480_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc480_dotsizes, sc480_densities, "variable_x80_6pl", + "1440dpi", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 39: Stylus Color Pro XL */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 16, 1, 4, 16, 1, 4, 16, 1, 4, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g1_dotsizes, g1_densities, &stpi_escp2_simple_drops, - stpi_escp2_720dpi_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g1_dotsizes, g1_densities, "simple", + "720dpi", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 40: Stylus Pro 5500 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro_pigment_dotsizes, spro_pigment_densities, &stpi_escp2_simple_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_pigment_inkgroup, - standard_bits, pro_base_res, &spro5000_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7500_printer_weave_list, &photo_channel_name_list + spro_pigment_dotsizes, spro_pigment_densities, "simple", + "pro", "photo_pigment", + standard_bits, pro_base_res, "spro5000", + "standard", NULL, NULL, + NULL, "pro7500", "photo" }, /* 41: Stylus Pro 10000 */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_PRO | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(44), INCH(1200), INCH(7), INCH(7), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 9, 9, 9, 9, 9, 9, -1, -1, 0, 0, 0, 1, 7, 0, 0, - spro10000_dotsizes, spro10000_densities, &stpi_escp2_spro10000_drops, - stpi_escp2_pro_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, NULL, NULL, - &stpi_escp2_pro7000_printer_weave_list, &photo_channel_name_list + spro10000_dotsizes, spro10000_densities, "spro10000", + "pro", "photo_gen2", + variable_bits, pro_base_res, "pro_roll_feed", + "standard", NULL, NULL, + NULL, "pro7000", "photo" }, /* 42: Stylus C20SX/C20UX */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_YES | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sc480_dotsizes, sc480_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_720dpi_soft_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc480_dotsizes, sc480_densities, "variable_x80_6pl", + "720dpi_soft", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 43: Stylus C40SX/C40UX/C41SX/C41UX/C42SX/C42UX */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_YES | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sc480_dotsizes, sc480_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + sc480_dotsizes, sc480_densities, "variable_x80_6pl", + "1440dpi", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 44: Stylus C70/C80 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 60, 60, 2, 180, 180, 2, 180, 180, 2, 4, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 0, -240, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 0, 0, -240, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_densities, &stpi_escp2_variable_3pl_pigment_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 45: Stylus Color Pro */ { (MODEL_VARIABLE_NO | MODEL_COMMAND_1998 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_NO), 16, 1, 4, 16, 1, 4, 16, 1, 4, 4, - 360, 14400, -1, 720, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 720, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(44), INCH(2), INCH(2), 9, 9, 9, 40, 9, 9, 9, 40, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 1, 7, 0, 0, - g1_dotsizes, g1_densities, &stpi_escp2_simple_drops, - stpi_escp2_720dpi_reslist, &stpi_escp2_standard_inkgroup, - standard_bits, standard_base_res, &default_input_slot_list, - &standard_quality_list, NULL, NULL, - NULL, &standard_channel_name_list + g1_dotsizes, g1_densities, "simple", + "720dpi", "standard", + standard_bits, standard_base_res, "default", + "standard", NULL, NULL, + NULL, NULL, "standard" }, /* 46: Stylus Photo 950/960 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 96, 96, 2, 96, 96, 2, 24, 24, 1, 6, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 24, 4, 15, 0, 0, - c2pl_dotsizes, c2pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_f360_photo_inkgroup, - stp950_bits, stp950_base_res, &cd_cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &sp960_channel_name_list + c2pl_dotsizes, c2pl_densities, "variable_2pl", + "superfine", "f360_photo", + stp950_bits, stp950_base_res, "cd_cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp960_borderless_sequence, NULL, "sp960" }, /* 47: Stylus Photo 2100/2200 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 96, 96, 2, 96, 96, 2, 192, 192, 1, 7, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 0, 4, 15, 0, 0, - c4pl_pigment_dotsizes, c4pl_pigment_densities, &stpi_escp2_variable_ultrachrome_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_f360_ultrachrome_inkgroup, - ultrachrome_bits, ultrachrome_base_res, &cd_cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &sp2200_channel_name_list + c4pl_pigment_dotsizes, c4pl_pigment_densities, "variable_ultrachrome", + "superfine", "f360_ultrachrome", + ultrachrome_bits, ultrachrome_base_res, "cd_cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "sp2200" }, /* 48: Stylus Pro 7600 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_PRO | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 0, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(24), INCH(1200), INCH(7), INCH(7), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - spro_c4pl_pigment_dotsizes, c4pl_pigment_densities, &stpi_escp2_variable_ultrachrome_drops, - stpi_escp2_pro_reslist, &stpi_escp2_ultrachrome_inkgroup, - ultrachrome_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - &stpi_escp2_pro7600_printer_weave_list, &photo_channel_name_list + spro_c4pl_pigment_dotsizes, c4pl_pigment_densities, "variable_ultrachrome", + "pro", "ultrachrome", + ultrachrome_bits, pro_base_res, "pro_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, "pro7600", "photo" }, /* 49: Stylus Pro 9600 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_PRO | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_YES | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 0, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(44), INCH(1200), INCH(7), INCH(7), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - spro_c4pl_pigment_dotsizes, c4pl_pigment_densities, &stpi_escp2_variable_ultrachrome_drops, - stpi_escp2_pro_reslist, &stpi_escp2_ultrachrome_inkgroup, - ultrachrome_bits, pro_base_res, &pro_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - &stpi_escp2_pro7600_printer_weave_list, &photo_channel_name_list + spro_c4pl_pigment_dotsizes, c4pl_pigment_densities, "variable_ultrachrome", + "pro", "ultrachrome", + ultrachrome_bits, pro_base_res, "pro_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, "pro7600", "photo" }, /* 50: Stylus Photo 825/830 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 1440, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880_1440dpi", "photo_gen2", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp1280_borderless_sequence, NULL, "photo" }, /* 51: Stylus Photo 925 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 1440, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880_1440dpi", "photo_gen2", + variable_bits, variable_base_res, "cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp925_borderless_sequence, NULL, "photo" }, /* 52: Stylus Color C62 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 144, 1, 1, 144, 1, 1, 4, - 360, 14400, -1, 2880, 1440, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_standard_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880_1440dpi", "standard", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 53: Japanese PM-950C */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 96, 96, 2, 96, 96, 2, 24, 24, 1, 6, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 24, 4, 15, 0, 0, - c2pl_dotsizes, c2pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_f360_photo7_japan_inkgroup, - stp950_bits, stp950_base_res, &cd_cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &pm_950c_channel_name_list + c2pl_dotsizes, c2pl_densities, "variable_2pl", + "superfine", "f360_photo7_japan", + stp950_bits, stp950_base_res, "cd_cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp960_borderless_sequence, NULL, "pm_950c" }, /* 54: Stylus Photo EX3 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_1999 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 32, 1, 4, 32, 1, 4, 32, 1, 4, 6, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, 0, 0, 0, 1, 28800, 720 * 720, INCH(13), INCH(44), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - sp720_dotsizes, c6pl_densities, &stpi_escp2_variable_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_photo_gen1_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + sp720_dotsizes, c6pl_densities, "variable_6pl", + "1440dpi", "photo_gen1", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" }, /* 55: Stylus C82/CX-5200 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 59, 60, 2, 180, 180, 2, 180, 180, 2, 4, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 0, -240, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 0, 0, -240, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_densities, &stpi_escp2_variable_3pl_pigment_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c82_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c82", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 56: Stylus C50 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, -1, 1440, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, -1, 1440, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_x80_6pl", + "1440dpi", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 57: Japanese PM-970C */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 180, 2, 360, 360, 1, 360, 360, 1, 7, - 360, 14400, -1, 2880, 2880, 720, 360, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 2880, 720, 360, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c1_8pl_dotsizes, c1_8pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_f360_photo7_japan_inkgroup, - c1_8_bits, c1_8_base_res, &cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &pm_950c_channel_name_list + c1_8pl_dotsizes, c1_8pl_densities, "variable_2pl", + "superfine", "f360_photo7_japan", + c1_8_bits, c1_8_base_res, "cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &pm970c_borderless_sequence, NULL, "pm_950c" }, /* 58: Japanese PM-930C */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 90, 2, 90, 90, 2, 90, 90, 2, 6, - 360, 14400, -1, 2880, 2880, 720, 360, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 2880, 720, 360, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c1_8pl_dotsizes, c1_8pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_photo_gen2_inkgroup, - c1_8_bits, c1_8_base_res, &cutter_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c1_8pl_dotsizes, c1_8pl_densities, "variable_2pl", + "superfine", "photo_gen2", + c1_8_bits, c1_8_base_res, "cutter_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &pm930c_borderless_sequence, NULL, "photo" }, /* 59: Stylus C43SX/C43UX/C44SX/C44UX (WRONG -- see 43!) */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_NO | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_YES | MODEL_PACKET_MODE_YES), 15, 15, 3, 48, 48, 3, 48, 48, 3, 4, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 0, -99, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 0, 0, -99, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_densities, &stpi_escp2_variable_x80_6pl_drops, - stpi_escp2_1440dpi_reslist, &stpi_escp2_x80_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c4pl_dotsizes, c4pl_densities, "variable_x80_6pl", + "1440dpi", "x80", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 60: Stylus C84 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 59, 60, 2, 180, 180, 2, 180, 180, 2, 4, - 360, 14400, -1, 2880, 1440, 360, 180, 0, 1, 0, 0, -240, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 80, 42, -240, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_densities, &stpi_escp2_variable_3pl_pigment_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c82_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c82", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &bsc84_borderless_sequence, NULL, "standard" }, /* 61: Stylus Color C63/C64 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 29, 30, 3, 90, 90, 3, 90, 90, 3, 4, - 360, 14400, -1, 2880, 1440, 360, 120, 0, 1, 0, 0, -180, 0, 0, 1, 1440 * 720, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, -180, 0, 0, 1, 28800, 1440 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_densities, &stpi_escp2_variable_3pl_pigment_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c64", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &bsc64_borderless_sequence, NULL, "standard" }, /* 62: Stylus Photo 900 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, - 360, 14400, -1, 2880, 720, 90, 90, 0, 1, 0, 55, 0, 0, 0, 1, 720 * 720, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 399, 394, 595, 842, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 399, 394, 595, 842, 24, 3, 15, 0, 0, - c4pl_dotsizes, c4pl_2880_densities, &stpi_escp2_variable_2880_4pl_drops, - stpi_escp2_2880dpi_reslist, &stpi_escp2_photo_gen2_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "photo_gen2", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp900_borderless_sequence, NULL, "photo" }, /* 63: Stylus Photo R300 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 1, 3, 90, 1, 3, 90, 1, 3, 6, - 360, 14400, -1, 2880, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, 4, 15, 0, 0, - p3pl_dotsizes, p3pl_densities, &stpi_escp2_variable_3pl_pmg_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_photo_gen3_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + p3pl_dotsizes, p3pl_densities, "variable_3pl_pmg", + "superfine", "photo_gen3", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &spr300_borderless_sequence, NULL, "photo" }, /* 64: PM-G800/Stylus Photo R800 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 1, 2, 180, 1, 2, 180, 1, 2, 8, - 360, 28800, -1, 1440, 2880, 360, 180, 0, 1, 0, 190, 0, 0, 0, 8, 2880 * 1440, + 360, 28800, -1, 5760, 2880, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 180, 5760 * 2880, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 11, + 9, 9, 0, 11, 9, 9, 0, 11, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, 4, 15, 0, 0, - p1_5pl_dotsizes, p1_5pl_densities, &stpi_escp2_variable_1_5pl_drops, - stpi_escp2_r2400_reslist, &stpi_escp2_cmykrb_inkgroup, - variable_bits, c1_5_base_res, &cd_roll_feed_input_slot_list, - &p1_5_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &r800_channel_name_list + p1_5pl_dotsizes, p1_5pl_densities, "variable_1_5pl", + "superfine", "cmykrb", + variable_bits, c1_5_base_res, "r1800", + "p1_5", &new_init_sequence, &je_deinit_sequence, + &spr800_borderless_sequence, NULL, "r800" }, /* 65: Stylus Photo CX4600 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 1, 3, 90, 1, 3, 90, 1, 3, 4, - 360, 14400, -1, 1440, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 8, 1440 * 1440, + 360, 14400, -1, 5760, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 180, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 0, 4, 15, 0, 0, - p3pl_dotsizes, p3pl_densities, &stpi_escp2_variable_3pl_pmg_drops, - stpi_escp2_cx3650_reslist, &stpi_escp2_cx3650_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &mfp2005_channel_name_list + p3pl_dotsizes, p3pl_densities, "variable_3pl_pmg", + "superfine", "cx3650", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "mfp2005" }, /* 66: Stylus Color C65/C66 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 29, 30, 3, 90, 90, 3, 90, 90, 3, 4, - 360, 14400, -1, 2880, 1440, 360, 120, 0, 1, 0, 0, -180, 0, 0, 1, 1440 * 720, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, -180, 0, 0, 1, 28800, 1440 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, &stpi_escp2_variable_3pl_pigment_c66_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, "variable_3pl_pigment_c66", + "2880_1440dpi", "c64", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &bsc66_borderless_sequence, NULL, "standard" }, /* 67: Stylus Photo R1800 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 1, 2, 180, 1, 2, 180, 1, 2, 8, - 360, 28800, -1, 1440, 2880, 360, 180, 0, 1, 0, 190, 0, 0, 0, 8, 2880 * 1440, + 360, 28800, -1, 5760, 2880, 360, 180, + 0, 1, 0, 96, 42, 0, 0, 0, 1, 180, 5760 * 2880, INCH(13), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 11, + 9, 9, 0, 11, 9, 9, 0, 11, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, 4, 15, 0, 0, - p1_5pl_dotsizes, p1_5pl_densities, &stpi_escp2_variable_1_5pl_drops, - stpi_escp2_r2400_reslist, &stpi_escp2_cmykrb_inkgroup, - variable_bits, c1_5_base_res, &r1800_input_slot_list, - &p1_5_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &r800_channel_name_list + p1_5pl_dotsizes, p1_5pl_densities, "variable_1_5pl", + "superfine", "cmykrb", + variable_bits, c1_5_base_res, "r1800", + "p1_5", &new_init_sequence, &je_deinit_sequence, + &spr800_borderless_sequence, NULL, "r800" }, /* 68: PM-G820 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 1, 2, 180, 1, 2, 180, 1, 2, 8, - 360, 14400, -1, 1440, 2880, 360, 180, 0, 1, 0, 190, 0, 0, 0, 8, 2880 * 1440, + 360, 14400, -1, 5760, 2880, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 180, 5760 * 2880, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 11, + 9, 9, 0, 11, 9, 9, 0, 11, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, 4, 15, 0, 0, - p1_5pl_dotsizes, p1_5pl_densities, &stpi_escp2_variable_1_5pl_drops, - stpi_escp2_r2400_reslist, &stpi_escp2_photo_gen3_inkgroup, - variable_bits, c1_5_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &r800_channel_name_list + p1_5pl_dotsizes, p1_5pl_densities, "variable_1_5pl", + "superfine", "photo_gen3", + variable_bits, c1_5_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &spr800_borderless_sequence, NULL, "r800" }, /* 69: Stylus C86 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 59, 60, 2, 180, 180, 2, 180, 180, 2, 4, - 360, 14400, -1, 2880, 2880, 360, 180, 0, 1, 0, 0, -240, 0, 0, 1, 1440 * 720, + 360, 14400, -1, 2880, 2880, 360, 180, + 0, 1, 0, 80, 42, -240, 0, 0, 1, 28800, 1440 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), - 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_densities, &stpi_escp2_variable_3pl_pigment_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c82_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c82", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &bsc86_borderless_sequence, NULL, "standard" }, /* 70: Stylus Photo RX700 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 1, 2, 180, 1, 2, 180, 1, 2, 6, - 360, 28800, -1, 5760, 2880, 360, 180, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 28800, -1, 5760, 2880, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 263, 595, 842, 0, 4, 15, 0, 0, - p1_5pl_dotsizes, p1_5pl_densities, &stpi_escp2_variable_1_5pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_photo_gen3_inkgroup, - variable_bits, c1_5_base_res, &rx700_input_slot_list, - &p1_5_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &rx700_channel_name_list + p1_5pl_dotsizes, p1_5pl_densities, "variable_1_5pl", + "superfine", "photo_gen3", + variable_bits, c1_5_base_res, "rx700", + "p1_5", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "rx700" }, /* 71: Stylus Photo R2400 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 180, 1, 2, 180, 1, 2, 180, 1, 2, 8, - 360, 14400, -1, 1440, 2880, 360, 180, 0, 1, 0, 190, 0, 0, 0, 8, 1440 * 1440, + 360, 14400, -1, 5760, 2880, 360, 180, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 180, 1440 * 1440, INCH(13), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 0, 4, 15, 0, 0, - p3_5pl_dotsizes, p3_5pl_densities, &stpi_escp2_variable_r2400_drops, - stpi_escp2_r2400_reslist, &stpi_escp2_f360_ultrachrome_k3_inkgroup, - variable_bits, c1_5_base_res, &r2400_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &r2400_channel_name_list + p3_5pl_dotsizes, p3_5pl_densities, "variable_r2400", + "superfine", "f360_ultrachrome_k3", + variable_bits, c1_5_base_res, "r2400", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "r2400" }, /* 72: Stylus CX3700/3800/3810 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 29, 30, 3, 90, 90, 3, 90, 90, 3, 4, - 360, 14400, -1, 2880, 1440, 360, 120, 0, 1, 0, 0, -180, 0, 0, 1, 1440 * 720, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, -180, 0, 0, 1, 28800, 1440 * 720, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, &stpi_escp2_variable_3pl_pigment_c66_drops, - stpi_escp2_2880_1440dpi_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &default_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &cx3800_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, "variable_3pl_pigment_c66", + "2880_1440dpi", "c64", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "cx3800" }, /* 73: E-100/PictureMate */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 1, 3, 90, 1, 3, 90, 1, 3, 6, - 360, 28800, -1, 5760, 1440, 1440, 720, 0, 1, 0, 0, 0, 0, 0, 1, 1440 * 1440, + 360, 28800, -1, 5760, 1440, 1440, 720, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(4), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 0, 4, 15, 0, 0, - picturemate_dotsizes, picturemate_densities, &stpi_escp2_variable_picturemate_drops, - stpi_escp2_picturemate_reslist, &stpi_escp2_picturemate_inkgroup, - variable_bits, c1_5_base_res, &default_input_slot_list, - &picturemate_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &picturemate_channel_name_list + picturemate_dotsizes, picturemate_densities, "variable_picturemate", + "picturemate", "picturemate", + variable_bits, c1_5_base_res, "default", + "picturemate", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "picturemate" }, /* 74: PM-A650 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 90, 3, 90, 90, 3, 90, 90, 3, 4, - 360, 14400, -1, 5760, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 5760, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 0, 4, 15, 0, 0, - c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, &stpi_escp2_variable_3pl_pigment_c66_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c3pl_pigment_dotsizes, c3pl_pigment_c66_densities, "variable_3pl_pigment_c66", + "superfine", "c64", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 75: Japanese PM-A750 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 90, 3, 90, 90, 3, 90, 90, 3, 4, - 360, 14400, -1, 5760, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 5760, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 0, 4, 15, 0, 0, - c2pl_dotsizes, c2pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c2pl_dotsizes, c2pl_densities, "variable_2pl", + "superfine", "c64", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 76: Japanese PM-A890 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_NO | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_YES | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 90, 3, 90, 90, 3, 90, 90, 3, 6, - 360, 14400, -1, 5760, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 5760, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 0, 0, 0, 4, 15, 0, 0, - c2pl_dotsizes, c2pl_densities, &stpi_escp2_variable_2pl_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_photo_gen3_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &standard_channel_name_list + c2pl_dotsizes, c2pl_densities, "variable_2pl", + "superfine", "photo_gen3", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "standard" }, /* 77: Japanese PM-D600 */ { (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | - MODEL_XZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | MODEL_PACKET_MODE_YES), 90, 1, 3, 90, 1, 3, 90, 1, 3, 4, - 360, 14400, -1, 2880, 1440, 360, 120, 0, 1, 0, 190, 0, 0, 0, 1, 1440 * 1440, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, INCH(17 / 2), INCH(1200), INCH(2), INCH(2), 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 0, 4, 15, 0, 0, - p3pl_dotsizes, p3pl_densities, &stpi_escp2_variable_3pl_pmg_drops, - stpi_escp2_superfine_reslist, &stpi_escp2_c64_inkgroup, - variable_bits, variable_base_res, &cd_roll_feed_input_slot_list, - &standard_quality_list, &new_init_sequence, &je_deinit_sequence, - NULL, &photo_channel_name_list + p3pl_dotsizes, p3pl_densities, "variable_3pl_pmg", + "superfine", "c64", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" + }, + /* 78: Stylus Photo 810/820 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 48, 1, 3, 48, 1, 3, 48, 1, 3, 6, + 360, 14400, -1, 2880, 720, 90, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 720 * 720, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, + 3, 15, 0, 0, + c4pl_dotsizes, c4pl_2880_densities, "variable_2880_4pl", + "2880dpi", "photo_gen2", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &sp1280_borderless_sequence, NULL, "photo" + }, + /* 79: Stylus CX6400 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 59, 60, 2, 180, 180, 2, 180, 180, 2, 4, + 360, 14400, -1, 2880, 1440, 360, 180, + 0, 1, 0, 80, 42, -240, 0, 0, 1, 28800, 720 * 720, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, + 4, 15, 0, 0, + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c82", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &cx6400_borderless_sequence, NULL, "standard" + }, + /* 80: Stylus CX6600 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 59, 60, 2, 180, 180, 2, 180, 180, 2, 4, + 360, 14400, -1, 2880, 2880, 360, 180, + 0, 1, 0, 80, 42, -240, 0, 0, 1, 28800, 1440 * 720, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, -1, -1, 0, 0, 24, + 4, 15, 0, 0, + c3pl_pigment_dotsizes, c3pl_pigment_densities, "variable_3pl_pigment", + "2880_1440dpi", "c82", + variable_bits, variable_base_res, "default", + "standard", &new_init_sequence, &je_deinit_sequence, + &cx6600_borderless_sequence, NULL, "standard" + }, + /* 81: Stylus Photo R260 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 90, 1, 4, 90, 1, 4, 90, 1, 4, 6, + 360, 14400, -1, 5760, 2880, 360, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 5760 * 2880, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 189, 595, 842, 24, + 4, 15, 0, 0, + claria_dotsizes, claria_densities, "variable_claria", + "superfine", "claria", + variable_bits, c1_5_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" + }, + /* 82: Stylus Photo 1400 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_YES | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 90, 1, 4, 90, 1, 4, 90, 1, 4, 6, + 360, 14400, -1, 5760, 2880, 360, 90, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 5760 * 2880, + INCH(13), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 263, 595, 842, 24, + 4, 15, 0, 0, + claria_1400_dotsizes, claria_1400_densities, "variable_claria_1400", + "claria_1400", "claria", + variable_bits, claria_1400_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + NULL, NULL, "photo" + }, + /* 83: Stylus Photo R240 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 90, 1, 3, 90, 1, 3, 90, 1, 3, 4, + 360, 14400, -1, 5760, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, + 4, 15, 0, 0, + p3pl_dotsizes, p3pl_densities, "variable_3pl_pmg", + "superfine", "photo_gen3_4", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &spr300_borderless_sequence, NULL, "standard" + }, + /* 84: Stylus Photo RX500 */ + { + (MODEL_VARIABLE_YES | MODEL_COMMAND_2000 | MODEL_GRAYMODE_YES | + MODEL_ZEROMARGIN_FULL | MODEL_VACUUM_NO | MODEL_FAST_360_NO | + MODEL_SEND_ZERO_ADVANCE_YES | MODEL_SUPPORTS_INK_CHANGE_NO | + MODEL_PACKET_MODE_YES), + 90, 1, 3, 90, 1, 3, 90, 1, 3, 6, + 360, 14400, -1, 2880, 1440, 360, 120, + 0, 1, 0, 80, 42, 0, 0, 0, 1, 28800, 1440 * 1440, + INCH(17 / 2), INCH(1200), INCH(2), INCH(2), + 9, 9, 0, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 204, 191, 595, 842, 24, + 4, 15, 0, 0, + p3pl_dotsizes, p3pl_densities, "variable_3pl_pmg", + "superfine", "photo_gen3", + variable_bits, variable_base_res, "cd_roll_feed", + "standard", &new_init_sequence, &je_deinit_sequence, + &sprx500_borderless_sequence, NULL, "photo" }, }; diff --git a/src/main/print-escp2.c b/src/main/print-escp2.c index d97634b..191fa34 100644 --- a/src/main/print-escp2.c +++ b/src/main/print-escp2.c @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2.c,v 1.354 2006/07/22 20:28:14 rlk Exp $" + * "$Id: print-escp2.c,v 1.355.2.2 2007/05/29 01:47:29 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -45,7 +45,9 @@ #define OP_JOB_PRINT 2 #define OP_JOB_END 4 -#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#ifndef MAX +# define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif /* !MAX */ typedef struct { @@ -57,14 +59,14 @@ typedef struct static const escp2_printer_attr_t escp2_printer_attrs[] = { { "command_mode", 0, 4 }, - { "horizontal_zero_margin", 4, 1 }, - { "variable_mode", 5, 1 }, - { "graymode", 6, 1 }, - { "vacuum", 7, 1 }, - { "fast_360", 8, 1 }, - { "send_zero_advance", 9, 1 }, - { "supports_ink_change", 10, 1 }, - { "packet_mode", 11, 1 }, + { "zero_margin", 4, 2 }, + { "variable_mode", 6, 1 }, + { "graymode", 7, 1 }, + { "vacuum", 8, 1 }, + { "fast_360", 9, 1 }, + { "send_zero_advance", 10, 1 }, + { "supports_ink_change", 11, 1 }, + { "packet_mode", 12, 1 }, }; typedef struct @@ -198,6 +200,18 @@ static const stp_parameter_t the_parameters[] = STP_PARAMETER_LEVEL_BASIC, 1, 1, -1, 1, 0 }, { + "CDOuterDiameter", N_("CD Size (Custom)"), N_("Basic Printer Setup"), + N_("Variable adjustment for the outer diameter of CD"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { + "CDInnerDiameter", N_("CD Hub Size (Custom)"), N_("Basic Printer Setup"), + N_("Variable adjustment to the inner hub of the CD"), + STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0 + }, + { "CDXAdjustment", N_("CD Horizontal Fine Adjustment"), N_("Advanced Printer Setup"), N_("Fine adjustment to horizontal position for CD printing"), STP_PARAMETER_TYPE_DIMENSION, STP_PARAMETER_CLASS_FEATURE, @@ -385,7 +399,9 @@ static const stp_parameter_t the_parameters[] = PARAMETER_INT(max_black_resolution), PARAMETER_INT(zero_margin_offset), PARAMETER_INT(extra_720dpi_separation), - PARAMETER_INT(horizontal_position_alignment), + PARAMETER_INT(micro_left_margin), + PARAMETER_INT(min_horizontal_position_alignment), + PARAMETER_INT(base_horizontal_position_alignment), PARAMETER_INT(bidirectional_upper_limit), PARAMETER_INT(physical_channels), PARAMETER_INT(left_margin), @@ -400,9 +416,10 @@ static const stp_parameter_t the_parameters[] = PARAMETER_INT(cd_y_offset), PARAMETER_INT(cd_page_width), PARAMETER_INT(cd_page_height), - PARAMETER_INT(page_extra_height), + PARAMETER_INT(paper_extra_bottom), PARAMETER_RAW(preinit_sequence), - PARAMETER_RAW(postinit_remote_sequence) + PARAMETER_RAW(postinit_remote_sequence), + PARAMETER_RAW(vertical_borderless_sequence) }; static const int the_parameter_count = @@ -610,14 +627,6 @@ escp2_##f(const stp_vars_t *v) \ } \ } -#define DEF_COMPOSITE_ACCESSOR(f, t) \ -static inline t \ -escp2_##f(const stp_vars_t *v) \ -{ \ - int model = stp_get_model_id(v); \ - return (stpi_escp2_model_capabilities[model].f); \ -} - #define DEF_ROLL_ACCESSOR(f, t) \ static inline t \ escp2_##f(const stp_vars_t *v, int rollfeed) \ @@ -667,7 +676,7 @@ DEF_SIMPLE_ACCESSOR(cd_x_offset, int) DEF_SIMPLE_ACCESSOR(cd_y_offset, int) DEF_SIMPLE_ACCESSOR(cd_page_width, int) DEF_SIMPLE_ACCESSOR(cd_page_height, int) -DEF_SIMPLE_ACCESSOR(page_extra_height, int) +DEF_SIMPLE_ACCESSOR(paper_extra_bottom, int) DEF_SIMPLE_ACCESSOR(extra_feed, unsigned) DEF_SIMPLE_ACCESSOR(pseudo_separation_rows, int) DEF_SIMPLE_ACCESSOR(base_separation, int) @@ -677,14 +686,15 @@ DEF_SIMPLE_ACCESSOR(black_initial_vertical_offset, int) DEF_SIMPLE_ACCESSOR(max_black_resolution, int) DEF_SIMPLE_ACCESSOR(zero_margin_offset, int) DEF_SIMPLE_ACCESSOR(extra_720dpi_separation, int) -DEF_SIMPLE_ACCESSOR(horizontal_position_alignment, unsigned) +DEF_SIMPLE_ACCESSOR(micro_left_margin, int) +DEF_SIMPLE_ACCESSOR(min_horizontal_position_alignment, unsigned) +DEF_SIMPLE_ACCESSOR(base_horizontal_position_alignment, unsigned) DEF_SIMPLE_ACCESSOR(bidirectional_upper_limit, int) DEF_SIMPLE_ACCESSOR(physical_channels, int) DEF_SIMPLE_ACCESSOR(alignment_passes, int) DEF_SIMPLE_ACCESSOR(alignment_choices, int) DEF_SIMPLE_ACCESSOR(alternate_alignment_passes, int) DEF_SIMPLE_ACCESSOR(alternate_alignment_choices, int) -DEF_COMPOSITE_ACCESSOR(printer_weaves, const printer_weave_list_t *) DEF_ROLL_ACCESSOR(left_margin, unsigned) DEF_ROLL_ACCESSOR(right_margin, unsigned) @@ -694,11 +704,55 @@ DEF_ROLL_ACCESSOR(bottom_margin, unsigned) DEF_RAW_ACCESSOR(preinit_sequence, const stp_raw_t *) DEF_RAW_ACCESSOR(postinit_remote_sequence, const stp_raw_t *) -DEF_COMPOSITE_ACCESSOR(reslist, const res_t *const *) -DEF_COMPOSITE_ACCESSOR(inkgroup, const inkgroup_t *) -DEF_COMPOSITE_ACCESSOR(input_slots, const input_slot_list_t *) -DEF_COMPOSITE_ACCESSOR(quality_list, const quality_list_t *) -DEF_COMPOSITE_ACCESSOR(channel_names, const channel_name_t *) +DEF_RAW_ACCESSOR(vertical_borderless_sequence, const stp_raw_t *) + +static inline const res_t *const * +escp2_reslist(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_reslist_named + (stpi_escp2_model_capabilities[model].reslist)); +} + +static inline const printer_weave_list_t * +escp2_printer_weaves(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_printer_weaves_named + (stpi_escp2_model_capabilities[model].printer_weaves)); +} + +static inline const channel_name_t * +escp2_channel_names(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_channel_names_named + (stpi_escp2_model_capabilities[model].channel_names)); +} + +static inline const inkgroup_t * +escp2_inkgroup(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_inkgroup_named + (stpi_escp2_model_capabilities[model].inkgroup)); +} + +static inline const quality_list_t * +escp2_quality_list(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_quality_list_named + (stpi_escp2_model_capabilities[model].quality_list)); +} + +static inline const input_slot_list_t * +escp2_input_slots(const stp_vars_t *v) +{ + int model = stp_get_model_id(v); + return (stpi_escp2_get_input_slot_list_named + (stpi_escp2_model_capabilities[model].input_slots)); +} static const channel_count_t * get_channel_count_by_name(const char *name) @@ -772,17 +826,17 @@ static const escp2_dropsize_t * escp2_dropsizes(const stp_vars_t *v, int resid) { int model = stp_get_model_id(v); - const escp2_drop_list_t *drops = stpi_escp2_model_capabilities[model].drops; + const escp2_drop_list_t *drops = + stpi_escp2_get_drop_list_named(stpi_escp2_model_capabilities[model].drops); return (*drops)[resid]; } static const inklist_t * escp2_inklist(const stp_vars_t *v) { - int model = stp_get_model_id(v); int i; const char *ink_list_name = NULL; - const inkgroup_t *inkgroup = stpi_escp2_model_capabilities[model].inkgroup; + const inkgroup_t *inkgroup = escp2_inkgroup(v); if (stp_check_string_parameter(v, "InkSet", STP_PARAMETER_ACTIVE)) ink_list_name = stp_get_string_parameter(v, "InkSet"); @@ -809,12 +863,19 @@ escp2_paperlist(const stp_vars_t *v) { const inklist_t *inklist = escp2_inklist(v); if (inklist) - return inklist->papers; + return stpi_escp2_get_paperlist_named(inklist->papers); else return NULL; } static int +supports_borderless(const stp_vars_t *v) +{ + return (escp2_has_cap(v, MODEL_ZEROMARGIN, MODEL_ZEROMARGIN_YES) || + escp2_has_cap(v, MODEL_ZEROMARGIN, MODEL_ZEROMARGIN_FULL)); +} + +static int compute_internal_resid(int hres, int vres) { static const int resolutions[RES_N] = @@ -851,6 +912,31 @@ compute_printed_resid(const res_t *res) return compute_internal_resid(res->printed_hres, res->printed_vres); } +static int +compute_virtual_resid(const res_t *res) +{ + int virtual = compute_internal_resid(res->virtual_hres, res->virtual_vres); + int normal = compute_internal_resid(res->hres, res->vres); + if (normal == virtual) + return compute_internal_resid(res->printed_hres, res->printed_vres); + else + return virtual; +} + +static int +max_nozzle_span(const stp_vars_t *v) +{ + int nozzle_count = escp2_nozzles(v); + int nozzle_separation = escp2_nozzle_separation(v); + int black_nozzle_count = escp2_black_nozzles(v); + int black_nozzle_separation = escp2_black_nozzle_separation(v); + int nozzle_span = nozzle_count * nozzle_separation; + int black_nozzle_span = black_nozzle_count * black_nozzle_separation; + if (black_nozzle_span > nozzle_span) + return black_nozzle_span; + else + return nozzle_span; +} static const input_slot_t * get_input_slot(const stp_vars_t *v) @@ -1033,7 +1119,7 @@ verify_resolution(const stp_vars_t *v, const res_t *res) ((res->vres / nozzle_width) * nozzle_width) == res->vres)) { int xdpi = res->hres; - int physical_xdpi = escp2_base_res(v, compute_resid(res)); + int physical_xdpi = escp2_base_res(v, compute_virtual_resid(res)); int horizontal_passes, oversample; if (physical_xdpi > xdpi) physical_xdpi = xdpi; @@ -1209,13 +1295,17 @@ get_media_adjustment(const stp_vars_t *v) const inklist_t *ink_list = escp2_inklist(v); if (pt && ink_list && ink_list->paper_adjustments) { - const paper_adjustment_list_t *adjlist = ink_list->paper_adjustments; - const char *paper_name = pt->name; - int i; - for (i = 0; i < adjlist->paper_count; i++) + const paper_adjustment_list_t *adjlist = + stpi_escp2_get_paper_adjustment_list_named(ink_list->paper_adjustments); + if (adjlist) { - if (strcmp(paper_name, adjlist->papers[i].name) == 0) - return &(adjlist->papers[i]); + const char *paper_name = pt->name; + int i; + for (i = 0; i < adjlist->paper_count; i++) + { + if (strcmp(paper_name, adjlist->papers[i].name) == 0) + return &(adjlist->papers[i]); + } } } return NULL; @@ -1260,7 +1350,12 @@ set_density_parameter(const stp_vars_t *v, if (ink_name && ink_name->channel_set->channel_count > color && ink_name->channel_set->channels[color]) - description->is_active = 1; + { + description->is_active = 1; + description->bounds.dbl.lower = 0; + description->bounds.dbl.upper = 2.0; + description->deflt.dbl = 1.0; + } } } @@ -1538,6 +1633,8 @@ escp2_parameters(const stp_vars_t *v, const char *name, (description->bounds.str, "CD5Inch", _("CD - 5 inch")); stp_string_list_add_string (description->bounds.str, "CD3Inch", _("CD - 3 inch")); + stp_string_list_add_string + (description->bounds.str, "CDCustom", _("CD - Custom")); } else { @@ -1552,11 +1649,14 @@ escp2_parameters(const stp_vars_t *v, const char *name, description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; } - else if (strcmp(name, "CDInnerRadius") == 0) + else if (strcmp(name, "CDInnerRadius") == 0 ) { const input_slot_t *slot = get_input_slot(v); description->bounds.str = stp_string_list_create(); - if (printer_supports_print_to_cd(v) && (!slot || (slot && slot->is_cd))) + if (printer_supports_print_to_cd(v) && + (!slot || slot->is_cd) && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") != 0)) { stp_string_list_add_string (description->bounds.str, "None", _("Normal")); @@ -1568,6 +1668,34 @@ escp2_parameters(const stp_vars_t *v, const char *name, else description->is_active = 0; } + else if (strcmp(name, "CDInnerDiameter") == 0 ) + { + const input_slot_t *slot = get_input_slot(v); + description->bounds.dimension.lower = 16 * 10 * 72 / 254; + description->bounds.dimension.upper = 43 * 10 * 72 / 254; + description->deflt.dimension = 43 * 10 * 72 / 254; + if (printer_supports_print_to_cd(v) && + (!slot || slot->is_cd) && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") == 0)) + description->is_active = 1; + else + description->is_active = 0; + } + else if (strcmp(name, "CDOuterDiameter") == 0 ) + { + const input_slot_t *slot = get_input_slot(v); + description->bounds.dimension.lower = 65 * 10 * 72 / 254; + description->bounds.dimension.upper = 120 * 10 * 72 / 254; + description->deflt.dimension = 329; + if (printer_supports_print_to_cd(v) && + (!slot || slot->is_cd) && + (!stp_get_string_parameter(v, "PageSize") || + strcmp(stp_get_string_parameter(v, "PageSize"), "CDCustom") == 0)) + description->is_active = 1; + else + description->is_active = 0; + } else if (strcmp(name, "CDXAdjustment") == 0 || strcmp(name, "CDYAdjustment") == 0) { @@ -1575,7 +1703,7 @@ escp2_parameters(const stp_vars_t *v, const char *name, description->bounds.dimension.lower = -15; description->bounds.dimension.upper = 15; description->deflt.dimension = 0; - if (printer_supports_print_to_cd(v) && (!slot || (slot && slot->is_cd))) + if (printer_supports_print_to_cd(v) && (!slot || slot->is_cd)) description->is_active = 1; else description->is_active = 0; @@ -1755,7 +1883,7 @@ escp2_parameters(const stp_vars_t *v, const char *name, const input_slot_t *slot = get_input_slot(v); if (slot && slot->is_cd) description->is_active = 0; - else if (escp2_has_cap(v, MODEL_XZEROMARGIN, MODEL_XZEROMARGIN_YES)) + else if (supports_borderless(v)) description->deflt.boolean = 0; else description->is_active = 0; @@ -2012,11 +2140,7 @@ internal_imageable_area(const stp_vars_t *v, int use_paper_margins, bottom_margin = imax(bottom_margin, escp2_bottom_margin(v, rollfeed)); top_margin = imax(top_margin, escp2_top_margin(v, rollfeed)); } - *left = left_margin; - *right = width - right_margin; - *top = top_margin; - *bottom = height - bottom_margin; - if (escp2_has_cap(v, MODEL_XZEROMARGIN, MODEL_XZEROMARGIN_YES) && + if (supports_borderless(v) && (use_maximum_area || (!cd && stp_get_boolean_parameter(v, "FullBleed")))) { @@ -2025,13 +2149,34 @@ internal_imageable_area(const stp_vars_t *v, int use_paper_margins, if (pt->left <= 0 && pt->right <= 0 && pt->top <= 0 && pt->bottom <= 0) { - *left -= 80 / (360 / 72); /* 80 per the Epson manual */ - *right += 80 / (360 / 72); /* 80 per the Epson manual */ - *bottom += escp2_nozzles(v) * escp2_nozzle_separation(v) * 72 / - escp2_base_separation(v); + if (use_paper_margins) + { + unsigned width_limit = escp2_max_paper_width(v); + int offset = escp2_zero_margin_offset(v); + int margin = escp2_micro_left_margin(v); + int sep = escp2_base_separation(v); + int delta = -((offset - margin) * 72 / sep); + left_margin = delta; /* Allow some overlap if paper isn't */ + right_margin = delta; /* positioned correctly */ + if (width - right_margin - 3 > width_limit) + right_margin = width - width_limit - 3; + top_margin = -7; + bottom_margin = -7; + } + else + { + left_margin = 0; + right_margin = 0; + top_margin = 0; + bottom_margin = 0; + } } } } + *left = left_margin; + *right = width - right_margin; + *top = top_margin; + *bottom = height - bottom_margin; } /* @@ -2176,7 +2321,9 @@ adjust_density_and_ink_type(stp_vars_t *v, stp_image_t *image) escp2_privdata_t *pd = get_privdata(v); const paper_adjustment_t *pt = pd->paper_adjustment; double paper_density = .8; - int o_resid = compute_printed_resid(pd->res); + int o_resid = compute_virtual_resid(pd->res); + int n_resid = compute_printed_resid(pd->res); + double virtual_scale = 1; if (pt) paper_density = pt->base_density; @@ -2187,8 +2334,18 @@ adjust_density_and_ink_type(stp_vars_t *v, stp_image_t *image) stp_set_float_parameter(v, "Density", 1.0); } + while (n_resid > o_resid) + { + virtual_scale /= 2.0; + n_resid--; + } + while (n_resid < o_resid) + { + virtual_scale *= 2.0; + n_resid++; + } stp_scale_float_parameter - (v, "Density", paper_density * escp2_density(v, o_resid)); + (v, "Density", virtual_scale * paper_density * escp2_density(v, o_resid)); pd->drop_size = escp2_ink_type(v, o_resid); pd->ink_resid = o_resid; @@ -2202,6 +2359,7 @@ adjust_density_and_ink_type(stp_vars_t *v, stp_image_t *image) if (stp_check_int_parameter(v, "escp2_ink_type", STP_PARAMETER_ACTIVE) || stp_check_int_parameter(v, "escp2_density", STP_PARAMETER_ACTIVE) || stp_check_int_parameter(v, "escp2_bits", STP_PARAMETER_ACTIVE) || + virtual_scale != 1.0 || (stp_check_boolean_parameter(v, "AdjustDotsize", STP_PARAMETER_ACTIVE) && ! stp_get_boolean_parameter(v, "AdjustDotsize"))) @@ -2217,8 +2375,10 @@ adjust_density_and_ink_type(stp_vars_t *v, stp_image_t *image) while (density > 1.0 && resid >= RES_360) { int tresid = xresid - 1; + int base_res_now = escp2_base_res(v, resid); int bits_now = escp2_bits(v, resid); double density_now = escp2_density(v, resid); + int base_res_then = escp2_base_res(v, tresid); int bits_then = escp2_bits(v, tresid); double density_then = escp2_density(v, tresid); int drop_size_then = escp2_ink_type(v, tresid); @@ -2230,7 +2390,7 @@ adjust_density_and_ink_type(stp_vars_t *v, stp_image_t *image) */ if (bits_now != bits_then || density_then <= 0.0 || - drop_size_then == -1) + base_res_now != base_res_then || drop_size_then == -1) break; xdensity = density * density_then / density_now / 2; xresid = tresid; @@ -2564,24 +2724,29 @@ setup_head_offset(stp_vars_t *v) } static void -setup_misc(stp_vars_t *v) +setup_basic(stp_vars_t *v) { escp2_privdata_t *pd = get_privdata(v); - pd->input_slot = get_input_slot(v); - pd->paper_type = get_media_type(v); - pd->paper_adjustment = get_media_adjustment(v); - pd->ink_group = escp2_inkgroup(v); - pd->init_sequence = escp2_preinit_sequence(v); - pd->deinit_sequence = escp2_postinit_remote_sequence(v); pd->advanced_command_set = escp2_has_advanced_command_set(v); pd->command_set = escp2_get_cap(v, MODEL_COMMAND); pd->variable_dots = escp2_has_cap(v, MODEL_VARIABLE_DOT, MODEL_VARIABLE_YES); pd->has_vacuum = escp2_has_cap(v, MODEL_VACUUM, MODEL_VACUUM_YES); pd->has_graymode = escp2_has_cap(v, MODEL_GRAYMODE, MODEL_GRAYMODE_YES); + pd->init_sequence = escp2_preinit_sequence(v); + pd->deinit_sequence = escp2_postinit_remote_sequence(v); + pd->borderless_sequence = escp2_vertical_borderless_sequence(v); pd->base_separation = escp2_base_separation(v); pd->resolution_scale = escp2_resolution_scale(v); - pd->use_extended_commands = - escp2_use_extended_commands(v, pd->res->softweave); +} + +static void +setup_misc(stp_vars_t *v) +{ + escp2_privdata_t *pd = get_privdata(v); + pd->input_slot = get_input_slot(v); + pd->paper_type = get_media_type(v); + pd->paper_adjustment = get_media_adjustment(v); + pd->ink_group = escp2_inkgroup(v); } static void @@ -2692,7 +2857,9 @@ setup_resolution(stp_vars_t *v) int horizontal = adjusted_horizontal_resolution(res); pd->res = res; - pd->physical_xdpi = escp2_base_res(v, resid); + pd->use_extended_commands = + escp2_use_extended_commands(v, pd->res->softweave); + pd->physical_xdpi = escp2_base_res(v, compute_virtual_resid(res)); if (pd->physical_xdpi > pd->res->hres) pd->physical_xdpi = pd->res->hres; @@ -2782,7 +2949,7 @@ setup_head_parameters(stp_vars_t *v) pd->use_aux_channels); if (pd->physical_channels == 0) { - pd->inkname = &stpi_escp2_default_black_inkset; + pd->inkname = stpi_escp2_get_default_black_inkset(); pd->physical_channels = compute_channel_count(pd->inkname, pd->logical_channels, pd->use_aux_channels); @@ -2845,31 +3012,68 @@ setup_head_parameters(stp_vars_t *v) static void setup_page(stp_vars_t *v) { - int n; escp2_privdata_t *pd = get_privdata(v); const input_slot_t *input_slot = get_input_slot(v); int extra_left = 0; int extra_top = 0; - const char *inner_radius_name = stp_get_string_parameter(v, "CDInnerRadius"); - int hub_size = 43; /* 43 mm standard CD hub */ - - if (inner_radius_name && strcmp(inner_radius_name, "Small") == 0) - hub_size = 16; /* 15 mm prints to the hole - play it + int hub_size = 0; + int min_horizontal_alignment = escp2_min_horizontal_position_alignment(v); + int base_horizontal_alignment = + pd->res->hres / escp2_base_horizontal_position_alignment(v); + int required_horizontal_alignment = + MAX(min_horizontal_alignment, base_horizontal_alignment); + + const char *cd_type = stp_get_string_parameter(v, "PageSize"); + if (cd_type && (strcmp(cd_type, "CDCustom") == 0 )) + { + int outer_diameter = stp_get_dimension_parameter(v, "CDOuterDiameter"); + stp_set_page_width(v, outer_diameter); + stp_set_page_height(v, outer_diameter); + stp_set_width(v, outer_diameter); + stp_set_height(v, outer_diameter); + hub_size = stp_get_dimension_parameter(v, "CDInnerDiameter"); + } + else + { + const char *inner_radius_name = stp_get_string_parameter(v, "CDInnerRadius"); + hub_size = 43 * 10 * 72 / 254; /* 43 mm standard CD hub */ + + if (inner_radius_name && strcmp(inner_radius_name, "Small") == 0) + hub_size = 16 * 10 * 72 / 254; /* 15 mm prints to the hole - play it safe and print 16 mm */ + } - stp_default_media_size(v, &n, &(pd->page_true_height)); - pd->page_extra_height = escp2_page_extra_height(v); - if (pd->page_extra_height > 0 && - escp2_has_cap(v, MODEL_XZEROMARGIN, MODEL_XZEROMARGIN_YES) && - (!(input_slot->is_cd) && stp_get_boolean_parameter(v, "FullBleed"))) - pd->page_extra_height += - escp2_nozzles(v) * escp2_nozzle_separation(v) * 72 / - escp2_base_separation(v); - internal_imageable_area(v, 0, 0, &pd->page_left, &pd->page_right, - &pd->page_bottom, &pd->page_top); + stp_default_media_size(v, &(pd->page_true_width), &(pd->page_true_height)); /* Don't use full bleed mode if the paper itself has a margin */ if (pd->page_left > 0 || pd->page_top > 0) stp_set_boolean_parameter(v, "FullBleed", 0); + if (escp2_has_cap(v, MODEL_ZEROMARGIN, MODEL_ZEROMARGIN_FULL) && + ((!input_slot || !(input_slot->is_cd)))) + { + pd->page_extra_height = + max_nozzle_span(v) * pd->page_management_units / + escp2_base_separation(v); + if (stp_get_boolean_parameter(v, "FullBleed")) + pd->paper_extra_bottom = 0; + else + pd->paper_extra_bottom = escp2_paper_extra_bottom(v); + } + else if (escp2_has_cap(v, MODEL_ZEROMARGIN, MODEL_ZEROMARGIN_YES) && + (stp_get_boolean_parameter(v, "FullBleed")) && + ((!input_slot || !(input_slot->is_cd)))) + { + pd->paper_extra_bottom = 0; + pd->page_extra_height = + escp2_zero_margin_offset(v) * pd->page_management_units / + escp2_base_separation(v); + } + else + { + pd->page_extra_height = 0; + pd->paper_extra_bottom = escp2_paper_extra_bottom(v); + } + internal_imageable_area(v, 0, 0, &pd->page_left, &pd->page_right, + &pd->page_bottom, &pd->page_top); if (input_slot && input_slot->is_cd && escp2_cd_x_offset(v) > 0) { @@ -2878,6 +3082,8 @@ setup_page(stp_vars_t *v) int top_center = escp2_cd_y_offset(v) + stp_get_dimension_parameter(v, "CDYAdjustment"); pd->page_true_height = pd->page_bottom - pd->page_top; + pd->page_true_width = pd->page_right - pd->page_left; + pd->paper_extra_bottom = 0; pd->page_extra_height = 0; stp_set_left(v, stp_get_left(v) - pd->page_left); stp_set_top(v, stp_get_top(v) - pd->page_top); @@ -2887,17 +3093,17 @@ setup_page(stp_vars_t *v) pd->page_left = 0; extra_top = top_center - (pd->page_bottom / 2); extra_left = left_center - (pd->page_right / 2); - pd->cd_inner_radius = hub_size * pd->micro_units * 10 / 254 / 2; + pd->cd_inner_radius = hub_size * pd->micro_units / 72 / 2; pd->cd_outer_radius = pd->page_right * pd->micro_units / 72 / 2; pd->cd_x_offset = ((pd->page_right / 2) - stp_get_left(v)) * pd->micro_units / 72; - pd->cd_y_offset = - ((pd->page_bottom / 2) - stp_get_top(v)) * pd->micro_units / 72; + pd->cd_y_offset = stp_get_top(v) * pd->res->printed_vres / 72; if (escp2_cd_page_height(v)) { pd->page_right = escp2_cd_page_width(v); pd->page_bottom = escp2_cd_page_height(v); pd->page_true_height = escp2_cd_page_height(v); + pd->page_true_width = escp2_cd_page_width(v); } } @@ -2908,18 +3114,28 @@ setup_page(stp_vars_t *v) pd->image_scaled_width = pd->image_width * pd->res->hres / 72; pd->image_printed_width = pd->image_width * pd->res->printed_hres / 72; pd->image_left_position = pd->image_left * pd->micro_units / 72; + pd->zero_margin_offset = escp2_zero_margin_offset(v); + if (supports_borderless(v) && + pd->advanced_command_set && pd->command_set != MODEL_COMMAND_PRO && + ((!input_slot || !(input_slot->is_cd)) && + stp_get_boolean_parameter(v, "FullBleed"))) + { + int margin = escp2_micro_left_margin(v); + int sep = escp2_base_separation(v); + pd->image_left_position += + (pd->zero_margin_offset - margin) * pd->micro_units / sep; + } /* * Many printers print extremely slowly if the starting position - * is not a multiple of 8 + * is not aligned to 1/180" */ - if (escp2_horizontal_position_alignment(v) > 1) + if (required_horizontal_alignment > 1) pd->image_left_position = - (pd->image_left_position / escp2_horizontal_position_alignment(v)) * - escp2_horizontal_position_alignment(v); + (pd->image_left_position / required_horizontal_alignment) * + required_horizontal_alignment; pd->page_bottom += extra_top + 1; - pd->page_true_height += extra_top + 1; pd->page_height = pd->page_bottom - pd->page_top; pd->image_top = stp_get_top(v) - pd->page_top + extra_top; pd->image_height = stp_get_height(v); @@ -3018,7 +3234,8 @@ escp2_print_data(stp_vars_t *v, stp_image_t *image) if (cd_mask) { int y_distance_from_center = - pd->cd_outer_radius - (y * pd->micro_units / pd->res->printed_vres); + pd->cd_outer_radius - + ((y + pd->cd_y_offset) * pd->micro_units / pd->res->printed_vres); if (y_distance_from_center < 0) y_distance_from_center = -y_distance_from_center; memset(cd_mask, 0, (pd->image_printed_width + 7) / 8); @@ -3091,8 +3308,10 @@ escp2_print_page(stp_vars_t *v, stp_image_t *image) pd->bitwidth, pd->image_printed_width, pd->image_printed_height, - pd->image_top * pd->res->vres / 72, - (pd->page_height + escp2_extra_feed(v)) * pd->res->vres / 72, + ((pd->page_extra_height * pd->res->vres / pd->vertical_units) + + (pd->image_top * pd->res->vres / 72)), + (pd->page_extra_height + + (pd->page_height + escp2_extra_feed(v)) * pd->res->vres / 72), pd->head_offset, weave_pattern, stpi_escp2_flush_pass, @@ -3165,6 +3384,7 @@ escp2_do_print(stp_vars_t *v, stp_image_t *image, int print_op) pd->use_aux_channels = 0; pd->channels_in_use = count_channels(pd->inkname, pd->use_aux_channels); + setup_basic(v); setup_resolution(v); setup_head_parameters(v); setup_page(v); diff --git a/src/main/print-escp2.h b/src/main/print-escp2.h index 1fd76b3..f75354a 100644 --- a/src/main/print-escp2.h +++ b/src/main/print-escp2.h @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2.h,v 1.105 2006/07/22 20:28:14 rlk Exp $" + * "$Id: print-escp2.h,v 1.105.6.2 2007/05/29 01:47:29 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -152,6 +152,8 @@ typedef struct const char *text; short hres; short vres; + short virtual_hres; + short virtual_vres; short printed_hres; short printed_vres; short softweave; @@ -233,8 +235,8 @@ typedef struct const char *name; const char *text; const escp2_inkname_t *const *inknames; - const paperlist_t *papers; - const paper_adjustment_list_t *paper_adjustments; + const char *papers; + const char *paper_adjustments; const shade_set_t *shades; short n_inks; } inklist_t; @@ -367,42 +369,43 @@ typedef struct #define MODEL_COMMAND_2000 0x2ul /* The 2000 series printers */ #define MODEL_COMMAND_PRO 0x3ul /* Stylus Pro printers */ -#define MODEL_XZEROMARGIN_MASK 0x10ul /* Does this printer support */ -#define MODEL_XZEROMARGIN_NO 0x00ul /* zero margin mode? */ -#define MODEL_XZEROMARGIN_YES 0x10ul /* (print to edge of the paper) */ +#define MODEL_ZEROMARGIN_MASK 0x30ul /* Does this printer support */ +#define MODEL_ZEROMARGIN_NO 0x00ul /* zero margin mode? */ +#define MODEL_ZEROMARGIN_YES 0x10ul /* (print to edge of the paper) */ +#define MODEL_ZEROMARGIN_FULL 0x20ul /* (print to edge of the paper) */ -#define MODEL_VARIABLE_DOT_MASK 0x20ul /* Does this printer support var */ +#define MODEL_VARIABLE_DOT_MASK 0x40ul /* Does this printer support var */ #define MODEL_VARIABLE_NO 0x00ul /* dot size printing? The newest */ -#define MODEL_VARIABLE_YES 0x20ul /* printers support multiple modes */ +#define MODEL_VARIABLE_YES 0x40ul /* printers support multiple modes */ -#define MODEL_GRAYMODE_MASK 0x40ul /* Does this printer support special */ +#define MODEL_GRAYMODE_MASK 0x80ul /* Does this printer support special */ #define MODEL_GRAYMODE_NO 0x00ul /* fast black printing? */ -#define MODEL_GRAYMODE_YES 0x40ul +#define MODEL_GRAYMODE_YES 0x80ul -#define MODEL_VACUUM_MASK 0x80ul -#define MODEL_VACUUM_NO 0x00ul -#define MODEL_VACUUM_YES 0x80ul +#define MODEL_VACUUM_MASK 0x100ul +#define MODEL_VACUUM_NO 0x000ul +#define MODEL_VACUUM_YES 0x100ul -#define MODEL_FAST_360_MASK 0x100ul +#define MODEL_FAST_360_MASK 0x200ul #define MODEL_FAST_360_NO 0x000ul -#define MODEL_FAST_360_YES 0x100ul +#define MODEL_FAST_360_YES 0x200ul -#define MODEL_SEND_ZERO_ADVANCE_MASK 0x200ul +#define MODEL_SEND_ZERO_ADVANCE_MASK 0x400ul #define MODEL_SEND_ZERO_ADVANCE_NO 0x000ul -#define MODEL_SEND_ZERO_ADVANCE_YES 0x200ul +#define MODEL_SEND_ZERO_ADVANCE_YES 0x400ul -#define MODEL_SUPPORTS_INK_CHANGE_MASK 0x400ul +#define MODEL_SUPPORTS_INK_CHANGE_MASK 0x800ul #define MODEL_SUPPORTS_INK_CHANGE_NO 0x000ul -#define MODEL_SUPPORTS_INK_CHANGE_YES 0x400ul +#define MODEL_SUPPORTS_INK_CHANGE_YES 0x800ul -#define MODEL_PACKET_MODE_MASK 0x800ul -#define MODEL_PACKET_MODE_NO 0x000ul -#define MODEL_PACKET_MODE_YES 0x800ul +#define MODEL_PACKET_MODE_MASK 0x1000ul +#define MODEL_PACKET_MODE_NO 0x0000ul +#define MODEL_PACKET_MODE_YES 0x1000ul typedef enum { MODEL_COMMAND, - MODEL_XZEROMARGIN, + MODEL_ZEROMARGIN, MODEL_VARIABLE_DOT, MODEL_GRAYMODE, MODEL_VACUUM, @@ -440,6 +443,7 @@ typedef struct escp2_printer short max_vres; short min_hres; short min_vres; +/*****************************************************************************/ /* Miscellaneous printer-specific data */ short extra_feed; /* Extra distance the paper can be spaced */ /* beyond the bottom margin, in 1/360". */ @@ -452,10 +456,13 @@ typedef struct escp2_printer short zero_margin_offset; /* Offset to use to achieve */ /* zero-margin printing */ + short micro_left_margin; /* Precise left margin (base separation) */ short initial_vertical_offset; short black_initial_vertical_offset; short extra_720dpi_separation; - short horizontal_position_alignment; /* Horizontal alignment */ + short min_horizontal_position_alignment; /* Horizontal alignment */ + /* for good performance */ + short base_horizontal_position_alignment; /* Horizontal alignment */ /* for good performance */ int bidirectional_upper_limit; /* Highest total resolution */ /* for bidirectional printing */ @@ -496,7 +503,7 @@ typedef struct escp2_printer short cd_page_width; /* Width of "page" when printing to CD */ short cd_page_height; /* Height of "page" when printing to CD */ /* Extra height for form factor command */ - short page_extra_height; /* Extra height (lie to set form factor) */ + short paper_extra_bottom; /* Extra space on the bottom of the page */ /*****************************************************************************/ /* Parameters for escputil */ short alignment_passes; @@ -506,111 +513,37 @@ typedef struct escp2_printer /*****************************************************************************/ const short *dot_sizes; /* Vector of dot sizes for resolutions */ const float *densities; /* List of densities for each printer */ - const escp2_drop_list_t *drops; /* Drop sizes */ + const char *drops; /* Drop sizes */ /*****************************************************************************/ - const res_t *const *reslist; - const inkgroup_t *inkgroup; + const char *reslist; + const char *inkgroup; /*****************************************************************************/ const short *bits; const short *base_resolutions; - const input_slot_list_t *input_slots; + const char *input_slots; /*****************************************************************************/ - const quality_list_t *quality_list; + const char *quality_list; const stp_raw_t *preinit_sequence; const stp_raw_t *postinit_remote_sequence; /*****************************************************************************/ - const printer_weave_list_t *const printer_weaves; - const channel_name_t *channel_names; + const stp_raw_t *vertical_borderless_sequence; + const char *const printer_weaves; + const char *channel_names; } stpi_escp2_printer_t; extern const stpi_escp2_printer_t stpi_escp2_model_capabilities[]; extern const int stpi_escp2_model_limit; -extern const escp2_drop_list_t stpi_escp2_simple_drops; -extern const escp2_drop_list_t stpi_escp2_spro10000_drops; -extern const escp2_drop_list_t stpi_escp2_variable_1_5pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_2pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_3pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_drops; -extern const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_c66_drops; -extern const escp2_drop_list_t stpi_escp2_variable_3pl_pmg_drops; -extern const escp2_drop_list_t stpi_escp2_variable_r2400_drops; -extern const escp2_drop_list_t stpi_escp2_variable_picturemate_drops; -extern const escp2_drop_list_t stpi_escp2_variable_1440_4pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_ultrachrome_drops; -extern const escp2_drop_list_t stpi_escp2_variable_2880_4pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_6pl_drops; -extern const escp2_drop_list_t stpi_escp2_variable_2000p_drops; -extern const escp2_drop_list_t stpi_escp2_variable_x80_6pl_drops; - -extern const paperlist_t stpi_escp2_standard_paper_list; -extern const paperlist_t stpi_escp2_durabrite_paper_list; -extern const paperlist_t stpi_escp2_durabrite2_paper_list; -extern const paperlist_t stpi_escp2_ultrachrome_paper_list; -extern const paperlist_t stpi_escp2_ultrachrome_k3_paper_list; -extern const paperlist_t stpi_escp2_r800_paper_list; -extern const paperlist_t stpi_escp2_picturemate_paper_list; - -extern const paper_adjustment_list_t stpi_escp2_standard_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_durabrite_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_durabrite2_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_photo_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_photo2_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_photo3_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_sp960_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_ultrachrome_photo_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_ultrachrome_matte_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_ultrachrome_k3_photo_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_ultrachrome_k3_matte_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_r800_photo_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_r800_matte_paper_adjustment_list; -extern const paper_adjustment_list_t stpi_escp2_picturemate_paper_adjustment_list; - -extern const res_t *const stpi_escp2_superfine_reslist[]; -extern const res_t *const stpi_escp2_r2400_reslist[]; -extern const res_t *const stpi_escp2_cx3650_reslist[]; -extern const res_t *const stpi_escp2_no_printer_weave_reslist[]; -extern const res_t *const stpi_escp2_pro_reslist[]; -extern const res_t *const stpi_escp2_sp5000_reslist[]; -extern const res_t *const stpi_escp2_720dpi_reslist[]; -extern const res_t *const stpi_escp2_720dpi_soft_reslist[]; -extern const res_t *const stpi_escp2_g3_720dpi_reslist[]; -extern const res_t *const stpi_escp2_1440dpi_reslist[]; -extern const res_t *const stpi_escp2_2880dpi_reslist[]; -extern const res_t *const stpi_escp2_2880_1440dpi_reslist[]; -extern const res_t *const stpi_escp2_g3_reslist[]; -extern const res_t *const stpi_escp2_sc500_reslist[]; -extern const res_t *const stpi_escp2_sc640_reslist[]; -extern const res_t *const stpi_escp2_picturemate_reslist[]; - -extern const inkgroup_t stpi_escp2_cmy_inkgroup; -extern const inkgroup_t stpi_escp2_standard_inkgroup; -extern const inkgroup_t stpi_escp2_c80_inkgroup; -extern const inkgroup_t stpi_escp2_c82_inkgroup; -extern const inkgroup_t stpi_escp2_c64_inkgroup; -extern const inkgroup_t stpi_escp2_f360_inkgroup; -extern const inkgroup_t stpi_escp2_cx3650_inkgroup; -extern const inkgroup_t stpi_escp2_x80_inkgroup; -extern const inkgroup_t stpi_escp2_photo_gen1_inkgroup; -extern const inkgroup_t stpi_escp2_photo_gen2_inkgroup; -extern const inkgroup_t stpi_escp2_photo_gen3_inkgroup; -extern const inkgroup_t stpi_escp2_photo_pigment_inkgroup; -extern const inkgroup_t stpi_escp2_photo7_japan_inkgroup; -extern const inkgroup_t stpi_escp2_ultrachrome_inkgroup; -extern const inkgroup_t stpi_escp2_f360_photo_inkgroup; -extern const inkgroup_t stpi_escp2_f360_photo7_japan_inkgroup; -extern const inkgroup_t stpi_escp2_f360_ultrachrome_inkgroup; -extern const inkgroup_t stpi_escp2_f360_ultrachrome_k3_inkgroup; -extern const inkgroup_t stpi_escp2_cmykrb_inkgroup; -extern const inkgroup_t stpi_escp2_picturemate_inkgroup; - -extern const escp2_inkname_t stpi_escp2_default_black_inkset; - -extern const printer_weave_list_t stpi_escp2_standard_printer_weave_list; -extern const printer_weave_list_t stpi_escp2_sp2200_printer_weave_list; -extern const printer_weave_list_t stpi_escp2_pro7000_printer_weave_list; -extern const printer_weave_list_t stpi_escp2_pro7500_printer_weave_list; -extern const printer_weave_list_t stpi_escp2_pro7600_printer_weave_list; +extern const paper_adjustment_list_t *stpi_escp2_get_paper_adjustment_list_named(const char *); +extern const paperlist_t *stpi_escp2_get_paperlist_named(const char *); +extern const quality_list_t *stpi_escp2_get_quality_list_named(const char *); +extern const escp2_inkname_t *stpi_escp2_get_default_black_inkset(void); +extern const inkgroup_t *stpi_escp2_get_inkgroup_named(const char *); +extern const input_slot_list_t *stpi_escp2_get_input_slot_list_named(const char *); +extern const res_t *const *stpi_escp2_get_reslist_named(const char *); +extern const escp2_drop_list_t *stpi_escp2_get_drop_list_named(const char *); +extern const printer_weave_list_t *stpi_escp2_get_printer_weaves_named(const char *); +extern const channel_name_t *stpi_escp2_get_channel_names_named(const char *); typedef struct { @@ -626,6 +559,7 @@ typedef struct int micro_units; /* Micro-units for horizontal positioning */ int unit_scale; /* Scale factor for units */ int send_zero_pass_advance; /* Send explicit command for zero advance */ + int zero_margin_offset; /* Zero margin offset */ /* Ink parameters */ int bitwidth; /* Number of bits per ink drop */ @@ -653,6 +587,7 @@ typedef struct const inkgroup_t *ink_group; /* Which set of inks */ const stp_raw_t *init_sequence; /* Initialization sequence */ const stp_raw_t *deinit_sequence; /* De-initialization sequence */ + const stp_raw_t *borderless_sequence; /* Vertical borderless sequence */ model_featureset_t command_set; /* Which command set this printer supports */ int variable_dots; /* Print supports variable dot sizes */ int has_vacuum; /* Printer supports vacuum command */ @@ -681,7 +616,9 @@ typedef struct int page_width; /* Page width (points) */ int page_height; /* Page height (points) */ int page_true_height; /* Physical page height (points) */ - int page_extra_height; /* Extra height for set_form_factor */ + int page_extra_height; /* Extra height for set_form_factor (rows) */ + int paper_extra_bottom; /* Extra bottom for set_page_size (rows) */ + int page_true_width; /* Physical page height (points) */ int cd_x_offset; /* CD X offset (micro units) */ int cd_y_offset; /* CD Y offset (micro units) */ int cd_outer_radius; /* CD radius (micro units) */ @@ -728,5 +665,5 @@ extern void stpi_escp2_terminate_page(stp_vars_t *v); #endif /* GUTENPRINT_INTERNAL_ESCP2_H */ /* - * End of "$Id: print-escp2.h,v 1.105 2006/07/22 20:28:14 rlk Exp $". + * End of "$Id: print-escp2.h,v 1.105.6.2 2007/05/29 01:47:29 rlk Exp $". */ diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c index c5ad531..7c02b15 100644 --- a/src/main/print-olympus.c +++ b/src/main/print-olympus.c @@ -1,9 +1,9 @@ /* - * "$Id: print-olympus.c,v 1.59 2006/05/28 16:59:05 rlk Exp $" + * "$Id: print-olympus.c,v 1.61.2.1 2007/03/02 12:01:30 rlk Exp $" * - * Print plug-in Olympus driver for the GIMP. + * Print plug-in DyeSub driver (formerly Olympus driver) for the GIMP. * - * Copyright 2003 - 2005 + * Copyright 2003 - 2006 * Michael Mraka (Michael.Mraka@linux.cz) * * The plug-in is based on the code of the RAW plugin for the GIMP of @@ -37,26 +37,42 @@ #include <gutenprint/gutenprint-intl-internal.h> #include <string.h> #include <stdio.h> +#include <limits.h> + +#define STP_DBG_DYESUB STP_DBG_OLYMPUS #ifdef __GNUC__ #define inline __inline__ #endif -#define OLYMPUS_INTERLACE_NONE 0 -#define OLYMPUS_INTERLACE_LINE 1 -#define OLYMPUS_INTERLACE_PLANE 2 - -#define OLYMPUS_FEATURE_NONE 0x00000000 -#define OLYMPUS_FEATURE_FULL_WIDTH 0x00000001 -#define OLYMPUS_FEATURE_FULL_HEIGHT 0x00000002 -#define OLYMPUS_FEATURE_BLOCK_ALIGN 0x00000004 -#define OLYMPUS_FEATURE_BORDERLESS 0x00000008 -#define OLYMPUS_FEATURE_WHITE_BORDER 0x00000010 - -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define DYESUB_FEATURE_NONE 0x00000000 +#define DYESUB_FEATURE_FULL_WIDTH 0x00000001 +#define DYESUB_FEATURE_FULL_HEIGHT 0x00000002 +#define DYESUB_FEATURE_BLOCK_ALIGN 0x00000004 +#define DYESUB_FEATURE_BORDERLESS 0x00000008 +#define DYESUB_FEATURE_WHITE_BORDER 0x00000010 +#define DYESUB_FEATURE_PLANE_INTERLACE 0x00000020 + +#define DYESUB_PORTRAIT 0 +#define DYESUB_LANDSCAPE 1 + +#ifndef MIN +# define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif /* !MIN */ +#ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif /* !MAX */ +#define PX(pt,dpi) ((pt) * (dpi) / 72) +#define PT(px,dpi) ((px) * 72 / (dpi)) +#define LIST(list_t, list_name, items_t, items_name) \ + static const list_t list_name = \ + { \ + items_name, sizeof(items_name) / sizeof(items_t) \ + } -static const char *zero = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; +#define MAX_INK_CHANNELS 3 +#define MAX_BYTES_PER_CHANNEL 2 +#define SIZE_THRESHOLD 6 typedef struct { @@ -75,12 +91,12 @@ typedef struct { const char* name; int xdpi; int ydpi; -} olymp_resolution_t; +} dyesub_resolution_t; typedef struct { - const olymp_resolution_t *item; + const dyesub_resolution_t *item; size_t n_items; -} olymp_resolution_list_t; +} dyesub_resolution_list_t; typedef struct { const char* name; @@ -91,24 +107,25 @@ typedef struct { int border_pt_right; int border_pt_top; int border_pt_bottom; -} olymp_pagesize_t; + int print_mode; +} dyesub_pagesize_t; typedef struct { - const olymp_pagesize_t *item; + const dyesub_pagesize_t *item; size_t n_items; -} olymp_pagesize_list_t; +} dyesub_pagesize_list_t; typedef struct { const char* res_name; const char* pagesize_name; int width_px; int height_px; -} olymp_printsize_t; +} dyesub_printsize_t; typedef struct { - const olymp_printsize_t *item; + const dyesub_printsize_t *item; size_t n_items; -} olymp_printsize_list_t; +} dyesub_printsize_list_t; typedef struct { @@ -131,18 +148,32 @@ typedef struct int block_max_x, block_max_y; const char* pagesize; const laminate_t* laminate; -} olympus_privdata_t; +} dyesub_privdata_t; -static olympus_privdata_t privdata; +static dyesub_privdata_t privdata; + +typedef struct { + int out_channels; + int ink_channels; + const char *ink_order; + int bytes_per_out_channel; + int bytes_per_ink_channel; + int plane_interlacing; + char empty_byte; + unsigned short **image_data; + int outh_px, outw_px, outt_px, outb_px, outl_px, outr_px; + int imgh_px, imgw_px; + int prnh_px, prnw_px, prnt_px, prnb_px, prnl_px, prnr_px; + int print_mode; /* portrait or landscape */ +} dyesub_print_vars_t; typedef struct /* printer specific parameters */ { int model; /* printer model number from printers.xml*/ const ink_list_t *inks; - const olymp_resolution_list_t *resolution; - const olymp_pagesize_list_t *pages; - const olymp_printsize_list_t *printsize; - int interlacing; /* color interlacing scheme */ + const dyesub_resolution_list_t *resolution; + const dyesub_pagesize_list_t *pages; + const dyesub_printsize_list_t *printsize; int block_size; int features; void (*printer_init_func)(stp_vars_t *); @@ -155,11 +186,12 @@ typedef struct /* printer specific parameters */ const char *adj_magenta; const char *adj_yellow; const laminate_list_t *laminate; -} olympus_cap_t; +} dyesub_cap_t; -static const olympus_cap_t* olympus_get_model_capabilities(int model); -static const laminate_t* olympus_get_laminate_pattern(stp_vars_t *v); +static const dyesub_cap_t* dyesub_get_model_capabilities(int model); +static const laminate_t* dyesub_get_laminate_pattern(stp_vars_t *v); +static void dyesub_nputc(stp_vars_t *v, char byte, int count); static const ink_t cmy_inks[] = @@ -167,76 +199,55 @@ static const ink_t cmy_inks[] = { "CMY", 3, "CMY", "\1\2\3" }, }; -static const ink_list_t cmy_ink_list = -{ - cmy_inks, sizeof(cmy_inks) / sizeof(ink_t) -}; +LIST(ink_list_t, cmy_ink_list, ink_t, cmy_inks); static const ink_t ymc_inks[] = { { "CMY", 3, "CMY", "\3\2\1" }, }; -static const ink_list_t ymc_ink_list = -{ - ymc_inks, sizeof(ymc_inks) / sizeof(ink_t) -}; +LIST(ink_list_t, ymc_ink_list, ink_t, ymc_inks); static const ink_t rgb_inks[] = { { "RGB", 3, "RGB", "\1\2\3" }, }; -static const ink_list_t rgb_ink_list = -{ - rgb_inks, sizeof(rgb_inks) / sizeof(ink_t) -}; +LIST(ink_list_t, rgb_ink_list, ink_t, rgb_inks); static const ink_t bgr_inks[] = { { "RGB", 3, "RGB", "\3\2\1" }, }; -static const ink_list_t bgr_ink_list = -{ - bgr_inks, sizeof(bgr_inks) / sizeof(ink_t) -}; +LIST(ink_list_t, bgr_ink_list, ink_t, bgr_inks); /* Olympus P-10 */ -static const olymp_resolution_t res_320dpi[] = +static const dyesub_resolution_t res_310dpi[] = { - { "320x320", 320, 320}, + { "310x310", 310, 310}, }; -static const olymp_resolution_list_t res_320dpi_list = -{ - res_320dpi, sizeof(res_320dpi) / sizeof(olymp_resolution_t) -}; +LIST(dyesub_resolution_list_t, res_310dpi_list, dyesub_resolution_t, res_310dpi); -static const olymp_pagesize_t p10_page[] = +static const dyesub_pagesize_t p10_page[] = { - { "w288h432", "4 x 6", -1, -1, 0, 0, 16, 0}, /* 4x6" */ - { "B7", "3.5 x 5", -1, -1, 0, 0, 4, 0}, /* 3.5x5" */ - { "Custom", NULL, -1, -1, 28, 28, 48, 48}, + { "w288h432", "4 x 6", 298, 430, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 4x6" */ + { "B7", "3.5 x 5", 266, 370, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 3.5x5" */ + { "Custom", NULL, 298, 430, 28, 28, 48, 48, DYESUB_PORTRAIT}, }; -static const olymp_pagesize_list_t p10_page_list = -{ - p10_page, sizeof(p10_page) / sizeof(olymp_pagesize_t) -}; +LIST(dyesub_pagesize_list_t, p10_page_list, dyesub_pagesize_t, p10_page); -static const olymp_printsize_t p10_printsize[] = +static const dyesub_printsize_t p10_printsize[] = { - { "320x320", "w288h432", 1280, 1848}, - { "320x320", "B7", 1144, 1591}, - { "320x320", "Custom", 1280, 1848}, + { "310x310", "w288h432", 1280, 1848}, + { "310x310", "B7", 1144, 1591}, + { "310x310", "Custom", 1280, 1848}, }; -static const olymp_printsize_list_t p10_printsize_list = -{ - p10_printsize, sizeof(p10_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, p10_printsize_list, dyesub_printsize_t, p10_printsize); static void p10_printer_init_func(stp_vars_t *v) { @@ -266,34 +277,32 @@ static const laminate_t p10_laminate[] = {"None", N_("None"), {1, "\x02"}}, }; -static const laminate_list_t p10_laminate_list = -{ - p10_laminate, sizeof(p10_laminate) / sizeof(laminate_t) -}; +LIST(laminate_list_t, p10_laminate_list, laminate_t, p10_laminate); /* Olympus P-200 series */ -static const olymp_pagesize_t p200_page[] = +static const dyesub_resolution_t res_320dpi[] = { - { "ISOB7", "80x125mm", -1, -1, 16, 17, 33, 33}, - { "Custom", NULL, -1, -1, 16, 17, 33, 33}, + { "320x320", 320, 320}, }; -static const olymp_pagesize_list_t p200_page_list = +LIST(dyesub_resolution_list_t, res_320dpi_list, dyesub_resolution_t, res_320dpi); + +static const dyesub_pagesize_t p200_page[] = { - p200_page, sizeof(p200_page) / sizeof(olymp_pagesize_t) + { "ISOB7", "80x125mm", -1, -1, 16, 17, 33, 33, DYESUB_PORTRAIT}, + { "Custom", NULL, -1, -1, 16, 17, 33, 33, DYESUB_PORTRAIT}, }; -static const olymp_printsize_t p200_printsize[] = +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}, }; -static const olymp_printsize_list_t p200_printsize_list = -{ - p200_printsize, sizeof(p200_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, p200_printsize_list, dyesub_printsize_t, p200_printsize); static void p200_printer_init_func(stp_vars_t *v) { @@ -327,40 +336,31 @@ static const char p200_adj_any[] = /* Olympus P-300 series */ -static const olymp_resolution_t p300_res[] = +static const dyesub_resolution_t p300_res[] = { { "306x306", 306, 306}, { "153x153", 153, 153}, }; -static const olymp_resolution_list_t p300_res_list = -{ - p300_res, sizeof(p300_res) / sizeof(olymp_resolution_t) -}; +LIST(dyesub_resolution_list_t, p300_res_list, dyesub_resolution_t, p300_res); -static const olymp_pagesize_t p300_page[] = +static const dyesub_pagesize_t p300_page[] = { - { "A6", NULL, -1, -1, 28, 28, 48, 48}, - { "Custom", NULL, -1, -1, 28, 28, 48, 48}, + { "A6", NULL, -1, -1, 28, 28, 48, 48, DYESUB_PORTRAIT}, + { "Custom", NULL, -1, -1, 28, 28, 48, 48, DYESUB_PORTRAIT}, }; -static const olymp_pagesize_list_t p300_page_list = -{ - p300_page, sizeof(p300_page) / sizeof(olymp_pagesize_t) -}; +LIST(dyesub_pagesize_list_t, p300_page_list, dyesub_pagesize_t, p300_page); -static const olymp_printsize_t p300_printsize[] = +static const dyesub_printsize_t p300_printsize[] = { { "306x306", "A6", 1024, 1376}, { "153x153", "A6", 512, 688}, { "306x306", "Custom", 1024, 1376}, - { "153x153", "Custom", 1024, 1376}, + { "153x153", "Custom", 512, 688}, }; -static const olymp_printsize_list_t p300_printsize_list = -{ - p300_printsize, sizeof(p300_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, p300_printsize_list, dyesub_printsize_t, p300_printsize); static void p300_printer_init_func(stp_vars_t *v) { @@ -374,7 +374,7 @@ static void p300_plane_end_func(stp_vars_t *v) { const char *c = "CMY"; stp_zprintf(v, "\033\033\033P%cS", c[privdata.plane-1]); - stp_deprintf(STP_DBG_OLYMPUS, "olympus: p300_plane_end_func: %c\n", + stp_deprintf(STP_DBG_DYESUB, "dyesub: p300_plane_end_func: %c\n", c[privdata.plane-1]); } @@ -387,7 +387,7 @@ static void p300_block_init_func(stp_vars_t *v) stp_put16_be(privdata.block_max_y, v); stp_put16_be(privdata.block_max_x, v); - stp_deprintf(STP_DBG_OLYMPUS, "olympus: p300_block_init_func: %d-%dx%d-%d\n", + stp_deprintf(STP_DBG_DYESUB, "dyesub: p300_block_init_func: %d-%dx%d-%d\n", privdata.block_min_x, privdata.block_max_x, privdata.block_min_y, privdata.block_max_y); } @@ -433,30 +433,24 @@ static const char p300_adj_yellow[] = /* Olympus P-400 series */ -static const olymp_resolution_t res_314dpi[] = +static const dyesub_resolution_t res_314dpi[] = { { "314x314", 314, 314}, }; -static const olymp_resolution_list_t res_314dpi_list = -{ - res_314dpi, sizeof(res_314dpi) / sizeof(olymp_resolution_t) -}; +LIST(dyesub_resolution_list_t, res_314dpi_list, dyesub_resolution_t, res_314dpi); -static const olymp_pagesize_t p400_page[] = +static const dyesub_pagesize_t p400_page[] = { - { "A4", NULL, -1, -1, 22, 22, 54, 54}, - { "c8x10", "A5 wide", -1, -1, 58, 59, 84, 85}, - { "C6", "2 Postcards (A4)", -1, -1, 9, 9, 9, 9}, - { "Custom", NULL, -1, -1, 22, 22, 54, 54}, + { "A4", NULL, -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}, }; -static const olymp_pagesize_list_t p400_page_list = -{ - p400_page, sizeof(p400_page) / sizeof(olymp_pagesize_t) -}; +LIST(dyesub_pagesize_list_t, p400_page_list, dyesub_pagesize_t, p400_page); -static const olymp_printsize_t p400_printsize[] = +static const dyesub_printsize_t p400_printsize[] = { { "314x314", "A4", 2400, 3200}, { "314x314", "c8x10", 2000, 2400}, @@ -464,20 +458,17 @@ static const olymp_printsize_t p400_printsize[] = { "314x314", "Custom", 2400, 3200}, }; -static const olymp_printsize_list_t p400_printsize_list = -{ - p400_printsize, sizeof(p400_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, p400_printsize_list, dyesub_printsize_t, p400_printsize); static void p400_printer_init_func(stp_vars_t *v) { int wide = (strcmp(privdata.pagesize, "c8x10") == 0 || strcmp(privdata.pagesize, "C6") == 0); - stp_zprintf(v, "\033ZQ"); stp_zfwrite(zero, 1, 61, v); - stp_zprintf(v, "\033FP"); stp_zfwrite(zero, 1, 61, v); + stp_zprintf(v, "\033ZQ"); dyesub_nputc(v, '\0', 61); + stp_zprintf(v, "\033FP"); dyesub_nputc(v, '\0', 61); stp_zprintf(v, "\033ZF"); - stp_putc((wide ? '\x40' : '\x00'), v); stp_zfwrite(zero, 1, 60, v); + stp_putc((wide ? '\x40' : '\x00'), v); dyesub_nputc(v, '\0', 60); stp_zprintf(v, "\033ZS"); if (wide) { @@ -489,18 +480,18 @@ static void p400_printer_init_func(stp_vars_t *v) stp_put16_be(privdata.xsize, v); stp_put16_be(privdata.ysize, v); } - stp_zfwrite(zero, 1, 57, v); - stp_zprintf(v, "\033ZP"); stp_zfwrite(zero, 1, 61, v); + dyesub_nputc(v, '\0', 57); + stp_zprintf(v, "\033ZP"); dyesub_nputc(v, '\0', 61); } static void p400_plane_init_func(stp_vars_t *v) { - stp_zprintf(v, "\033ZC"); stp_zfwrite(zero, 1, 61, v); + stp_zprintf(v, "\033ZC"); dyesub_nputc(v, '\0', 61); } static void p400_plane_end_func(stp_vars_t *v) { - stp_zprintf(v, "\033P"); stp_zfwrite(zero, 1, 62, v); + stp_zprintf(v, "\033P"); dyesub_nputc(v, '\0', 62); } static void p400_block_init_func(stp_vars_t *v) @@ -523,7 +514,7 @@ static void p400_block_init_func(stp_vars_t *v) stp_put16_be(privdata.block_max_x - privdata.block_min_x + 1, v); stp_put16_be(privdata.block_max_y - privdata.block_min_y + 1, v); } - stp_zfwrite(zero, 1, 53, v); + dyesub_nputc(v, '\0', 53); } static const char p400_adj_cyan[] = @@ -567,21 +558,19 @@ static const char p400_adj_yellow[] = /* Olympus P-440 series */ -static const olymp_pagesize_t p440_page[] = +/* FIXME: colors - BGR instead of RGB ?!? */ +static const dyesub_pagesize_t p440_page[] = { - { "A4", NULL, -1, -1, 10, 9, 54, 54}, - { "c8x10", "A5 wide", -1, -1, 58, 59, 72, 72}, - { "C6", "2 Postcards (A4)", -1, -1, 9, 9, 9, 9}, - { "w255h581", "A6 wide", -1, -1, 25, 25, 25, 24}, - { "Custom", NULL, -1, -1, 22, 22, 54, 54}, + { "A4", NULL, -1, -1, 10, 9, 54, 54, DYESUB_PORTRAIT}, + { "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}, }; -static const olymp_pagesize_list_t p440_page_list = -{ - p440_page, sizeof(p440_page) / sizeof(olymp_pagesize_t) -}; +LIST(dyesub_pagesize_list_t, p440_page_list, dyesub_pagesize_t, p440_page); -static const olymp_printsize_t p440_printsize[] = +static const dyesub_printsize_t p440_printsize[] = { { "314x314", "A4", 2508, 3200}, { "314x314", "c8x10", 2000, 2508}, @@ -590,25 +579,22 @@ static const olymp_printsize_t p440_printsize[] = { "314x314", "Custom", 2508, 3200}, }; -static const olymp_printsize_list_t p440_printsize_list = -{ - p440_printsize, sizeof(p440_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, p440_printsize_list, dyesub_printsize_t, p440_printsize); static void p440_printer_init_func(stp_vars_t *v) { int wide = ! (strcmp(privdata.pagesize, "A4") == 0 || strcmp(privdata.pagesize, "Custom") == 0); - stp_zprintf(v, "\033FP"); stp_zfwrite(zero, 1, 61, v); + stp_zprintf(v, "\033FP"); dyesub_nputc(v, '\0', 61); stp_zprintf(v, "\033Y"); stp_zfwrite((privdata.laminate->seq).data, 1, (privdata.laminate->seq).bytes, v); /* laminate */ - stp_zfwrite(zero, 1, 61, v); - stp_zprintf(v, "\033FC"); stp_zfwrite(zero, 1, 61, v); + dyesub_nputc(v, '\0', 61); + stp_zprintf(v, "\033FC"); dyesub_nputc(v, '\0', 61); stp_zprintf(v, "\033ZF"); - stp_putc((wide ? '\x40' : '\x00'), v); stp_zfwrite(zero, 1, 60, v); - stp_zprintf(v, "\033N\1"); stp_zfwrite(zero, 1, 61, v); + stp_putc((wide ? '\x40' : '\x00'), v); dyesub_nputc(v, '\0', 60); + stp_zprintf(v, "\033N\1"); dyesub_nputc(v, '\0', 61); stp_zprintf(v, "\033ZS"); if (wide) { @@ -620,16 +606,16 @@ static void p440_printer_init_func(stp_vars_t *v) stp_put16_be(privdata.xsize, v); stp_put16_be(privdata.ysize, v); } - stp_zfwrite(zero, 1, 57, v); + dyesub_nputc(v, '\0', 57); if (strcmp(privdata.pagesize, "C6") == 0) { - stp_zprintf(v, "\033ZC"); stp_zfwrite(zero, 1, 61, v); + stp_zprintf(v, "\033ZC"); dyesub_nputc(v, '\0', 61); } } static void p440_printer_end_func(stp_vars_t *v) { - stp_zprintf(v, "\033P"); stp_zfwrite(zero, 1, 62, v); + stp_zprintf(v, "\033P"); dyesub_nputc(v, '\0', 62); } static void p440_block_init_func(stp_vars_t *v) @@ -652,61 +638,145 @@ static void p440_block_init_func(stp_vars_t *v) stp_put16_be(privdata.block_max_x - privdata.block_min_x + 1, v); stp_put16_be(privdata.block_max_y - privdata.block_min_y + 1, v); } - stp_zfwrite(zero, 1, 53, v); + dyesub_nputc(v, '\0', 53); } static void p440_block_end_func(stp_vars_t *v) { int pad = (64 - (((privdata.block_max_x - privdata.block_min_x + 1) * (privdata.block_max_y - privdata.block_min_y + 1) * 3) % 64)) % 64; - stp_deprintf(STP_DBG_OLYMPUS, - "olympus: max_x %d min_x %d max_y %d min_y %d\n", + stp_deprintf(STP_DBG_DYESUB, + "dyesub: max_x %d min_x %d max_y %d min_y %d\n", privdata.block_max_x, privdata.block_min_x, privdata.block_max_y, privdata.block_min_y); - stp_deprintf(STP_DBG_OLYMPUS, "olympus: olympus-p440 padding=%d\n", pad); - stp_zfwrite(zero, 1, pad, v); + stp_deprintf(STP_DBG_DYESUB, "dyesub: olympus-p440 padding=%d\n", pad); + dyesub_nputc(v, '\0', pad); } -/* Canon CP-100 series */ -static const olymp_pagesize_t cpx00_page[] = +/* Olympus P-S100 */ +/* FIXME: colors - BGR instead of RGB ?!? */ +static const dyesub_pagesize_t ps100_page[] = { - { "Postcard", "Postcard 148x100mm", -1, -1, 13, 13, 16, 18}, - { "w253h337", "CP_L 89x119mm", -1, -1, 13, 13, 15, 15}, - { "w244h155", "Card 54x86mm", -1, -1, 15, 15, 13, 13}, - { "Custom", NULL, -1, -1, 13, 13, 16, 18}, + { "w288h432", "4 x 6", 296, 426, 0, 0, 0, 0, DYESUB_PORTRAIT},/* 4x6" */ + { "B7", "3.5 x 5", 264, 366, 0, 0, 0, 0, DYESUB_PORTRAIT}, /* 3.5x5" */ + { "Custom", NULL, 296, 426, 0, 0, 0, 0, DYESUB_PORTRAIT}, }; -static const olymp_pagesize_list_t cpx00_page_list = +LIST(dyesub_pagesize_list_t, ps100_page_list, dyesub_pagesize_t, ps100_page); + +static const dyesub_printsize_t ps100_printsize[] = { - cpx00_page, sizeof(cpx00_page) / sizeof(olymp_pagesize_t) + { "306x306", "w288h432", 1254, 1808}, + { "306x306", "B7", 1120, 1554}, + { "306x306", "Custom", 1254, 1808}, }; -static const olymp_printsize_t cpx00_printsize[] = +LIST(dyesub_printsize_list_t, ps100_printsize_list, dyesub_printsize_t, ps100_printsize); + +static void ps100_printer_init_func(stp_vars_t *v) { - { "314x314", "Postcard", 1232, 1808}, - { "314x314", "w253h337", 1100, 1456}, - { "314x314", "w244h155", 1040, 672}, - { "314x314", "Custom", 1232, 1808}, + stp_zprintf(v, "\033U"); dyesub_nputc(v, '\0', 62); + + /* stp_zprintf(v, "\033ZC"); dyesub_nputc(v, '\0', 61); */ + + stp_zprintf(v, "\033W"); dyesub_nputc(v, '\0', 62); + + stp_zfwrite("\x30\x2e\x00\xa2\x00\xa0\x00\xa0", 1, 8, v); + stp_put16_be(privdata.ysize, v); /* paper height (px) */ + stp_put16_be(privdata.xsize, v); /* paper width (px) */ + dyesub_nputc(v, '\0', 3); + stp_putc('\1', v); /* number of copies */ + dyesub_nputc(v, '\0', 8); + stp_putc('\1', v); + dyesub_nputc(v, '\0', 15); + stp_putc('\6', v); + dyesub_nputc(v, '\0', 23); + + stp_zfwrite("\033ZT\0", 1, 4, v); + stp_put16_be(0, v); /* image width offset (px) */ + stp_put16_be(0, v); /* image height offset (px) */ + stp_put16_be(privdata.xsize, v); /* image width (px) */ + stp_put16_be(privdata.ysize, v); /* image height (px) */ + dyesub_nputc(v, '\0', 52); +} + +static void ps100_printer_end_func(stp_vars_t *v) +{ + int pad = (64 - (((privdata.block_max_x - privdata.block_min_x + 1) + * (privdata.block_max_y - privdata.block_min_y + 1) * 3) % 64)) % 64; + stp_deprintf(STP_DBG_DYESUB, + "dyesub: max_x %d min_x %d max_y %d min_y %d\n", + privdata.block_max_x, privdata.block_min_x, + privdata.block_max_y, privdata.block_min_y); + stp_deprintf(STP_DBG_DYESUB, "dyesub: olympus-ps100 padding=%d\n", pad); + dyesub_nputc(v, '\0', pad); /* padding to 64B blocks */ + + stp_zprintf(v, "\033PY"); dyesub_nputc(v, '\0', 61); + stp_zprintf(v, "\033u"); dyesub_nputc(v, '\0', 62); +} + + +/* Canon CP-10 */ +static const dyesub_resolution_t res_300dpi[] = +{ + { "300x300", 300, 300}, +}; + +LIST(dyesub_resolution_list_t, res_300dpi_list, dyesub_resolution_t, res_300dpi); + +static const dyesub_pagesize_t cp10_page[] = +{ + { "w155h244", "Card 54x86mm", 159, 250, 6, 6, 29, 29, DYESUB_PORTRAIT}, + { "Custom", NULL, -1, -1, 6, 6, 29, 29, DYESUB_PORTRAIT}, }; -static const olymp_printsize_list_t cpx00_printsize_list = +LIST(dyesub_pagesize_list_t, cp10_page_list, dyesub_pagesize_t, cp10_page); + +static const dyesub_printsize_t cp10_printsize[] = +{ + { "300x300", "w155h244", 662, 1040}, + { "300x300", "Custom", 662, 1040}, +}; + +LIST(dyesub_printsize_list_t, cp10_printsize_list, dyesub_printsize_t, cp10_printsize); + + +/* Canon CP-100 series */ +static const dyesub_pagesize_t cpx00_page[] = +{ + { "Postcard", "Postcard 100x148mm", 296, 434, 13, 13, 16, 19, DYESUB_PORTRAIT}, + { "w253h337", "CP_L 89x119mm", 264, 350, 13, 13, 15, 15, DYESUB_PORTRAIT}, + { "w155h244", "Card 54x86mm", 162, 250, 13, 13, 15, 15, DYESUB_LANDSCAPE}, + { "Custom", NULL, 296, 434, 13, 13, 16, 19, DYESUB_PORTRAIT}, +}; + +LIST(dyesub_pagesize_list_t, cpx00_page_list, dyesub_pagesize_t, cpx00_page); + +static const dyesub_printsize_t cpx00_printsize[] = { - cpx00_printsize, sizeof(cpx00_printsize) / sizeof(olymp_printsize_t) + { "300x300", "Postcard", 1232, 1808}, + { "300x300", "w253h337", 1100, 1456}, + { "300x300", "w155h244", 672, 1040}, + { "300x300", "Custom", 1232, 1808}, }; +LIST(dyesub_printsize_list_t, cpx00_printsize_list, dyesub_printsize_t, cpx00_printsize); + static void cpx00_printer_init_func(stp_vars_t *v) { char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? '\1' : (strcmp(privdata.pagesize, "w253h337") == 0 ? '\2' : - (strcmp(privdata.pagesize, "w244h155") == 0 ? '\3' : + (strcmp(privdata.pagesize, "w155h244") == 0 ? + (strcmp(stp_get_driver(v),"canon-cp10") == 0 ? + '\0' : '\3' ) : (strcmp(privdata.pagesize, "w283h566") == 0 ? '\4' : '\1' )))); stp_put16_be(0x4000, v); stp_putc('\0', v); stp_putc(pg, v); - stp_zfwrite(zero, 1, 8, v); + dyesub_nputc(v, '\0', 8); } static void cpx00_plane_init_func(stp_vars_t *v) @@ -714,7 +784,7 @@ static void cpx00_plane_init_func(stp_vars_t *v) stp_put16_be(0x4001, v); stp_put16_le(3 - privdata.plane, v); stp_put32_le(privdata.xsize * privdata.ysize, v); - stp_zfwrite(zero, 1, 4, v); + dyesub_nputc(v, '\0', 4); } static const char cpx00_adj_cyan[] = @@ -758,79 +828,139 @@ static const char cpx00_adj_yellow[] = /* Canon CP-220 series */ -static const olymp_pagesize_t cp220_page[] = +static const dyesub_pagesize_t cp220_page[] = { - { "Postcard", "Postcard 148x100mm", -1, -1, 13, 13, 16, 18}, - { "w253h337", "CP_L 89x119mm", -1, -1, 13, 13, 15, 15}, - { "w244h155", "Card 54x86mm", -1, -1, 15, 15, 13, 13}, - { "w283h566", "Wide 200x100mm", -1, -1, 13, 13, 20, 20}, - { "Custom", NULL, -1, -1, 13, 13, 16, 18}, + { "Postcard", "Postcard 100x148mm", 296, 434, 13, 13, 16, 19, DYESUB_PORTRAIT}, + { "w253h337", "CP_L 89x119mm", 264, 350, 13, 13, 15, 15, DYESUB_PORTRAIT}, + { "w155h244", "Card 54x86mm", 162, 250, 13, 13, 15, 15, DYESUB_LANDSCAPE}, + { "w283h566", "Wide 100x200mm", 296, 580, 13, 13, 20, 20, DYESUB_PORTRAIT}, + { "Custom", NULL, 296, 434, 13, 13, 16, 19, DYESUB_PORTRAIT}, }; -static const olymp_pagesize_list_t cp220_page_list = +LIST(dyesub_pagesize_list_t, cp220_page_list, dyesub_pagesize_t, cp220_page); + +static const dyesub_printsize_t cp220_printsize[] = { - cp220_page, sizeof(cp220_page) / sizeof(olymp_pagesize_t) + { "300x300", "Postcard", 1232, 1808}, + { "300x300", "w253h337", 1100, 1456}, + { "300x300", "w155h244", 672, 1040}, + { "300x300", "w283h566", 1232, 2416}, + { "300x300", "Custom", 1232, 1808}, }; -static const olymp_printsize_t cp220_printsize[] = +LIST(dyesub_printsize_list_t, cp220_printsize_list, dyesub_printsize_t, cp220_printsize); + + +/* Sony DPP-EX5, DPP-EX7 */ +static const dyesub_resolution_t res_403dpi[] = { - { "314x314", "Postcard", 1232, 1808}, - { "314x314", "w253h337", 1100, 1456}, - { "314x314", "w244h155", 1040, 672}, - { "314x314", "w283h566", 1232, 2416}, - { "314x314", "Custom", 1232, 1808}, + { "403x403", 403, 403}, }; -static const olymp_printsize_list_t cp220_printsize_list = +LIST(dyesub_resolution_list_t, res_403dpi_list, dyesub_resolution_t, res_403dpi); + +/* only Postcard pagesize is supported */ +static const dyesub_pagesize_t dppex5_page[] = { - cp220_printsize, sizeof(cp220_printsize) / sizeof(olymp_printsize_t) + { "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); -/* Sony UP-DP10 */ -static const olymp_resolution_t updp10_res[] = +static const dyesub_printsize_t dppex5_printsize[] = { - { "300x300", 300, 300}, + { "403x403", "w288h432", 1664, 2466}, + { "403x403", "Custom", 1664, 2466}, }; -static const olymp_resolution_list_t updp10_res_list = +LIST(dyesub_printsize_list_t, dppex5_printsize_list, dyesub_printsize_t, dppex5_printsize); + +static void dppex5_printer_init(stp_vars_t *v) { - updp10_res, sizeof(updp10_res) / sizeof(olymp_resolution_t) -}; + stp_zfwrite("DPEX\0\0\0\x80", 1, 8, v); + stp_zfwrite("DPEX\0\0\0\x82", 1, 8, v); + stp_zfwrite("DPEX\0\0\0\x84", 1, 8, v); + stp_put32_be(privdata.xsize, v); + stp_put32_be(privdata.ysize, v); + stp_zfwrite("S\0o\0n\0y\0 \0D\0P\0P\0-\0E\0X\0\x35\0", 1, 24, v); + dyesub_nputc(v, '\0', 40); + stp_zfwrite("\1\4\0\4\xdc\0\x24\0\3\3\1\0\1\0\x82\0", 1, 16, v); + stp_zfwrite("\xf4\5\xf8\3\x64\0\1\0\x0e\0\x93\1\2\0\1\0", 1, 16, v); + stp_zfwrite("\x93\1\1\0\0\0", 1, 6, v); + stp_zfwrite("P\0o\0s\0t\0 \0c\0a\0r\0d\0", 1, 18, v); + dyesub_nputc(v, '\0', 46); + stp_zfwrite("\x93\1\x18", 1, 3, v); + dyesub_nputc(v, '\0', 19); + stp_zfwrite("\2\0\0\0\3\0\0\0\1\0\0\0\1", 1, 13, v); + dyesub_nputc(v, '\0', 19); + stp_zprintf(v, "5EPD"); + dyesub_nputc(v, '\0', 4); + stp_zfwrite((privdata.laminate->seq).data, 1, + (privdata.laminate->seq).bytes, v); /*laminate pattern*/ + stp_zfwrite("\0d\0d\0d", 1, 6, v); + dyesub_nputc(v, '\0', 21); +} + +static void dppex5_block_init(stp_vars_t *v) +{ + stp_zfwrite("DPEX\0\0\0\x85", 1, 8, v); + stp_put32_be((privdata.block_max_x - privdata.block_min_x + 1) + * (privdata.block_max_y - privdata.block_min_y + 1) * 3, v); +} -static const olymp_pagesize_t updp10_page[] = +static void dppex5_printer_end(stp_vars_t *v) { - { "w288h432", "UPC-10P23 (2:3)", -1, -1, 12, 12, 18, 18}, - { "w288h387", "UPC-10P34 (3:4)", -1, -1, 12, 12, 16, 16}, - { "w288h432", "UPC-10S01 (Sticker)", -1, -1, 12, 12, 18, 18}, - { "Custom", NULL, -1, -1, 12, 12, 0, 0}, + stp_zfwrite("DPEX\0\0\0\x83", 1, 8, v); + stp_zfwrite("DPEX\0\0\0\x81", 1, 8, v); +} + +static const laminate_t dppex5_laminate[] = +{ + {"Glossy", N_("Glossy"), {1, "\x00"}}, + {"Texture", N_("Texture"), {1, "\x01"}}, }; -static const olymp_pagesize_list_t updp10_page_list = +LIST(laminate_list_t, dppex5_laminate_list, laminate_t, dppex5_laminate); + + +/* Sony UP-DP10 */ +static const dyesub_pagesize_t updp10_page[] = { - updp10_page, sizeof(updp10_page) / sizeof(olymp_pagesize_t) + { "w288h432", "UPC-10P23 (2:3)", -1, -1, 12, 12, 18, 18, DYESUB_LANDSCAPE}, + { "w288h387", "UPC-10P34 (3:4)", -1, 384, 12, 12, 16, 16, DYESUB_LANDSCAPE}, + { "w288h432", "UPC-10S01 (Sticker)", -1, -1, 12, 12, 18, 18, DYESUB_LANDSCAPE}, + { "Custom", NULL, -1, -1, 12, 12, 0, 0, DYESUB_LANDSCAPE}, }; -static const olymp_printsize_t updp10_printsize[] = +LIST(dyesub_pagesize_list_t, updp10_page_list, dyesub_pagesize_t, updp10_page); + +static const dyesub_printsize_t updp10_printsize[] = { { "300x300", "w288h432", 1200, 1800}, { "300x300", "w288h387", 1200, 1600}, { "300x300", "Custom", 1200, 1800}, }; -static const olymp_printsize_list_t updp10_printsize_list = -{ - updp10_printsize, sizeof(updp10_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, updp10_printsize_list, dyesub_printsize_t, updp10_printsize); static void updp10_printer_init_func(stp_vars_t *v) { stp_zfwrite("\x98\xff\xff\xff\xff\xff\xff\xff" - "\x14\x00\x00\x00\x1b\x15\x00\x00" - "\x00\x0d\x00\x00\x00\x00\x00\xc7" - "\x00\x00\x00\x00", 1, 28, v); + "\x09\x00\x00\x00\x1b\xee\x00\x00" + "\x00\x04", 1, 34, v); + stp_zfwrite((privdata.laminate->seq).data, 1, + (privdata.laminate->seq).bytes, v); /*laminate pattern*/ + stp_zfwrite("\x00\x00\x00\x00", 1, 4, v); + stp_put16_be(privdata.ysize, v); stp_put16_be(privdata.xsize, 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(privdata.ysize, v); + stp_put16_be(privdata.xsize, v); stp_put32_le(privdata.xsize*privdata.ysize*3+11, v); stp_zfwrite("\x1b\xea\x00\x00\x00\x00", 1, 6, v); stp_put32_be(privdata.xsize*privdata.ysize*3, v); @@ -839,19 +969,10 @@ static void updp10_printer_init_func(stp_vars_t *v) static void updp10_printer_end_func(stp_vars_t *v) { - stp_zfwrite("\x12\x00\x00\x00\x1b\xe1\x00\x00" - "\x00\xb0\x00\x00\04", 1, 13, v); - stp_zfwrite((privdata.laminate->seq).data, 1, - (privdata.laminate->seq).bytes, v); /*laminate pattern*/ - stp_zfwrite("\x00\x00\x00\x00" , 1, 4, v); - stp_put16_be(privdata.ysize, v); - stp_put16_be(privdata.xsize, v); - stp_zfwrite("\xff\xff\xff\xff\x09\x00\x00\x00" - "\x1b\xee\x00\x00\x00\x02\x00\x00" - "\x01\x07\x00\x00\x00\x1b\x0a\x00" - "\x00\x00\x00\x00\xfd\xff\xff\xff" - "\xff\xff\xff\xff\xf8\xff\xff\xff" - , 1, 40, 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 laminate_t updp10_laminate[] = @@ -861,10 +982,7 @@ static const laminate_t updp10_laminate[] = {"Matte", N_("Matte"), {1, "\x0c"}}, }; -static const laminate_list_t updp10_laminate_list = -{ - updp10_laminate, sizeof(updp10_laminate) / sizeof(laminate_t) -}; +LIST(laminate_list_t, updp10_laminate_list, laminate_t, updp10_laminate); static const char updp10_adj_cyan[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" @@ -909,45 +1027,94 @@ static const char updp10_adj_yellow[] = "</gutenprint>\n"; -/* Sony UP-DR150 */ -static const olymp_resolution_t updr150_res[] = +/* Sony UP-DR100 */ +static const dyesub_pagesize_t updr100_page[] = { - { "346x346", 346, 346}, + { "w288h432", "4x6", 298, 442, 0, 0, 0, 0, DYESUB_LANDSCAPE}, + { "B7", "3.5x5", 261, 369, 0, 0, 0, 0, DYESUB_LANDSCAPE}, + { "w360h504", "5x7", 369, 514, 0, 0, 0, 0, DYESUB_PORTRAIT}, + { "w432h576", "6x8", 442, 588, 0, 0, 0, 0, DYESUB_PORTRAIT}, + { "Custom", NULL, 298, 442, 0, 0, 0, 0, DYESUB_LANDSCAPE}, }; -static const olymp_resolution_list_t updr150_res_list = +LIST(dyesub_pagesize_list_t, updr100_page_list, dyesub_pagesize_t, updr100_page); + +static const dyesub_printsize_t updr100_printsize[] = { - updr150_res, sizeof(updr150_res) / sizeof(olymp_resolution_t) + { "334x334", "w288h432", 1382, 2048}, + { "334x334", "B7", 1210, 1710}, + { "334x334", "w360h504", 1710, 2380}, + { "334x334", "w432h576", 2048, 2724}, + { "334x334", "Custom", 1382, 2048}, }; -static const olymp_pagesize_t updr150_page[] = +LIST(dyesub_printsize_list_t, updr100_printsize_list, dyesub_printsize_t, updr100_printsize); + +static void updr100_printer_init_func(stp_vars_t *v) +{ + + stp_zfwrite("UPD8D\x00\x00\x00\x10\x03\x00\x00", 1, 12, v); + stp_put32_le(privdata.xsize, v); + stp_put32_le(privdata.ysize, v); + stp_zfwrite("\x1e\x00\x03\x00\x01\x00\x4e\x01\x00\x00", 1, 10, v); + stp_zfwrite((privdata.laminate->seq).data, 1, + (privdata.laminate->seq).bytes, v); /* laminate pattern */ + dyesub_nputc(v, '\0', 13); + stp_zfwrite("\x01\x00\x01\x00\x03", 1, 5, v); + dyesub_nputc(v, '\0', 19); +} + +static void updr100_printer_end_func(stp_vars_t *v) +{ + stp_zfwrite("UPD8D\x00\x00\x00\x02", 1, 9, v); + dyesub_nputc(v, '\0', 25); + stp_zfwrite("\x9d\x02\x00\x04\x00\x00\xc0\xe7" + "\x9d\x02\x54\xe9\x9d\x02\x9d\x71" + "\x00\x73\xfa\x71\x00\x73\xf4\xea" + "\x9d\x02\xa8\x3e\x00\x73\x9c\xeb\x9d\x02" + , 1, 34, v); +} + +static const laminate_t updr100_laminate[] = { - { "w288h432", "2UPC-153 (4x6)", -1, -1, 0, 0, 3, 2}, - { "B7", "2UPC-154 (3.5x5)", -1, -1, 3, 2, 0, 0}, - { "w360h504", "2UPC-155 (5x7)", -1, -1, 0, 0, 4, 4}, - { "w432h576", "2UPC-156 (6x8)", -1, -1, 3, 2, 5, 4}, - { "Custom", NULL, -1, -1, 0, 0, 3, 2}, + {"Glossy", N_("Glossy"), {1, "\x01"}}, + {"Texture", N_("Texture"), {1, "\x03"}}, + {"Matte", N_("Matte"), {1, "\x04"}}, }; -static const olymp_pagesize_list_t updr150_page_list = +LIST(laminate_list_t, updr100_laminate_list, laminate_t, updr100_laminate); + + +/* Sony UP-DR150 */ +static const dyesub_resolution_t res_334dpi[] = { - updr150_page, sizeof(updr150_page) / sizeof(olymp_pagesize_t) + { "334x334", 334, 334}, }; -static const olymp_printsize_t updr150_printsize[] = +LIST(dyesub_resolution_list_t, res_334dpi_list, dyesub_resolution_t, res_334dpi); + +static const dyesub_pagesize_t updr150_page[] = { - { "346x346", "w288h432", 1382, 2048}, - { "346x346", "B7", 1210, 1728}, - { "346x346", "w360h504", 1728, 2380}, - { "346x346", "w432h576", 2048, 2724}, - { "346x346", "Custom", 1382, 2048}, + { "w288h432", "2UPC-153 (4x6)", 298, 442, 0, 0, 0, 0, DYESUB_LANDSCAPE}, + { "B7", "2UPC-154 (3.5x5)", 261, 373, 0, 0, 0, 0, DYESUB_LANDSCAPE}, + { "w360h504", "2UPC-155 (5x7)", 373, 514, 0, 0, 0, 0, DYESUB_PORTRAIT}, + { "w432h576", "2UPC-156 (6x8)", 442, 588, 0, 0, 0, 0, DYESUB_PORTRAIT}, + { "Custom", NULL, 298, 442, 0, 0, 0, 0, DYESUB_LANDSCAPE}, }; -static const olymp_printsize_list_t updr150_printsize_list = +LIST(dyesub_pagesize_list_t, updr150_page_list, dyesub_pagesize_t, updr150_page); + +static const dyesub_printsize_t updr150_printsize[] = { - updr150_printsize, sizeof(updr150_printsize) / sizeof(olymp_printsize_t) + { "334x334", "w288h432", 1382, 2048}, + { "334x334", "B7", 1210, 1728}, + { "334x334", "w360h504", 1728, 2380}, + { "334x334", "w432h576", 2048, 2724}, + { "334x334", "Custom", 1382, 2048}, }; +LIST(dyesub_printsize_list_t, updr150_printsize_list, dyesub_printsize_t, updr150_printsize); + static void updr150_printer_init_func(stp_vars_t *v) { char pg = '\0'; @@ -975,14 +1142,14 @@ static void updr150_printer_init_func(stp_vars_t *v) "\x1b\x15\x00\x00\x00\x0d\x00\x0d" "\x00\x00\x00\x00\x00\x00\x00\x07" "\x00\x00\x00\x00", 1, 91, v); - stp_put16_be(privdata.xsize, v); stp_put16_be(privdata.ysize, v); + stp_put16_be(privdata.xsize, v); stp_zfwrite("\xf9\xff\xff\xff\x07\x00\x00\x00" "\x1b\xe1\x00\x00\x00\x0b\x00\x0b" "\x00\x00\x00\x00\x80\x00\x00\x00" "\x00\x00", 1, 26, v); - stp_put16_be(privdata.xsize, v); stp_put16_be(privdata.ysize, v); + stp_put16_be(privdata.xsize, v); stp_zfwrite("\xf8\xff\xff\xff\x0b\x00\x00\x00\x1b\xea" "\x00\x00\x00\x00", 1, 14, v); stp_put32_be(privdata.xsize*privdata.ysize*3, v); @@ -1000,50 +1167,35 @@ static void updr150_printer_end_func(stp_vars_t *v) , 1, 34, v); } -/* Fujifilm CX-400 */ -static const olymp_resolution_t cx400_res[] = -{ - { "317x316", 317, 316}, -}; - -static const olymp_resolution_list_t cx400_res_list = -{ - cx400_res, sizeof(cx400_res) / sizeof(olymp_resolution_t) -}; -static const olymp_pagesize_t cx400_page[] = +/* Fujifilm CX-400 */ +static const dyesub_pagesize_t cx400_page[] = { - { "w288h432", NULL, -1, -1, 23, 23, 28, 28}, - { "w288h387", "4x5 3/8 (Digital Camera 3:4)", -1, -1, 23, 23, 27, 26}, - { "w288h504", NULL, -1, -1, 23, 23, 23, 22}, - { "Custom", NULL, -1, -1, 0, 0, 0, 0}, + { "w288h432", NULL, 295, 428, 24, 24, 23, 22, DYESUB_PORTRAIT}, + { "w288h387", "4x5 3/8 (Digital Camera 3:4)", 295, 386, 24, 24, 23, 23, DYESUB_PORTRAIT}, + { "w288h504", NULL, 295, 513, 24, 24, 23, 22, DYESUB_PORTRAIT}, + { "Custom", NULL, 295, 428, 0, 0, 0, 0, DYESUB_PORTRAIT}, }; -static const olymp_pagesize_list_t cx400_page_list = -{ - cx400_page, sizeof(cx400_page) / sizeof(olymp_pagesize_t) -}; +LIST(dyesub_pagesize_list_t, cx400_page_list, dyesub_pagesize_t, cx400_page); -static const olymp_printsize_t cx400_printsize[] = +static const dyesub_printsize_t cx400_printsize[] = { - { "317x316", "w288h387", 1268, 1658}, - { "317x316", "w288h432", 1268, 1842}, - { "317x316", "w288h504", 1268, 2208}, - { "317x316", "Custom", 1268, 1842}, + { "310x310", "w288h387", 1268, 1658}, + { "310x310", "w288h432", 1268, 1842}, + { "310x310", "w288h504", 1268, 2208}, + { "310x310", "Custom", 1268, 1842}, }; -static const olymp_printsize_list_t cx400_printsize_list = -{ - cx400_printsize, sizeof(cx400_printsize) / sizeof(olymp_printsize_t) -}; +LIST(dyesub_printsize_list_t, cx400_printsize_list, dyesub_printsize_t, cx400_printsize); static void cx400_printer_init_func(stp_vars_t *v) { char pg = '\0'; const char *pname = "XXXXXX"; - stp_deprintf(STP_DBG_OLYMPUS, - "olympus: fuji driver %s\n", stp_get_driver(v)); + stp_deprintf(STP_DBG_DYESUB, + "dyesub: fuji driver %s\n", stp_get_driver(v)); if (strcmp(stp_get_driver(v),"fujifilm-cx400") == 0) pname = "NX1000"; else if (strcmp(stp_get_driver(v),"fujifilm-cx550") == 0) @@ -1068,33 +1220,94 @@ static void cx400_printer_init_func(stp_vars_t *v) stp_putc('\1', v); } -static const olymp_resolution_t all_resolutions[] = + +/* Fujifilm NX-500 */ +static const dyesub_resolution_t res_306dpi[] = { { "306x306", 306, 306}, - { "153x153", 153, 153}, - { "314x314", 314, 314}, - { "300x300", 300, 300}, - { "317x316", 317, 316}, - { "320x320", 320, 320}, - { "346x346", 346, 346}, }; -static const olymp_resolution_list_t all_res_list = +LIST(dyesub_resolution_list_t, res_306dpi_list, dyesub_resolution_t, res_306dpi); + +static const dyesub_pagesize_t nx500_page[] = +{ + { "Postcard", NULL, -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); + +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); + +static void nx500_printer_init_func(stp_vars_t *v) +{ + stp_zfwrite("INFO-QX-20--MKS\x00\x00\x00M\x00W\00A\x00R\00E", 1, 27, v); + dyesub_nputc(v, '\0', 21); + stp_zfwrite("\x80\x00\x02", 1, 3, v); + dyesub_nputc(v, '\0', 20); + stp_zfwrite("\x02\x01\x01", 1, 3, v); + dyesub_nputc(v, '\0', 2); + stp_put16_le(privdata.ysize, v); + stp_put16_le(privdata.xsize, v); + stp_zfwrite("\x00\x02\x00\x70\x2f", 1, 5, v); + dyesub_nputc(v, '\0', 43); +} + + +/* Kodak Easyshare Dock family */ +static const dyesub_pagesize_t kodak_dock_page[] = +{ + { "w288h432", NULL, 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); + +static const dyesub_printsize_t kodak_dock_printsize[] = { - all_resolutions, sizeof(all_resolutions) / sizeof(olymp_resolution_t) + { "300x300", "w288h432", 1248, 1856}, + { "300x300", "Custom", 1248, 1856}, }; -static const olympus_cap_t olympus_model_capabilities[] = +LIST(dyesub_printsize_list_t, kodak_dock_printsize_list, dyesub_printsize_t, kodak_dock_printsize); + +static void kodak_dock_printer_init(stp_vars_t *v) +{ + stp_put16_be(0x3000, v); + dyesub_nputc(v, '\0', 10); +} + +static void kodak_dock_plane_init(stp_vars_t *v) +{ + stp_put16_be(0x3001, v); + stp_put16_le(3 - privdata.plane, v); + stp_put32_le(privdata.xsize*privdata.ysize, v); + dyesub_nputc(v, '\0', 4); +} + + + +/* Model capabilities */ + +static const dyesub_cap_t dyesub_model_capabilities[] = { { /* Olympus P-10, P-11 */ 2, &rgb_ink_list, - &res_320dpi_list, + &res_310dpi_list, &p10_page_list, &p10_printsize_list, - OLYMPUS_INTERLACE_PLANE, - 1848, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, &p10_printer_init_func, &p10_printer_end_func, NULL, NULL, &p10_block_init_func, NULL, @@ -1107,9 +1320,9 @@ static const olympus_cap_t olympus_model_capabilities[] = &res_320dpi_list, &p200_page_list, &p200_printsize_list, - OLYMPUS_INTERLACE_PLANE, - 1280, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_BLOCK_ALIGN, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_BLOCK_ALIGN + | DYESUB_FEATURE_PLANE_INTERLACE, &p200_printer_init_func, &p200_printer_end_func, &p200_plane_init_func, NULL, NULL, NULL, @@ -1122,9 +1335,9 @@ static const olympus_cap_t olympus_model_capabilities[] = &p300_res_list, &p300_page_list, &p300_printsize_list, - OLYMPUS_INTERLACE_PLANE, 16, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_BLOCK_ALIGN, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_BLOCK_ALIGN + | DYESUB_FEATURE_PLANE_INTERLACE, &p300_printer_init_func, NULL, NULL, &p300_plane_end_func, &p300_block_init_func, NULL, @@ -1137,9 +1350,9 @@ static const olympus_cap_t olympus_model_capabilities[] = &res_314dpi_list, &p400_page_list, &p400_printsize_list, - OLYMPUS_INTERLACE_PLANE, 180, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, &p400_printer_init_func, NULL, &p400_plane_init_func, &p400_plane_end_func, &p400_block_init_func, NULL, @@ -1152,25 +1365,54 @@ static const olympus_cap_t olympus_model_capabilities[] = &res_314dpi_list, &p440_page_list, &p440_printsize_list, - OLYMPUS_INTERLACE_NONE, 128, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, &p440_printer_init_func, &p440_printer_end_func, NULL, NULL, &p440_block_init_func, &p440_block_end_func, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ &p10_laminate_list, }, + { /* Olympus P-S100 */ + 20, + &rgb_ink_list, + &res_306dpi_list, + &ps100_page_list, + &ps100_printsize_list, + 1808, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + &ps100_printer_init_func, &ps100_printer_end_func, + NULL, NULL, + NULL, NULL, + NULL, NULL, NULL, /* color profile/adjustment is built into printer */ + NULL, + }, + { /* Canon CP-10 */ + 1002, + &ymc_ink_list, + &res_300dpi_list, + &cp10_page_list, + &cp10_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER + | DYESUB_FEATURE_PLANE_INTERLACE, + &cpx00_printer_init_func, NULL, + &cpx00_plane_init_func, NULL, + NULL, NULL, + cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, + NULL, + }, { /* Canon CP-100, CP-200, CP-300 */ 1000, &ymc_ink_list, - &res_314dpi_list, + &res_300dpi_list, &cpx00_page_list, &cpx00_printsize_list, - OLYMPUS_INTERLACE_PLANE, - 1808, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT - | OLYMPUS_FEATURE_BORDERLESS | OLYMPUS_FEATURE_WHITE_BORDER, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER + | DYESUB_FEATURE_PLANE_INTERLACE, &cpx00_printer_init_func, NULL, &cpx00_plane_init_func, NULL, NULL, NULL, @@ -1181,44 +1423,71 @@ static const olympus_cap_t olympus_model_capabilities[] = SELPHY CP-600, SELPHY CP-710 */ 1001, &ymc_ink_list, - &res_314dpi_list, + &res_300dpi_list, &cp220_page_list, &cp220_printsize_list, - OLYMPUS_INTERLACE_PLANE, - 1808, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT - | OLYMPUS_FEATURE_BORDERLESS | OLYMPUS_FEATURE_WHITE_BORDER, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER + | DYESUB_FEATURE_PLANE_INTERLACE, &cpx00_printer_init_func, NULL, &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, NULL, }, + { /* Sony DPP-EX5, DPP-EX7 */ + 2002, + &rgb_ink_list, + &res_403dpi_list, + &dppex5_page_list, + &dppex5_printsize_list, + 100, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS, + &dppex5_printer_init, &dppex5_printer_end, + NULL, NULL, + &dppex5_block_init, NULL, + NULL, NULL, NULL, + &dppex5_laminate_list, + }, { /* Sony UP-DP10 */ 2000, &cmy_ink_list, - &updp10_res_list, + &res_300dpi_list, &updp10_page_list, &updp10_printsize_list, - OLYMPUS_INTERLACE_NONE, - 1800, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT - | OLYMPUS_FEATURE_BORDERLESS, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS, &updp10_printer_init_func, &updp10_printer_end_func, NULL, NULL, NULL, NULL, updp10_adj_cyan, updp10_adj_magenta, updp10_adj_yellow, &updp10_laminate_list, }, + { /* Sony UP-DR100 */ + 2003, + &rgb_ink_list, + &res_334dpi_list, + &updr100_page_list, + &updr100_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + &updr100_printer_init_func, &updr100_printer_end_func, + NULL, NULL, + NULL, NULL, + NULL, NULL, NULL, + &updr100_laminate_list, + }, { /* Sony UP-DR150 */ 2001, &rgb_ink_list, - &updr150_res_list, + &res_334dpi_list, &updr150_page_list, &updr150_printsize_list, - OLYMPUS_INTERLACE_NONE, - 1800, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, &updr150_printer_init_func, &updr150_printer_end_func, NULL, NULL, NULL, NULL, @@ -1228,13 +1497,12 @@ static const olympus_cap_t olympus_model_capabilities[] = { /* Fujifilm Printpix CX-400 */ 3000, &rgb_ink_list, - &cx400_res_list, + &res_310dpi_list, &cx400_page_list, &cx400_printsize_list, - OLYMPUS_INTERLACE_NONE, - 2208, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT - | OLYMPUS_FEATURE_BORDERLESS, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS, &cx400_printer_init_func, NULL, NULL, NULL, NULL, NULL, @@ -1244,19 +1512,47 @@ static const olympus_cap_t olympus_model_capabilities[] = { /* Fujifilm Printpix CX-550 */ 3001, &rgb_ink_list, - &cx400_res_list, + &res_310dpi_list, &cx400_page_list, &cx400_printsize_list, - OLYMPUS_INTERLACE_NONE, - 2208, - OLYMPUS_FEATURE_FULL_WIDTH | OLYMPUS_FEATURE_FULL_HEIGHT - | OLYMPUS_FEATURE_BORDERLESS, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS, &cx400_printer_init_func, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ NULL, }, + { /* Fujifilm FinePix NX-500 */ + 3002, + &rgb_ink_list, + &res_306dpi_list, + &nx500_page_list, + &nx500_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + &nx500_printer_init_func, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, NULL, /* color profile/adjustment is built into printer */ + NULL, + }, + { /* Kodak Easyshare Dock family */ + 4000, + &ymc_ink_list, + &res_300dpi_list, + &kodak_dock_page_list, + &kodak_dock_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, + &kodak_dock_printer_init, NULL, + &kodak_dock_plane_init, NULL, + NULL, NULL, + NULL, NULL, NULL, + NULL, + }, }; static const stp_parameter_t the_parameters[] = @@ -1362,25 +1658,25 @@ static const float_param_t float_parameters[] = static const int float_parameter_count = sizeof(float_parameters) / sizeof(const float_param_t); -static const olympus_cap_t* olympus_get_model_capabilities(int model) +static const dyesub_cap_t* dyesub_get_model_capabilities(int model) { int i; - int models = sizeof(olympus_model_capabilities) / sizeof(olympus_cap_t); + int models = sizeof(dyesub_model_capabilities) / sizeof(dyesub_cap_t); for (i=0; i<models; i++) { - if (olympus_model_capabilities[i].model == model) - return &(olympus_model_capabilities[i]); + if (dyesub_model_capabilities[i].model == model) + return &(dyesub_model_capabilities[i]); } - stp_deprintf(STP_DBG_OLYMPUS, - "olympus: model %d not found in capabilities list.\n", model); - return &(olympus_model_capabilities[0]); + stp_deprintf(STP_DBG_DYESUB, + "dyesub: model %d not found in capabilities list.\n", model); + return &(dyesub_model_capabilities[0]); } -static const laminate_t* olympus_get_laminate_pattern(stp_vars_t *v) +static const laminate_t* dyesub_get_laminate_pattern(stp_vars_t *v) { const char *lpar = stp_get_string_parameter(v, "Laminate"); - const olympus_cap_t *caps = olympus_get_model_capabilities( + const dyesub_cap_t *caps = dyesub_get_model_capabilities( stp_get_model_id(v)); const laminate_list_t *llist = caps->laminate; const laminate_t *l = NULL; @@ -1396,16 +1692,16 @@ static const laminate_t* olympus_get_laminate_pattern(stp_vars_t *v) } static void -olympus_printsize(const stp_vars_t *v, +dyesub_printsize(const stp_vars_t *v, int *width, int *height) { int i; const char *page = stp_get_string_parameter(v, "PageSize"); const char *resolution = stp_get_string_parameter(v, "Resolution"); - const olympus_cap_t *caps = olympus_get_model_capabilities( + const dyesub_cap_t *caps = dyesub_get_model_capabilities( stp_get_model_id(v)); - const olymp_printsize_list_t *p = caps->printsize; + const dyesub_printsize_list_t *p = caps->printsize; for (i = 0; i < p->n_items; i++) { @@ -1417,18 +1713,18 @@ olympus_printsize(const stp_vars_t *v, return; } } - stp_erprintf("olympus_printsize: printsize not found (%s, %s)\n", + stp_erprintf("dyesub_printsize: printsize not found (%s, %s)\n", page, resolution); } static int -olympus_feature(const olympus_cap_t *caps, int feature) +dyesub_feature(const dyesub_cap_t *caps, int feature) { return ((caps->features & feature) == feature); } static stp_parameter_list_t -olympus_list_parameters(const stp_vars_t *v) +dyesub_list_parameters(const stp_vars_t *v) { stp_parameter_list_t *ret = stp_parameter_list_create(); int i; @@ -1441,11 +1737,11 @@ olympus_list_parameters(const stp_vars_t *v) } static void -olympus_parameters(const stp_vars_t *v, const char *name, +dyesub_parameters(const stp_vars_t *v, const char *name, stp_parameter_t *description) { int i; - const olympus_cap_t *caps = olympus_get_model_capabilities( + const dyesub_cap_t *caps = dyesub_get_model_capabilities( stp_get_model_id(v)); description->p_type = STP_PARAMETER_TYPE_INVALID; @@ -1472,7 +1768,7 @@ olympus_parameters(const stp_vars_t *v, const char *name, if (strcmp(name, "PageSize") == 0) { int default_specified = 0; - const olymp_pagesize_list_t *p = caps->pages; + const dyesub_pagesize_list_t *p = caps->pages; const char* text; description->bounds.str = stp_string_list_create(); @@ -1507,7 +1803,7 @@ olympus_parameters(const stp_vars_t *v, const char *name, else if (strcmp(name, "Resolution") == 0) { char res_text[24]; - const olymp_resolution_list_t *r = caps->resolution; + const dyesub_resolution_list_t *r = caps->resolution; description->bounds.str = stp_string_list_create(); for (i = 0; i < r->n_items; i++) @@ -1552,7 +1848,7 @@ olympus_parameters(const stp_vars_t *v, const char *name, } else if (strcmp(name, "Borderless") == 0) { - if (olympus_feature(caps, OLYMPUS_FEATURE_BORDERLESS)) + if (dyesub_feature(caps, DYESUB_FEATURE_BORDERLESS)) description->is_active = 1; } else if (strcmp(name, "PrintingMode") == 0) @@ -1568,104 +1864,129 @@ olympus_parameters(const stp_vars_t *v, const char *name, } +static const dyesub_pagesize_t* +dyesub_current_pagesize(const stp_vars_t *v) +{ + const char *page = stp_get_string_parameter(v, "PageSize"); + const stp_papersize_t *pt = stp_get_papersize_by_name(page); + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + const dyesub_pagesize_list_t *p = caps->pages; + int i; + + for (i = 0; i < p->n_items; i++) + { + if (strcmp(p->item[i].name,pt->name) == 0) + return &(p->item[i]); + } + return NULL; +} + static void -olympus_imageable_area_internal(const stp_vars_t *v, +dyesub_media_size(const stp_vars_t *v, + int *width, + int *height) +{ + const dyesub_pagesize_t *p = dyesub_current_pagesize(v); + stp_default_media_size(v, width, height); + + if (p && p->width_pt > 0) + *width = p->width_pt; + if (p && p->height_pt > 0) + *height = p->height_pt; +} + +static void +dyesub_imageable_area_internal(const stp_vars_t *v, int use_maximum_area, int *left, int *right, int *bottom, - int *top) + int *top, + int *print_mode) { int width, height; - int i; - const char *page = stp_get_string_parameter(v, "PageSize"); - const stp_papersize_t *pt = stp_get_papersize_by_name(page); - const olympus_cap_t *caps = olympus_get_model_capabilities( + const dyesub_pagesize_t *p = dyesub_current_pagesize(v); + const dyesub_cap_t *caps = dyesub_get_model_capabilities( stp_get_model_id(v)); - const olymp_pagesize_list_t *p = caps->pages; - for (i = 0; i < p->n_items; i++) + dyesub_media_size(v, &width, &height); + if (use_maximum_area + || (dyesub_feature(caps, DYESUB_FEATURE_BORDERLESS) && + stp_get_boolean_parameter(v, "Borderless")) + || !p) { - if (strcmp(p->item[i].name,pt->name) == 0) - { -/* - if (p->item[i].width_pt >= 0) - stp_set_page_width(v, p->item[i].width_pt); - if (p->item[i].height_pt >= 0) - stp_set_page_height(v, p->item[i].height_pt); -*/ - - stp_default_media_size(v, &width, &height); - - - if (use_maximum_area || - (olympus_feature(caps, OLYMPUS_FEATURE_BORDERLESS) && - stp_get_boolean_parameter(v, "Borderless"))) - { - *left = 0; - *top = 0; - *right = width; - *bottom = height; - } - else - { - *left = p->item[i].border_pt_left; - *top = p->item[i].border_pt_top; - *right = width - p->item[i].border_pt_right; - *bottom = height - p->item[i].border_pt_bottom; - } - break; - } + *left = 0; + *top = 0; + *right = width; + *bottom = height; } + else + { + *left = p->border_pt_left; + *top = p->border_pt_top; + *right = width - p->border_pt_right; + *bottom = height - p->border_pt_bottom; + } + if (p) + *print_mode = p->print_mode; + else + *print_mode = DYESUB_PORTRAIT; } static void -olympus_imageable_area(const stp_vars_t *v, +dyesub_imageable_area(const stp_vars_t *v, int *left, int *right, int *bottom, int *top) { - olympus_imageable_area_internal(v, 0, left, right, bottom, top); + int not_used; + dyesub_imageable_area_internal(v, 0, left, right, bottom, top, ¬_used); } static void -olympus_maximum_imageable_area(const stp_vars_t *v, +dyesub_maximum_imageable_area(const stp_vars_t *v, int *left, int *right, int *bottom, int *top) { - olympus_imageable_area_internal(v, 1, left, right, bottom, top); + int not_used; + dyesub_imageable_area_internal(v, 1, left, right, bottom, top, ¬_used); } static void -olympus_limit(const stp_vars_t *v, /* I */ +dyesub_limit(const stp_vars_t *v, /* I */ int *width, int *height, int *min_width, int *min_height) { - *width = 65535; - *height = 65535; - *min_width = 1; + *width = SHRT_MAX; + *height = SHRT_MAX; + *min_width = 1; *min_height = 1; } static void -olympus_describe_resolution(const stp_vars_t *v, int *x, int *y) +dyesub_describe_resolution(const stp_vars_t *v, int *x, int *y) { const char *resolution = stp_get_string_parameter(v, "Resolution"); + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + const dyesub_resolution_list_t *r = caps->resolution; int i; *x = -1; *y = -1; if (resolution) { - for (i = 0; i < all_res_list.n_items; i++) + for (i = 0; i < r->n_items; i++) { - if (strcmp(resolution, all_res_list.item[i].name) == 0) + if (strcmp(resolution, r->item[i].name) == 0) { - *x = all_res_list.item[i].xdpi; - *y = all_res_list.item[i].ydpi; + *x = r->item[i].xdpi; + *y = r->item[i].ydpi; + break; } } } @@ -1673,87 +1994,304 @@ olympus_describe_resolution(const stp_vars_t *v, int *x, int *y) } static const char * -olympus_describe_output(const stp_vars_t *v) +dyesub_describe_output_internal(const stp_vars_t *v, dyesub_print_vars_t *pv) { - return "CMY"; + const char *ink_type = stp_get_string_parameter(v, "InkType"); + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + const char *output_type; + int i; + + pv->ink_channels = 1; + pv->ink_order = NULL; + output_type = "CMY"; + + if (ink_type) + { + for (i = 0; i < caps->inks->n_items; i++) + if (strcmp(ink_type, caps->inks->item[i].name) == 0) + { + output_type = caps->inks->item[i].output_type; + pv->ink_channels = caps->inks->item[i].output_channels; + pv->ink_order = caps->inks->item[i].channel_order; + break; + } + } + + return output_type; } -static unsigned short * -olympus_get_cached_output(stp_vars_t *v, - stp_image_t *image, - unsigned short **cache, - int line, int size) +static const char * +dyesub_describe_output(const stp_vars_t *v) +{ + dyesub_print_vars_t ipv; + return dyesub_describe_output_internal(v, &ipv); +} + +static void +dyesub_nputc(stp_vars_t *v, char byte, int count) +{ + int i; + for (i = 0; i < count; i++) + stp_putc(byte, v); +} + +static void +dyesub_swap_ints(int *a, int *b) +{ + int t = *a; + *a = *b; + *b = t; +} + +static void +dyesub_adjust_curve(stp_vars_t *v, + const char *color_adj, + const char *color_curve) +{ + stp_curve_t *adjustment = NULL; + + if (color_adj && + !stp_check_curve_parameter(v, color_curve, STP_PARAMETER_ACTIVE)) + { + adjustment = stp_curve_create_from_string(color_adj); + stp_set_curve_parameter(v, color_curve, adjustment); + stp_set_curve_parameter_active(v, color_curve, STP_PARAMETER_ACTIVE); + stp_curve_destroy(adjustment); + } +} + +static void +dyesub_exec(stp_vars_t *v, + void (*func)(stp_vars_t *), + const char *debug_string) +{ + if (func) + { + stp_deprintf(STP_DBG_DYESUB, "dyesub: %s\n", debug_string); + (*func)(v); + } +} + +static int +dyesub_interpolate(int oldval, int oldsize, int newsize) +{ + /* + * This is simple linear interpolation algorithm. + * When imagesize <> printsize I need rescale image somehow... :-/ + */ + return (int)(oldval * newsize / oldsize); +} + +static void +dyesub_free_image(unsigned short** image_data, stp_image_t *image) { - unsigned zero_mask; + int image_px_height = stp_image_height(image); + int i; + + for (i = 0; i< image_px_height; i++) + if (image_data[i]) + stp_free(image_data[i]); + if (image_data) + stp_free(image_data); +} + +static unsigned short ** +dyesub_read_image(stp_vars_t *v, + dyesub_print_vars_t *pv, + stp_image_t *image) +{ + int image_px_width = stp_image_width(image); + int image_px_height = stp_image_height(image); + int row_size = image_px_width * pv->ink_channels * pv->bytes_per_out_channel; + unsigned short **image_data; + unsigned int zero_mask; + int i; - stp_deprintf(STP_DBG_OLYMPUS, "olympus: get row %d", line); - if (cache[line] == NULL) + image_data = stp_zalloc(image_px_height * sizeof(unsigned short *)); + if (!image_data) + return NULL; /* ? out of memory ? */ + + for (i = 0; i < image_px_height; i++) { - stp_deprintf(STP_DBG_OLYMPUS, " (calling stp_color_get_row())\n"); - if (!stp_color_get_row(v, image, line, &zero_mask)) + if (stp_color_get_row(v, image, i, &zero_mask)) + { + stp_deprintf(STP_DBG_DYESUB, + "dyesub_read_image: " + "stp_color_get_row(..., %d, ...) == 0\n", i); + dyesub_free_image(image_data, image); + return NULL; + } + image_data[i] = stp_malloc(row_size); + if (!image_data[i]) { - cache[line] = stp_malloc(size); - memcpy(cache[line], stp_channel_get_output(v), size); + stp_deprintf(STP_DBG_DYESUB, + "dyesub_read_image: " + "(image_data[%d] = stp_malloc()) == NULL\n", i); + dyesub_free_image(image_data, image); + return NULL; + } + memcpy(image_data[i], stp_channel_get_output(v), row_size); + } + stp_image_conclude(image); + + return image_data; +} + +static int +dyesub_print_pixel(stp_vars_t *v, + dyesub_print_vars_t *pv, + int row, + int col, + int plane) +{ + unsigned short ink[MAX_INK_CHANNELS * MAX_BYTES_PER_CHANNEL], *out; + unsigned char *ink_u8; + int i, j; + + if (pv->print_mode == DYESUB_LANDSCAPE) + { /* "rotate" image */ + dyesub_swap_ints(&col, &row); + row = (pv->imgw_px - 1) - row; + } + + out = &(pv->image_data[row][col * pv->out_channels]); + + for (i = 0; i < pv->ink_channels; i++) + { + if (pv->out_channels == pv->ink_channels) + { /* copy out_channel (image) to equiv ink_channel (printer) */ + ink[i] = out[i]; + } + else if (pv->out_channels < pv->ink_channels) + { /* several ink_channels (printer) "share" same out_channel (image) */ + ink[i] = out[i * pv->out_channels / pv->ink_channels]; } + else /* (pv->out_channels > pv->ink_channels) */ + { /* merge several out_channels (image) into ink_channel (printer) */ + int avg = 0; + for (j = 0; j < pv->out_channels / pv->ink_channels; j++) + avg += out[j + i * pv->out_channels / pv->ink_channels]; + ink[i] = avg * pv->ink_channels / pv->out_channels; + } } + + if (pv->bytes_per_ink_channel == 1) /* convert 16bits to 8bit */ + { + ink_u8 = (unsigned char *) ink; + for (i = 0; i < pv->ink_channels; i++) + ink_u8[i] = ink[i] / 257; + } + + if (pv->plane_interlacing) + stp_zfwrite((char *) ink + plane, pv->bytes_per_ink_channel, 1, v); else + stp_zfwrite((char *) ink, pv->bytes_per_ink_channel, pv->ink_channels, v); + + return 1; +} + +static int +dyesub_print_row(stp_vars_t *v, + dyesub_print_vars_t *pv, + int row, + int plane) +{ + int ret = 0; + int w, col; + + for (w = 0; w < pv->outw_px; w++) + { + col = dyesub_interpolate(w, pv->outw_px, pv->imgw_px); + ret = dyesub_print_pixel(v, pv, row, col, plane); + if (ret > 1) + break; + } + return ret; +} + +static int +dyesub_print_plane(stp_vars_t *v, + dyesub_print_vars_t *pv, + const dyesub_cap_t *caps, + int plane) +{ + int ret = 0; + int h, row; + int out_bytes = (pv->plane_interlacing ? 1 : pv->ink_channels) + * pv->bytes_per_ink_channel; + + + for (h = 0; h <= pv->prnb_px - pv->prnt_px; h++) { - stp_deprintf(STP_DBG_OLYMPUS, " (cached)\n"); + if (h % caps->block_size == 0) + { /* block init */ + privdata.block_min_y = h + pv->prnt_px; + privdata.block_min_x = pv->prnl_px; + privdata.block_max_y = MIN(h + pv->prnt_px + caps->block_size - 1, + pv->prnb_px); + privdata.block_max_x = pv->prnr_px; + + dyesub_exec(v, caps->block_init_func, "caps->block_init"); + } + + if (h + pv->prnt_px < pv->outt_px || h + pv->prnt_px >= pv->outb_px) + { /* empty part above or below image area */ + dyesub_nputc(v, pv->empty_byte, out_bytes * pv->prnw_px); + } + else + { + if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH) + && pv->outl_px > 0) + { /* empty part left of image area */ + dyesub_nputc(v, pv->empty_byte, out_bytes * pv->outl_px); + } + + row = dyesub_interpolate(h + pv->prnt_px - pv->outt_px, + pv->outh_px, pv->imgh_px); + stp_deprintf(STP_DBG_DYESUB, + "dyesub_print_plane: h = %d, row = %d\n", h, row); + ret = dyesub_print_row(v, pv, row, plane); + + if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH) + && pv->outr_px < pv->prnw_px) + { /* empty part right of image area */ + dyesub_nputc(v, pv->empty_byte, out_bytes + * (pv->prnw_px - pv->outr_px)); + } + } + + if (h + pv->prnt_px == privdata.block_max_y) + { /* block end */ + dyesub_exec(v, caps->block_end_func, "caps->block_end"); + } } - return cache[line]; + return ret; } /* - * olympus_print() + * dyesub_print() */ static int -olympus_do_print(stp_vars_t *v, stp_image_t *image) +dyesub_do_print(stp_vars_t *v, stp_image_t *image) { - int i, j; - int y, min_y, max_y; /* Looping vars */ - int min_x, max_x; - int out_channels, out_bytes; - unsigned short *final_out = NULL; - unsigned char *char_out = NULL; - unsigned short *real_out = NULL; - unsigned short *err_out = NULL; - unsigned short **rows = NULL; /* "cache" of rows read from image */ - int char_out_width; + int i; + dyesub_print_vars_t pv; int status = 1; - int ink_channels = 1; - const char *ink_order = NULL; - stp_curve_t *adjustment = NULL; - - int r_errdiv, r_errmod; - int r_errval = 0; - int r_errlast = -1; - int r_errline = 0; - int c_errdiv, c_errmod; - int c_errval = 0; - int c_errlast = -1; - int c_errcol = 0; const int model = stp_get_model_id(v); - const char *ink_type = stp_get_string_parameter(v, "InkType"); - const olympus_cap_t *caps = olympus_get_model_capabilities(model); + const char *ink_type; + const dyesub_cap_t *caps = dyesub_get_model_capabilities(model); int max_print_px_width = 0; int max_print_px_height = 0; int xdpi, ydpi; /* Resolution */ - /* image in pixels */ - int image_px_width; - int image_px_height; - /* output in 1/72" */ int out_pt_width = stp_get_width(v); int out_pt_height = stp_get_height(v); int out_pt_left = stp_get_left(v); int out_pt_top = stp_get_top(v); - /* output in pixels */ - int out_px_width, out_px_height; - int out_px_left, out_px_right, out_px_top, out_px_bottom; - /* page in 1/72" */ int page_pt_width = stp_get_page_width(v); int page_pt_height = stp_get_page_height(v); @@ -1761,13 +2299,11 @@ olympus_do_print(stp_vars_t *v, stp_image_t *image) int page_pt_right = 0; int page_pt_top = 0; int page_pt_bottom = 0; + int page_mode; - /* page w/out borders in pixels (according to selected dpi) */ - int print_px_width; - int print_px_height; - int pl; - unsigned char *zeros = NULL; + + if (!stp_verify(v)) { @@ -1776,51 +2312,46 @@ olympus_do_print(stp_vars_t *v, stp_image_t *image) } stp_image_init(image); - image_px_width = stp_image_width(image); - image_px_height = stp_image_height(image); + pv.imgw_px = stp_image_width(image); + pv.imgh_px = stp_image_height(image); stp_describe_resolution(v, &xdpi, &ydpi); - olympus_printsize(v, &max_print_px_width, &max_print_px_height); + dyesub_printsize(v, &max_print_px_width, &max_print_px_height); privdata.pagesize = stp_get_string_parameter(v, "PageSize"); if (caps->laminate) - privdata.laminate = olympus_get_laminate_pattern(v); + privdata.laminate = dyesub_get_laminate_pattern(v); - if (olympus_feature(caps, OLYMPUS_FEATURE_WHITE_BORDER)) - stp_default_media_size(v, &page_pt_right, &page_pt_bottom); - else - olympus_imageable_area(v, &page_pt_left, &page_pt_right, - &page_pt_bottom, &page_pt_top); + dyesub_imageable_area_internal(v, + (dyesub_feature(caps, DYESUB_FEATURE_WHITE_BORDER) ? 1 : 0), + &page_pt_left, &page_pt_right, &page_pt_bottom, &page_pt_top, + &page_mode); - print_px_width = MIN(max_print_px_width, - (page_pt_right - page_pt_left) * xdpi / 72); - print_px_height = MIN(max_print_px_height, - (page_pt_bottom - page_pt_top) * ydpi / 72); - out_px_width = out_pt_width * xdpi / 72; - out_px_height = out_pt_height * ydpi / 72; + pv.prnw_px = MIN(max_print_px_width, + PX(page_pt_right - page_pt_left, xdpi)); + pv.prnh_px = MIN(max_print_px_height, + PX(page_pt_bottom - page_pt_top, ydpi)); + pv.outw_px = PX(out_pt_width, xdpi); + pv.outh_px = PX(out_pt_height, ydpi); /* if image size is close enough to output size send out original size */ - if (out_px_width - image_px_width > -5 - && out_px_width - image_px_width < 5 - && out_px_height - image_px_height > -5 - && out_px_height - image_px_height < 5) - { - out_px_width = image_px_width; - out_px_height = image_px_height; - } - - out_px_width = MIN(out_px_width, print_px_width); - out_px_height = MIN(out_px_height, print_px_height); - out_px_left = MIN(((out_pt_left - page_pt_left) * xdpi / 72), - print_px_width - out_px_width); - out_px_top = MIN(((out_pt_top - page_pt_top) * ydpi / 72), - print_px_height - out_px_height); - out_px_right = out_px_left + out_px_width; - out_px_bottom = out_px_top + out_px_height; + if (abs(pv.outw_px - pv.imgw_px) < SIZE_THRESHOLD) + pv.outw_px = pv.imgw_px; + if (abs(pv.outh_px - pv.imgh_px) < SIZE_THRESHOLD) + pv.outh_px = pv.imgh_px; + + pv.outw_px = MIN(pv.outw_px, pv.prnw_px); + pv.outh_px = MIN(pv.outh_px, pv.prnh_px); + pv.outl_px = MIN(PX(out_pt_left - page_pt_left, xdpi), + pv.prnw_px - pv.outw_px); + pv.outt_px = MIN(PX(out_pt_top - page_pt_top, ydpi), + pv.prnh_px - pv.outh_px); + pv.outr_px = pv.outl_px + pv.outw_px; + pv.outb_px = pv.outt_px + pv.outh_px; - stp_deprintf(STP_DBG_OLYMPUS, + stp_deprintf(STP_DBG_DYESUB, "paper (pt) %d x %d\n" "image (px) %d x %d\n" "image (pt) %d x %d\n" @@ -1832,357 +2363,139 @@ olympus_do_print(stp_vars_t *v, stp_image_t *image) "printable pixels (px) %d x %d\n" "res (dpi) %d x %d\n", page_pt_width, page_pt_height, - image_px_width, image_px_height, - image_px_width * 72 / xdpi, image_px_height * 72 / ydpi, + pv.imgw_px, pv.imgh_px, + PT(pv.imgw_px, xdpi), PT(pv.imgh_px, ydpi), out_pt_width, out_pt_height, - out_px_width, out_px_height, + pv.outw_px, pv.outh_px, out_pt_left, out_pt_top, - out_px_left, out_px_top, + pv.outl_px, pv.outt_px, page_pt_right, page_pt_left, page_pt_right - page_pt_left, page_pt_bottom, page_pt_top, page_pt_bottom - page_pt_top, - print_px_width, print_px_height, + pv.prnw_px, pv.prnh_px, xdpi, ydpi ); privdata.xdpi = xdpi; privdata.ydpi = ydpi; - privdata.xsize = print_px_width; - privdata.ysize = print_px_height; - - stp_set_string_parameter(v, "STPIOutputType", "CMY"); - - if (caps->adj_cyan && - !stp_check_curve_parameter(v, "CyanCurve", STP_PARAMETER_ACTIVE)) - { - adjustment = stp_curve_create_from_string(caps->adj_cyan); - stp_set_curve_parameter(v, "CyanCurve", adjustment); - stp_set_curve_parameter_active(v, "CyanCurve", STP_PARAMETER_ACTIVE); - stp_curve_destroy(adjustment); - } - if (caps->adj_magenta && - !stp_check_curve_parameter(v, "MagentaCurve", STP_PARAMETER_ACTIVE)) - { - adjustment = stp_curve_create_from_string(caps->adj_magenta); - stp_set_curve_parameter(v, "MagentaCurve", adjustment); - stp_set_curve_parameter_active(v, "MagentaCurve", STP_PARAMETER_ACTIVE); - stp_curve_destroy(adjustment); - } - if (caps->adj_yellow && - !stp_check_curve_parameter(v, "YellowCurve", STP_PARAMETER_ACTIVE)) - { - adjustment = stp_curve_create_from_string(caps->adj_yellow); - stp_set_curve_parameter(v, "YellowCurve", adjustment); - stp_set_curve_parameter_active(v, "YellowCurve", STP_PARAMETER_ACTIVE); - stp_curve_destroy(adjustment); - } + privdata.xsize = pv.prnw_px; + privdata.ysize = pv.prnh_px; - if (ink_type) - { - for (i = 0; i < caps->inks->n_items; i++) - if (strcmp(ink_type, caps->inks->item[i].name) == 0) - { - stp_set_string_parameter(v, "STPIOutputType", - caps->inks->item[i].output_type); - ink_channels = caps->inks->item[i].output_channels; - ink_order = caps->inks->item[i].channel_order; - break; - } - } + /* FIXME: move this into print_init_drv */ + ink_type = dyesub_describe_output_internal(v, &pv); + stp_set_string_parameter(v, "STPIOutputType", ink_type); stp_channel_reset(v); - for (i = 0; i < ink_channels; i++) + for (i = 0; i < pv.ink_channels; i++) stp_channel_add(v, i, 0, 1.0); - - out_channels = stp_color_init(v, image, 65536); - -#if 0 - if (out_channels != ink_channels && out_channels != 1 && ink_channels != 1) - { - stp_eprintf(v, "Internal error! Output channels or input channels must be 1\n"); - return 0; - } -#endif - - rows = stp_zalloc(image_px_height * sizeof(unsigned short *)); - err_out = stp_malloc(print_px_width * ink_channels * 2); - if (out_channels != ink_channels) - final_out = stp_malloc(print_px_width * ink_channels * 2); - + pv.out_channels = stp_color_init(v, image, 65536); + pv.bytes_per_ink_channel = 1; /* FIXME: this is printer dependent */ + pv.bytes_per_out_channel = 2; /* FIXME: this is ??? */ + pv.image_data = dyesub_read_image(v, &pv, image); + pv.empty_byte = (ink_type && + (strcmp(ink_type, "RGB") == 0 || strcmp(ink_type, "BGR") == 0) + ? '\xff' : '\0'); + pv.plane_interlacing = dyesub_feature(caps, DYESUB_FEATURE_PLANE_INTERLACE); + pv.print_mode = page_mode; + if (!pv.image_data) + return 2; + /* /FIXME */ + + + dyesub_adjust_curve(v, caps->adj_cyan, "CyanCurve"); + dyesub_adjust_curve(v, caps->adj_magenta, "MagentaCurve"); + dyesub_adjust_curve(v, caps->adj_yellow, "YellowCurve"); stp_set_float_parameter(v, "Density", 1.0); - if (ink_type && - (strcmp(ink_type, "RGB") == 0 || strcmp(ink_type, "BGR") == 0)) - { - zeros = stp_malloc(ink_channels * print_px_width + 1); - (void) memset(zeros, '\xff', ink_channels * print_px_width + 1); - } - else - zeros = stp_zalloc(ink_channels * print_px_width + 1); - - out_bytes = (caps->interlacing == OLYMPUS_INTERLACE_PLANE ? 1 : ink_channels); - - /* printer init */ - if (caps->printer_init_func) - { - stp_deprintf(STP_DBG_OLYMPUS, "olympus: caps->printer_init\n"); - (*(caps->printer_init_func))(v); - } - if (olympus_feature(caps, OLYMPUS_FEATURE_FULL_HEIGHT)) + if (dyesub_feature(caps, DYESUB_FEATURE_FULL_HEIGHT)) { - min_y = 0; - max_y = print_px_height - 1; + pv.prnt_px = 0; + pv.prnb_px = pv.prnh_px - 1; } - else if (olympus_feature(caps, OLYMPUS_FEATURE_BLOCK_ALIGN)) + else if (dyesub_feature(caps, DYESUB_FEATURE_BLOCK_ALIGN)) { - min_y = out_px_top - (out_px_top % caps->block_size); + pv.prnt_px = pv.outt_px - (pv.outt_px % caps->block_size); /* floor to multiple of block_size */ - max_y = (out_px_bottom - 1) + (caps->block_size - 1) - - ((out_px_bottom - 1) % caps->block_size); + pv.prnb_px = (pv.outb_px - 1) + (caps->block_size - 1) + - ((pv.outb_px - 1) % caps->block_size); /* ceil to multiple of block_size */ } else { - min_y = out_px_top; - max_y = out_px_bottom - 1; + pv.prnt_px = pv.outt_px; + pv.prnb_px = pv.outb_px - 1; } - if (olympus_feature(caps, OLYMPUS_FEATURE_FULL_WIDTH)) + if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH)) { - min_x = 0; - max_x = print_px_width - 1; + pv.prnl_px = 0; + pv.prnr_px = pv.prnw_px - 1; } else { - min_x = out_px_left; - max_x = out_px_right; + pv.prnl_px = pv.outl_px; + pv.prnr_px = pv.outr_px; } - r_errdiv = image_px_height / out_px_height; - r_errmod = image_px_height % out_px_height; - c_errdiv = image_px_width / out_px_width; - c_errmod = image_px_width % out_px_width; - - for (pl = 0; pl < (caps->interlacing == OLYMPUS_INTERLACE_PLANE - ? ink_channels : 1); pl++) + if (pv.print_mode == DYESUB_LANDSCAPE) { - r_errval = 0; - r_errlast = -1; - r_errline = 0; + dyesub_swap_ints(&pv.outh_px, &pv.outw_px); + dyesub_swap_ints(&pv.outt_px, &pv.outl_px); + dyesub_swap_ints(&pv.outb_px, &pv.outr_px); + + dyesub_swap_ints(&pv.prnh_px, &pv.prnw_px); + dyesub_swap_ints(&pv.prnt_px, &pv.prnl_px); + dyesub_swap_ints(&pv.prnb_px, &pv.prnr_px); + + dyesub_swap_ints(&pv.imgh_px, &pv.imgw_px); + } - privdata.plane = ink_order[pl]; - stp_deprintf(STP_DBG_OLYMPUS, "olympus: plane %d\n", privdata.plane); + /* printer init */ + dyesub_exec(v, caps->printer_init_func, "caps->printer_init"); + + for (pl = 0; pl < (pv.plane_interlacing ? pv.ink_channels : 1); pl++) + { + privdata.plane = pv.ink_order[pl]; + stp_deprintf(STP_DBG_DYESUB, "dyesub: plane %d\n", privdata.plane); /* plane init */ - if (caps->plane_init_func) - { - stp_deprintf(STP_DBG_OLYMPUS, "olympus: caps->plane_init\n"); - (*(caps->plane_init_func))(v); - } - - for (y = min_y; y <= max_y; y++) - { - unsigned short *out; - int duplicate_line = 1; -/* unsigned zero_mask; */ - - if (((y - min_y) % caps->block_size) == 0) - { - /* block init */ - privdata.block_min_y = y; - privdata.block_min_x = min_x; - privdata.block_max_y = MIN(y + caps->block_size - 1, max_y); - privdata.block_max_x = max_x; - - if (caps->block_init_func) - { - stp_deprintf(STP_DBG_OLYMPUS, - "olympus: caps->block_init\n"); - (*(caps->block_init_func))(v); - } - } - - if (y < out_px_top || y >= out_px_bottom) - stp_zfwrite((char *) zeros, out_bytes, print_px_width, v); - else - { - if (olympus_feature(caps, OLYMPUS_FEATURE_FULL_WIDTH) - && out_px_left > 0) - { - stp_zfwrite((char *) zeros, out_bytes, out_px_left, v); - /* stp_erprintf("left %d ", out_px_left); */ - } - -#if 0 - if (r_errline != r_errlast) - { - r_errlast = r_errline; - duplicate_line = 0; - - /* stp_erprintf("r_errline %d, ", r_errline); */ - if (stp_color_get_row(v, image, r_errline, &zero_mask)) - { - status = 2; - break; - } - } - - out = stp_channel_get_output(v); -#endif - if (r_errline != r_errlast) - { - r_errlast = r_errline; - duplicate_line = 0; - } - - out = olympus_get_cached_output(v, image, rows, r_errline, - image_px_width * ink_channels * 2); - if (out == NULL) - { - status = 2; - break; - } - - c_errval = 0; - c_errlast = -1; - c_errcol = 0; - for (i = 0; i < out_px_width; i++) - { - if (c_errcol != c_errlast) - c_errlast = c_errcol; - for (j = 0; j < ink_channels; j++) - err_out[i * ink_channels + j] = - out[c_errcol * ink_channels + ink_order[j]-1]; - - c_errval += c_errmod; - c_errcol += c_errdiv; - if (c_errval >= out_px_width) - { - c_errval -= out_px_width; - c_errcol ++; - } - } - - real_out = err_out; - if (out_channels != ink_channels) - { - real_out = final_out; - if (out_channels < ink_channels) - { - for (i = 0; i < out_px_width; i++) - { - for (j = 0; j < ink_channels; j++) - final_out[i * ink_channels + j] = err_out[i]; - } - } - else - { - for (i = 0; i < out_px_width; i++) - { - int avg = 0; - for (j = 0; j < out_channels; j++) - avg += err_out[i * out_channels + j]; - final_out[i] = avg / out_channels; - } - } - } - char_out = (unsigned char *) real_out; - char_out_width = (caps->interlacing == OLYMPUS_INTERLACE_PLANE ? - out_px_width : out_px_width * out_channels); - for (i = 0; i < char_out_width; i++) - { - if (caps->interlacing == OLYMPUS_INTERLACE_PLANE) - j = i * ink_channels + pl; - else if (caps->interlacing == OLYMPUS_INTERLACE_LINE) - j = (i % out_px_width) + (i / out_px_width); - else /* OLYMPUS_INTERLACE_NONE */ - j = i; - - char_out[i] = real_out[j] / 257; - } - - stp_zfwrite((char *) real_out, 1, char_out_width, v); - /* stp_erprintf("data %d ", out_px_width); */ - if (olympus_feature(caps, OLYMPUS_FEATURE_FULL_WIDTH) - && out_px_right < print_px_width) - { - stp_zfwrite((char *) zeros, out_bytes, - print_px_width - out_px_right, v); - /* stp_erprintf("right %d ", print_px_width-out_px_right); */ - } - /* stp_erprintf("\n"); */ + dyesub_exec(v, caps->plane_init_func, "caps->plane_init"); - r_errval += r_errmod; - r_errline += r_errdiv; - if (r_errval >= out_px_height) - { - r_errval -= out_px_height; - r_errline ++; - } - } - - if (y == privdata.block_max_y) - { - /* block end */ - if (caps->block_end_func) - { - stp_deprintf(STP_DBG_OLYMPUS, "olympus: caps->block_end\n"); - (*(caps->block_end_func))(v); - } - } - } + dyesub_print_plane(v, &pv, caps, (int) pv.ink_order[pl] - 1); /* plane end */ - if (caps->plane_end_func) { - stp_deprintf(STP_DBG_OLYMPUS, "olympus: caps->plane_end\n"); - (*(caps->plane_end_func))(v); - } + dyesub_exec(v, caps->plane_end_func, "caps->plane_end"); } /* printer end */ - if (caps->printer_end_func) - { - stp_deprintf(STP_DBG_OLYMPUS, "olympus: caps->printer_end\n"); - (*(caps->printer_end_func))(v); - } - stp_image_conclude(image); - if (final_out) - stp_free(final_out); - if (err_out) - stp_free(err_out); - if (zeros) - stp_free(zeros); - if (rows) - { - for (i = 0; i <image_px_height; i++) - stp_free(rows[i]); - stp_free(rows); - } + dyesub_exec(v, caps->printer_end_func, "caps->printer_end"); + + dyesub_free_image(pv.image_data, image); return status; } static int -olympus_print(const stp_vars_t *v, stp_image_t *image) +dyesub_print(const stp_vars_t *v, stp_image_t *image) { int status; stp_vars_t *nv = stp_vars_create_copy(v); stp_prune_inactive_options(nv); - status = olympus_do_print(nv, image); + status = dyesub_do_print(nv, image); stp_vars_destroy(nv); return status; } -static const stp_printfuncs_t print_olympus_printfuncs = -{ - olympus_list_parameters, - olympus_parameters, - stp_default_media_size, - olympus_imageable_area, - olympus_maximum_imageable_area, - olympus_limit, - olympus_print, - olympus_describe_resolution, - olympus_describe_output, +static const stp_printfuncs_t print_dyesub_printfuncs = +{ + dyesub_list_parameters, + dyesub_parameters, + dyesub_media_size, + dyesub_imageable_area, + dyesub_maximum_imageable_area, + dyesub_limit, + dyesub_print, + dyesub_describe_resolution, + dyesub_describe_output, stp_verify_printer_params, NULL, NULL @@ -2191,24 +2504,24 @@ static const stp_printfuncs_t print_olympus_printfuncs = -static stp_family_t print_olympus_module_data = +static stp_family_t print_dyesub_module_data = { - &print_olympus_printfuncs, + &print_dyesub_printfuncs, NULL }; static int -print_olympus_module_init(void) +print_dyesub_module_init(void) { - return stp_family_register(print_olympus_module_data.printer_list); + return stp_family_register(print_dyesub_module_data.printer_list); } static int -print_olympus_module_exit(void) +print_dyesub_module_exit(void) { - return stp_family_unregister(print_olympus_module_data.printer_list); + return stp_family_unregister(print_dyesub_module_data.printer_list); } @@ -2225,8 +2538,8 @@ stp_module_t stp_module_data = "Olympus family driver", STP_MODULE_CLASS_FAMILY, NULL, - print_olympus_module_init, - print_olympus_module_exit, - (void *) &print_olympus_module_data + print_dyesub_module_init, + print_dyesub_module_exit, + (void *) &print_dyesub_module_data }; diff --git a/src/main/print-pcl.c b/src/main/print-pcl.c index f1afc25..c428310 100644 --- a/src/main/print-pcl.c +++ b/src/main/print-pcl.c @@ -1,5 +1,5 @@ /* - * "$Id: print-pcl.c,v 1.144 2006/07/07 13:11:42 rlk Exp $" + * "$Id: print-pcl.c,v 1.145 2006/09/12 19:03:33 easysw Exp $" * * Print plug-in HP PCL driver for the GIMP. * @@ -45,7 +45,10 @@ */ static void pcl_mode0(stp_vars_t *, unsigned char *, int, int); static void pcl_mode2(stp_vars_t *, unsigned char *, int, int); -#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +#ifndef MAX +# define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif /* !MAX */ typedef struct { diff --git a/src/main/print-ps.c b/src/main/print-ps.c index 702d2d7..62b5437 100644 --- a/src/main/print-ps.c +++ b/src/main/print-ps.c @@ -1,5 +1,5 @@ /* - * "$Id: print-ps.c,v 1.87 2006/06/04 18:06:34 rleigh Exp $" + * "$Id: print-ps.c,v 1.87.8.1 2007/05/29 01:47:29 rlk Exp $" * * Print plug-in Adobe PostScript driver for the GIMP. * @@ -233,9 +233,15 @@ static void ps_parameters(const stp_vars_t *v, const char *name, stp_parameter_t *description) { - char *locale = setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif ps_parameters_internal(v, name, description); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif } /* @@ -275,9 +281,15 @@ ps_media_size_internal(const stp_vars_t *v, /* I */ static void ps_media_size(const stp_vars_t *v, int *width, int *height) { - char *locale = setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif ps_media_size_internal(v, width, height); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif } /* @@ -350,9 +362,15 @@ ps_imageable_area(const stp_vars_t *v, /* I */ int *bottom, /* O - Bottom position in points */ int *top) /* O - Top position in points */ { - char *locale = setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif ps_imageable_area_internal(v, 0, left, right, bottom, top); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif } static void @@ -362,9 +380,15 @@ ps_maximum_imageable_area(const stp_vars_t *v, /* I */ int *bottom, /* O - Bottom position in points */ int *top) /* O - Top position in points */ { - char *locale = setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif ps_imageable_area_internal(v, 1, left, right, bottom, top); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif } static void @@ -397,17 +421,30 @@ ps_describe_resolution_internal(const stp_vars_t *v, int *x, int *y) static void ps_describe_resolution(const stp_vars_t *v, int *x, int *y) { - char *locale = setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif ps_describe_resolution_internal(v, x, y); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif } static const char * ps_describe_output(const stp_vars_t *v) { const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); + const char *input_image_type = stp_get_string_parameter(v, "InputImageType"); if (print_mode && strcmp(print_mode, "Color") == 0) - return "RGB"; + { + if (input_image_type && (strcmp(input_image_type, "CMYK") == 0 || + strcmp(input_image_type, "KCMY") == 0)) + return "CMYK"; + else + return "RGB"; + } else return "Whitescale"; } @@ -417,7 +454,7 @@ ps_describe_output(const stp_vars_t *v) */ static int -ps_print_internal(const stp_vars_t *v, stp_image_t *image) +ps_print_internal(stp_vars_t *v, stp_image_t *image) { int status = 1; int model = stp_get_model_id(v); @@ -427,6 +464,7 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) const char *media_type = stp_get_string_parameter(v, "MediaType"); const char *media_source = stp_get_string_parameter(v, "InputSlot"); const char *print_mode = stp_get_string_parameter(v, "PrintingMode"); + const char *input_image_type = stp_get_string_parameter(v, "InputImageType"); unsigned short *out = NULL; int top = stp_get_top(v); int left = stp_get_left(v); @@ -459,8 +497,9 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) } commands[4]; int image_height, image_width; - stp_vars_t *nv = stp_vars_create_copy(v); - char *locale; + int color_out = 0; + int cmyk_out = 0; + if (!resolution) resolution = ""; if (!media_size) @@ -470,12 +509,12 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) if (!media_source) media_source = ""; - stp_prune_inactive_options(nv); - if (!stp_verify(nv)) - { - stp_eprintf(nv, "Print options not verified; cannot print.\n"); - return 0; - } + if (print_mode && strcmp(print_mode, "Color") == 0) + color_out = 1; + if (color_out && + input_image_type && (strcmp(input_image_type, "CMYK") == 0 || + strcmp(input_image_type, "KCMY") == 0)) + cmyk_out = 1; stp_image_init(image); @@ -486,8 +525,8 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) out_width = stp_get_width(v); out_height = stp_get_height(v); - ps_imageable_area(nv, &page_left, &page_right, &page_bottom, &page_top); - ps_media_size(v, &paper_width, &paper_height); + ps_imageable_area_internal(v, 0, &page_left, &page_right, &page_bottom, &page_top); + ps_media_size_internal(v, &paper_width, &paper_height); page_width = page_right - page_left; page_height = page_bottom - page_top; @@ -523,7 +562,6 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) stp_zprintf(v, "%%%%Creator: %s/Gutenprint\n", stp_image_get_appname(image)); #endif stp_zprintf(v, "%%%%CreationDate: %s", ctime(&curtime)); - stp_puts("%Copyright: 1997-2002 by Michael Sweet (mike@easysw.com) and Robert Krawitz (rlk@alum.mit.edu)\n", v); stp_zprintf(v, "%%%%BoundingBox: %d %d %d %d\n", page_left, paper_height - page_bottom, page_right, paper_height - page_top); @@ -645,26 +683,30 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) always be printed with a decimal point rather than the locale-specific setting. */ - locale = setlocale(LC_ALL, "C"); stp_zprintf(v, "%.3f %.3f scale\n", (double)out_width / ((double)image_width), (double)out_height / ((double)image_height)); - setlocale(LC_ALL, locale); - stp_channel_reset(nv); - stp_channel_add(nv, 0, 0, 1.0); - if (strcmp(print_mode, "Color") == 0) + stp_channel_reset(v); + stp_channel_add(v, 0, 0, 1.0); + if (color_out) { - stp_channel_add(nv, 1, 0, 1.0); - stp_channel_add(nv, 2, 0, 1.0); - stp_set_string_parameter(nv, "STPIOutputType", "RGB"); + stp_channel_add(v, 1, 0, 1.0); + stp_channel_add(v, 2, 0, 1.0); + if (cmyk_out) + { + stp_channel_add(v, 3, 0, 1.0); + stp_set_string_parameter(v, "STPIOutputType", "CMYK"); + } + else + stp_set_string_parameter(v, "STPIOutputType", "RGB"); } else - stp_set_string_parameter(nv, "STPIOutputType", "Whitescale"); + stp_set_string_parameter(v, "STPIOutputType", "Whitescale"); - stp_set_boolean_parameter(nv, "SimpleGamma", 1); + stp_set_boolean_parameter(v, "SimpleGamma", 1); - out_channels = stp_color_init(nv, image, 256); + out_channels = stp_color_init(v, image, 256); if (model == 0) { @@ -674,28 +716,47 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) stp_puts("[ 1 0 0 -1 0 1 ]\n", v); - if (strcmp(print_mode, "Color") == 0) + if (cmyk_out) + stp_puts("{currentfile picture readhexstring pop} false 4 colorimage\n", v); + else if (color_out) stp_puts("{currentfile picture readhexstring pop} false 3 colorimage\n", v); else stp_puts("{currentfile picture readhexstring pop} image\n", v); for (y = 0; y < image_height; y ++) { - if (stp_color_get_row(nv, image, y, &zero_mask)) + if (stp_color_get_row(v, image, y, &zero_mask)) { status = 2; break; } - out = stp_channel_get_input(nv); + out = stp_channel_get_input(v); + + /* Convert from KCMY to CMYK */ + if (cmyk_out) + { + int x; + unsigned short *pos = out; + for (x = 0; x < image_width; x++, pos += 4) + { + unsigned short p0 = pos[0]; + pos[0] = pos[1]; + pos[1] = pos[2]; + pos[2] = pos[3]; + pos[3] = p0; + } + } ps_hex(v, out, image_width * out_channels); } } else { unsigned short *tmp_buf = - stp_malloc(sizeof(unsigned short) * (image_width * out_channels + 3)); - if (strcmp(print_mode, "Color") == 0) + stp_malloc(sizeof(unsigned short) * (image_width * out_channels + 4)); + if (cmyk_out) + stp_puts("/DeviceCMYK setcolorspace\n", v); + else if (color_out) stp_puts("/DeviceRGB setcolorspace\n", v); else stp_puts("/DeviceGray setcolorspace\n", v); @@ -707,7 +768,9 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) stp_zprintf(v, "\t/Height %d\n", image_height); stp_puts("\t/BitsPerComponent 8\n", v); - if (strcmp(print_mode, "Color") == 0) + if (cmyk_out) + stp_puts("\t/Decode [ 0 1 0 1 0 1 0 1 ]\n", v); + else if (color_out) stp_puts("\t/Decode [ 0 1 0 1 0 1 ]\n", v); else stp_puts("\t/Decode [ 0 1 ]\n", v); @@ -726,12 +789,12 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) { unsigned short *where; /* FIXME!!! */ - if (stp_color_get_row(nv, image, y /*, out + out_offset */ , &zero_mask)) + if (stp_color_get_row(v, image, y /*, out + out_offset */ , &zero_mask)) { status = 2; break; } - out = stp_channel_get_input(nv); + out = stp_channel_get_input(v); if (out_offset > 0) { memcpy(tmp_buf + out_offset, out, @@ -741,6 +804,21 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) else where = out; + /* Convert from KCMY to CMYK */ + if (cmyk_out) + { + int x; + unsigned short *pos = where; + for (x = 0; x < image_width; x++, pos += 4) + { + unsigned short p0 = pos[0]; + pos[0] = pos[1]; + pos[1] = pos[2]; + pos[2] = pos[3]; + pos[3] = p0; + } + } + out_ps_height = out_offset + image_width * out_channels; if (y < (image_height - 1)) @@ -766,16 +844,33 @@ ps_print_internal(const stp_vars_t *v, stp_image_t *image) stp_puts("showpage\n", v); stp_puts("%%Trailer\n", v); stp_puts("%%EOF\n", v); - stp_vars_destroy(nv); return status; } static int ps_print(const stp_vars_t *v, stp_image_t *image) { - char *locale = setlocale(LC_ALL, "C"); - int status = ps_print_internal(v, image); + int status; +#ifdef HAVE_LOCALE_H + char *locale; +#endif + stp_vars_t *nv = stp_vars_create_copy(v); + stp_prune_inactive_options(nv); + if (!stp_verify(nv)) + { + stp_eprintf(nv, "Print options not verified; cannot print.\n"); + return 0; + } +#ifdef HAVE_LOCALE_H + locale = stp_strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, "C"); +#endif + status = ps_print_internal(nv, image); +#ifdef HAVE_LOCALE_H setlocale(LC_ALL, locale); + stp_free(locale); +#endif + stp_vars_destroy(nv); return status; } diff --git a/src/main/print-util.c b/src/main/print-util.c index 1138781..975ec65 100644 --- a/src/main/print-util.c +++ b/src/main/print-util.c @@ -1,5 +1,5 @@ /* - * "$Id: print-util.c,v 1.108 2004/09/17 18:38:26 rleigh Exp $" + * "$Id: print-util.c,v 1.109.4.3 2007/06/04 00:25:16 rlk Exp $" * * Print plug-in driver utility functions for the GIMP. * @@ -172,12 +172,19 @@ stp_puts(const char *s, const stp_vars_t *v) } void +stp_putraw(const stp_raw_t *r, const stp_vars_t *v) +{ + (stp_get_outfunc(v))((void *)(stp_get_outdata(v)), r->data, r->bytes); +} + +void stp_send_command(const stp_vars_t *v, const char *command, const char *format, ...) { int i = 0; char fchar; const char *out_str; + const stp_raw_t *out_raw; unsigned short byte_count = 0; va_list args; @@ -208,6 +215,10 @@ stp_send_command(const stp_vars_t *v, const char *command, (void) va_arg(args, unsigned int); byte_count += 4; break; + case 'r': + out_raw = va_arg(args, const stp_raw_t *); + byte_count += out_raw->bytes; + break; case 's': out_str = va_arg(args, const char *); byte_count += strlen(out_str); @@ -257,6 +268,9 @@ stp_send_command(const stp_vars_t *v, const char *command, case 's': stp_puts(va_arg(args, const char *), v); break; + case 'r': + stp_putraw(va_arg(args, const stp_raw_t *), v); + break; } format++; } @@ -445,10 +459,16 @@ stp_init(void) { /* Things that are only initialised once */ /* Set up gettext */ +#ifdef HAVE_LOCALE_H + char *locale = stp_strdup(setlocale (LC_ALL, "")); +#endif #ifdef ENABLE_NLS - setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); #endif +#ifdef HAVE_LOCALE_H + setlocale(LC_ALL, locale); + stp_free(locale); +#endif stpi_init_debug(); stp_xml_preinit(); stpi_init_printer(); @@ -549,7 +569,8 @@ stp_read_and_compose_curves(const char *s1, const char *s2, } else if (t1) { - stp_curve_destroy(t2); + if(t2) + stp_curve_destroy(t2); return t1; } else @@ -562,6 +583,8 @@ stp_merge_printvars(stp_vars_t *user, const stp_vars_t *print) int i; stp_parameter_list_t params = stp_get_parameter_list(print); int count = stp_parameter_list_count(params); + stp_deprintf(STP_DBG_VARS, "Merging printvars from %s\n", + stp_get_driver(print)); for (i = 0; i < count; i++) { const stp_parameter_t *p = stp_parameter_list_param(params, i); @@ -595,6 +618,7 @@ stp_merge_printvars(stp_vars_t *user, const stp_vars_t *print) stp_parameter_description_destroy(&desc); } } + stp_deprintf(STP_DBG_VARS, "Exiting merge printvars\n"); stp_parameter_list_destroy(params); } diff --git a/src/main/print-vars.c b/src/main/print-vars.c index c2b1d27..e3d4195 100644 --- a/src/main/print-vars.c +++ b/src/main/print-vars.c @@ -1,5 +1,5 @@ /* - * "$Id: print-vars.c,v 1.75 2006/06/25 00:25:14 rlk Exp $" + * "$Id: print-vars.c,v 1.75.8.1 2007/05/29 01:47:29 rlk Exp $" * * Print plug-in driver utility functions for the GIMP. * @@ -86,18 +86,14 @@ static int standard_vars_initialized = 0; static stp_vars_t default_vars; -static void -null_vars(void) -{ - stp_erprintf("Null stp_vars_t! Please report this bug.\n"); - stp_abort(); -} - static inline void check_vars(const stp_vars_t *v) { if (v == NULL) - null_vars(); + { + stp_erprintf("Null stp_vars_t! Please report this bug.\n"); + stp_abort(); + } } static const char * @@ -345,38 +341,40 @@ stp_vars_destroy(stp_vars_t *v) stp_free(v); } -#define DEF_STRING_FUNCS(s, pre) \ -void \ -pre##_set_##s(stp_vars_t *v, const char *val) \ -{ \ - check_vars(v); \ - if (val) \ - stp_dprintf(STP_DBG_VARS, v, "set %s to %s\n", #s, val); \ - else \ - stp_dprintf(STP_DBG_VARS, v, "clear %s\n", #s); \ - if (v->s == val) \ - return; \ - STP_SAFE_FREE(v->s); \ - v->s = stp_strdup(val); \ - v->verified = 0; \ -} \ - \ -void \ -pre##_set_##s##_n(stp_vars_t *v, const char *val, int n) \ -{ \ - check_vars(v); \ - if (v->s == val) \ - return; \ - STP_SAFE_FREE(v->s); \ - v->s = stp_strndup(val, n); \ - v->verified = 0; \ -} \ - \ -const char * \ -pre##_get_##s(const stp_vars_t *v) \ -{ \ - check_vars(v); \ - return v->s; \ +#define DEF_STRING_FUNCS(s, pre) \ +void \ +pre##_set_##s(stp_vars_t *v, const char *val) \ +{ \ + check_vars(v); \ + if (val) \ + stp_deprintf(STP_DBG_VARS, "set %s to %s (0x%p)\n", #s, val, \ + (const void *) v); \ + else \ + stp_deprintf(STP_DBG_VARS, "clear %s (0x%p)\n", #s, \ + (const void *) v); \ + if (v->s == val) \ + return; \ + STP_SAFE_FREE(v->s); \ + v->s = stp_strdup(val); \ + v->verified = 0; \ +} \ + \ +void \ +pre##_set_##s##_n(stp_vars_t *v, const char *val, int n) \ +{ \ + check_vars(v); \ + if (v->s == val) \ + return; \ + STP_SAFE_FREE(v->s); \ + v->s = stp_strndup(val, n); \ + v->verified = 0; \ +} \ + \ +const char * \ +pre##_get_##s(const stp_vars_t *v) \ +{ \ + check_vars(v); \ + return v->s; \ } #define DEF_FUNCS(s, t, pre) \ @@ -473,11 +471,11 @@ stp_set_string_parameter_n(stp_vars_t *v, const char *parameter, { stp_list_t *list = v->params[STP_PARAMETER_TYPE_STRING_LIST]; if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s, %s)\n", - parameter, value); + stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value); else - stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s)\n", + (const void *) v, parameter); set_raw_parameter(list, parameter, value, bytes, STP_PARAMETER_TYPE_STRING_LIST); stp_set_verified(v, 0); @@ -489,14 +487,9 @@ stp_set_string_parameter(stp_vars_t *v, const char *parameter, { int byte_count = 0; if (value) - { byte_count = strlen(value); - stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s, %s)\n", - parameter, value); - } - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); stp_set_string_parameter_n(v, parameter, value, byte_count); stp_set_verified(v, 0); } @@ -506,12 +499,8 @@ stp_set_default_string_parameter_n(stp_vars_t *v, const char *parameter, const char *value, size_t bytes) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_STRING_LIST]; - if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_string_parameter(%s, %s)\n", - parameter, value); - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_string_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_default_string_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); set_default_raw_parameter(list, parameter, value, bytes, STP_PARAMETER_TYPE_STRING_LIST); stp_set_verified(v, 0); @@ -597,12 +586,8 @@ stp_set_file_parameter(stp_vars_t *v, const char *parameter, size_t byte_count = 0; if (value) byte_count = strlen(value); - if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s, %s)\n", - parameter, value); - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_file_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); set_raw_parameter(list, parameter, value, byte_count, STP_PARAMETER_TYPE_FILE); stp_set_verified(v, 0); @@ -613,12 +598,8 @@ stp_set_file_parameter_n(stp_vars_t *v, const char *parameter, const char *value, size_t byte_count) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_FILE]; - if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s, %s)\n", - parameter, value); - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_file_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); set_raw_parameter(list, parameter, value, byte_count, STP_PARAMETER_TYPE_FILE); stp_set_verified(v, 0); @@ -632,12 +613,8 @@ stp_set_default_file_parameter(stp_vars_t *v, const char *parameter, size_t byte_count = 0; if (value) byte_count = strlen(value); - if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s, %s)\n", - parameter, value); - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_default_file_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); set_default_raw_parameter(list, parameter, value, byte_count, STP_PARAMETER_TYPE_FILE); stp_set_verified(v, 0); @@ -648,12 +625,8 @@ stp_set_default_file_parameter_n(stp_vars_t *v, const char *parameter, const char *value, size_t byte_count) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_FILE]; - if (value) - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s, %s)\n", - parameter, value); - else - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_default_file_parameter(0x%p, %s, %s)\n", + (const void *) v, parameter, value ? value : "NULL"); set_default_raw_parameter(list, parameter, value, byte_count, STP_PARAMETER_TYPE_FILE); stp_set_verified(v, 0); @@ -686,7 +659,8 @@ stp_set_curve_parameter(stp_vars_t *v, const char *parameter, { stp_list_t *list = v->params[STP_PARAMETER_TYPE_CURVE]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_curve_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_curve_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (curve) { value_t *val; @@ -719,8 +693,8 @@ stp_set_default_curve_parameter(stp_vars_t *v, const char *parameter, { stp_list_t *list = v->params[STP_PARAMETER_TYPE_CURVE]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_curve_parameter(%s)\n", - parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_default_curve_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (!item) { if (curve) @@ -764,6 +738,8 @@ stp_set_array_parameter(stp_vars_t *v, const char *parameter, { stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_array_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (array) { value_t *val; @@ -795,7 +771,8 @@ stp_set_default_array_parameter(stp_vars_t *v, const char *parameter, { stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_array_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_set_default_array_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (!item) { if (array) @@ -824,8 +801,6 @@ stp_get_array_parameter(const stp_vars_t *v, const char *parameter) const stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY]; const value_t *val; const stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_array_parameter(%s)\n", - parameter); if (item) { val = (const value_t *) stp_list_item_get_data(item); @@ -841,8 +816,8 @@ stp_set_int_parameter(stp_vars_t *v, const char *parameter, int ival) stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_int_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_int_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (item) { val = (value_t *) stp_list_item_get_data(item); @@ -867,8 +842,8 @@ stp_set_default_int_parameter(stp_vars_t *v, const char *parameter, int ival) stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_int_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_default_int_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (!item) { val = stp_malloc(sizeof(value_t)); @@ -886,7 +861,8 @@ stp_clear_int_parameter(stp_vars_t *v, const char *parameter) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_clear_int_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_clear_int_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (item) stp_list_item_destroy(list, item); stp_set_verified(v, 0); @@ -929,8 +905,8 @@ stp_set_boolean_parameter(stp_vars_t *v, const char *parameter, int ival) stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_boolean_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_boolean_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (item) { val = (value_t *) stp_list_item_get_data(item); @@ -959,8 +935,8 @@ stp_set_default_boolean_parameter(stp_vars_t *v, const char *parameter, stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_boolean_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_default_boolean_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (!item) { val = stp_malloc(sizeof(value_t)); @@ -981,7 +957,8 @@ stp_clear_boolean_parameter(stp_vars_t *v, const char *parameter) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_clear_boolean_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_clear_boolean_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (item) stp_list_item_destroy(list, item); stp_set_verified(v, 0); @@ -1024,8 +1001,8 @@ stp_set_dimension_parameter(stp_vars_t *v, const char *parameter, int ival) stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_dimension_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_dimension_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (item) { val = (value_t *) stp_list_item_get_data(item); @@ -1050,8 +1027,8 @@ stp_set_default_dimension_parameter(stp_vars_t *v, const char *parameter, int iv stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_dimension_parameter(%s, %d)\n", - parameter, ival); + stp_deprintf(STP_DBG_VARS, "stp_set_default_dimension_parameter(0x%p, %s, %d)\n", + (const void *) v, parameter, ival); if (!item) { val = stp_malloc(sizeof(value_t)); @@ -1069,7 +1046,8 @@ stp_clear_dimension_parameter(stp_vars_t *v, const char *parameter) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_clear_dimension_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_clear_dimension_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (item) stp_list_item_destroy(list, item); stp_set_verified(v, 0); @@ -1112,8 +1090,8 @@ stp_set_float_parameter(stp_vars_t *v, const char *parameter, double dval) stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_float_parameter(%s, %f)\n", - parameter, dval); + stp_deprintf(STP_DBG_VARS, "stp_set_float_parameter(0x%p, %s, %f)\n", + (const void *) v, parameter, dval); if (item) { val = (value_t *) stp_list_item_get_data(item); @@ -1139,8 +1117,8 @@ stp_set_default_float_parameter(stp_vars_t *v, const char *parameter, stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE]; value_t *val; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_set_default_float_parameter(%s, %f)\n", - parameter, dval); + stp_deprintf(STP_DBG_VARS, "stp_set_default_float_parameter(0x%p, %s, %f)\n", + (const void *) v, parameter, dval); if (!item) { val = stp_malloc(sizeof(value_t)); @@ -1158,7 +1136,8 @@ stp_clear_float_parameter(stp_vars_t *v, const char *parameter) { stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE]; stp_list_item_t *item = stp_list_get_item_by_name(list, parameter); - stp_dprintf(STP_DBG_VARS, v, "stp_clear_float_parameter(%s)\n", parameter); + stp_deprintf(STP_DBG_VARS, "stp_clear_float_parameter(0x%p, %s)\n", + (const void *) v, parameter); if (item) stp_list_item_destroy(list, item); stp_set_verified(v, 0); @@ -1214,6 +1193,8 @@ stp_scale_float_parameter(stp_vars_t *v, const char *parameter, val = desc.deflt.dbl; stp_parameter_description_destroy(&desc); } + stp_deprintf(STP_DBG_VARS, "stp_scale_float_parameter(%p, %s, %f*%f)\n", + (const void *) v, parameter, val, scale); stp_set_float_parameter(v, parameter, val * scale); } @@ -1289,12 +1270,15 @@ set_parameter_active_generic(const stp_vars_t *v, stp_parameter_type_t p_type, ((value_t *) stp_list_item_get_data(item))->active = active; } -#define SET_PARAMETER_ACTIVE_FUNCTION(type, index) \ -void \ +#define SET_PARAMETER_ACTIVE_FUNCTION(type, index) \ +void \ stp_set_##type##_parameter_active(const stp_vars_t *v, const char *parameter, \ - stp_parameter_activity_t active) \ -{ \ - set_parameter_active_generic(v, index, parameter, active); \ + stp_parameter_activity_t active) \ +{ \ + stp_deprintf(STP_DBG_VARS, \ + "stp_set_%s_parameter_active(0x%p, %s, %d)\n", \ + #type, (const void *) v, parameter, active); \ + set_parameter_active_generic(v, index, parameter, active); \ } SET_PARAMETER_ACTIVE_FUNCTION(string, STP_PARAMETER_TYPE_STRING_LIST) @@ -1322,9 +1306,9 @@ stp_fill_parameter_settings(stp_parameter_t *desc, desc->verify_this_parameter = param->verify_this_parameter; desc->read_only = param->read_only; desc->name = param->name; - desc->text = param->text; - desc->category = param->category; - desc->help = param->help; + desc->text = _(param->text); + desc->category = _(param->category); + desc->help = _(param->help); return; } } @@ -1419,6 +1403,86 @@ stp_parameter_list_add_param(stp_parameter_list_t list, stp_list_item_create(ilist, NULL, item); } +static void +debug_print_parameter_description(const stp_parameter_t *desc, const char *who, + const stp_vars_t *v) +{ + int i; + char *curve; + if (! (stp_get_debug_level() & STP_DBG_VARS)) + return; + stp_deprintf(STP_DBG_VARS, "Describe %s: vars 0x%p from %s type %d class %d level %d\n", + desc->name, (const void *) v, who, + desc->p_type, desc->p_class, desc->p_level); + stp_deprintf(STP_DBG_VARS, " driver %s mandatory %d active %d channel %d verify %d ro %d\n", + stp_get_driver(v), desc->is_mandatory, desc->is_active, + desc->channel, desc->verify_this_parameter, desc->read_only); + switch (desc->p_type) + { + case STP_PARAMETER_TYPE_STRING_LIST: + stp_deprintf(STP_DBG_VARS, + " String default: %s\n", + desc->deflt.str ? desc->deflt.str : "(null)"); + if (desc->bounds.str) + for (i = 0; i < stp_string_list_count(desc->bounds.str); i++) + { + if (i == 0) + stp_deprintf(STP_DBG_VARS, " Choices: %s\n", + stp_string_list_param(desc->bounds.str, i)->name); + else + stp_deprintf(STP_DBG_VARS, " : %s\n", + stp_string_list_param(desc->bounds.str, i)->name); + } + break; + case STP_PARAMETER_TYPE_INT: + stp_deprintf(STP_DBG_VARS, + " Integer default: %d Bounds: %d %d\n", + desc->deflt.integer, + desc->bounds.integer.lower, desc->bounds.integer.upper); + break; + case STP_PARAMETER_TYPE_DIMENSION: + stp_deprintf(STP_DBG_VARS, + " Dimension default: %d Bounds: %d %d\n", + desc->deflt.dimension, + desc->bounds.dimension.lower, desc->bounds.dimension.upper); + break; + case STP_PARAMETER_TYPE_BOOLEAN: + stp_deprintf(STP_DBG_VARS, + " Boolean default: %d\n", desc->deflt.boolean); + break; + case STP_PARAMETER_TYPE_DOUBLE: + stp_deprintf(STP_DBG_VARS, + " Double default: %f Bounds: %f %f\n", + desc->deflt.dbl, + desc->bounds.dbl.lower, desc->bounds.dbl.upper); + break; + case STP_PARAMETER_TYPE_FILE: + stp_deprintf(STP_DBG_VARS, " File (no default)\n"); + break; + case STP_PARAMETER_TYPE_RAW: + stp_deprintf(STP_DBG_VARS, " Raw (no default)\n"); + break; + case STP_PARAMETER_TYPE_CURVE: + curve = stp_curve_write_string(desc->deflt.curve); + stp_deprintf(STP_DBG_VARS, + " Curve default: %s\n", curve); + stp_free(curve); + curve = stp_curve_write_string(desc->bounds.curve); + stp_deprintf(STP_DBG_VARS, + " bounds: %s\n", curve); + stp_free(curve); + break; + case STP_PARAMETER_TYPE_ARRAY: + stp_deprintf(STP_DBG_VARS, " Array\n"); + break; + case STP_PARAMETER_TYPE_INVALID: + stp_deprintf(STP_DBG_VARS, " *** Invalid ***\n"); + break; + default: + stp_deprintf(STP_DBG_VARS, " Unknown type!\n"); + } +} + void stp_describe_parameter(const stp_vars_t *v, const char *name, stp_parameter_t *description) @@ -1429,14 +1493,27 @@ stp_describe_parameter(const stp_vars_t *v, const char *name, description->deflt.str = NULL; stp_printer_describe_parameter(v, name, description); if (description->p_type != STP_PARAMETER_TYPE_INVALID) - return; + { + debug_print_parameter_description(description, "driver", v); + return; + } stp_color_describe_parameter(v, name, description); if (description->p_type != STP_PARAMETER_TYPE_INVALID) - return; + { + debug_print_parameter_description(description, "color", v); + return; + } stp_dither_describe_parameter(v, name, description); if (description->p_type != STP_PARAMETER_TYPE_INVALID) - return; + { + debug_print_parameter_description(description, "dither", v); + return; + } stpi_describe_generic_parameter(v, name, description); + if (description->p_type != STP_PARAMETER_TYPE_INVALID) + debug_print_parameter_description(description, "generic", v); + else + stp_deprintf(STP_DBG_VARS, "Describing invalid parameter %s\n", name); } void diff --git a/src/main/print-weave.c b/src/main/print-weave.c index ba008b0..d440ef1 100644 --- a/src/main/print-weave.c +++ b/src/main/print-weave.c @@ -1,5 +1,5 @@ /* - * "$Id: print-weave.c,v 1.65 2006/07/07 22:34:43 rleigh Exp $" + * "$Id: print-weave.c,v 1.65.8.1 2007/03/02 12:01:32 rlk Exp $" * * Softweave calculator for Gutenprint. * @@ -1151,9 +1151,9 @@ stp_initialize_weave(stp_vars_t *v, sw->separation, sw->jets, sw->virtual_jets, osample, v_subpasses, v_subsample); stp_dprintf(STP_DBG_WEAVE_PARAMS, v, - " ncolors %d bpp %d width %d (%d) line_count %d first %d last %d\n", + " ncolors %d bpp %d width %d (%d) line_count %d first %d last %d max_offset %d\n", sw->ncolors, sw->bitwidth, linewidth, sw->horizontal_width, - sw->vertical_height, first_line, last_line); + sw->vertical_height, first_line, last_line, maxHeadOffset); stp_dprintf(STP_DBG_WEAVE_PARAMS, v, " oversample %d line buffer count %d total buffer %d\n", sw->oversample, sw->vmod, diff --git a/src/main/printers.c b/src/main/printers.c index d182637..9d56976 100644 --- a/src/main/printers.c +++ b/src/main/printers.c @@ -1,5 +1,5 @@ /* - * "$Id: printers.c,v 1.78 2006/04/17 23:33:56 rlk Exp $" + * "$Id: printers.c,v 1.79.2.1 2007/05/29 01:47:30 rlk Exp $" * * Print plug-in driver utility functions for the GIMP. * @@ -368,6 +368,9 @@ stp_initialize_printer_defaults(void) printer_item = stp_list_get_start(printer_list); while (printer_item) { + stp_deprintf + (STP_DBG_PRINTERS, " ==>init %s\n", + ((stp_printer_t *)(stp_list_item_get_data(printer_item)))->driver); set_printer_defaults (((stp_printer_t *)(stp_list_item_get_data(printer_item)))->printvars, 1); printer_item = stp_list_item_next(printer_item); @@ -725,6 +728,9 @@ stp_verify_printer_params(stp_vars_t *v) stp_outfunc_t ofunc = stp_get_errfunc(v); void *odata = stp_get_errdata(v); + stp_dprintf(STP_DBG_VARS, v, "** Entering stp_verify_printer_params(0x%p)\n", + v); + stp_parameter_list_t params; int nparams; int i; @@ -830,6 +836,8 @@ stp_verify_printer_params(stp_vars_t *v) stp_eprintf(v, "%s", errbuf.data); stp_free(errbuf.data); } + stp_dprintf(STP_DBG_VARS, v, "** Exiting stp_verify_printer_params(0x%p) => %d\n", + v, answer); return answer; } @@ -945,49 +953,79 @@ stp_fill_printvars_from_xmltree(stp_mxml_node_t *prop, else if (strcmp(p_type, "float") == 0) { if (child->type == STP_MXML_TEXT) - stp_set_float_parameter - (v, p_name, stp_xmlstrtod(child->value.text.string)); + { + stp_set_float_parameter + (v, p_name, stp_xmlstrtod(child->value.text.string)); + stp_deprintf(STP_DBG_XML, " Set float '%s' to '%s' (%f)\n", + p_name, child->value.text.string, + stp_get_float_parameter(v, p_name)); + } } else if (strcmp(p_type, "integer") == 0) { if (child->type == STP_MXML_TEXT) - stp_set_int_parameter - (v, p_name, (int) stp_xmlstrtol(child->value.text.string)); + { + stp_set_int_parameter + (v, p_name, (int) stp_xmlstrtol(child->value.text.string)); + stp_deprintf(STP_DBG_XML, " Set int '%s' to '%s' (%d)\n", + p_name, child->value.text.string, + stp_get_int_parameter(v, p_name)); + } } else if (strcmp(p_type, "boolean") == 0) { if (child->type == STP_MXML_TEXT) - stp_set_boolean_parameter - (v, p_name, (int) stp_xmlstrtol(child->value.text.string)); + { + stp_set_boolean_parameter + (v, p_name, (int) stp_xmlstrtol(child->value.text.string)); + stp_deprintf(STP_DBG_XML, " Set bool '%s' to '%s' (%d)\n", + p_name, child->value.text.string, + stp_get_boolean_parameter(v, p_name)); + } } else if (strcmp(p_type, "string") == 0) { if (child->type == STP_MXML_TEXT) - stp_set_string_parameter - (v, p_name, child->value.text.string); + { + stp_set_string_parameter + (v, p_name, child->value.text.string); + stp_deprintf(STP_DBG_XML, " Set string '%s' to '%s' (%s)\n", + p_name, child->value.text.string, + stp_get_string_parameter(v, p_name)); + } } else if (strcmp(p_type, "curve") == 0) { - stp_curve_t *curve = stp_curve_create_from_xmltree(child); + stp_curve_t *curve; + while (child->type == STP_MXML_TEXT && child->next) + child = child->next; + curve = stp_curve_create_from_xmltree(child); if (curve) { stp_set_curve_parameter(v, p_name, curve); + stp_deprintf(STP_DBG_XML, " Set curve '%s' to '%s' (%s)\n", + p_name, child->value.text.string, + stp_curve_write_string(curve)); stp_curve_destroy(curve); } } else if (strcmp(p_type, "array") == 0) { - stp_array_t *array = stp_array_create_from_xmltree(child); + stp_array_t *array; + while (child->type == STP_MXML_TEXT && child->next) + child = child->next; + array = stp_array_create_from_xmltree(child); if (array) { stp_set_array_parameter(v, p_name, array); + stp_deprintf(STP_DBG_XML, " Set array '%s' to '%s'\n", + p_name, child->value.text.string); stp_array_destroy(array); } } else { stp_erprintf("Bad property %s type %s\n", p_name, p_type); - continue; } } } @@ -1025,10 +1063,11 @@ stp_printvars_create_from_xmltree(stp_mxml_node_t *printer, strcat(sbuf, stmp); outprintvars->name = sbuf; prop = printer->child; + stp_deprintf(STP_DBG_XML, ">>stp_printvars_create_from_xmltree: %p, %s\n", + outprintvars->printvars, outprintvars->name); stp_fill_printvars_from_xmltree(prop, outprintvars->printvars); - if (stp_get_debug_level() & STP_DBG_XML) - stp_deprintf(STP_DBG_XML, "stp_printvars_create_from_xmltree: %s\n", - outprintvars->name); + stp_deprintf(STP_DBG_XML, "<<stp_printvars_create_from_xmltree: %p, %s\n", + outprintvars->printvars, outprintvars->name); return outprintvars; } diff --git a/src/main/printers.xml b/src/main/printers.xml index c9e444e..b080e60 100644 --- a/src/main/printers.xml +++ b/src/main/printers.xml @@ -4,7 +4,7 @@ XML description of printers known to libgutenprint This file was originally generated. It should be edited by hand. - "$Id: printers.xml,v 1.146 2006/07/07 13:11:42 rlk Exp $" + "$Id: printers.xml,v 1.157.4.6 2007/06/17 12:37:13 faust3 Exp $" --> <gutenprint xmlns="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0" @@ -38,6 +38,16 @@ <parameters name="gamma_750_params"> <parameter type="float" name="Gamma">0.75</parameter> </parameters> + <parameters name="PIXMA_iP4000_params"> + <parameter type="float" name="Gamma">0.4</parameter> + </parameters> + <parameters name="PIXMA_iP4300_params"> + <parameter type="float" name="Brightness">0.7</parameter> + <parameter type="float" name="Density">0.6</parameter> + <parameter type="float" name="Contrast">1.7</parameter> + <parameter type="float" name="Gamma">0.9</parameter> + <parameter type="float" name="BlackGamma">0.6</parameter> + </parameters> <printer name="Canon BJ-30" driver="bjc-30" manufacturer="Canon" model="30" parameters="gamma_2_density_800_params" /> <printer name="Canon BJC-50" driver="bjc-50" manufacturer="Canon" model="4400" parameters="gamma_5_density_800_params" /> <printer name="Canon BJC-55" driver="bjc-55" manufacturer="Canon" model="4400" parameters="gamma_5_density_800_params" /> @@ -64,7 +74,7 @@ <printer name="Canon BJC-8200" driver="bjc-8200" manufacturer="Canon" model="8200" parameters="density_800_params" /> <printer name="Canon S100" driver="bjc-s100" manufacturer="Canon" model="4300" parameters="gamma_750_params" /> <printer name="Canon S200" driver="bjc-s200" manufacturer="Canon" model="4202" parameters="gamma_8_density_900_params" /> - <printer name="Canon S300" driver="bjc-s300" manufacturer="Canon" model="4202" parameters="gamma_8_density_900_params" /> + <printer name="Canon S300" driver="bjc-s300" manufacturer="Canon" model="8201" parameters="density_800_params" /> <printer name="Canon S400" driver="bjc-s400" manufacturer="Canon" model="3000" parameters="density_800_params" /> <printer name="Canon S450" driver="bjc-s450" manufacturer="Canon" model="6200" parameters="gamma_750_params" /> <printer name="Canon S500" driver="bjc-s500" manufacturer="Canon" model="8200" parameters="density_800_params" /> @@ -72,7 +82,32 @@ <printer name="Canon S630" driver="bjc-s630" manufacturer="Canon" model="8200" parameters="density_800_params" /> <printer name="Canon S800" driver="bjc-s800" manufacturer="Canon" model="8200" parameters="density_800_params" /> <printer name="Canon S4500" driver="bjc-s4500" manufacturer="Canon" model="6500" parameters="gamma_750_params" /> - <printer name="Canon iP4000" driver="bjc-iP4000" manufacturer="Canon" model="4000" /> + <printer name="Canon PIXMA iP2000" driver="bjc-PIXMA-iP2000" manufacturer="Canon" model="9001" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP3000" driver="bjc-PIXMA-iP3000" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP3100" driver="bjc-PIXMA-iP3100" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP4000" driver="bjc-iP4000" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP4100" driver="bjc-PIXMA-iP4100" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP4200" driver="bjc-PIXMA-iP4200" manufacturer="Canon" model="4200" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP4300" driver="bjc-PIXMA-iP4300" manufacturer="Canon" model="4200" parameters="PIXMA_iP4300_params" /> + <printer name="Canon PIXMA iP5000" driver="bjc-PIXMA-iP5000" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP5200" driver="bjc-PIXMA-iP5200" manufacturer="Canon" model="4200" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA iP6700" driver="bjc-PIXMA-iP6700" manufacturer="Canon" model="4203" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP150" driver="bjc-MULTIPASS-MP150" manufacturer="Canon" model="4201" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP500" driver="bjc-MULTIPASS-MP500" manufacturer="Canon" model="4200" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP700" driver="bjc-MULTIPASS-MP700" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP730" driver="bjc-MULTIPASS-MP730" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP750" driver="bjc-MULTIPASS-MP750" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP760" driver="bjc-MULTIPASS-MP760" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP770" driver="bjc-MULTIPASS-MP770" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP780" driver="bjc-MULTIPASS-MP780" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP790" driver="bjc-MULTIPASS-MP790" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXMA MP830" driver="bjc-MULTIPASS-MP830" manufacturer="Canon" model="9000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXUS iP3100" driver="bjc-PIXUS-iP3100" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon PIXUS iP4100" driver="bjc-PIXUS-iP4100" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon i560" driver="bjc-i560" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon i850" driver="bjc-i850" manufacturer="Canon" model="3999" parameters="PIXMA_iP4000_params" /> + <printer name="Canon i860" driver="bjc-i860" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> + <printer name="Canon i865" driver="bjc-i865" manufacturer="Canon" model="4000" parameters="PIXMA_iP4000_params" /> </family> <family name="escp2"> <parameters name="standard_params"> @@ -93,6 +128,10 @@ <parameter type="float" name="YellowGamma">1.02</parameter> <parameter type="float" name="Gamma">0.500</parameter> </parameters> + <parameters name="claria_params"> + <parameter type="float" name="Gamma">0.470</parameter> + <parameter type="float" name="BlackDensity">0.8</parameter> + </parameters> <printer name="Epson Stylus C20" driver="escp2-c20" manufacturer="Epson" model="42" parameters="480_params" /> <printer name="Epson Stylus C20SX" driver="escp2-c20sx" manufacturer="Epson" model="42" parameters="480_params" /> <printer name="Epson Stylus C20UX" driver="escp2-c20ux" manufacturer="Epson" model="42" parameters="480_params" /> @@ -124,12 +163,14 @@ <printer name="Epson Stylus C66" driver="escp2-c66" manufacturer="Epson" model="66" parameters="standard_params" /> <printer name="Epson Stylus C68" driver="escp2-c68" manufacturer="Epson" model="66" parameters="standard_params" /> <printer name="Epson Stylus C70" driver="escp2-c70" manufacturer="Epson" model="44" parameters="standard_params" /> + <printer name="Epson Stylus C79" driver="escp2-c79" manufacturer="Epson" model="66" parameters="standard_params" /> <printer name="Epson Stylus C80" driver="escp2-c80" manufacturer="Epson" model="44" parameters="standard_params" /> <printer name="Epson Stylus C82" driver="escp2-c82" manufacturer="Epson" model="55" parameters="standard_params" /> <printer name="Epson Stylus C83" driver="escp2-c83" manufacturer="Epson" model="60" parameters="standard_params" /> <printer name="Epson Stylus C84" driver="escp2-c84" manufacturer="Epson" model="60" parameters="standard_params" /> <printer name="Epson Stylus C85" driver="escp2-c85" manufacturer="Epson" model="69" parameters="standard_params" /> <printer name="Epson Stylus C86" driver="escp2-c86" manufacturer="Epson" model="69" parameters="standard_params" /> + <printer name="Epson Stylus C87" driver="escp2-c87" manufacturer="Epson" model="69" parameters="standard_params" /> <printer name="Epson Stylus C88" driver="escp2-c88" manufacturer="Epson" model="69" parameters="standard_params" /> <printer name="Epson Stylus Color" driver="escp2" manufacturer="Epson" model="0" parameters="standard_params" /> <printer name="Epson Stylus Color I" driver="escp2-i" manufacturer="Epson" model="0" parameters="standard_params" /> @@ -175,8 +216,8 @@ --> <printer name="Epson Stylus Photo 785" driver="escp2-785" manufacturer="Epson" model="36" parameters="standard_params" /> <printer name="Epson Stylus Photo 790" driver="escp2-790" manufacturer="Epson" model="35" parameters="standard_params" /> - <printer name="Epson Stylus Photo 810" driver="escp2-810" manufacturer="Epson" model="35" parameters="standard_params" /> - <printer name="Epson Stylus Photo 820" driver="escp2-820" manufacturer="Epson" model="35" parameters="standard_params" /> + <printer name="Epson Stylus Photo 810" driver="escp2-810" manufacturer="Epson" model="78" parameters="standard_params" /> + <printer name="Epson Stylus Photo 820" driver="escp2-820" manufacturer="Epson" model="78" parameters="standard_params" /> <printer name="Epson Stylus Photo 825" driver="escp2-825" manufacturer="Epson" model="50" parameters="standard_params" /> <printer name="Epson Stylus Photo 830" driver="escp2-830" manufacturer="Epson" model="50" parameters="standard_params" /> <printer name="Epson Stylus Photo 830U" driver="escp2-830u" manufacturer="Epson" model="50" parameters="standard_params" /> @@ -194,25 +235,41 @@ <printer name="Epson Stylus Photo 1270" driver="escp2-1270" manufacturer="Epson" model="23" parameters="standard_params" /> <printer name="Epson Stylus Photo 1280" driver="escp2-1280" manufacturer="Epson" model="37" parameters="standard_params" /> <printer name="Epson Stylus Photo 1290" driver="escp2-1290" manufacturer="Epson" model="37" parameters="standard_params" /> + <printer name="Epson Stylus Photo 1400" driver="escp2-1400" manufacturer="Epson" model="82" parameters="claria_params" /> + <printer name="Epson Stylus Photo 1410" driver="escp2-1410" manufacturer="Epson" model="82" parameters="claria_params" /> <printer name="Epson Stylus Photo 2000P" driver="escp2-2000" manufacturer="Epson" model="26" parameters="standard_params" /> <printer name="Epson Stylus Photo 2100" driver="escp2-2100" manufacturer="Epson" model="47" parameters="standard_params" /> <printer name="Epson Stylus Photo 2200" driver="escp2-2200" manufacturer="Epson" model="47" parameters="standard_params" /> <printer name="Epson Stylus Photo R200" driver="escp2-r200" manufacturer="Epson" model="63" parameters="standard_params" /> <printer name="Epson Stylus Photo R210" driver="escp2-r210" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo R220" driver="escp2-r220" manufacturer="Epson" model="63" parameters="standard_params" /> + <printer name="Epson Stylus Photo R220" driver="escp2-r220" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo R230" driver="escp2-r230" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo R240" driver="escp2-r240" manufacturer="Epson" model="83" parameters="standard_params" /> + <printer name="Epson Stylus Photo R245" driver="escp2-r245" manufacturer="Epson" model="83" parameters="standard_params" /> + <printer name="Epson Stylus Photo R260" driver="escp2-r260" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo R265" driver="escp2-r265" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo R270" driver="escp2-r270" manufacturer="Epson" model="81" parameters="claria_params" /> <printer name="Epson Stylus Photo R300" driver="escp2-r300" manufacturer="Epson" model="63" parameters="standard_params" /> <printer name="Epson Stylus Photo R310" driver="escp2-r310" manufacturer="Epson" model="63" parameters="standard_params" /> <printer name="Epson Stylus Photo R320" driver="escp2-r320" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo R340" driver="escp2-r340" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX400" driver="escp2-rx400" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX420" driver="escp2-rx420" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX425" driver="escp2-rx425" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX430" driver="escp2-rx430" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX500" driver="escp2-rx500" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX510" driver="escp2-rx510" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX600" driver="escp2-rx600" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX620" driver="escp2-rx620" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson Stylus Photo RX630" driver="escp2-rx630" manufacturer="Epson" model="63" parameters="standard_params" /> + <printer name="Epson Stylus Photo R340" driver="escp2-r340" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo R350" driver="escp2-r350" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo R360" driver="escp2-r360" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo R380" driver="escp2-r380" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo R390" driver="escp2-r390" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo RX400" driver="escp2-rx400" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX420" driver="escp2-rx420" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX425" driver="escp2-rx425" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX430" driver="escp2-rx430" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX500" driver="escp2-rx500" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX510" driver="escp2-rx510" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX560" driver="escp2-rx560" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo RX580" driver="escp2-rx580" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo RX590" driver="escp2-rx590" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson Stylus Photo RX600" driver="escp2-rx600" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX620" driver="escp2-rx620" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX630" driver="escp2-rx630" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson Stylus Photo RX640" driver="escp2-rx640" manufacturer="Epson" model="81" parameters="claria_params" /> <printer name="Epson Stylus Photo RX700" driver="escp2-rx700" manufacturer="Epson" model="70" parameters="standard_params" /> <printer name="Epson Stylus Photo R800" driver="escp2-r800" manufacturer="Epson" model="64" parameters="standard_params" /> <printer name="Epson Stylus Photo R1800" driver="escp2-r1800" manufacturer="Epson" model="67" parameters="standard_params" /> @@ -244,20 +301,24 @@ <printer name="Epson Stylus CX4600" driver="escp2-cx4600" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson Stylus CX4700" driver="escp2-cx4700" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson Stylus CX4800" driver="escp2-cx4800" manufacturer="Epson" model="65" parameters="cx3500_params" /> + <printer name="Epson Stylus CX5000" driver="escp2-cx5000" manufacturer="Epson" model="65" parameters="cx3500_params" /> + <printer name="Epson Stylus CX5000F" driver="escp2-cx5000f" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson Stylus CX5100" driver="escp2-cx5100" manufacturer="Epson" model="55" parameters="cx3500_params" /> <printer name="Epson Stylus CX5200" driver="escp2-cx5200" manufacturer="Epson" model="55" parameters="cx3500_params" /> <printer name="Epson Stylus CX5300" driver="escp2-cx5300" manufacturer="Epson" model="55" parameters="cx3500_params" /> <printer name="Epson Stylus CX5400" driver="escp2-cx5400" manufacturer="Epson" model="55" parameters="cx3500_params" /> <printer name="Epson Stylus CX5700" driver="escp2-cx5700" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson Stylus CX5800" driver="escp2-cx5800" manufacturer="Epson" model="65" parameters="cx3500_params" /> + <printer name="Epson Stylus CX6000" driver="escp2-cx6000" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson Stylus CX6300" driver="escp2-cx6300" manufacturer="Epson" model="60" parameters="cx3500_params" /> - <printer name="Epson Stylus CX6400" driver="escp2-cx6400" manufacturer="Epson" model="60" parameters="cx3500_params" /> - <printer name="Epson Stylus CX6500" driver="escp2-cx6500" manufacturer="Epson" model="69" parameters="cx3500_params" /> - <printer name="Epson Stylus CX6600" driver="escp2-cx6600" manufacturer="Epson" model="69" parameters="cx3500_params" /> - <printer name="Epson Stylus CX7700" driver="escp2-cx7700" manufacturer="Epson" model="65" parameters="cx3500_params" /> + <printer name="Epson Stylus CX6400" driver="escp2-cx6400" manufacturer="Epson" model="79" parameters="cx3500_params" /> + <printer name="Epson Stylus CX6500" driver="escp2-cx6500" manufacturer="Epson" model="80" parameters="cx3500_params" /> + <printer name="Epson Stylus CX6600" driver="escp2-cx6600" manufacturer="Epson" model="80" parameters="cx3500_params" /> + <printer name="Epson Stylus CX7000F" driver="escp2-cx7000f" manufacturer="Epson" model="65" parameters="cx3500_params" /> + <printer name="Epson Stylus CX7700" driver="escp2-cx7700" manufacturer="Epson" model="80" parameters="cx3500_params" /> <printer name="Epson Stylus CX7800" driver="escp2-cx7800" manufacturer="Epson" model="65" parameters="cx3500_params" /> - <printer name="Epson Stylus CX8300" driver="escp2-cx8300" manufacturer="Epson" model="60" parameters="cx3500_params" /> - <printer name="Epson Stylus CX8400" driver="escp2-cx8400" manufacturer="Epson" model="60" parameters="cx3500_params" /> + <printer name="Epson Stylus CX8300" driver="escp2-cx8300" manufacturer="Epson" model="79" parameters="cx3500_params" /> + <printer name="Epson Stylus CX8400" driver="escp2-cx8400" manufacturer="Epson" model="79" parameters="cx3500_params" /> <printer name="Epson Stylus D68" driver="escp2-d68" manufacturer="Epson" model="66" parameters="standard_params" /> <printer name="Epson Stylus D88" driver="escp2-d88" manufacturer="Epson" model="69" parameters="standard_params" /> <printer name="Epson Stylus DX3800" driver="escp2-dx3800" manufacturer="Epson" model="72" parameters="standard_params" /> @@ -267,6 +328,14 @@ <printer name="Epson Stylus DX4800" driver="escp2-dx4800" manufacturer="Epson" model="65" parameters="standard_params" /> <printer name="Epson PictureMate" driver="escp2-picmate" manufacturer="Epson" model="73" parameters="standard_params" /> <printer name="Epson PictureMate Deluxe" driver="escp2-picmated" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate Flash" driver="escp2-picmateflash" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate Pal" driver="escp2-picmatepal" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate Snap" driver="escp2-picmatesnap" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate 200" driver="escp2-picmate200" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate 210" driver="escp2-picmate210" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate 240" driver="escp2-picmate240" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate 250" driver="escp2-picmate250" manufacturer="Epson" model="73" parameters="standard_params" /> + <printer name="Epson PictureMate 280" driver="escp2-picmate280" manufacturer="Epson" model="73" parameters="standard_params" /> <printer name="Epson CL 700" driver="escp2-cl700" manufacturer="Epson" model="38" parameters="480_params" /> <printer name="Epson CL 750" driver="escp2-cl750" manufacturer="Epson" model="43" parameters="480_params" /> <printer name="Epson CL 760" driver="escp2-cl760" manufacturer="Epson" model="56" parameters="480_params" /> @@ -314,19 +383,23 @@ <printer name="Epson PM 10000" driver="escp2-pm10000" manufacturer="Epson" model="41" parameters="standard_params" /> <printer name="Epson PM A650" driver="escp2-pma650" manufacturer="Epson" model="74" parameters="standard_params" /> <printer name="Epson PM A750" driver="escp2-pma750" manufacturer="Epson" model="75" parameters="standard_params" /> + <printer name="Epson PM A820" driver="escp2-pma820" manufacturer="Epson" model="81" parameters="claria_params" /> <printer name="Epson PM A890" driver="escp2-pma890" manufacturer="Epson" model="76" parameters="standard_params" /> <printer name="Epson PM A900" driver="escp2-pma900" manufacturer="Epson" model="70" parameters="standard_params" /> <printer name="Epson PM A950" driver="escp2-pma950" manufacturer="Epson" model="70" parameters="standard_params" /> <printer name="Epson PM D600" driver="escp2-pmd600" manufacturer="Epson" model="77" parameters="standard_params" /> <printer name="Epson PM D750" driver="escp2-pmd750" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM D770" driver="escp2-pmd770" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM D800" driver="escp2-pmd800" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM D1000" driver="escp2-pmd1000" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM G700" driver="escp2-pmg700" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM G720" driver="escp2-pmg720" manufacturer="Epson" model="63" parameters="standard_params" /> - <printer name="Epson PM G730" driver="escp2-pmg730" manufacturer="Epson" model="63" parameters="standard_params" /> + <printer name="Epson PM D770" driver="escp2-pmd770" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson PM D800" driver="escp2-pmd800" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson PM D870" driver="escp2-pmd870" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson PM D1000" driver="escp2-pmd1000" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson PM G700" driver="escp2-pmg700" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson PM G720" driver="escp2-pmg720" manufacturer="Epson" model="84" parameters="standard_params" /> + <printer name="Epson PM G730" driver="escp2-pmg730" manufacturer="Epson" model="84" parameters="standard_params" /> <printer name="Epson PM G800" driver="escp2-pmg800" manufacturer="Epson" model="68" parameters="standard_params" /> <printer name="Epson PM G820" driver="escp2-pmg820" manufacturer="Epson" model="68" parameters="standard_params" /> + <printer name="Epson PM G850" driver="escp2-pmg850" manufacturer="Epson" model="81" parameters="claria_params" /> + <printer name="Epson PM G4500" driver="escp2-pmg4500" manufacturer="Epson" model="82" parameters="standard_params" /> <printer name="Epson PX A650" driver="escp2-pxa650" manufacturer="Epson" model="65" parameters="cx3500_params" /> <printer name="Epson PX G900" driver="escp2-pxg900" manufacturer="Epson" model="64" parameters="standard_params" /> <printer name="Epson PX G920" driver="escp2-pxg920" manufacturer="Epson" model="64" parameters="standard_params" /> @@ -724,6 +797,7 @@ <printer name="Lexmark 4076" driver="lexmark-4076" manufacturer="Lexmark" model="500" parameters="pcl_inkjet_params" /> <printer name="Lexmark Optra E" driver="lexmark-optra_e" manufacturer="Lexmark" model="6" parameters="pcl_laser_params" /> <printer name="Lexmark Optra E+" driver="lexmark-optra_eplus" manufacturer="Lexmark" model="6" parameters="pcl_laser_params" /> + <printer name="Lexmark Optra E220" driver="lexmark-optra_e220" manufacturer="Lexmark" model="6" parameters="pcl_laser_params" /> <printer name="Lexmark Valuewriter 300" driver="lexmark-vw_300" manufacturer="Lexmark" model="2" parameters="pcl_laser_params" /> <printer name="Minolta PagePro 6" driver="minolta-pp_6" manufacturer="Minolta" model="6" parameters="pcl_laser_params" /> <printer name="Minolta PagePro 6e" driver="minolta-pp_6e" manufacturer="Minolta" model="6" parameters="pcl_laser_params" /> @@ -789,6 +863,7 @@ <printer name="Xerox DocuPrint P1202" driver="xerox-dp_p1202" manufacturer="Xerox" model="6" parameters="pcl_laser_params" /> <printer name="Xerox DocuPrint P8e" driver="xerox-dp_p8e" manufacturer="Xerox" model="6" parameters="pcl_laser_params" /> <printer name="Xerox Document Centre 400" driver="xerox-dc_400" manufacturer="Xerox" model="6" parameters="pcl_laser_params" /> + <printer name="Xerox WorkCentre M118" driver="xerox-wc_m118" manufacturer="Xerox" model="6" parameters="pcl_laser_params" /> </family> <family name="lexmark"> <parameters name="standard_params"> @@ -796,6 +871,8 @@ <parameter type="float" name="Gamma">0.5</parameter> <parameter type="float" name="Density">2.0</parameter> </parameters> + <printer name="Compaq IJ1200" driver="compaq-ij1200" manufacturer="Compaq" model="10042" parameters="standard_params" /> + <printer name="Lexmark X73" driver="lexmark-x73" manufacturer="Lexmark" model="10042" parameters="standard_params" /> <printer name="Lexmark Z42" driver="lexmark-z42" manufacturer="Lexmark" model="10042" parameters="standard_params" /> <printer name="Lexmark Z43" driver="lexmark-z43" manufacturer="Lexmark" model="10042" parameters="standard_params" /> <printer name="Lexmark Z52" driver="lexmark-z52" manufacturer="Lexmark" model="10052" parameters="standard_params" /> @@ -812,6 +889,8 @@ <printer name="Olympus P-330NE" driver="olympus-p330ne" manufacturer="Olympus" model="0" /> <printer name="Olympus P-400" driver="olympus-p400" manufacturer="Olympus" model="1" /> <printer name="Olympus P-440" driver="olympus-p440" manufacturer="Olympus" model="3" /> + <printer name="Olympus P-S100" driver="olympus-ps100" manufacturer="Olympus" model="20" /> + <printer name="Canon CP-10" driver="canon-cp10" manufacturer="Canon" model="1002" /> <printer name="Canon CP-100" driver="canon-cp100" manufacturer="Canon" model="1000" /> <printer name="Canon CP-200" driver="canon-cp200" manufacturer="Canon" model="1000" /> <printer name="Canon CP-220" driver="canon-cp220" manufacturer="Canon" model="1001" /> @@ -822,10 +901,15 @@ <printer name="Canon SELPHY-CP-510" driver="canon-cp510" manufacturer="Canon" model="1001" /> <printer name="Canon SELPHY-CP-600" driver="canon-cp600" manufacturer="Canon" model="1001" /> <printer name="Canon SELPHY-CP-710" driver="canon-cp710" manufacturer="Canon" model="1001" /> + <printer name="Sony DPP-EX5" driver="sony-dppex5" manufacturer="Sony" model="2002" /> + <printer name="Sony DPP-EX7" driver="sony-dppex5" manufacturer="Sony" model="2002" /> <printer name="Sony UP-DP10" driver="sony-updp10" manufacturer="Sony" model="2000" /> + <printer name="Sony UP-DR100" driver="sony-updr100" manufacturer="Sony" model="2003" /> <printer name="Sony UP-DR150" driver="sony-updr150" manufacturer="Sony" model="2001" /> <printer name="Fujifilm Printpix-CX-400" driver="fujifilm-cx400" manufacturer="Fujifilm" model="3000" /> <printer name="Fujifilm Printpix-CX-550" driver="fujifilm-cx550" manufacturer="Fujifilm" model="3001" /> + <printer name="Fujifilm FinePix-NX-500" driver="fujifilm-nx500" manufacturer="Fujifilm" model="3002" /> + <printer name="Kodak Easyshare-Printer-Dock" driver="kodak-dock" manufacturer="Kodak" model="4000"/> </family> <family name="raw"> <printer name="RAW DATA 16 bit" driver="raw-data-16" manufacturer="" model="0" /> diff --git a/src/main/sequence.c b/src/main/sequence.c index ef69990..83f2b69 100644 --- a/src/main/sequence.c +++ b/src/main/sequence.c @@ -1,5 +1,5 @@ /* - * "$Id: sequence.c,v 1.22 2006/07/07 21:31:02 rleigh Exp $" + * "$Id: sequence.c,v 1.23 2006/09/12 19:03:33 easysw Exp $" * * Sequence data type. This type is designed to be derived from by * the curve and dither matrix types. @@ -277,7 +277,7 @@ stp_sequence_set_point(stp_sequence_t *sequence, size_t where, { check_sequence(sequence); - if (where >= sequence->size || ! finite(data) || + if (where >= sequence->size || ! isfinite(data) || data < sequence->blo || data > sequence->bhi) return 0; @@ -378,7 +378,7 @@ stp_sequence_create_from_xmltree(stp_mxml_node_t *da) child->value.text.string); goto error; } - if (! finite(tmpval) + if (! isfinite(tmpval) || ( tmpval == 0 && errno == ERANGE ) || tmpval < low || tmpval > high) @@ -484,7 +484,7 @@ stp_sequence_set_##name##_data(stp_sequence_t *sequence, \ \ /* Validate the data before we commit to it. */ \ for (i = 0; i < count; i++) \ - if (! finite(data[i]) || \ + if (! isfinite(data[i]) || \ data[i] < sequence->blo || \ data[i] > sequence->bhi) \ return 0; \ diff --git a/src/main/util.h b/src/main/util.h index 701a8eb..7a3fe61 100644 --- a/src/main/util.h +++ b/src/main/util.h @@ -1,5 +1,5 @@ /* - * "$Id: util.h,v 1.33 2006/01/13 16:09:14 rleigh Exp $" + * "$Id: util.h,v 1.33.10.1 2007/03/02 12:01:33 rlk Exp $" * * Gutenprint header. * @@ -58,6 +58,9 @@ extern "C" { extern void stpi_init_paper(void); extern void stpi_init_dither(void); extern void stpi_init_printer(void); +#define BUFFER_FLAG_FLIP_X 0x1 +#define BUFFER_FLAG_FLIP_Y 0x2 +extern stp_image_t* stpi_buffer_image(stp_image_t* image, unsigned int flags); /** @} */ @@ -67,5 +70,5 @@ extern void stpi_init_printer(void); #endif /* GUTENPRINT_INTERNAL_UTIL_H */ /* - * End of "$Id: util.h,v 1.33 2006/01/13 16:09:14 rleigh Exp $". + * End of "$Id: util.h,v 1.33.10.1 2007/03/02 12:01:33 rlk Exp $". */ diff --git a/src/main/xml.c b/src/main/xml.c index ac64537..c43b13b 100644 --- a/src/main/xml.c +++ b/src/main/xml.c @@ -1,5 +1,5 @@ /* - * "$Id: xml.c,v 1.33 2004/09/17 18:38:27 rleigh Exp $" + * "$Id: xml.c,v 1.33.18.1 2007/05/29 01:47:30 rlk Exp $" * * XML parser - process Gutenprint XML data with mxml. * @@ -126,9 +126,7 @@ stp_unregister_xml_preload(const char *name) static void stpi_xml_process_gutenprint(stp_mxml_node_t *gutenprint, const char *file); -static char *saved_lc_collate; /* Saved LC_COLLATE */ -static char *saved_lc_ctype; /* Saved LC_CTYPE */ -static char *saved_lc_numeric; /* Saved LC_NUMERIC */ +static char *saved_locale; /* Saved LC_ALL */ static int xml_is_initialised; /* Flag for init */ void @@ -154,6 +152,8 @@ stp_xml_preinit(void) void stp_xml_init(void) { + stp_deprintf(STP_DBG_XML, "stp_xml_init: entering at level %d\n", + xml_is_initialised); if (xml_is_initialised >= 1) { xml_is_initialised++; @@ -161,9 +161,11 @@ stp_xml_init(void) } /* Set some locale facets to "C" */ - saved_lc_collate = setlocale(LC_COLLATE, "C"); - saved_lc_ctype = setlocale(LC_CTYPE, "C"); - saved_lc_numeric = setlocale(LC_NUMERIC, "C"); +#ifdef HAVE_LOCALE_H + saved_locale = stp_strdup(setlocale(LC_ALL, NULL)); + stp_deprintf(STP_DBG_XML, "stp_xml_init: saving locale %s\n", saved_locale); + setlocale(LC_ALL, "C"); +#endif xml_is_initialised = 1; } @@ -175,6 +177,8 @@ stp_xml_init(void) void stp_xml_exit(void) { + stp_deprintf(STP_DBG_XML, "stp_xml_exit: entering at level %d\n", + xml_is_initialised); if (xml_is_initialised > 1) /* don't restore original state */ { xml_is_initialised--; @@ -184,9 +188,12 @@ stp_xml_exit(void) return; /* Restore locale */ - setlocale(LC_COLLATE, saved_lc_collate); - setlocale(LC_CTYPE, saved_lc_ctype); - setlocale(LC_NUMERIC, saved_lc_numeric); +#ifdef HAVE_LOCALE_H + stp_deprintf(STP_DBG_XML, "stp_xml_init: restoring locale %s\n", saved_locale); + setlocale(LC_ALL, saved_locale); + stp_free(saved_locale); + saved_locale = NULL; +#endif xml_is_initialised = 0; } |