kopia lustrzana https://gitlab.com/sane-project/backends
use y white strip offset to reach calibration area
- use y white strip offset to move to calibration area for GL841 devices - set y offset to 0 for all GL841 devices but one needing itmerge-requests/1/head
rodzic
77a3c2f7aa
commit
b882b2ed06
|
@ -3089,8 +3089,8 @@ genesys_send_shading_coefficient (Genesys_Device * dev)
|
|||
channels,
|
||||
0,
|
||||
coeff,
|
||||
0xfa00,
|
||||
0x0a00);
|
||||
0xf900,
|
||||
0x0001);
|
||||
break;
|
||||
case CCD_PLUSTEK_3600:
|
||||
compute_shifted_coefficients (dev,
|
||||
|
|
|
@ -1373,7 +1373,7 @@ static Genesys_Model canon_lide_50_model = {
|
|||
SANE_FIX (218.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (6.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2087,7 +2087,7 @@ static Genesys_Model canon_lide_60_model = {
|
|||
SANE_FIX (218.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (6.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2140,7 +2140,7 @@ static Genesys_Model canon_lide_80_model = {
|
|||
SANE_FIX (216.07), /* Size of scan area in mm (x) 218.00 */
|
||||
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (4.5), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2571,7 +2571,7 @@ static Genesys_Model visioneer_xp300_model = {
|
|||
SANE_FIX (435.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2676,7 +2676,7 @@ static Genesys_Model visioneer_roadwarrior_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2728,7 +2728,7 @@ static Genesys_Model syscan_docketport_465_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2780,7 +2780,7 @@ static Genesys_Model visioneer_xp100_r3_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2832,7 +2832,7 @@ static Genesys_Model pentax_dsmobile_600_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2884,7 +2884,7 @@ static Genesys_Model syscan_docketport_467_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2936,7 +2936,7 @@ static Genesys_Model syscan_docketport_685_model = {
|
|||
SANE_FIX (212.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (500), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -2989,7 +2989,7 @@ static Genesys_Model syscan_docketport_485_model = {
|
|||
SANE_FIX (435.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -3042,7 +3042,7 @@ static Genesys_Model dct_docketport_487_model = {
|
|||
SANE_FIX (435.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
@ -3207,7 +3207,7 @@ static Genesys_Model xerox_travelscanner_model = {
|
|||
SANE_FIX (220.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (511), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
|
|
|
@ -3894,15 +3894,12 @@ gl841_feed (Genesys_Device * dev, int steps)
|
|||
uint8_t val;
|
||||
int loop;
|
||||
|
||||
DBG (DBG_proc, "gl841_feed (steps = %d)\n",
|
||||
steps);
|
||||
DBG (DBG_proc, "gl841_feed (steps = %d)\n", steps);
|
||||
|
||||
status =
|
||||
gl841_stop_action (dev);
|
||||
status = gl841_stop_action (dev);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
"gl841_feed: failed to stop action: %s\n",
|
||||
DBG (DBG_error, "gl841_feed: failed to stop action: %s\n",
|
||||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
|
@ -3911,12 +3908,9 @@ gl841_feed (Genesys_Device * dev, int steps)
|
|||
|
||||
gl841_init_optical_regs_off(local_reg);
|
||||
|
||||
gl841_init_motor_regs(dev,local_reg,
|
||||
steps,MOTOR_ACTION_FEED,0);
|
||||
gl841_init_motor_regs(dev,local_reg, steps,MOTOR_ACTION_FEED,0);
|
||||
|
||||
status =
|
||||
gl841_bulk_write_register (dev, local_reg,
|
||||
GENESYS_GL841_MAX_REGS);
|
||||
status = gl841_bulk_write_register (dev, local_reg, GENESYS_GL841_MAX_REGS);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
|
@ -3933,8 +3927,7 @@ gl841_feed (Genesys_Device * dev, int steps)
|
|||
sane_strstatus (status));
|
||||
gl841_stop_action (dev);
|
||||
/* send original registers */
|
||||
gl841_bulk_write_register (dev, dev->reg,
|
||||
GENESYS_GL841_MAX_REGS);
|
||||
gl841_bulk_write_register (dev, dev->reg, GENESYS_GL841_MAX_REGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -4570,6 +4563,7 @@ gl841_led_calibration (Genesys_Device * dev)
|
|||
char fn[20];
|
||||
uint16_t expr, expg, expb;
|
||||
Genesys_Register_Set *r;
|
||||
int move;
|
||||
|
||||
SANE_Bool acceptable = SANE_FALSE;
|
||||
|
||||
|
@ -4579,20 +4573,20 @@ gl841_led_calibration (Genesys_Device * dev)
|
|||
|
||||
DBGSTART;
|
||||
|
||||
/* feed to white strip. canon lide 35 only. */
|
||||
if (dev->model->gpo_type == GPO_CANONLIDE35
|
||||
|| dev->model->gpo_type == GPO_CANONLIDE80)
|
||||
/* feed to white strip if needed */
|
||||
if (dev->model->y_offset_calib>0)
|
||||
{
|
||||
status = gl841_feed(dev, 280);
|
||||
|
||||
move = SANE_UNFIX (dev->model->y_offset_calib);
|
||||
move = (move * (dev->motor.base_ydpi)) / MM_PER_INCH;
|
||||
DBG (DBG_io, "%s: move=%d lines\n", __FUNCTION__, move);
|
||||
status = gl841_feed(dev, move);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
"%s: failed to feed: %s\n", __FUNCTION__,
|
||||
sane_strstatus (status));
|
||||
DBG (DBG_error, "%s: failed to feed: %s\n", __FUNCTION__,
|
||||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* offset calibration is always done in color mode */
|
||||
channels = 3;
|
||||
|
@ -4754,7 +4748,7 @@ gl841_led_calibration (Genesys_Device * dev)
|
|||
turn++;
|
||||
|
||||
} while (!acceptable && turn < 100);
|
||||
|
||||
|
||||
DBG(DBG_info,"%s: acceptable exposure: %d,%d,%d\n", __FUNCTION__, expr,expg,expb);
|
||||
|
||||
/* cleanup before return */
|
||||
|
@ -5328,20 +5322,21 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi)
|
|||
float gain[3];
|
||||
int val;
|
||||
int lines=1;
|
||||
int move;
|
||||
|
||||
DBG (DBG_proc, "gl841_coarse_gain_calibration dpi=%d\n", dpi);
|
||||
DBG (DBG_proc, "%s: dpi=%d\n", __FUNCTION__, dpi);
|
||||
|
||||
/*feed to white strip. canon lide 35 only.*/
|
||||
if (dev->model->gpo_type == GPO_CANONLIDE35
|
||||
|| dev->model->gpo_type == GPO_CANONLIDE80)
|
||||
/* feed to white strip if needed */
|
||||
if (dev->model->y_offset_calib>0)
|
||||
{
|
||||
status = gl841_feed(dev, 280);
|
||||
|
||||
move = SANE_UNFIX (dev->model->y_offset_calib);
|
||||
move = (move * (dev->motor.base_ydpi)) / MM_PER_INCH;
|
||||
DBG (DBG_io, "%s: move=%d lines\n", __FUNCTION__, move);
|
||||
status = gl841_feed(dev, move);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
"gl841_coarse_gain_calibration: failed to feed: %s\n",
|
||||
sane_strstatus (status));
|
||||
DBG (DBG_error, "%s: failed to feed: %s\n", __FUNCTION__,
|
||||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
@ -5369,8 +5364,7 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi)
|
|||
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
"gl841_coarse_calibration: failed to setup scan: %s\n",
|
||||
DBG (DBG_error, "%s: failed to setup scan: %s\n", __FUNCTION__,
|
||||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
|
@ -5431,8 +5425,7 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi)
|
|||
dev->frontend.gain[j] = gain[j]*12;
|
||||
}
|
||||
|
||||
DBG (DBG_proc,
|
||||
"gl841_coarse_gain_calibration: channel %d, max=%d, gain = %f, setting:%d\n",
|
||||
DBG (DBG_proc, "%s: channel %d, max=%d, gain = %f, setting:%d\n", __FUNCTION__,
|
||||
j, max[j], gain[j],dev->frontend.gain[j]);
|
||||
}
|
||||
|
||||
|
@ -5482,7 +5475,7 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi)
|
|||
|
||||
gl841_slow_back_home(dev, SANE_TRUE);
|
||||
|
||||
DBG (DBG_proc, "gl841_coarse_gain_calibration: completed\n");
|
||||
DBGCOMPLETED;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue