1 /* sane - Scanner Access Now Easy.
2 
3    Copyright (C) 2007-2012 stef.dev@free.fr
4 
5    This file is part of the SANE package.
6 
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2 of the
10    License, or (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 
20    As a special exception, the authors of SANE give permission for
21    additional uses of the libraries contained in this release of SANE.
22 
23    The exception is that, if you link a SANE library with other files
24    to produce an executable, this does not by itself cause the
25    resulting executable to be covered by the GNU General Public
26    License.  Your use of that executable is in no way restricted on
27    account of linking the SANE library code into it.
28 
29    This exception does not, however, invalidate any other reasons why
30    the executable file might be covered by the GNU General Public
31    License.
32 
33    If you submit changes to SANE to the maintainers to be included in
34    a subsequent release, you agree by submitting the changes that
35    those changes may be distributed with this exception intact.
36 
37    If you write modifications of your own for SANE, it is your choice
38    whether to permit this exception to apply to your modifications.
39    If you do not wish that, delete this exception notice.
40 */
41 
42 
43 /* here we have the various device settings...
44  */
45 static Rts8891_Model hp4400c_model = {
46   "HP4400c",			/* Name */
47   "Hewlett-Packard",		/* Device vendor string */
48   "4400c",			/* Device model name */
49   "flatbed scanner",		/* Device  type */
50   {1200, 600, 300, 150, 75, 0},	/* possible x-resolutions */
51   {600, 300, 150, 0},		/* possible y-resolutions */
52   1200,				/* max physical x dpi */
53   600,				/* max physical y dpi */
54   150,				/* min physical y dpi */
55 
56   SANE_FIX (8.3),		/* Start of scan area in mm  (x) */
57   SANE_FIX (3.0),		/* Start of scan area in mm (y) */
58   SANE_FIX (215.9),		/* Size of scan area in mm (x) */
59   SANE_FIX (298.1),		/* Size of scan area in mm (y) */
60 
61   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (x) */
62   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (y) */
63   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (x) */
64   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (y) */
65 
66   24, 12, 0,			/* R, G, and B CCD Line-distance correction in lines at
67 				   max motor resolution */
68   /* default sensor */
69   SENSOR_TYPE_4400,
70 
71   /* default gamma table */
72   {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c, 0x20, 0x24, 0x28, 0x2c,
73    0x30, 0x34, 0x38, 0x3c, 0x40, 0x44, 0x48, 0x4c, 0x50, 0x52, 0x53, 0x55,
74    0x57, 0x58, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x63, 0x64, 0x66, 0x67,
75    0x68, 0x6a, 0x6b, 0x6c, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75, 0x76,
76    0x77, 0x78, 0x79, 0x7a, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
77    0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8d, 0x8e,
78    0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x96, 0x97, 0x98, 0x99,
79    0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3,
80    0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac,
81    0xac, 0xad, 0xae, 0xaf, 0xaf, 0xb0, 0xb1, 0xb1, 0xb2, 0xb3, 0xb4, 0xb4,
82    0xb5, 0xb6, 0xb6, 0xb7, 0xb8, 0xb8, 0xb9, 0xba, 0xba, 0xbb, 0xbc, 0xbc,
83    0xbd, 0xbe, 0xbe, 0xbf, 0xc0, 0xc0, 0xc1, 0xc1, 0xc2, 0xc3, 0xc3, 0xc4,
84    0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc8, 0xc9, 0xc9, 0xca, 0xcb, 0xcb,
85    0xcc, 0xcc, 0xcd, 0xce, 0xce, 0xcf, 0xcf, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2,
86    0xd3, 0xd3, 0xd4, 0xd5, 0xd5, 0xd6, 0xd6, 0xd7, 0xd7, 0xd8, 0xd9, 0xd9,
87    0xda, 0xda, 0xdb, 0xdb, 0xdc, 0xdc, 0xdd, 0xdd, 0xde, 0xdf, 0xdf, 0xe0,
88    0xe0, 0xe1, 0xe1, 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5, 0xe6,
89    0xe6, 0xe7, 0xe7, 0xe8, 0xe8, 0xe9, 0xe9, 0xea, 0xea, 0xeb, 0xeb, 0xec,
90    0xec, 0xed, 0xed, 0xee, 0xee, 0xef, 0xef, 0xf0, 0xf0, 0xf1, 0xf1, 0xf2,
91    0xf2, 0xf3, 0xf3, 0xf4, 0xf4, 0xf5, 0xf5, 0xf6, 0xf6, 0xf7, 0xf7, 0xf8,
92    0xf8, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfc, 0xfc, 0xfd, 0xfd,
93    0xfe, 0xfe, 0xff, 0xff},
94 
95   /* number of buttons */
96   5,
97 
98   /* button names */
99   { "copy", "mail", "image-copy", "scan", "power"},
100 
101   /* button titles */
102   { "copy", "mail", "image copy", "scan", "power"},
103 
104   /* flags */
105   RTS8891_FLAG_EMULATED_GRAY_MODE
106 };
107 
108 
109 static Rts8891_Model hp4470c_model = {
110   "HP4470c",			/* Name */
111   "Hewlett-Packard",		/* Device vendor string */
112   "4470c",			/* Device model name */
113   "flatbed scanner",		/* Device  type */
114   {1200, 600, 300, 150, 75, 0},	/* possible x-resolutions */
115   {600, 300, 150, 0},		/* possible y-resolutions */
116   1200,				/* max physical x dpi */
117   600,				/* max physical y dpi */
118   150,				/* min physical y dpi */
119 
120   SANE_FIX (8.3),		/* Start of scan area in mm  (x) */
121   SANE_FIX (3.0),		/* Start of scan area in mm (y) */
122   SANE_FIX (215.9),		/* Size of scan area in mm (x) */
123   SANE_FIX (298.1),		/* Size of scan area in mm (y) */
124 
125   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (x) */
126   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (y) */
127   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (x) */
128   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (y) */
129 
130   24, 12, 0,			/* R, G, and B CCD Line-distance correction in lines at
131 				   max motor resolution */
132   /* default sensor */
133   SENSOR_TYPE_XPA,
134 
135   /* default gamma table */
136   {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c, 0x20, 0x24, 0x28, 0x2c,
137    0x30, 0x34, 0x38, 0x3c, 0x40, 0x44, 0x48, 0x4c, 0x50, 0x52, 0x53, 0x55,
138    0x57, 0x58, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x63, 0x64, 0x66, 0x67,
139    0x68, 0x6a, 0x6b, 0x6c, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75, 0x76,
140    0x77, 0x78, 0x79, 0x7a, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
141    0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8d, 0x8e,
142    0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x96, 0x97, 0x98, 0x99,
143    0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3,
144    0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac,
145    0xac, 0xad, 0xae, 0xaf, 0xaf, 0xb0, 0xb1, 0xb1, 0xb2, 0xb3, 0xb4, 0xb4,
146    0xb5, 0xb6, 0xb6, 0xb7, 0xb8, 0xb8, 0xb9, 0xba, 0xba, 0xbb, 0xbc, 0xbc,
147    0xbd, 0xbe, 0xbe, 0xbf, 0xc0, 0xc0, 0xc1, 0xc1, 0xc2, 0xc3, 0xc3, 0xc4,
148    0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc8, 0xc9, 0xc9, 0xca, 0xcb, 0xcb,
149    0xcc, 0xcc, 0xcd, 0xce, 0xce, 0xcf, 0xcf, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2,
150    0xd3, 0xd3, 0xd4, 0xd5, 0xd5, 0xd6, 0xd6, 0xd7, 0xd7, 0xd8, 0xd9, 0xd9,
151    0xda, 0xda, 0xdb, 0xdb, 0xdc, 0xdc, 0xdd, 0xdd, 0xde, 0xdf, 0xdf, 0xe0,
152    0xe0, 0xe1, 0xe1, 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5, 0xe6,
153    0xe6, 0xe7, 0xe7, 0xe8, 0xe8, 0xe9, 0xe9, 0xea, 0xea, 0xeb, 0xeb, 0xec,
154    0xec, 0xed, 0xed, 0xee, 0xee, 0xef, 0xef, 0xf0, 0xf0, 0xf1, 0xf1, 0xf2,
155    0xf2, 0xf3, 0xf3, 0xf4, 0xf4, 0xf5, 0xf5, 0xf6, 0xf6, 0xf7, 0xf7, 0xf8,
156    0xf8, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfc, 0xfc, 0xfd, 0xfd,
157    0xfe, 0xfe, 0xff, 0xff},
158 
159   /* number of buttons */
160   11,
161 
162   /* button names */
163   {"plus", "minus", "copy", "mail", "image-copy", "www", "scan", "power",
164    "cancel", "options", "toggle-mode"},
165 
166   /* button titles */
167   {"plus", "minus", "copy", "mail", "image copy", "www", "scan", "power",
168    "cancel", "options", "toggle color/gray mode"},
169 
170   /* flags */
171   RTS8891_FLAG_EMULATED_GRAY_MODE
172 };
173 
174 static Rts8891_Model astra4400_model = {
175   "Astra 4400",			/* Name */
176   "UMAX",			/* Device vendor string */
177   "Astra 4400",			/* Device model name */
178   "flatbed scanner",		/* Device  type */
179 
180   {1200, 600, 300, 150, 75, 0},	/* possible x-resolutions */
181   {600, 300, 150, 0},		/* possible y-resolutions */
182   1200,				/* max physical x dpi */
183   600,				/* max physical y dpi */
184   150,				/* min physical y dpi */
185 
186   SANE_FIX (8.3),		/* Start of scan area in mm  (x) */
187   SANE_FIX (3.0),		/* Start of scan area in mm (y) */
188   SANE_FIX (215.9),		/* Size of scan area in mm (x) */
189   SANE_FIX (298.1),		/* Size of scan area in mm (y) */
190 
191   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (x) */
192   SANE_FIX (0.0),		/* Start of scan area in TA mode in mm (y) */
193   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (x) */
194   SANE_FIX (100.0),		/* Size of scan area in TA mode in mm (y) */
195 
196   24, 12, 0,			/* R, G, and B CCD Line-distance correction in lines at
197 				   max motor resolution */
198   /* default sensor */
199   SENSOR_TYPE_XPA,
200 
201   /* default gamma table */
202   {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c, 0x20, 0x24, 0x28, 0x2c,
203    0x30, 0x34, 0x38, 0x3c, 0x40, 0x44, 0x48, 0x4c, 0x50, 0x52, 0x53, 0x55,
204    0x57, 0x58, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x63, 0x64, 0x66, 0x67,
205    0x68, 0x6a, 0x6b, 0x6c, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75, 0x76,
206    0x77, 0x78, 0x79, 0x7a, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
207    0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8d, 0x8e,
208    0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0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0xfc, 0xfd, 0xfd,
223    0xfe, 0xfe, 0xff, 0xff},
224 
225   /* number of buttons */
226   11,
227 
228   /* button names */
229   {"plus", "minus", "copy", "mail", "image-copy", "www", "scan", "power",
230    "cancel", "options", "toggle-mode"},
231 
232   /* button titles */
233   {"plus", "minus", "copy", "mail", "image copy", "www", "scan", "power",
234    "cancel", "options", "toggle color/gray mode"},
235 
236   /* flags */
237   RTS8891_FLAG_EMULATED_GRAY_MODE
238 };
239 
240 /* full list of supported devices: vendor, product, description structure */
241 static Rts8891_USB_Device_Entry rts8891_usb_device_list[] = {
242   {0x03f0, 0x0705, &hp4400c_model},
243   {0x03f0, 0x0805, &hp4470c_model},
244   {0x1606, 0x0070, &astra4400_model},
245   {0, 0, NULL}
246 };
247