From 5f3625ad7aaa51817eb715d6d147229c070ada6e Mon Sep 17 00:00:00 2001 From: Pierre Willenbrock Date: Fri, 9 Oct 2009 23:02:11 +0200 Subject: [PATCH] Add Calibration for Visioneer Roadwarrior and DocketPort 665 --- backend/genesys.c | 4 ++++ backend/genesys_devices.c | 26 ++++++++++++++------------ backend/genesys_gl841.c | 3 ++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/backend/genesys.c b/backend/genesys.c index 993bd3aec..0d5443d94 100644 --- a/backend/genesys.c +++ b/backend/genesys.c @@ -1311,6 +1311,8 @@ genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data, if (dev->settings.scan_mode < 2 && dev->model->ccd_type != CCD_DSMOBILE600 && dev->model->ccd_type != CCD_XP300 + && dev->model->ccd_type != CCD_DP665 + && dev->model->ccd_type != CCD_ROADWARRIOR && dev->model->ccd_type != CCD_HP2300 && dev->model->ccd_type != CCD_HP2400 && dev->model->ccd_type != CCD_HP3670 @@ -3043,6 +3045,8 @@ genesys_send_shading_coefficient (Genesys_Device * dev) target_code); break; case CCD_XP300: + case CCD_ROADWARRIOR: + case CCD_DP665: target_code = 0xdc00; o = 4; cmat[0] = 0; diff --git a/backend/genesys_devices.c b/backend/genesys_devices.c index 19af642c4..0b9adeab7 100644 --- a/backend/genesys_devices.c +++ b/backend/genesys_devices.c @@ -299,14 +299,14 @@ static Genesys_Sensor Sensor[] = { /* Syscan DP 665 */ {CCD_DP665, 600, /*TODO: find a good reason for keeping all three following variables*/ - 28, /*(black) */ - 28, /* (dummy) */ + 27, /*(black) */ + 27, /* (dummy) */ 0, /* (startxoffset) */ 2496, /*sensor_pixels */ 210, 200, {0x00, 0x00, 0x00, 0x00}, - {0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x04, 0x50, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, 0x10, 0x00, 0x20, 0x02 }, {0x04, 0x05, @@ -322,14 +322,14 @@ static Genesys_Sensor Sensor[] = { /* Visioneer Roadwarrior */ {CCD_ROADWARRIOR, 600, /*TODO: find a good reason for keeping all three following variables*/ - 28, /*(black) */ - 28, /* (dummy) */ + 27, /*(black) */ + 27, /* (dummy) */ 0, /* (startxoffset) */ 5200, /*sensor_pixels */ 210, 200, {0x00, 0x00, 0x00, 0x00}, - {0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x02, 0x04, 0x50, + {0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x00, 0x02, 0x04, 0x50, 0x10, 0x00, 0x20, 0x02 }, {0x04, 0x05, @@ -1326,9 +1326,10 @@ static Genesys_Model syscan_docketport_665_model = { MOTOR_DP665, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; @@ -1376,9 +1377,10 @@ static Genesys_Model visioneer_roadwarrior_model = { MOTOR_ROADWARRIOR, GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */ | GENESYS_FLAG_SKIP_WARMUP - | GENESYS_FLAG_NO_CALIBRATION, - GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW, - 300, + | GENESYS_FLAG_OFFSET_CALIBRATION + | GENESYS_FLAG_DARK_CALIBRATION, + GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE, + 100, 400 }; diff --git a/backend/genesys_gl841.c b/backend/genesys_gl841.c index c96fefdcf..94b2151ba 100644 --- a/backend/genesys_gl841.c +++ b/backend/genesys_gl841.c @@ -5427,7 +5427,8 @@ gl841_coarse_gain_calibration (Genesys_Device * dev, int dpi) gain[j] = 65535.0/max[j]; - if (dev->model->dac_type == DAC_CANONLIDE35) { + if (dev->model->dac_type == DAC_CANONLIDE35 || + dev->model->dac_type == DAC_WOLFSON_XP300) { gain[j] *= 0.69;/*seems we don't get the real maximum. empirically derived*/ if (283 - 208/gain[j] > 255) dev->frontend.gain[j] = 255;