Lines Matching refs:SANE_Int

80 static SANE_Int hp4370_prueba (struct st_device *dev);
84 static SANE_Int Calib_test (struct st_device *dev, SANE_Byte * Regs,
87 static SANE_Int Calib_BlackShading_jkd (struct st_device *dev,
100 static SANE_Int RTS_Scanner_Init (struct st_device *dev);
101 static SANE_Int RTS_Scanner_SetParams (struct st_device *dev,
103 static SANE_Int RTS_Scanner_StartScan (struct st_device *dev);
104 static void RTS_Scanner_StopScan (struct st_device *dev, SANE_Int wait);
108 static SANE_Int Load_Buttons (struct st_device *dev);
109 static SANE_Int Load_Chipset (struct st_device *dev);
110 static SANE_Int Load_Config (struct st_device *dev);
111 static SANE_Int Load_Constrains (struct st_device *dev);
112 static SANE_Int Load_Motor (struct st_device *dev);
113 static SANE_Int Load_MotorCurves (struct st_device *dev);
114 static SANE_Int Load_Motormoves (struct st_device *dev);
115 static SANE_Int Load_Scanmodes (struct st_device *dev);
116 static SANE_Int Load_Sensor (struct st_device *dev);
117 static SANE_Int Load_Timings (struct st_device *dev);
133 static SANE_Byte data_bitget (SANE_Byte * address, SANE_Int mask);
134 static void data_bitset (SANE_Byte * address, SANE_Int mask, SANE_Byte data);
135 static SANE_Int data_lsb_get (SANE_Byte * address, SANE_Int size);
136 static void data_lsb_set (SANE_Byte * address, SANE_Int data, SANE_Int size);
137 static void data_msb_set (SANE_Byte * address, SANE_Int data, SANE_Int size);
138 static void data_wide_bitset (SANE_Byte * address, SANE_Int mask,
139 SANE_Int data);
140 static SANE_Int data_swap_endianess (SANE_Int address, SANE_Int size);
142 static SANE_Int Device_get (SANE_Int product, SANE_Int vendor);
145 static SANE_Int Chipset_ID (struct st_device *dev);
146 static SANE_Int Chipset_Name (struct st_device *dev, char *name,
147 SANE_Int size);
148 static SANE_Int Chipset_Reset (struct st_device *dev);
151 static SANE_Int Init_Registers (struct st_device *dev);
152 static SANE_Int Init_USBData (struct st_device *dev);
153 static SANE_Int Init_Vars (void);
156 static SANE_Int Scanmode_fitres (struct st_device *dev, SANE_Int scantype,
157 SANE_Int colormode, SANE_Int resolution);
158 static SANE_Int Scanmode_maxres (struct st_device *dev, SANE_Int scantype,
159 SANE_Int colormode);
160 static SANE_Int Scanmode_minres (struct st_device *dev, SANE_Int scantype,
161 SANE_Int colormode);
164 static SANE_Int RTS_USBType (struct st_device *dev);
167 static SANE_Int RTS_Enable_CCD (struct st_device *dev, SANE_Byte * Regs,
168 SANE_Int channels);
171 static SANE_Int RTS_DMA_Cancel (struct st_device *dev);
172 static SANE_Int RTS_DMA_CheckType (struct st_device *dev, SANE_Byte * Regs);
173 static SANE_Int RTS_DMA_Enable_Read (struct st_device *dev, SANE_Int dmacs,
174 SANE_Int size, SANE_Int options);
175 static SANE_Int RTS_DMA_Enable_Write (struct st_device *dev, SANE_Int dmacs,
176 SANE_Int size, SANE_Int options);
177 static SANE_Int RTS_DMA_Read (struct st_device *dev, SANE_Int dmacs,
178 SANE_Int options, SANE_Int size,
180 static SANE_Int RTS_DMA_Reset (struct st_device *dev);
181 static SANE_Int RTS_DMA_SetType (struct st_device *dev, SANE_Byte * Regs,
183 static SANE_Int RTS_DMA_WaitReady (struct st_device *dev, SANE_Int msecs);
184 static SANE_Int RTS_DMA_Write (struct st_device *dev, SANE_Int dmacs,
185 SANE_Int options, SANE_Int size,
189 static SANE_Int RTS_EEPROM_ReadByte (USB_Handle usb_handle, SANE_Int address,
191 static SANE_Int RTS_EEPROM_ReadInteger (USB_Handle usb_handle,
192 SANE_Int address, SANE_Int * data);
193 static SANE_Int RTS_EEPROM_ReadWord (USB_Handle usb_handle, SANE_Int address,
194 SANE_Int * data);
195 static SANE_Int RTS_EEPROM_WriteBuffer (USB_Handle usb_handle,
196 SANE_Int address, SANE_Byte * data,
197 SANE_Int size);
198 static SANE_Int RTS_EEPROM_WriteByte (USB_Handle usb_handle, SANE_Int address,
200 static SANE_Int RTS_EEPROM_WriteInteger (USB_Handle usb_handle,
201 SANE_Int address, SANE_Int data);
202 static SANE_Int RTS_EEPROM_WriteWord (USB_Handle usb_handle, SANE_Int address,
203 SANE_Int data);
205 static SANE_Int RTS_Execute (struct st_device *dev);
206 static SANE_Int RTS_Warm_Reset (struct st_device *dev);
209 static SANE_Int RTS_GetScanmode (struct st_device *dev, SANE_Int scantype,
210 SANE_Int colormode, SANE_Int resolution);
211 static SANE_Int RTS_GetImage (struct st_device *dev, SANE_Byte * Regs,
216 SANE_Int options, SANE_Int gainmode);
217 static SANE_Int RTS_GetImage_GetBuffer (struct st_device *dev, double dSize,
220 static SANE_Int RTS_GetImage_Read (struct st_device *dev, SANE_Byte * buffer,
224 static SANE_Int RTS_isTmaAttached (struct st_device *dev);
227 static SANE_Int RTS_WaitInitEnd (struct st_device *dev, SANE_Int msecs);
228 static SANE_Int RTS_WaitScanEnd (struct st_device *dev, SANE_Int msecs);
231 static SANE_Int RTS_ReadRegs (USB_Handle usb_handle, SANE_Byte * buffer);
232 static SANE_Int RTS_WriteRegs (USB_Handle usb_handle, SANE_Byte * buffer);
235 static SANE_Int RTS_ScanCounter_Inc (struct st_device *dev);
236 static SANE_Int RTS_ScanCounter_Get (struct st_device *dev);
239 static SANE_Int RTS_Setup (struct st_device *dev, SANE_Byte * Regs,
245 SANE_Int colormode);
248 SANE_Int mycolormode);
249 static void RTS_Setup_Coords (SANE_Byte * Regs, SANE_Int iLeft, SANE_Int iTop,
250 SANE_Int width, SANE_Int height);
251 static SANE_Int RTS_Setup_Depth (SANE_Byte * Regs,
253 SANE_Int mycolormode);
260 static SANE_Int RTS_Setup_Line_Distances (struct st_device *dev,
264 SANE_Int mycolormode,
265 SANE_Int arrangeline);
266 static SANE_Int RTS_Setup_Motor (struct st_device *dev, SANE_Byte * Regs,
268 SANE_Int somevalue);
270 static void RTS_Setup_SensorTiming (struct st_device *dev, SANE_Int mytiming,
275 SANE_Int bytes_per_line);
277 static SANE_Int Scan_Start (struct st_device *dev);
281 static SANE_Int fn3330 (struct st_device *dev, SANE_Byte * Regs,
283 SANE_Int sensorchannelcolor, SANE_Int * tablepos,
284 SANE_Int data);
285 static SANE_Int fn3560 (USHORT * table, struct st_cal2 *calbuffers,
286 SANE_Int * tablepos);
287 static SANE_Int fn3730 (struct st_device *dev, struct st_cal2 *calbuffers,
289 SANE_Int sensorchannelcolor, SANE_Int data);
291 static SANE_Int Reading_CreateBuffers (struct st_device *dev);
292 static SANE_Int Reading_DestroyBuffers (struct st_device *dev);
293 static SANE_Int Reading_BufferSize_Get (struct st_device *dev,
295 SANE_Int channel_size);
296 static SANE_Int Reading_BufferSize_Notify (struct st_device *dev,
297 SANE_Int data, SANE_Int size);
298 static SANE_Int Reading_Wait (struct st_device *dev,
300 SANE_Byte Channel_size, SANE_Int size,
301 SANE_Int * last_amount, SANE_Int seconds,
304 static SANE_Int Read_Image (struct st_device *dev, SANE_Int buffer_size,
305 SANE_Byte * buffer, SANE_Int * transferred);
306 static SANE_Int Read_ResizeBlock (struct st_device *dev, SANE_Byte * buffer,
307 SANE_Int buffer_size,
308 SANE_Int * transferred);
309 static SANE_Int Read_Block (struct st_device *dev, SANE_Int buffer_size,
310 SANE_Byte * buffer, SANE_Int * transferred);
311 static SANE_Int Read_NonColor_Block (struct st_device *dev,
312 SANE_Byte * buffer, SANE_Int buffer_size,
314 SANE_Int * transferred);
317 static SANE_Int Refs_Analyze_Pattern (struct st_scanparams *scancfg,
319 SANE_Int * ler1, SANE_Int ler1order,
320 SANE_Int * ser1, SANE_Int ser1order);
321 static SANE_Int Refs_Counter_Inc (struct st_device *dev);
323 static SANE_Int Refs_Counter_Save (struct st_device *dev, SANE_Byte data);
324 static SANE_Int Refs_Detect (struct st_device *dev, SANE_Byte * Regs,
325 SANE_Int resolution_x, SANE_Int resolution_y,
326 SANE_Int * x, SANE_Int * y);
327 static SANE_Int Refs_Load (struct st_device *dev, SANE_Int * x, SANE_Int * y);
328 static SANE_Int Refs_Save (struct st_device *dev, SANE_Int left_leading,
329 SANE_Int start_pos);
330 static SANE_Int Refs_Set (struct st_device *dev, SANE_Byte * Regs,
334 static SANE_Int Constrains_Check (struct st_device *dev, SANE_Int Resolution,
335 SANE_Int scantype,
341 static SANE_Int GainOffset_Clear (struct st_device *dev);
342 static SANE_Int GainOffset_Get (struct st_device *dev);
343 static SANE_Int GainOffset_Save (struct st_device *dev, SANE_Int * offset,
345 static SANE_Int GainOffset_Counter_Inc (struct st_device *dev,
346 SANE_Int * arg1);
348 static SANE_Int GainOffset_Counter_Save (struct st_device *dev,
352 static SANE_Int Gamma_AllocTable (SANE_Byte * table);
353 static SANE_Int Gamma_Apply (struct st_device *dev, SANE_Byte * Regs,
358 static SANE_Int Gamma_SendTables (struct st_device *dev, SANE_Byte * Regs,
359 SANE_Byte * gammatable, SANE_Int size);
360 static SANE_Int Gamma_GetTables (struct st_device *dev,
364 static SANE_Byte Lamp_GetGainMode (struct st_device *dev, SANE_Int resolution,
367 SANE_Int resolution, SANE_Byte gainmode);
368 static SANE_Int Lamp_PWM_DutyCycle_Get (struct st_device *dev,
369 SANE_Int * data);
370 static SANE_Int Lamp_PWM_DutyCycle_Set (struct st_device *dev,
371 SANE_Int duty_cycle);
372 static SANE_Int Lamp_PWM_Setup (struct st_device *dev, SANE_Int lamp);
373 static SANE_Int Lamp_PWM_use (struct st_device *dev, SANE_Int enable);
374 static SANE_Int Lamp_PWM_CheckStable (struct st_device *dev,
375 SANE_Int resolution, SANE_Int lamp);
376 static SANE_Int Lamp_PWM_Save (struct st_device *dev, SANE_Int fixedpwm);
377 static SANE_Int Lamp_PWM_SaveStatus (struct st_device *dev, SANE_Byte status);
378 static SANE_Int Lamp_Status_Get (struct st_device *dev, SANE_Byte * flb_lamp,
380 static SANE_Int Lamp_Status_Set (struct st_device *dev, SANE_Byte * Regs,
381 SANE_Int turn_on, SANE_Int lamp);
382 static SANE_Int Lamp_Status_Timer_Set (struct st_device *dev,
383 SANE_Int minutes);
384 static SANE_Int Lamp_Warmup (struct st_device *dev, SANE_Byte * Regs,
385 SANE_Int lamp, SANE_Int resolution);
388 static SANE_Int Head_IsAtHome (struct st_device *dev, SANE_Byte * Regs);
389 static SANE_Int Head_ParkHome (struct st_device *dev, SANE_Int bWait,
390 SANE_Int movement);
391 static SANE_Int Head_Relocate (struct st_device *dev, SANE_Int speed,
392 SANE_Int direction, SANE_Int ypos);
395 static SANE_Byte *Motor_AddStep (SANE_Byte * steps, SANE_Int * bwriten,
396 SANE_Int step);
397 static SANE_Int Motor_Change (struct st_device *dev, SANE_Byte * buffer,
399 static SANE_Int Motor_GetFromResolution (SANE_Int resolution);
400 static SANE_Int Motor_Move (struct st_device *dev, SANE_Byte * Regs,
404 static SANE_Int Motor_Setup_Steps (struct st_device *dev, SANE_Byte * Regs,
405 SANE_Int mysetting);
406 static SANE_Int Motor_Curve_Equal (struct st_device *dev,
407 SANE_Int motorsetting, SANE_Int direction,
408 SANE_Int curve1, SANE_Int curve2);
410 SANE_Int * mtc_count);
412 SANE_Int motorcurve,
413 SANE_Int direction, SANE_Int itype);
414 static struct st_motorcurve **Motor_Curve_Parse (SANE_Int * mtc_count,
415 SANE_Int * buffer);
418 static SANE_Int Arrange_Colour (struct st_device *dev, SANE_Byte * buffer,
419 SANE_Int buffer_size, SANE_Int * transferred);
420 static SANE_Int Arrange_Compose (struct st_device *dev, SANE_Byte * buffer,
421 SANE_Int buffer_size,
422 SANE_Int * transferred);
423 static SANE_Int Arrange_NonColour (struct st_device *dev, SANE_Byte * buffer,
424 SANE_Int buffer_size,
425 SANE_Int * transferred);
429 SANE_Byte * buffer, SANE_Int channels_count);
431 SANE_Byte * buffer, SANE_Int channels_count);
434 SANE_Byte * buffer, SANE_Int dots);
441 SANE_Int Width);
444 SANE_Int dots);
447 SANE_Byte * buffer, SANE_Int Width);
451 SANE_Byte * buffer, SANE_Int Width);
452 static void Triplet_Colour_LRes (SANE_Int Width, SANE_Byte * Buffer,
457 static SANE_Int Timing_SetLinearImageSensorClock (SANE_Byte * Regs,
461 static SANE_Int Resize_Start (struct st_device *dev, SANE_Int * transferred);
462 static SANE_Int Resize_CreateBuffers (struct st_device *dev, SANE_Int size1,
463 SANE_Int size2, SANE_Int size3);
464 static SANE_Int Resize_DestroyBuffers (struct st_device *dev);
465 static SANE_Int Resize_Increase (SANE_Byte * to_buffer,
466 SANE_Int to_resolution, SANE_Int to_width,
468 SANE_Int from_resolution,
469 SANE_Int from_width, SANE_Int myresize_mode);
470 static SANE_Int Resize_Decrease (SANE_Byte * to_buffer,
471 SANE_Int to_resolution, SANE_Int to_width,
473 SANE_Int from_resolution,
474 SANE_Int from_width, SANE_Int myresize_mode);
477 static SANE_Int Buttons_Count (struct st_device *dev);
478 static SANE_Int Buttons_Enable (struct st_device *dev);
479 static SANE_Int Buttons_Order (struct st_device *dev, SANE_Int mask);
480 static SANE_Int Buttons_Status (struct st_device *dev);
481 static SANE_Int Buttons_Released (struct st_device *dev);
484 static SANE_Int Calib_CreateBuffers (struct st_device *dev,
486 SANE_Int my14b4);
487 static SANE_Int Calib_CreateFixedBuffers (void);
490 struct st_scanparams *scancfg, SANE_Int scantype,
492 static SANE_Int Calib_AdcGain (struct st_device *dev,
494 SANE_Int arg2, SANE_Int gainmode);
495 static SANE_Int Calib_AdcOffsetRT (struct st_device *dev,
497 SANE_Int value);
498 static SANE_Int Calib_BlackShading (struct st_device *dev,
501 SANE_Int gainmode);
502 static SANE_Int Calib_BWShading (struct st_calibration_config *calibcfg,
504 SANE_Int gainmode);
505 static SANE_Int Calib_WhiteShading_3 (struct st_device *dev,
508 SANE_Int gainmode);
510 static SANE_Int Calibrate_Malloc (struct st_cal2 *calbuffers,
513 SANE_Int somelength);
514 static SANE_Int Calib_ReadTable (struct st_device *dev, SANE_Byte * table,
515 SANE_Int size, SANE_Int data);
516 static SANE_Int Calib_WriteTable (struct st_device *dev, SANE_Byte * table,
517 SANE_Int size, SANE_Int data);
518 static SANE_Int Calib_LoadConfig (struct st_device *dev,
520 SANE_Int scantype, SANE_Int resolution,
521 SANE_Int bitmode);
522 static SANE_Int Calib_PAGain (struct st_device *dev,
524 SANE_Int gainmode);
525 static SANE_Int Calibration (struct st_device *dev, SANE_Byte * Regs,
527 struct st_calibration *myCalib, SANE_Int value);
530 static SANE_Int WShading_Calibrate (struct st_device *dev, SANE_Byte * Regs,
533 static void WShading_Emulate (SANE_Byte * buffer, SANE_Int * chnptr,
534 SANE_Int size, SANE_Int depth);
537 static SANE_Int Shading_apply (struct st_device *dev, SANE_Byte * Regs,
540 static SANE_Int Shading_black_apply (struct st_device *dev, SANE_Byte * Regs,
541 SANE_Int channels,
544 static SANE_Int Shading_white_apply (struct st_device *dev, SANE_Byte * Regs,
545 SANE_Int channels,
550 static SANE_Int SSCG_Enable (struct st_device *dev);
553 SANE_Byte * fuente, SANE_Int size);
554 static SANE_Int Scan_Read_BufferA (struct st_device *dev,
555 SANE_Int buffer_size, SANE_Int arg2,
557 SANE_Int * bytes_transferred);
559 static SANE_Int Bulk_Operation (struct st_device *dev, SANE_Byte op,
560 SANE_Int buffer_size, SANE_Byte * buffer,
561 SANE_Int * transferred);
562 static SANE_Int Get_PAG_Value (SANE_Byte scantype, SANE_Byte color);
563 static SANE_Int GetOneLineInfo (struct st_device *dev, SANE_Int resolution,
564 SANE_Int * maximus, SANE_Int * minimus,
567 static SANE_Int Load_StripCoords (SANE_Int scantype, SANE_Int * ypos,
568 SANE_Int * xpos);
570 /*static SANE_Int Free_Fixed_CalBuffer(void);*/
571 static SANE_Int SetMultiExposure (struct st_device *dev, SANE_Byte * Regs);
575 static SANE_Int LoadImagingParams (struct st_device *dev, SANE_Int inifile);
577 static SANE_Int SetScanParams (struct st_device *dev, SANE_Byte * Regs,
580 static SANE_Int IsScannerLinked (struct st_device *dev);
582 static SANE_Int Read_FE3E (struct st_device *dev, SANE_Byte * destino);
584 static double get_shrd (double value, SANE_Int desp);
586 /*static SANE_Int RTS8822_GetRegisters(SANE_Byte *buffer);*/
630 SANE_Int rst = OK;
696 static SANE_Int
697 Device_get (SANE_Int product, SANE_Int vendor)
702 static SANE_Int
705 SANE_Int rst;
738 static SANE_Int
741 SANE_Int rst = ERROR;
751 static SANE_Int
754 SANE_Int rst = ERROR;
795 SANE_Int data;
809 Motor_Curve_Get (struct st_device *dev, SANE_Int motorcurve,
810 SANE_Int direction, SANE_Int itype)
825 SANE_Int a = 0;
852 static SANE_Int
853 Motor_Curve_Equal (struct st_device *dev, SANE_Int motorsetting,
854 SANE_Int direction, SANE_Int curve1, SANE_Int curve2)
859 SANE_Int rst = FALSE;
873 SANE_Int a = 0;
888 Motor_Curve_Parse (SANE_Int * mtc_count, SANE_Int * buffer)
903 SANE_Int phase;
999 (SANE_Int *) malloc (sizeof (SANE_Int) *
1004 sizeof (SANE_Int) *
1033 Motor_Curve_Free (struct st_motorcurve **motorcurves, SANE_Int * mtc_count)
1078 SANE_Int a, b, c;
1118 SANE_Int a;
1131 static SANE_Int
1134 SANE_Int rst = OK;
1135 SANE_Int a, b;
1242 static SANE_Int
1245 SANE_Int rst = ERROR;
1255 SANE_Int model;
1271 static SANE_Int
1332 static SANE_Int
1333 LoadImagingParams (struct st_device *dev, SANE_Int inifile)
1355 static SANE_Int
1357 SANE_Int buffer_size, SANE_Int * transferred)
1364 SANE_Int mydistance;
1365 SANE_Int Lines_Count;
1366 SANE_Int space;
1367 SANE_Int rst = OK;
1368 SANE_Int c;
1535 static SANE_Int
1538 SANE_Int rst = ERROR;
1635 static SANE_Int
1640 SANE_Int mycolormode;
1641 SANE_Int myvalue;
1642 SANE_Int mymode;
1643 SANE_Int channel_size;
1644 SANE_Int channel_count;
1645 SANE_Int dots_per_block;
1646 SANE_Int aditional_dots;
1681 SANE_Int fitres;
1899 static SANE_Int
1902 SANE_Int rst = OK;
1916 static SANE_Int
1917 GainOffset_Counter_Inc (struct st_device *dev, SANE_Int * arg1)
1920 SANE_Int rst;
1951 static SANE_Int
1954 SANE_Int a, data, rst;
2024 static SANE_Int
2025 Scanmode_maxres (struct st_device *dev, SANE_Int scantype, SANE_Int colormode)
2028 SANE_Int rst = 0;
2029 SANE_Int a;
2057 static SANE_Int
2058 Scanmode_minres (struct st_device *dev, SANE_Int scantype, SANE_Int colormode)
2061 SANE_Int rst, a;
2091 static SANE_Int
2092 Scanmode_fitres (struct st_device *dev, SANE_Int scantype, SANE_Int colormode,
2093 SANE_Int resolution)
2096 SANE_Int rst;
2097 SANE_Int a, nullres;
2137 static SANE_Int
2138 RTS_GetScanmode (struct st_device *dev, SANE_Int scantype, SANE_Int colormode,
2139 SANE_Int resolution)
2142 SANE_Int rst = -1;
2143 SANE_Int a;
2192 static SANE_Int
2197 SANE_Int rst = ERROR;
2242 static SANE_Int
2247 SANE_Int rst = ERROR;
2264 static SANE_Int
2269 SANE_Int rst = ERROR;
2296 SANE_Int a;
2309 static SANE_Int
2312 SANE_Int rst = OK;
2313 SANE_Int a;
2358 static SANE_Int
2361 SANE_Int var2;
2377 SANE_Int firstconnection;
2433 static SANE_Int
2437 SANE_Int rst = OK;
2460 static SANE_Int
2461 Lamp_PWM_Save (struct st_device *dev, SANE_Int fixedpwm)
2463 SANE_Int rst;
2479 static SANE_Int
2480 Lamp_PWM_Setup (struct st_device *dev, SANE_Int lamp)
2482 SANE_Int rst = OK;
2489 SANE_Int fixedpwm, currentpwd;
2511 static SANE_Int
2512 Lamp_PWM_DutyCycle_Get (struct st_device *dev, SANE_Int * data)
2515 SANE_Int rst = ERROR;
2530 static SANE_Int
2531 Lamp_PWM_DutyCycle_Set (struct st_device *dev, SANE_Int duty_cycle)
2534 SANE_Int rst;
2569 static SANE_Int
2570 Head_ParkHome (struct st_device *dev, SANE_Int bWait, SANE_Int movement)
2572 SANE_Int rst = ERROR;
2653 static SANE_Int
2658 SANE_Int rst;
2667 SANE_Int data, v12dcf8, coord_y, step_type;
2797 SANE_Int some_step;
2887 SANE_Int a;
2915 static SANE_Int
2918 SANE_Int rst = ERROR;
2919 SANE_Int *mtc = NULL;
2947 static SANE_Int
2950 SANE_Int rst = OK;
2951 SANE_Int a;
2996 Motor_AddStep (SANE_Byte * steps, SANE_Int * bwriten, SANE_Int step)
3010 static SANE_Int
3012 SANE_Int mysetting)
3014 SANE_Int varx10, cont, last_acc_step, varx20, stepbuffer_size,
3016 SANE_Int myvar, var1, myvalor, mybwriten;
3110 SANE_Int step_size = _B0 (Regs[0xe0]) + 1;
3444 static SANE_Int
3445 Lamp_PWM_use (struct st_device *dev, SANE_Int enable)
3448 SANE_Int rst = ERROR;
3488 static SANE_Int
3491 SANE_Int rst;
3492 SANE_Int sscg;
3494 SANE_Int enable, mode, clock;
3551 static SANE_Int
3669 static SANE_Int
3672 SANE_Int rst = OK;
3780 static SANE_Int
3783 SANE_Int rst;
3804 static SANE_Int
3807 SANE_Int rst;
3855 static SANE_Int
3856 RTS_WaitScanEnd (struct st_device *dev, SANE_Int msecs)
3859 SANE_Int rst;
3883 static SANE_Int
3884 RTS_Enable_CCD (struct st_device *dev, SANE_Byte * Regs, SANE_Int channels)
3886 SANE_Int rst = ERROR;
3904 static SANE_Int
3908 SANE_Int rst;
3928 static SANE_Int
3929 Lamp_Status_Timer_Set (struct st_device *dev, SANE_Int minutes)
3932 SANE_Int rst;
3956 (SANE_Int) ((MyBuffer[1] << 8) + MyBuffer[0]));
3963 static SANE_Int
3966 SANE_Int data, rst;
3983 static SANE_Int
3986 SANE_Int rst = 0;
3998 static SANE_Int
4001 SANE_Int rst = -1;
4017 static SANE_Int
4020 SANE_Int rst = -1;
4036 static SANE_Int
4037 Buttons_Order (struct st_device *dev, SANE_Int mask)
4040 SANE_Int rst = -1;
4044 SANE_Int a;
4059 static SANE_Int
4062 SANE_Int rst = OK;
4073 SANE_Int a;
4087 static SANE_Int
4095 SANE_Int rst = ERROR; /* default */
4101 SANE_Int data1;
4137 static SANE_Int
4138 RTS_DMA_WaitReady (struct st_device *dev, SANE_Int msecs)
4141 SANE_Int rst;
4167 static SANE_Int
4168 RTS_WaitInitEnd (struct st_device *dev, SANE_Int msecs)
4171 SANE_Int rst;
4197 static SANE_Int
4200 SANE_Int data, rst;
4233 static SANE_Int
4234 RTS_DMA_Read (struct st_device *dev, SANE_Int dmacs, SANE_Int options,
4235 SANE_Int size, SANE_Byte * buffer)
4237 SANE_Int rst = ERROR;
4252 SANE_Int transferred;
4265 static SANE_Int
4266 RTS_DMA_Write (struct st_device *dev, SANE_Int dmacs, SANE_Int options,
4267 SANE_Int size, SANE_Byte * buffer)
4269 SANE_Int rst = ERROR;
4284 SANE_Int transferred;
4291 SANE_Int a;
4302 SANE_Int b = 0, diff = FALSE;
4358 static SANE_Int
4364 SANE_Int rst = -1;
4382 SANE_Int a, b, diff;
4429 SANE_Int data = 0;
4440 SANE_Int c = 0;
4532 static SANE_Int
4535 SANE_Int rst = ERROR;
4593 static SANE_Int
4597 SANE_Int ret;
4636 static SANE_Int
4639 SANE_Int rst;
4656 static SANE_Int
4659 SANE_Int C;
4660 SANE_Int rst = OK;
4711 static SANE_Int
4716 SANE_Int rst = OK;
4732 SANE_Int table_size, buffersize, c;
4796 static SANE_Int
4798 SANE_Byte * scanned_pattern, SANE_Int * ler1,
4799 SANE_Int ler1order, SANE_Int * ser1, SANE_Int ser1order)
4801 SANE_Int buffersize, xpos, ypos, coord, cnt, chn_size, dist, rst;
4803 SANE_Int vector[3];
4999 get_shrd (double value, SANE_Int desp)
5027 static SANE_Int
5030 SANE_Int rst = ERROR;
5066 RTS_Setup_SensorTiming (struct st_device *dev, SANE_Int mytiming,
5136 static SANE_Int
5137 Motor_GetFromResolution (SANE_Int resolution)
5139 SANE_Int ret;
5162 static SANE_Int
5165 SANE_Int iValue, myctpc;
5225 SANE_Int traget;
5226 SANE_Int step_size = _B0 (Regs[0xe0]) + 1;
5254 static SANE_Int
5255 data_lsb_get (SANE_Byte * address, SANE_Int size)
5257 SANE_Int ret = 0;
5260 SANE_Int a;
5273 data_bitget (SANE_Byte * address, SANE_Int mask)
5275 SANE_Int desp = 0;
5297 data_bitset (SANE_Byte * address, SANE_Int mask, SANE_Byte data)
5320 data_wide_bitset (SANE_Byte * address, SANE_Int mask, SANE_Int data)
5329 SANE_Int mymask, started = FALSE;
5341 SANE_Int a, myvalue;
5368 data_lsb_set (SANE_Byte * address, SANE_Int data, SANE_Int size)
5372 SANE_Int a;
5382 data_msb_set (SANE_Byte * address, SANE_Int data, SANE_Int size)
5386 SANE_Int a;
5396 static SANE_Int
5397 data_swap_endianess (SANE_Int address, SANE_Int size)
5399 SANE_Int rst = 0;
5403 SANE_Int a;
5417 SANE_Int resolution, SANE_Byte gainmode)
5425 SANE_Int data1, data2;
5454 SANE_Int data;
5482 static SANE_Int
5485 SANE_Int rst = ERROR; /* default */
5486 SANE_Int data;
5506 SANE_Int transferred;
5534 SANE_Byte * buffer, SANE_Int channels_count)
5543 SANE_Int value;
5544 SANE_Int channel_size;
5571 SANE_Byte * buffer, SANE_Int channels_count)
5575 SANE_Int dots_count = 0;
5576 SANE_Int channel;
5579 SANE_Int C;
5614 static SANE_Int
5616 SANE_Int buffer_size, SANE_Int * transferred)
5623 SANE_Int lines_count = 0; /* ebp */
5624 SANE_Int channels_count = 0; /* fadc pisa buffer */
5625 SANE_Int rst = ERROR;
5719 static SANE_Int
5720 Resize_Decrease (SANE_Byte * to_buffer, SANE_Int to_resolution,
5721 SANE_Int to_width, SANE_Byte * from_buffer,
5722 SANE_Int from_resolution, SANE_Int from_width,
5723 SANE_Int myresize_mode)
5735 SANE_Int rst = ERROR;
5736 SANE_Int channels = 0; /* fac8 */
5737 SANE_Int depth = 0; /* fae0 */
5738 SANE_Int color[3] = { 0, 0, 0 }; /* fab8 | fabc | fac0 */
5739 SANE_Int to_pos = 0; /* fad4 */
5740 SANE_Int rescont = 0;
5741 SANE_Int from_pos = 0; /* fab4 */
5742 SANE_Int C;
5743 SANE_Int smres = 0; /* fab0 */
5744 SANE_Int value;
5745 SANE_Int channel_size;
5824 SANE_Int bit, pos, desp, rescont2;
5885 static SANE_Int
5886 Resize_Increase (SANE_Byte * to_buffer, SANE_Int to_resolution,
5887 SANE_Int to_width, SANE_Byte * from_buffer,
5888 SANE_Int from_resolution, SANE_Int from_width,
5889 SANE_Int myresize_mode)
5902 SANE_Int rst = ERROR;
5903 SANE_Int desp; /* fac0 */
5905 SANE_Int mywidth; /* fab4 fab8 */
5906 SANE_Int mychannels; /* fabc */
5907 SANE_Int channels = 0; /* faa4 */
5908 SANE_Int depth = 0; /* faa8 */
5909 SANE_Int pos = 0; /* fae0 */
5910 SANE_Int rescount;
5911 SANE_Int val6 = 0;
5912 SANE_Int val7 = 0;
5913 SANE_Int value;
6009 SANE_Int myres2; /* fac8 */
6010 SANE_Int sres;
6011 SANE_Int lfae0;
6012 SANE_Int lfad8;
6013 SANE_Int myres;
6014 SANE_Int cont = 1;
6015 SANE_Int someval;
6016 SANE_Int bit; /*lfaa8 */
6073 static SANE_Int
6074 Resize_Start (struct st_device *dev, SANE_Int * transferred)
6076 SANE_Int rst = ERROR;
6133 static SANE_Int
6134 Resize_CreateBuffers (struct st_device *dev, SANE_Int size1, SANE_Int size2,
6135 SANE_Int size3)
6137 SANE_Int rst = ERROR;
6155 static SANE_Int
6176 static SANE_Int
6195 static SANE_Int
6197 SANE_Byte * gammatable, SANE_Int size)
6199 SANE_Int rst = ERROR;
6205 SANE_Int transferred;
6206 SANE_Int first_table;
6207 SANE_Int cont = 0;
6208 SANE_Int retry = TRUE;
6275 static SANE_Int
6278 SANE_Int rst = ERROR;
6288 SANE_Int size = 768;
6292 SANE_Int transferred = 0;
6309 SANE_Int c;
6325 RTS_Scanner_StopScan (struct st_device *dev, SANE_Int wait)
6380 static SANE_Int
6384 SANE_Int mybytesperline;
6385 SANE_Int mybuffersize, a, b;
6435 static SANE_Int
6440 SANE_Int idata;
6482 static SANE_Int
6487 SANE_Int idata = 0;
6515 static SANE_Int
6516 Read_Image (struct st_device *dev, SANE_Int buffer_size, SANE_Byte * buffer,
6517 SANE_Int * transferred)
6519 SANE_Int rst;
6559 static SANE_Int
6561 SANE_Int buffer_size, SANE_Int * transferred)
6570 SANE_Int mydistance; /*ebp */
6571 SANE_Int mydots; /*fa74 */
6572 SANE_Int channel_size;
6573 SANE_Int c;
6743 SANE_Byte * buffer, SANE_Int Width)
6745 SANE_Int Value;
6746 SANE_Int Channel_size;
6747 SANE_Int max_value;
6810 SANE_Byte * buffer, SANE_Int dots)
6812 SANE_Int Value;
6881 SANE_Byte * buffer, SANE_Int dots)
6883 SANE_Int Value;
6884 SANE_Int Channel_size;
6885 SANE_Int max_value;
6925 SANE_Byte * buffer, SANE_Int Width)
6927 SANE_Int Value;
6956 SANE_Int Colour;
7000 SANE_Byte * buffer, SANE_Int Width)
7002 SANE_Int Value;
7003 SANE_Int channel_size;
7004 SANE_Int c;
7037 Triplet_Colour_LRes (SANE_Int Width, SANE_Byte * Buffer,
7054 SANE_Int Value;
7055 SANE_Int channel_size;
7056 SANE_Int c;
7082 static SANE_Int
7084 SANE_Int buffer_size, SANE_Int * transferred)
7091 SANE_Int rst = ERROR; /* fa68 */
7092 SANE_Int lfa54;
7093 SANE_Int lfa58;
7096 SANE_Int bOk;
7143 SANE_Int bit = 0;
7145 SANE_Int value;
7200 SANE_Int value;
7233 SANE_Int lfa68;
7234 SANE_Int transferred;
7235 SANE_Int channel_size;
7257 SANE_Int mask, mres;
7294 SANE_Int value;
7355 SANE_Int size)
7371 SANE_Int C;
7395 static SANE_Int
7397 SANE_Int buffer_size, SANE_Byte ColorMode,
7398 SANE_Int * transferred)
7405 SANE_Int rst = OK;
7406 SANE_Int lfa38 = 0;
7408 SANE_Int block_bytes_per_line;
7409 SANE_Int mysize;
7432 SANE_Int LinesCount;
7433 SANE_Int mysize4lines;
7436 SANE_Int puntero;
7437 SANE_Int value;
7474 SANE_Int channel_size;
7521 SANE_Int desp;
7582 static SANE_Int
7583 Read_Block (struct st_device *dev, SANE_Int buffer_size, SANE_Byte * buffer,
7584 SANE_Int * transferred)
7587 SANE_Int buffer_size fa80
7601 SANE_Int rst, LinesCount;
7602 SANE_Int mysize;
7693 static SANE_Int
7694 Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2,
7695 SANE_Byte * pBuffer, SANE_Int * bytes_transferred)
7697 SANE_Int rst = OK;
7747 SANE_Int iAmount, dofree;
7782 SANE_Int opStatus, sc;
7802 SANE_Int transferred = 0;
7812 iAmount = (SANE_Int) transferred;
7828 SANE_Int rest =
7870 SANE_Int iAmount;
7876 SANE_Int rest =
7919 static SANE_Int
7921 SANE_Int channel_size)
7925 SANE_Int rst;
7935 SANE_Int myAmount;
7956 static SANE_Int
7957 Lamp_Warmup (struct st_device *dev, SANE_Byte * Regs, SANE_Int lamp,
7958 SANE_Int resolution)
7960 SANE_Int rst = OK;
7968 SANE_Int overdrivetime;
8051 static SANE_Int
8054 SANE_Int rst;
8062 SANE_Int ypos, xpos, runb1;
8085 SANE_Int lfaa0 = 0;
8184 /*SANE_Int ta_y_start; */
8228 SANE_Int mytop = (((scancfg.coord.top * 5) * 5) * 16) / scancfg.resolution_y;
8338 SANE_Int val1 = scancfg.coord.top - (scancfg.resolution_y / 10);
8451 static SANE_Int
8453 struct st_scanparams *scancfg, SANE_Int somevalue)
8455 SANE_Int rst = ERROR; /* default */
8463 SANE_Int colormode, mymode;
8472 SANE_Int mbs[2] = { 0 }; /* motor back steps */
8473 SANE_Int step_size, step_type, dummyline, myvalue, lf02c;
8634 SANE_Int myexpt[3], linexpt, a;
8677 static SANE_Int
8680 struct st_hwdconfig *hwdcfg, SANE_Int mycolormode,
8681 SANE_Int arrangeline)
8683 SANE_Int iLineDistance = 0;
8688 SANE_Int mylinedistance, myevenodddist;
8761 static SANE_Int
8763 SANE_Int mycolormode)
8769 SANE_Int bytes_per_line = 0;
8773 SANE_Int channels_per_line =
8813 struct st_hwdconfig *hwdcfg, SANE_Int bytes_per_line)
8821 SANE_Int dots_count, myvalue, myvalue2, mem_available, resolution_ratio,
8823 SANE_Int channels, table_size;
8931 SANE_Int colormode)
8949 struct st_scanparams *scancfg, SANE_Int mycolormode)
9040 static SANE_Int
9045 SANE_Int rst = ERROR; /* default */
9046 SANE_Int lSMode;
9080 SANE_Int dummyline, iLineDistance, resolution_ratio, bytes_per_line;
9180 SANE_Int channels_per_line;
9229 RTS_Setup_Coords (SANE_Byte * Regs, SANE_Int iLeft, SANE_Int iTop,
9230 SANE_Int width, SANE_Int height)
9277 SANE_Int a;
9310 SANE_Int c;
9333 static SANE_Int
9335 struct st_calibration *myCalib, SANE_Int somelength)
9337 SANE_Int myshadinglength, pos;
9338 SANE_Int rst;
9409 static SANE_Int
9410 fn3560 (USHORT * table, struct st_cal2 *calbuffers, SANE_Int * tablepos)
9422 SANE_Int pos[4] = { 0, 0, 0, 0 }; /*f960 f964 f968 f96c */
9423 SANE_Int usetable = 0;
9424 SANE_Int a;
9426 SANE_Int mylength3 = calbuffers->shadinglength1; /*f97c */
9476 memcpy (tablepos, pos, sizeof (SANE_Int) * 4);
9483 static SANE_Int
9484 Calib_WriteTable (struct st_device *dev, SANE_Byte * table, SANE_Int size,
9485 SANE_Int data)
9487 SANE_Int rst = ERROR;
9493 SANE_Int transferred;
9509 static SANE_Int
9510 Calib_ReadTable (struct st_device *dev, SANE_Byte * table, SANE_Int size,
9511 SANE_Int data)
9513 SANE_Int rst = ERROR;
9519 SANE_Int transferred;
9535 static SANE_Int
9537 SANE_Int sensorchannelcolor, SANE_Int * tablepos, SANE_Int data)
9550 SANE_Int table_count = calbuffers->table_count; /*f960 */
9551 SANE_Int schcolor = _B0 (sensorchannelcolor);
9552 SANE_Int a = 0;
9553 SANE_Int tablelength = calbuffers->shadinglength3 / table_count; /*f954 */
9554 SANE_Int val_color = 0; /*f974 */
9555 SANE_Int val_lineart = 0; /*f978 */
9556 SANE_Int val_gray = 0; /*ebx */
9557 SANE_Int value4 = 0; /*ebp */
9558 SANE_Int size;
9559 SANE_Int rst = OK;
9679 static SANE_Int
9681 USHORT * table, SANE_Int sensorchannelcolor, SANE_Int data)
9690 SANE_Int pos[4] = { 0, 0, 0, 0 }; /*f998 f99c f9a0 f9a4 */
9691 SANE_Int rst;
9705 static SANE_Int
9707 SANE_Int channels, struct st_calibration *myCalib,
9710 SANE_Int rst = OK;
9721 SANE_Int chnl;
9722 SANE_Int pos; /*fa2c */
9723 SANE_Int transferred;
9767 static SANE_Int
9769 SANE_Int channels, struct st_calibration *myCalib,
9772 SANE_Int rst = OK;
9783 SANE_Int chnl;
9784 SANE_Int pos; /*fa2c */
9785 SANE_Int transferred;
9831 static SANE_Int
9843 SANE_Int rst; /* lf9e0 */
9844 SANE_Int myfact; /* e820 */
9845 SANE_Int shadata;
9847 SANE_Int myShadingBase; /* e818 */
9862 SANE_Int le7cc, le7d8;
9893 SANE_Int pos;
9894 SANE_Int colour;
9917 SANE_Int colour, pos;
10039 static SANE_Int
10040 Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size,
10041 SANE_Byte * buffer, SANE_Int * transferred)
10043 SANE_Int iTransferSize, iBytesToTransfer, iPos, rst, iBytesTransfered;
10111 static SANE_Int
10112 Reading_BufferSize_Notify (struct st_device *dev, SANE_Int data,
10113 SANE_Int size)
10115 SANE_Int rst;
10127 static SANE_Int
10129 SANE_Byte Channel_size, SANE_Int size, SANE_Int * last_amount,
10130 SANE_Int seconds, SANE_Byte op)
10132 SANE_Int rst;
10134 SANE_Int lastAmount, myAmount;
10204 static SANE_Int
10208 SANE_Int rst = ERROR;
10209 SANE_Int itransferred;
10220 SANE_Int myLength;
10221 SANE_Int iPos = 0;
10264 static SANE_Int
10272 SANE_Int rst = ERROR;
10305 static SANE_Int
10309 struct st_calibration *myCalib, SANE_Int options,
10310 SANE_Int gaincontrol)
10314 SANE_Int rst = ERROR; /* default */
10398 SANE_Int iValue;
10430 SANE_Int myvalue;
10532 static SANE_Int
10533 Refs_Detect (struct st_device *dev, SANE_Byte * Regs, SANE_Int resolution_x,
10534 SANE_Int resolution_y, SANE_Int * x, SANE_Int * y)
10536 SANE_Int rst = ERROR; /* default */
10569 SANE_Int gaincontrol, pwmlamplevel_backup, C;
10606 SANE_Int ser1, ler1;
10646 static SANE_Int
10650 SANE_Int rst;
10651 SANE_Int y, x;
10737 static SANE_Int
10738 Lamp_Status_Set (struct st_device *dev, SANE_Byte * Regs, SANE_Int turn_on,
10739 SANE_Int lamp)
10741 SANE_Int rst = ERROR; /* default */
10808 static SANE_Int
10811 SANE_Int rst, iType, iColor;
10854 Lamp_GetGainMode (struct st_device *dev, SANE_Int resolution,
10858 SANE_Int mygain, iValue;
10963 static SANE_Int
10964 GetOneLineInfo (struct st_device *dev, SANE_Int resolution,
10965 SANE_Int * maximus, SANE_Int * minimus, double *average)
10967 SANE_Int rst = ERROR;
10977 SANE_Int a, gainmode;
11035 SANE_Int cmin[3]; /* min values */
11036 SANE_Int cmax[3]; /* max values */
11038 SANE_Int mysize;
11060 SANE_Int y, x;
11063 SANE_Int desp[3];
11137 static SANE_Int
11138 Lamp_PWM_CheckStable (struct st_device *dev, SANE_Int resolution,
11139 SANE_Int lamp)
11142 SANE_Int rst;
11151 SANE_Int maximus[3] = { 0 };
11152 SANE_Int minimus[3] = { 0 };
11154 SANE_Int maxbigger;
11155 SANE_Int last_colour = 0;
11207 static SANE_Int
11210 SANE_Int rst = OK;
11228 static SANE_Int
11247 static SANE_Int
11248 Load_StripCoords (SANE_Int scantype, SANE_Int * ypos, SANE_Int * xpos)
11250 SANE_Int iType;
11274 static SANE_Int
11275 Head_Relocate (struct st_device *dev, SANE_Int speed, SANE_Int direction,
11276 SANE_Int ypos)
11278 SANE_Int rst;
11321 static SANE_Int
11325 SANE_Int ret;
11360 static SANE_Int
11362 SANE_Int my14b4)
11364 SANE_Int ebp, ret, channel;
11388 SANE_Int pos;
11428 SANE_Int channel;
11447 static SANE_Int
11449 struct st_calibration_config *calibcfg, SANE_Int scantype,
11450 SANE_Int resolution, SANE_Int bitmode)
11452 SANE_Int section, a;
11586 static SANE_Int
11588 SANE_Int arg2, SANE_Int gaincontrol)
11597 SANE_Int rst = ERROR;
11607 SANE_Int bytes_per_line, bytes_to_next_colour, bytes_per_pixel;
11691 SANE_Int a;
11692 SANE_Int vmin[3], vmax[3];
11710 SANE_Int pos, myheight /*f164 */ ;
11711 SANE_Int chn_sum[3];
11766 SANE_Int ival;
11794 SANE_Int ival;
11866 static SANE_Int
11867 GainOffset_Save (struct st_device *dev, SANE_Int * offset, SANE_Byte * gain)
11869 SANE_Int rst = OK;
11878 SANE_Int a, crc, value;
11901 static SANE_Int
11903 SANE_Int gainmode)
11907 SANE_Int channel_size;
11908 SANE_Int bytes_to_next_colour = 0;
11909 SANE_Int bytes_per_pixel = 0;
11910 SANE_Int length = 0;
11913 SANE_Int ret = ERROR;
11985 SANE_Int a;
11987 SANE_Int vmin[3] = { 255, 255, 255 }; /* f16c|f16e|f170 */
11988 SANE_Int vmax[3] = { 0, 0, 0 }; /* f164|f166|f168 */
11989 SANE_Int total[3];
11997 SANE_Int pos, b;
12059 static SANE_Int
12062 SANE_Int ret;
12074 static SANE_Int
12075 Chipset_Name (struct st_device *dev, char *name, SANE_Int size)
12077 SANE_Int rst = ERROR;
12088 static SANE_Int
12089 Refs_Load (struct st_device *dev, SANE_Int * x, SANE_Int * y)
12091 SANE_Int ret = OK;
12100 SANE_Int data;
12124 static SANE_Int
12125 Refs_Save (struct st_device *dev, SANE_Int left_leading, SANE_Int start_pos)
12127 SANE_Int ret = OK;
12152 static SANE_Int
12154 struct st_calibration_config *calibcfg, SANE_Int value)
12162 SANE_Int channels_per_dot; /*f108 */
12164 SANE_Int *pedcg; /*f114 */
12165 SANE_Int *podcg; /*f118 */
12166 SANE_Int *poffseteven; /*f130 */
12167 SANE_Int *poffsetodd; /*f128 */
12168 SANE_Int channel;
12169 SANE_Int avgtarget[3]; /*f1b8 f1bc f1c0 */
12171 SANE_Int scan_options; /*f12c */
12172 SANE_Int highresolution; /*f144 */
12174 SANE_Int do_loop; /*f0ec */
12175 SANE_Int gainmode;
12179 SANE_Int imgcount = 0;
12290 SANE_Int lf104;
12291 SANE_Int *mydcg; /*f0f4 */
12296 SANE_Int colour;
12331 SANE_Int dot;
12357 SANE_Int myesi;
12358 SANE_Int d;
12430 SANE_Int colour;
12449 SANE_Int dot;
12471 SANE_Int myesi;
12472 SANE_Int op1, op2, op3;
12501 op1 = (SANE_Int) (colour / (dbValues[channel] * op3));
12572 SANE_Int scantype, struct st_calibration_config *calibcfg)
12576 /**/ SANE_Int channel[3];
12577 SANE_Int a;
12592 static SANE_Int
12594 struct st_calibration *myCalib, SANE_Int gainmode)
12612 static SANE_Int
12615 struct st_calibration *myCalib, SANE_Int gainmode)
12625 SANE_Int myWidth; /*f14c */
12626 SANE_Int lf168, bytes_per_pixel;
12627 SANE_Int bytes_per_line;
12628 /**/ SANE_Int a;
12630 SANE_Int otherheight; /*f150 */
12631 SANE_Int otherheight2;
12632 SANE_Int lf12c;
12633 SANE_Int lf130;
12638 SANE_Int position; /*f140 */
12639 SANE_Int lf13c, myHeight;
12640 SANE_Int myESI, myEDI;
12641 SANE_Int channel; /*f134 */
12644 SANE_Int rst;
13127 static SANE_Int
13130 struct st_calibration *myCalib, SANE_Int gainmode)
13144 SANE_Int rst;
13145 SANE_Int a;
13146 SANE_Int mheight; /*efe0 */
13147 SANE_Int current_line; /*efe4 */
13148 SANE_Int bytes_per_line; /*efd8 */
13149 SANE_Int position; /*lefcc */
13150 SANE_Int leff0, lf010, lefd0;
13153 SANE_Int buff3[0x8000];
13155 SANE_Int my14b4; /*f008 pisa ptr */
13156 SANE_Int biggest; /*bx */
13157 SANE_Int lowest; /*dx */
13158 SANE_Int lefdc;
13159 SANE_Int channel;
13160 SANE_Int smvalues[3]; /*f04c f04e f050 */
13231 SANE_Int b, d;
13334 memset (&buff3, 0, 0x8000 * sizeof (SANE_Int));
13343 SANE_Int value;
13597 SANE_Int b, c;
13611 static SANE_Int
13614 SANE_Int value)
13616 /*//SANE_Int Calibration([fa20]char *Regs, [fa24]struct st_scanparams *scancfg, [fa28]struct st_calibration myCalib, [fa2c]SANE_Int value)
13620 SANE_Int a;
13622 SANE_Int lf900;
13855 SANE_Int a;
13878 static SANE_Int
13881 SANE_Int rst = ERROR;
13899 static SANE_Int
13900 Constrains_Check (struct st_device *dev, SANE_Int Resolution,
13901 SANE_Int scantype, struct st_coords *mycoords)
13911 SANE_Int rst = ERROR;
14040 SANE_Int table_size;
14086 static SANE_Int
14091 SANE_Int rst = ERROR;
14105 static SANE_Int
14108 SANE_Int rst = OK;
14202 static SANE_Int
14205 SANE_Int rst;
14229 static SANE_Int
14230 RTS_DMA_Enable_Read (struct st_device *dev, SANE_Int dmacs, SANE_Int size,
14231 SANE_Int options)
14233 SANE_Int rst = ERROR;
14252 static SANE_Int
14253 RTS_DMA_Enable_Write (struct st_device *dev, SANE_Int dmacs, SANE_Int size,
14254 SANE_Int options)
14256 SANE_Int rst = ERROR;
14275 static SANE_Int
14278 SANE_Int rst;
14289 static SANE_Int
14292 SANE_Int rst;
14303 static SANE_Int
14304 RTS_EEPROM_WriteByte (USB_Handle usb_handle, SANE_Int address, SANE_Byte data)
14306 SANE_Int rst;
14318 static SANE_Int
14319 RTS_EEPROM_ReadWord (USB_Handle usb_handle, SANE_Int address, SANE_Int * data)
14321 SANE_Int rst;
14332 static SANE_Int
14333 RTS_EEPROM_ReadByte (USB_Handle usb_handle, SANE_Int address,
14336 SANE_Int rst;
14347 static SANE_Int
14348 RTS_EEPROM_WriteWord (USB_Handle usb_handle, SANE_Int address, SANE_Int data)
14350 SANE_Int rst;
14362 static SANE_Int
14363 RTS_EEPROM_ReadInteger (USB_Handle usb_handle, SANE_Int address,
14364 SANE_Int * data)
14366 SANE_Int rst;
14377 static SANE_Int
14378 RTS_EEPROM_WriteInteger (USB_Handle usb_handle, SANE_Int address,
14379 SANE_Int data)
14381 SANE_Int rst;
14392 static SANE_Int
14393 RTS_EEPROM_WriteBuffer (USB_Handle usb_handle, SANE_Int address,
14394 SANE_Byte * data, SANE_Int size)
14396 SANE_Int rst;
14409 WShading_Emulate (SANE_Byte * buffer, SANE_Int * chnptr, SANE_Int size,
14410 SANE_Int depth)
14417 SANE_Int chnsize;
14418 SANE_Int pos;
14419 SANE_Int icolor;
14450 static SANE_Int
14459 SANE_Int bytes_per_line;
14460 /**/ SANE_Int x, y, a, C;
14463 SANE_Int gainmode;
14464 SANE_Int rst;
14541 SANE_Int chn;
14544 SANE_Int data;
14545 SANE_Int bytes_per_channel;
14673 static SANE_Int
14681 SANE_Int bytes_per_line;
14682 /**/ SANE_Int a, C;
14684 SANE_Int gainmode;
14685 SANE_Int rst;
14787 static SANE_Int
14790 SANE_Int rst;
14791 SANE_Int data = 0x0530, a;
14792 SANE_Int transferred;
14805 static SANE_Int
14814 SANE_Int bytes_per_line;
14815 /**/ SANE_Int x, y, a, C;
14818 SANE_Int gainmode;
14819 SANE_Int rst;
14941 static SANE_Int
14949 SANE_Int bytes_per_line;
14950 /**/ SANE_Int a, C;
14952 SANE_Int gainmode;
14953 SANE_Int rst;