1141cc406Sopenharmony_ci 2141cc406Sopenharmony_ci BACKEND TECO2 3141cc406Sopenharmony_ci 4141cc406Sopenharmony_ciINQUIRY 5141cc406Sopenharmony_ci 6141cc406Sopenharmony_ciTECO VM3564 (1) 7141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS 8141cc406Sopenharmony_ci016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 9141cc406Sopenharmony_ci032: 31 2e 30 37 31 2e 30 37 00 01 54 45 43 4f 20 56 1.071.07..TECO V 10141cc406Sopenharmony_ci048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6 M3564 ...,...X.. 11141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 12141cc406Sopenharmony_ci 13141cc406Sopenharmony_ciTECO VM3564 (2) 14141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS 15141cc406Sopenharmony_ci016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 16141cc406Sopenharmony_ci032: 31 2e 30 39 31 2e 30 39 00 01 54 45 43 4f 20 56 1.091.09..TECO V 17141cc406Sopenharmony_ci048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6 M3564 ...,...X.. 18141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 19141cc406Sopenharmony_ci 20141cc406Sopenharmony_ciTECO VM356A (1) 21141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20 ....C...RELISYS 22141cc406Sopenharmony_ci016: 41 50 4f 4c 4c 4f 20 45 78 70 72 65 73 73 20 33 APOLLO Express 3 23141cc406Sopenharmony_ci032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56 1.031.03..TECO V 24141cc406Sopenharmony_ci048: 4d 33 35 36 41 20 00 01 01 2c 00 01 02 58 09 f6 M356A ...,...X.. 25141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 26141cc406Sopenharmony_ci 27141cc406Sopenharmony_ciTECO VM356A (2) 28141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 10 50 72 69 6d 61 78 20 20 ....C...Primax 29141cc406Sopenharmony_ci016: 4a 65 77 65 6c 20 20 20 20 20 20 20 20 20 20 20 Jewel 30141cc406Sopenharmony_ci032: 31 2e 30 31 31 2e 30 31 00 01 54 45 43 4f 20 56 1.011.01..TECO V 31141cc406Sopenharmony_ci048: 4d 33 35 36 41 20 00 01 01 2c 00 01 02 58 09 f6 M356A ...,...X.. 32141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 33141cc406Sopenharmony_ci 34141cc406Sopenharmony_ciTECO VM3575 35141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... 36141cc406Sopenharmony_ci016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner 37141cc406Sopenharmony_ci032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56 1.031.03..TECO V 38141cc406Sopenharmony_ci048: 4d 33 35 37 35 20 00 01 01 2c 00 01 02 58 09 f6 M3575 ...,...X.. 39141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 40141cc406Sopenharmony_ci 41141cc406Sopenharmony_ciTECO VM656A 42141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20 ....C...RELISYS 43141cc406Sopenharmony_ci016: 41 50 4f 4c 4c 4f 20 45 78 70 72 65 73 73 20 36 APOLLO Express 6 44141cc406Sopenharmony_ci032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56 1.031.03..TECO V 45141cc406Sopenharmony_ci048: 4d 36 35 36 41 00 01 01 2c 00 01 02 58 09 f6 0d M656A...,...X... 46141cc406Sopenharmony_ci064: af 01 2c 00 08 01 00 00 ..,..... 47141cc406Sopenharmony_ci 48141cc406Sopenharmony_ciTECO VM6575 49141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS 50141cc406Sopenharmony_ci016: 53 43 4f 52 50 49 4f 20 50 72 6f 20 20 20 20 20 SCORPIO Pro 51141cc406Sopenharmony_ci032: 31 2e 30 31 31 2e 30 31 00 01 54 45 43 4f 20 56 1.011.01..TECO V 52141cc406Sopenharmony_ci048: 4d 36 35 37 35 20 00 01 01 2c 00 01 02 58 09 f6 M6575 ...,...X.. 53141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 54141cc406Sopenharmony_ci 55141cc406Sopenharmony_ciTECO VM6586 56141cc406Sopenharmony_ci000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... 57141cc406Sopenharmony_ci016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner 58141cc406Sopenharmony_ci032: 33 2e 30 31 33 2e 30 31 00 01 54 45 43 4f 20 56 3.013.01..TECO V 59141cc406Sopenharmony_ci048: 4d 36 35 38 36 20 00 01 01 2c 00 01 02 58 09 f6 M6586 ...,...X.. 60141cc406Sopenharmony_ci064: 0d af 01 2c 00 08 01 00 ...,.... 61141cc406Sopenharmony_ci 62141cc406Sopenharmony_ci/*--------------------------------------------------------------------------*/ 63141cc406Sopenharmony_ci 64141cc406Sopenharmony_ci 65141cc406Sopenharmony_ci 66141cc406Sopenharmony_ciSCSI Commands supported by the TECO VM3575: 67141cc406Sopenharmony_ci 68141cc406Sopenharmony_ci 69141cc406Sopenharmony_ci 70141cc406Sopenharmony_ciREQUEST SENSE 71141cc406Sopenharmony_ci03 00 00 00 12 00 72141cc406Sopenharmony_ci 73141cc406Sopenharmony_ci 74141cc406Sopenharmony_ciVENDOR-06 75141cc406Sopenharmony_ci??? 76141cc406Sopenharmony_ciReceives 4 bytes of data 77141cc406Sopenharmony_ci 78141cc406Sopenharmony_ci 79141cc406Sopenharmony_ciVENDOR-9 80141cc406Sopenharmony_ciGet calibration lines - 12 lines 81141cc406Sopenharmony_ci 2 = ? 82141cc406Sopenharmony_ci 0x00 color scan 83141cc406Sopenharmony_ci 0x01 grayscal scan 84141cc406Sopenharmony_ci 0x02 b&w scan 85141cc406Sopenharmony_ci Returns 6 bytes per pixel, probably 2 bytes per color in little endian order. (2550 * 6 = 15300) 86141cc406Sopenharmony_ci 87141cc406Sopenharmony_ciVENDOR-0C 88141cc406Sopenharmony_ci??? Unsupported? 89141cc406Sopenharmony_ci 90141cc406Sopenharmony_ci 91141cc406Sopenharmony_ciVENDOR-0E 92141cc406Sopenharmony_ciSet calibration. Apparently the line is computed from the calibration lines. It is not an average though. 93141cc406Sopenharmony_ci 94141cc406Sopenharmony_ci 95141cc406Sopenharmony_ciINQUIRY 96141cc406Sopenharmony_ci12 00 00 00 48 00 97141cc406Sopenharmony_ci standard inquiry 98141cc406Sopenharmony_ci 72 bytes 99141cc406Sopenharmony_ci 32-39: firmware version 100141cc406Sopenharmony_ci 42-52: real scanner name 101141cc406Sopenharmony_ci 54-55: min X resolution 102141cc406Sopenharmony_ci 56-57: max X resolution 103141cc406Sopenharmony_ci 58-59: min Y resolution 104141cc406Sopenharmony_ci 60-61: max Y resolution 105141cc406Sopenharmony_ci 62-63: scan area length 106141cc406Sopenharmony_ci 64-65: scan area width 107141cc406Sopenharmony_ci 66-67: unit for scan area (eg 300th of inch) 108141cc406Sopenharmony_ci 109141cc406Sopenharmony_ci eg if 62-63 = 2550 and 66-67 = 300, the length is 2550/300=8.5 inches. 110141cc406Sopenharmony_ci 111141cc406Sopenharmony_ci 112141cc406Sopenharmony_ciSCAN 113141cc406Sopenharmony_ci1B 00 00 00 00 00 114141cc406Sopenharmony_ci 115141cc406Sopenharmony_ci 116141cc406Sopenharmony_ciVENDOR-1C 117141cc406Sopenharmony_ci1c 00 00 00 00 00 118141cc406Sopenharmony_ci(Same opcode as RECEIVE DIAGNOSTIC RESULTS) 119141cc406Sopenharmony_ci sends 4 bytes of data. 120141cc406Sopenharmony_ci 121141cc406Sopenharmony_ci 122141cc406Sopenharmony_ciSET WINDOW 123141cc406Sopenharmony_ci24 00 00 00 00 00 00 00 35 00 (VM3575) 124141cc406Sopenharmony_ci24 00 00 00 00 00 00 00 38 00 (VM6586) 125141cc406Sopenharmony_ci 126141cc406Sopenharmony_ciTotal length is 127141cc406Sopenharmony_ci 07 = length 128141cc406Sopenharmony_ci VM3575 53-8 = 45 129141cc406Sopenharmony_ci VM6586 56-8 = 48 130141cc406Sopenharmony_ci VM3552 69-8 = 61 131141cc406Sopenharmony_ci 10-11 = X Resolution 132141cc406Sopenharmony_ci 12-13 = Y resolution 133141cc406Sopenharmony_ci 14-17 = X top left corner 134141cc406Sopenharmony_ci 18-21 = Y top left corner 135141cc406Sopenharmony_ci 22-25 = width (size in inches * 300) 136141cc406Sopenharmony_ci 26-29 = length (size in inches * 300) 137141cc406Sopenharmony_ci 31 = 0x80 ? 138141cc406Sopenharmony_ci 33 = scan mode 139141cc406Sopenharmony_ci 0x00 = black & white 140141cc406Sopenharmony_ci 0x02 = grayscale 141141cc406Sopenharmony_ci 0x05 = color 142141cc406Sopenharmony_ci 34 = bit depth? - invariant, always 8 143141cc406Sopenharmony_ci 36 = (vm6586 only ?) halftone pattern ? 144141cc406Sopenharmony_ci 1 = type 1 dithering 145141cc406Sopenharmony_ci 37 = 146141cc406Sopenharmony_ci 0x80 = RIF? 147141cc406Sopenharmony_ci 48 = color channel to use 148141cc406Sopenharmony_ci if scan mode is 0 or 2: 149141cc406Sopenharmony_ci 0x00 = red 150141cc406Sopenharmony_ci 0x01 = green 151141cc406Sopenharmony_ci 0x02 = blue 152141cc406Sopenharmony_ci if scan mode is 05 -> ignored 153141cc406Sopenharmony_ci TWAIN leaves 0x02 154141cc406Sopenharmony_ci 50 = ? 155141cc406Sopenharmony_ci 156141cc406Sopenharmony_ci VM6585 only: 157141cc406Sopenharmony_ci 52-53 = size of a line expected? 158141cc406Sopenharmony_ci 54-55 = number of lines expected? 159141cc406Sopenharmony_ci 160141cc406Sopenharmony_ci 161141cc406Sopenharmony_ciREAD 162141cc406Sopenharmony_ci28 00 00 00 00 19 00 1f 0e 00 163141cc406Sopenharmony_ci 5 = number of lines to read 164141cc406Sopenharmony_ci 7-8 = buffer size. 165141cc406Sopenharmony_ci Always number of lines to read * size of a line. 166141cc406Sopenharmony_ci 0x2000 appears to be the upper limit 167141cc406Sopenharmony_ci 168141cc406Sopenharmony_ci 169141cc406Sopenharmony_ciSEND 170141cc406Sopenharmony_ci2A 00 03 00 00 04 00 0C 00 00 171141cc406Sopenharmony_ci 2 = data type code 172141cc406Sopenharmony_ci 0x03 = gamma 173141cc406Sopenharmony_ci 4-5 = data type qualifier (?) 174141cc406Sopenharmony_ci 6-8 = length (0xc00 = 3276 = 3*2^10) 175141cc406Sopenharmony_ci or: 176141cc406Sopenharmony_ci 5-6: length of each gamma 177141cc406Sopenharmony_ci 7-8: length of all gamma 178141cc406Sopenharmony_ci 179141cc406Sopenharmony_ci 180141cc406Sopenharmony_ciOBJECT POSITION 181141cc406Sopenharmony_ci31 00 00 00 00 00 00 00 00 00 182141cc406Sopenharmony_ciPark the CCD. 183141cc406Sopenharmony_ci 184141cc406Sopenharmony_ci 185141cc406Sopenharmony_ciGET DATA BUFFER STATUS 186141cc406Sopenharmony_ci34 01 00 00 00 00 00 00 12 00 187141cc406Sopenharmony_ci 188141cc406Sopenharmony_ci 1 = bit 1 is wait 189141cc406Sopenharmony_ci 7-8 = allocation length 190141cc406Sopenharmony_ci 191141cc406Sopenharmony_ci returned buffer is 0x12 bytes long. 192141cc406Sopenharmony_ci 00 00 0f 00 00 00 00 14 00 00 00 80 1b 6c 09 f6 05 05 193141cc406Sopenharmony_ci 0-2 = additional length (0x12-3 = 0x0F) 194141cc406Sopenharmony_ci 7 = ? always 0x14 195141cc406Sopenharmony_ci 11 = bit 7 - (maybe) scanner is ready to send data 196141cc406Sopenharmony_ci 12-13 = number of lines (constant during a scan) 197141cc406Sopenharmony_ci 14-15 = bytes per line (constant during a scan) 198141cc406Sopenharmony_ci 16-17 = garbage (the command only returns 0x10 bytes) 199141cc406Sopenharmony_ci 200141cc406Sopenharmony_ci 201141cc406Sopenharmony_ci/*--------------------------------------------------------------------------*/ 202141cc406Sopenharmony_ci 203141cc406Sopenharmony_ciScan sequence 204141cc406Sopenharmony_ci 205141cc406Sopenharmony_ciGet some info: 206141cc406Sopenharmony_ci INQUIRY 207141cc406Sopenharmony_ci 208141cc406Sopenharmony_ciSetup the scan: 209141cc406Sopenharmony_ci REQUEST SENSE 210141cc406Sopenharmony_ci TUR 211141cc406Sopenharmony_ci SET WINDOWS 212141cc406Sopenharmony_ci GET BUFFER STATUS 213141cc406Sopenharmony_ci VENDOR-0C 214141cc406Sopenharmony_ci VENDOR-09 (read calibration) 215141cc406Sopenharmony_ci VENDOR-0E (send new calibration) 216141cc406Sopenharmony_ci REQUEST SENSE 217141cc406Sopenharmony_ci SEND(10) 218141cc406Sopenharmony_ci SET WINDOWS (same as the first one) 219141cc406Sopenharmony_ci COMMAND 06 220141cc406Sopenharmony_ci RECEIVE DIAGNOSTIC RESULTS 221141cc406Sopenharmony_ci SCAN 222141cc406Sopenharmony_ci GET BUFFER STATUS 223141cc406Sopenharmony_ci 224141cc406Sopenharmony_ciloop until all data read: 225141cc406Sopenharmony_ci READ(10) 226141cc406Sopenharmony_ci 227141cc406Sopenharmony_cipark the CCD: 228141cc406Sopenharmony_ci OBJECT POSITION 229141cc406Sopenharmony_ci 230141cc406Sopenharmony_ci/*--------------------------------------------------------------------------*/ 231141cc406Sopenharmony_ci 232141cc406Sopenharmony_cicalibration 233141cc406Sopenharmony_ci 234141cc406Sopenharmony_ciTECO VM3575 reads 12 lines of calibration 235141cc406Sopenharmony_ciTECO VM656A reads 8 lines of calibration 236141cc406Sopenharmony_ciTECO VM6586 ?? 237141cc406Sopenharmony_ci 238141cc406Sopenharmony_ciAlgorithms used (text from Alex Wulms): 239141cc406Sopenharmony_ciThe old algorithm was based on the assumption that the calibration value needs 240141cc406Sopenharmony_cito be an offset, to go from the value obtained during input to the average 241141cc406Sopenharmony_civalue (0x800). 242141cc406Sopenharmony_ci 243141cc406Sopenharmony_ciE.g., if the input value is 0x800, the calibration value must be 0x800 (0x1000 244141cc406Sopenharmony_ci- 0x800). 245141cc406Sopenharmony_ciLikewise, if the input value is 0x700, the calibration value must be 0x900 246141cc406Sopenharmony_ci(0x1000 - 0x700) 247141cc406Sopenharmony_ciAnd if the input value is 0x600, the calibration value must be 0xA00 248141cc406Sopenharmony_ci 249141cc406Sopenharmony_ciThe new algorithm is based on the assumption that the calibration needs to be 250141cc406Sopenharmony_cia multiplication factor, to compensate for the too strong or too weak pixel 251141cc406Sopenharmony_ciin the sensor. Again, we want to obtain the average value (approximately 252141cc406Sopenharmony_ci0x800) for every pixel read during calibration. 253141cc406Sopenharmony_ci 254141cc406Sopenharmony_ciE.g., if the input value is 0x800, the calibration value must be 0x800 255141cc406Sopenharmony_ci(0x800*0x800 / 0x800). 256141cc406Sopenharmony_ciLikewise, if the input value is 0x700, the calibration value must be 0x924 257141cc406Sopenharmony_ci(0x800*0x800 / 0x700). 258141cc406Sopenharmony_ciAnd if the input value is 0x600, the calibration value must 0xAAA (0x800*0x800 259141cc406Sopenharmony_ci/ 0x600) 260141cc406Sopenharmony_ci 261141cc406Sopenharmony_ciThough, careful comparison with scans done under windows has shown that the 262141cc406Sopenharmony_cifactor is slightly different from 0x800*0x800(=0x400000) but in stead it 263141cc406Sopenharmony_ciseems to be approximately 0x40302f (which would mean that the average value 264141cc406Sopenharmony_ciis approximately 0x803 in stead of 0x800). 265141cc406Sopenharmony_ci 266141cc406Sopenharmony_ciHope this is clarifies the new algorithm. 267