xref: /third_party/backends/doc/teco/teco2.txt (revision 141cc406)
1
2          BACKEND TECO2
3
4INQUIRY
5
6TECO VM3564 (1)
7000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20    ....C...RELISYS
8016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20    AVEC II S3
9032: 31 2e 30 37 31 2e 30 37 00 01 54 45 43 4f 20 56    1.071.07..TECO V
10048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6    M3564 ...,...X..
11064: 0d af 01 2c 00 08 01 00                            ...,....
12
13TECO VM3564 (2)
14000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20    ....C...RELISYS
15016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20    AVEC II S3
16032: 31 2e 30 39 31 2e 30 39 00 01 54 45 43 4f 20 56    1.091.09..TECO V
17048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6    M3564 ...,...X..
18064: 0d af 01 2c 00 08 01 00                            ...,....
19
20TECO VM356A (1)
21000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20    ....C...RELISYS
22016: 41 50 4f 4c 4c 4f 20 45 78 70 72 65 73 73 20 33    APOLLO Express 3
23032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56    1.031.03..TECO V
24048: 4d 33 35 36 41 20 00 01 01 2c 00 01 02 58 09 f6    M356A ...,...X..
25064: 0d af 01 2c 00 08 01 00                            ...,....
26
27TECO VM356A (2)
28000: 06 00 02 02 43 00 00 10 50 72 69 6d 61 78 20 20    ....C...Primax
29016: 4a 65 77 65 6c 20 20 20 20 20 20 20 20 20 20 20    Jewel
30032: 31 2e 30 31 31 2e 30 31 00 01 54 45 43 4f 20 56    1.011.01..TECO V
31048: 4d 33 35 36 41 20 00 01 01 2c 00 01 02 58 09 f6    M356A ...,...X..
32064: 0d af 01 2c 00 08 01 00                            ...,....
33
34TECO VM3575
35000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20    ....C...
36016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20    Flatbed Scanner
37032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56    1.031.03..TECO V
38048: 4d 33 35 37 35 20 00 01 01 2c 00 01 02 58 09 f6    M3575 ...,...X..
39064: 0d af 01 2c 00 08 01 00                            ...,....
40
41TECO VM656A
42000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20    ....C...RELISYS
43016: 41 50 4f 4c 4c 4f 20 45 78 70 72 65 73 73 20 36    APOLLO Express 6
44032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56    1.031.03..TECO V
45048: 4d 36 35 36 41 00 01 01 2c 00 01 02 58 09 f6 0d    M656A...,...X...
46064: af 01 2c 00 08 01 00 00                            ..,.....
47
48TECO VM6575
49000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20    ....C...RELISYS
50016: 53 43 4f 52 50 49 4f 20 50 72 6f 20 20 20 20 20    SCORPIO Pro
51032: 31 2e 30 31 31 2e 30 31 00 01 54 45 43 4f 20 56    1.011.01..TECO V
52048: 4d 36 35 37 35 20 00 01 01 2c 00 01 02 58 09 f6    M6575 ...,...X..
53064: 0d af 01 2c 00 08 01 00                            ...,....
54
55TECO VM6586
56000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20    ....C...
57016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20    Flatbed Scanner
58032: 33 2e 30 31 33 2e 30 31 00 01 54 45 43 4f 20 56    3.013.01..TECO V
59048: 4d 36 35 38 36 20 00 01 01 2c 00 01 02 58 09 f6    M6586 ...,...X..
60064: 0d af 01 2c 00 08 01 00                            ...,....
61
62/*--------------------------------------------------------------------------*/
63
64
65
66SCSI Commands supported by the TECO VM3575:
67
68
69
70REQUEST SENSE
7103 00 00 00 12 00
72
73
74VENDOR-06
75???
76Receives 4 bytes of data
77
78
79VENDOR-9
80Get calibration lines - 12 lines
81  2 = ?
82     0x00 color scan
83     0x01 grayscal scan
84     0x02 b&w scan
85  Returns 6 bytes per pixel, probably 2 bytes per color in little endian order.    (2550 * 6 = 15300)
86
87VENDOR-0C
88??? Unsupported?
89
90
91VENDOR-0E
92Set calibration. Apparently the line is computed from the calibration lines. It is not an average though.
93
94
95INQUIRY
9612 00 00 00 48 00
97  standard inquiry
98    72 bytes
99    32-39: firmware version
100    42-52: real scanner name
101	54-55: min X resolution
102    56-57: max X resolution
103    58-59: min Y resolution
104    60-61: max Y resolution
105    62-63: scan area length
106    64-65: scan area width
107    66-67: unit for scan area (eg 300th of inch)
108
109    eg if 62-63 = 2550 and 66-67 = 300, the length is 2550/300=8.5 inches.
110
111
112SCAN
1131B 00 00 00 00 00
114
115
116VENDOR-1C
1171c 00 00 00 00 00
118(Same opcode as RECEIVE DIAGNOSTIC RESULTS)
119  sends 4 bytes of data.
120
121
122SET WINDOW
12324 00 00 00 00 00 00 00 35 00 (VM3575)
12424 00 00 00 00 00 00 00 38 00 (VM6586)
125
126Total length is
127  07 = length
128       VM3575 53-8 = 45
129	   VM6586 56-8 = 48
130	   VM3552 69-8 = 61
131  10-11 = X Resolution
132  12-13 = Y resolution
133  14-17 = X top left corner
134  18-21 = Y top left corner
135  22-25 = width  (size in inches * 300)
136  26-29 = length (size in inches * 300)
137  31 = 0x80 ?
138  33 = scan mode
139        0x00 = black & white
140        0x02 = grayscale
141		0x05 = color
142  34 = bit depth? - invariant, always 8
143  36 = (vm6586 only ?) halftone pattern ?
144         1 = type 1 dithering
145  37 =
146     0x80 = RIF?
147  48 = color channel to use
148     if scan mode is 0 or 2:
149       0x00 = red
150       0x01 = green
151       0x02 = blue
152     if scan mode is 05 -> ignored
153       TWAIN leaves 0x02
154  50 = ?
155
156  VM6585 only:
157    52-53 = size of a line expected?
158    54-55 = number of lines expected?
159
160
161READ
16228 00 00 00 00 19 00 1f 0e 00
163  5 = number of lines to read
164  7-8 = buffer size.
165       Always number of lines to read * size of a line.
166       0x2000 appears to be the upper limit
167
168
169SEND
1702A 00 03 00 00 04 00 0C 00 00
171  2 = data type code
172       0x03 = gamma
173  4-5 = data type qualifier (?)
174  6-8 = length (0xc00 = 3276 = 3*2^10)
175  or:
176  5-6: length of each gamma
177  7-8: length of all gamma
178
179
180OBJECT POSITION
18131 00 00 00 00 00 00 00 00 00
182Park the CCD.
183
184
185GET DATA BUFFER STATUS
18634 01 00 00 00 00 00 00 12 00
187
188  1   = bit 1 is wait
189  7-8 = allocation length
190
191  returned buffer is 0x12 bytes long.
192  00 00 0f 00 00 00 00 14 00 00 00 80 1b 6c 09 f6 05 05
193    0-2 = additional length (0x12-3 = 0x0F)
194      7 = ? always 0x14
195     11 = bit 7 - (maybe) scanner is ready to send data
196  12-13 = number of lines (constant during a scan)
197  14-15 = bytes per line (constant during a scan)
198  16-17 = garbage (the command only returns 0x10 bytes)
199
200
201/*--------------------------------------------------------------------------*/
202
203Scan sequence
204
205Get some info:
206  INQUIRY
207
208Setup the scan:
209  REQUEST SENSE
210  TUR
211  SET WINDOWS
212  GET BUFFER STATUS
213  VENDOR-0C
214  VENDOR-09 (read calibration)
215  VENDOR-0E (send new calibration)
216  REQUEST SENSE
217  SEND(10)
218  SET WINDOWS (same as the first one)
219  COMMAND 06
220  RECEIVE DIAGNOSTIC RESULTS
221  SCAN
222  GET BUFFER STATUS
223
224loop until all data read:
225  READ(10)
226
227park the CCD:
228  OBJECT POSITION
229
230/*--------------------------------------------------------------------------*/
231
232calibration
233
234TECO VM3575 reads 12 lines of calibration
235TECO VM656A reads 8 lines of calibration
236TECO VM6586 ??
237
238Algorithms used (text from Alex Wulms):
239The old algorithm was based on the assumption that the calibration value needs
240to be an offset, to go from the value obtained during input to the average
241value (0x800).
242
243E.g., if the input value is 0x800, the calibration value must be 0x800 (0x1000
244- 0x800).
245Likewise, if the input value is 0x700, the calibration value must be 0x900
246(0x1000 - 0x700)
247And if the input value is 0x600, the calibration value must be 0xA00
248
249The new algorithm is based on the assumption that the calibration needs to be
250a multiplication factor, to compensate for the too strong or too weak pixel
251in the sensor. Again, we want to obtain the average value (approximately
2520x800) for every pixel read during calibration.
253
254E.g., if the input value is 0x800, the calibration value must be 0x800
255(0x800*0x800 / 0x800).
256Likewise, if the input value is 0x700, the calibration value must be 0x924
257(0x800*0x800 / 0x700).
258And if the input value is 0x600, the calibration value must 0xAAA (0x800*0x800
259/ 0x600)
260
261Though, careful comparison with scans done under windows has shown that the
262factor is slightly different from 0x800*0x800(=0x400000) but in stead it
263seems to be approximately 0x40302f (which would mean that the average value
264is approximately 0x803 in stead of 0x800).
265
266Hope this is clarifies the new algorithm.
267