kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'genesys-session-cleanup' into 'master'
genesys: More cleanup for ScanSession See merge request sane-project/backends!236merge-requests/237/merge
commit
e4a908d88b
|
@ -336,13 +336,6 @@ struct Genesys_Device
|
||||||
|
|
||||||
Calibration calibration_cache;
|
Calibration calibration_cache;
|
||||||
|
|
||||||
// used red line-distance shift
|
|
||||||
SANE_Int ld_shift_r = 0;
|
|
||||||
// used green line-distance shift
|
|
||||||
SANE_Int ld_shift_g = 0;
|
|
||||||
// used blue line-distance shift
|
|
||||||
SANE_Int ld_shift_b = 0;
|
|
||||||
|
|
||||||
// number of scan lines used during scan
|
// number of scan lines used during scan
|
||||||
int line_count = 0;
|
int line_count = 0;
|
||||||
|
|
||||||
|
|
|
@ -291,11 +291,6 @@ sanei_genesys_init_structs (Genesys_Device * dev)
|
||||||
static_cast<unsigned>(dev->model->gpio_id),
|
static_cast<unsigned>(dev->model->gpio_id),
|
||||||
static_cast<unsigned>(dev->model->motor_id));
|
static_cast<unsigned>(dev->model->motor_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up initial line distance shift */
|
|
||||||
dev->ld_shift_r = dev->model->ld_shift_r;
|
|
||||||
dev->ld_shift_g = dev->model->ld_shift_g;
|
|
||||||
dev->ld_shift_b = dev->model->ld_shift_b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main function for slope creation */
|
/* main function for slope creation */
|
||||||
|
|
|
@ -887,20 +887,6 @@ static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
reg->set16(REG_DUMMY, sensor.dummy_pixel);
|
reg->set16(REG_DUMMY, sensor.dummy_pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl124_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
DBG_HELPER(dbg);
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
|
|
||||||
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** set up registers for an actual scan
|
/** set up registers for an actual scan
|
||||||
*
|
*
|
||||||
* this function sets up the scanner to scan in normal or single line mode
|
* this function sets up the scanner to scan in normal or single line mode
|
||||||
|
@ -1018,7 +1004,7 @@ void CommandSetGl124::calculate_current_setup(Genesys_Device * dev,
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
|
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
/* compute scan parameters values */
|
/* compute scan parameters values */
|
||||||
/* pixels are allways given at half or full CCD optical resolution */
|
/* pixels are allways given at half or full CCD optical resolution */
|
||||||
|
@ -1319,7 +1305,7 @@ void CommandSetGl124::slow_back_home(Genesys_Device* dev, bool wait_until_home)
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1409,7 +1395,7 @@ static void gl124_feed(Genesys_Device* dev, unsigned int steps, int reverse)
|
||||||
SCAN_FLAG_FEEDING |
|
SCAN_FLAG_FEEDING |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1492,7 +1478,7 @@ void CommandSetGl124::search_start_position(Genesys_Device* dev) const
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
gl124_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1553,7 +1539,7 @@ void CommandSetGl124::init_regs_for_coarse_calibration(Genesys_Device* dev,
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_FEEDING |
|
SCAN_FLAG_FEEDING |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1619,7 +1605,7 @@ void CommandSetGl124::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
@ -1697,7 +1683,7 @@ void CommandSetGl124::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.scan_mode = dev->settings.scan_mode;
|
session.params.scan_mode = dev->settings.scan_mode;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl124_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
}
|
}
|
||||||
|
@ -1833,7 +1819,7 @@ static void move_to_calibration_area(Genesys_Device* dev, const Genesys_Sensor&
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1909,7 +1895,7 @@ SensorExposure CommandSetGl124::led_calibration(Genesys_Device* dev, const Genes
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2077,7 +2063,7 @@ void CommandSetGl124::offset_calibration(Genesys_Device* dev, const Genesys_Sens
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2231,7 +2217,7 @@ void CommandSetGl124::coarse_gain_calibration(Genesys_Device* dev, const Genesys
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gl124_init_scan_regs(dev, sensor, ®s, session);
|
gl124_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
@ -2339,7 +2325,7 @@ void CommandSetGl124::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl124_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl124_init_scan_regs(dev, sensor, reg, session);
|
gl124_init_scan_regs(dev, sensor, reg, session);
|
||||||
|
|
||||||
|
|
|
@ -207,19 +207,6 @@ static int get_cksel(SensorId sensor_id, int required, unsigned channels)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl646_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
DBG_HELPER(dbg);
|
|
||||||
(void) dev;
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup register and motor tables for a scan at the
|
* Setup register and motor tables for a scan at the
|
||||||
* given resolution and color mode. TODO try to not use any filed from
|
* given resolution and color mode. TODO try to not use any filed from
|
||||||
|
@ -2008,7 +1995,7 @@ static void setup_for_scan(Genesys_Device* dev,
|
||||||
if (xcorrection) {
|
if (xcorrection) {
|
||||||
session.params.flags |= SCAN_FLAG_USE_XCORRECTION;
|
session.params.flags |= SCAN_FLAG_USE_XCORRECTION;
|
||||||
}
|
}
|
||||||
gl646_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
std::vector<uint16_t> slope_table0;
|
std::vector<uint16_t> slope_table0;
|
||||||
std::vector<uint16_t> slope_table1;
|
std::vector<uint16_t> slope_table1;
|
||||||
|
|
|
@ -1608,24 +1608,6 @@ int scan_step_type=0;
|
||||||
return scan_step_type;
|
return scan_step_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl841_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
DBG_HELPER(dbg);
|
|
||||||
|
|
||||||
// no 16 bit gamma for this ASIC
|
|
||||||
if (s.params.depth == 16) {
|
|
||||||
s.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
|
||||||
}
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||||
// line mode
|
// line mode
|
||||||
static void gl841_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
static void gl841_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||||
|
@ -1801,7 +1783,7 @@ void CommandSetGl841::calculate_current_setup(Genesys_Device * dev,
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
|
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
/* dummy lines: may not be usefull, for instance 250 dpi works with 0 or 1
|
/* dummy lines: may not be usefull, for instance 250 dpi works with 0 or 1
|
||||||
dummy line. Maybe the dummy line adds correctness since the motor runs
|
dummy line. Maybe the dummy line adds correctness since the motor runs
|
||||||
|
@ -2530,7 +2512,7 @@ void CommandSetGl841::search_start_position(Genesys_Device* dev) const
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, sensor, &local_reg, session);
|
gl841_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -2590,7 +2572,7 @@ void CommandSetGl841::init_regs_for_coarse_calibration(Genesys_Device* dev,
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, sensor, ®s, session);
|
gl841_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2662,7 +2644,7 @@ void CommandSetGl841::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
/*SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |*/
|
/*SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |*/
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2754,7 +2736,7 @@ void CommandSetGl841::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.scan_mode = dev->settings.scan_mode;
|
session.params.scan_mode = dev->settings.scan_mode;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl841_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
}
|
}
|
||||||
|
@ -2839,7 +2821,7 @@ SensorExposure CommandSetGl841::led_calibration(Genesys_Device* dev, const Genes
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, calib_sensor_base);
|
compute_session(dev, session, calib_sensor_base);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor_base, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor_base, ®s, session);
|
||||||
|
|
||||||
|
@ -3043,7 +3025,7 @@ static void ad_fe_offset_calibration(Genesys_Device* dev, const Genesys_Sensor&
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -3166,7 +3148,7 @@ void CommandSetGl841::offset_calibration(Genesys_Device* dev, const Genesys_Sens
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
||||||
SCAN_FLAG_DISABLE_LAMP;
|
SCAN_FLAG_DISABLE_LAMP;
|
||||||
gl841_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -3531,7 +3513,7 @@ void CommandSetGl841::coarse_gain_calibration(Genesys_Device* dev, const Genesys
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -3676,7 +3658,7 @@ void CommandSetGl841::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, sensor, local_reg, session);
|
gl841_init_scan_regs(dev, sensor, local_reg, session);
|
||||||
|
|
||||||
|
@ -3834,7 +3816,7 @@ void CommandSetGl841::init(Genesys_Device* dev) const
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl841_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl841_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -3956,7 +3938,7 @@ void CommandSetGl841::search_strip(Genesys_Device* dev, const Genesys_Sensor& se
|
||||||
session.params.scan_mode = ScanColorMode::GRAY;
|
session.params.scan_mode = ScanColorMode::GRAY;
|
||||||
session.params.color_filter = ColorFilter::RED;
|
session.params.color_filter = ColorFilter::RED;
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING | SCAN_FLAG_DISABLE_GAMMA;
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING | SCAN_FLAG_DISABLE_GAMMA;
|
||||||
gl841_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
size = pixels * channels * lines * (session.params.depth / 8);
|
size = pixels * channels * lines * (session.params.depth / 8);
|
||||||
std::vector<uint8_t> data(size);
|
std::vector<uint8_t> data(size);
|
||||||
|
|
|
@ -1192,23 +1192,6 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
r->value = sensor.dummy_pixel;
|
r->value = sensor.dummy_pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// computes physical parameters for specific scan setup
|
|
||||||
static void gl843_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
// no 16 bit gamma for this ASIC
|
|
||||||
if (s.params.depth == 16) {
|
|
||||||
s.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
|
||||||
}
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||||
// line mode
|
// line mode
|
||||||
static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||||
|
@ -1254,20 +1237,6 @@ static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
|
||||||
gl843_init_optical_regs_scan(dev, sensor, reg, exposure, session);
|
gl843_init_optical_regs_scan(dev, sensor, reg, exposure, session);
|
||||||
|
|
||||||
/*** motor parameters ***/
|
/*** motor parameters ***/
|
||||||
|
|
||||||
/* it seems base_dpi of the G4050 motor is changed above 600 dpi*/
|
|
||||||
if (dev->model->motor_id == MotorId::G4050 && session.params.yres>600) {
|
|
||||||
dev->ld_shift_r = (dev->model->ld_shift_r*3800)/dev->motor.base_ydpi;
|
|
||||||
dev->ld_shift_g = (dev->model->ld_shift_g*3800)/dev->motor.base_ydpi;
|
|
||||||
dev->ld_shift_b = (dev->model->ld_shift_b*3800)/dev->motor.base_ydpi;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dev->ld_shift_r = dev->model->ld_shift_r;
|
|
||||||
dev->ld_shift_g = dev->model->ld_shift_g;
|
|
||||||
dev->ld_shift_b = dev->model->ld_shift_b;
|
|
||||||
}
|
|
||||||
|
|
||||||
mflags = 0;
|
mflags = 0;
|
||||||
if (session.params.flags & SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE) {
|
if (session.params.flags & SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE) {
|
||||||
mflags |= MOTOR_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
mflags |= MOTOR_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
|
@ -1353,7 +1322,7 @@ void CommandSetGl843::calculate_current_setup(Genesys_Device * dev,
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
|
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
/* compute scan parameters values */
|
/* compute scan parameters values */
|
||||||
/* pixels are allways given at half or full CCD optical resolution */
|
/* pixels are allways given at half or full CCD optical resolution */
|
||||||
|
@ -1366,17 +1335,6 @@ void CommandSetGl843::calculate_current_setup(Genesys_Device * dev,
|
||||||
}
|
}
|
||||||
DBG(DBG_info, "%s : exposure=%d pixels\n", __func__, exposure);
|
DBG(DBG_info, "%s : exposure=%d pixels\n", __func__, exposure);
|
||||||
|
|
||||||
/* it seems base_dpi of the G4050 motor is changed above 600 dpi*/
|
|
||||||
if (dev->model->motor_id == MotorId::G4050 && session.params.yres>600) {
|
|
||||||
dev->ld_shift_r = (dev->model->ld_shift_r*3800)/dev->motor.base_ydpi;
|
|
||||||
dev->ld_shift_g = (dev->model->ld_shift_g*3800)/dev->motor.base_ydpi;
|
|
||||||
dev->ld_shift_b = (dev->model->ld_shift_b*3800)/dev->motor.base_ydpi;
|
|
||||||
} else {
|
|
||||||
dev->ld_shift_r = dev->model->ld_shift_r;
|
|
||||||
dev->ld_shift_g = dev->model->ld_shift_g;
|
|
||||||
dev->ld_shift_b = dev->model->ld_shift_b;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
dev->current_setup.pixels = session.output_pixels;
|
dev->current_setup.pixels = session.output_pixels;
|
||||||
DBG(DBG_info, "%s: current_setup.pixels=%d\n", __func__, dev->current_setup.pixels);
|
DBG(DBG_info, "%s: current_setup.pixels=%d\n", __func__, dev->current_setup.pixels);
|
||||||
|
@ -1965,7 +1923,7 @@ void CommandSetGl843::slow_back_home(Genesys_Device* dev, bool wait_until_home)
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -2058,7 +2016,7 @@ void CommandSetGl843::search_start_position(Genesys_Device* dev) const
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -2122,7 +2080,7 @@ void CommandSetGl843::init_regs_for_coarse_calibration(Genesys_Device* dev,
|
||||||
session.params.scan_mode = dev->settings.scan_mode;
|
session.params.scan_mode = dev->settings.scan_mode;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, ®s, session);
|
gl843_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2169,7 +2127,7 @@ static void gl843_feed(Genesys_Device* dev, unsigned int steps)
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_FEEDING |
|
SCAN_FLAG_FEEDING |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
gl843_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -2287,7 +2245,7 @@ void CommandSetGl843::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
||||||
session.params.scan_mode = dev->settings.scan_mode;
|
session.params.scan_mode = dev->settings.scan_mode;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl843_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2374,7 +2332,7 @@ void CommandSetGl843::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.scan_mode = dev->settings.scan_mode;
|
session.params.scan_mode = dev->settings.scan_mode;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl843_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl843_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
}
|
}
|
||||||
|
@ -2456,7 +2414,7 @@ SensorExposure CommandSetGl843::led_calibration(Genesys_Device* dev, const Genes
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, calib_sensor, ®s, session);
|
gl843_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2669,7 +2627,7 @@ void CommandSetGl843::offset_calibration(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS;
|
session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS;
|
||||||
session.params.color_filter = ColorFilter::RED;
|
session.params.color_filter = ColorFilter::RED;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
pixels = session.output_pixels;
|
pixels = session.output_pixels;
|
||||||
|
|
||||||
DBG(DBG_io, "%s: dpihw =%d\n", __func__, dpihw);
|
DBG(DBG_io, "%s: dpihw =%d\n", __func__, dpihw);
|
||||||
|
@ -2885,7 +2843,7 @@ void CommandSetGl843::coarse_gain_calibration(Genesys_Device* dev, const Genesys
|
||||||
session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS;
|
session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS;
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = flags;
|
session.params.flags = flags;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
std::size_t pixels = session.output_pixels;
|
std::size_t pixels = session.output_pixels;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2996,7 +2954,7 @@ void CommandSetGl843::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, calib_sensor, reg, session);
|
gl843_init_scan_regs(dev, calib_sensor, reg, session);
|
||||||
|
|
||||||
|
@ -3240,7 +3198,7 @@ void CommandSetGl843::search_strip(Genesys_Device* dev, const Genesys_Sensor& se
|
||||||
session.params.scan_mode = ScanColorMode::GRAY;
|
session.params.scan_mode = ScanColorMode::GRAY;
|
||||||
session.params.color_filter = ColorFilter::RED;
|
session.params.color_filter = ColorFilter::RED;
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING | SCAN_FLAG_DISABLE_SHADING;
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING | SCAN_FLAG_DISABLE_SHADING;
|
||||||
gl843_compute_session(dev, session, calib_sensor);
|
compute_session(dev, session, calib_sensor);
|
||||||
|
|
||||||
gl843_init_scan_regs(dev, calib_sensor, &local_reg, session);
|
gl843_init_scan_regs(dev, calib_sensor, &local_reg, session);
|
||||||
|
|
||||||
|
|
|
@ -741,21 +741,6 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
r->value = sensor.dummy_pixel;
|
r->value = sensor.dummy_pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl846_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
DBG_HELPER(dbg);
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
|
|
||||||
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
|
||||||
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||||
// line mode
|
// line mode
|
||||||
static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||||
|
@ -873,7 +858,7 @@ void CommandSetGl846::calculate_current_setup(Genesys_Device* dev,
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
|
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
/* compute scan parameters values */
|
/* compute scan parameters values */
|
||||||
/* pixels are allways given at half or full CCD optical resolution */
|
/* pixels are allways given at half or full CCD optical resolution */
|
||||||
|
@ -1087,7 +1072,7 @@ void CommandSetGl846::slow_back_home(Genesys_Device* dev, bool wait_until_home)
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1180,7 +1165,7 @@ void CommandSetGl846::search_start_position(Genesys_Device* dev) const
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1242,7 +1227,7 @@ void CommandSetGl846::init_regs_for_coarse_calibration(Genesys_Device* dev,
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, ®s, session);
|
gl846_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1285,7 +1270,7 @@ static void gl846_feed(Genesys_Device* dev, unsigned int steps)
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_FEEDING |
|
SCAN_FLAG_FEEDING |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1373,7 +1358,7 @@ void CommandSetGl846::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, ®s, session);
|
gl846_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1455,7 +1440,7 @@ void CommandSetGl846::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
// backtracking isn't handled well, so don't enable it
|
// backtracking isn't handled well, so don't enable it
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
session.params.flags = SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl846_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
}
|
}
|
||||||
|
@ -1586,7 +1571,7 @@ SensorExposure CommandSetGl846::led_calibration(Genesys_Device* dev, const Genes
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, ®s, session);
|
gl846_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1909,7 +1894,7 @@ void CommandSetGl846::search_strip(Genesys_Device* dev, const Genesys_Sensor& se
|
||||||
session.params.color_filter = ColorFilter::RED;
|
session.params.color_filter = ColorFilter::RED;
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA;
|
SCAN_FLAG_DISABLE_GAMMA;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
gl846_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -2132,7 +2117,7 @@ void CommandSetGl846::offset_calibration(Genesys_Device* dev, const Genesys_Sens
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl846_init_scan_regs(dev, sensor, ®s, session);
|
gl846_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2280,7 +2265,7 @@ void CommandSetGl846::coarse_gain_calibration(Genesys_Device* dev, const Genesys
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl846_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gl846_init_scan_regs(dev, sensor, ®s, session);
|
gl846_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
|
@ -752,19 +752,6 @@ static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
r->value = sensor.dummy_pixel;
|
r->value = sensor.dummy_pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl847_compute_session(Genesys_Device* dev, ScanSession& s,
|
|
||||||
const Genesys_Sensor& sensor)
|
|
||||||
{
|
|
||||||
DBG_HELPER(dbg);
|
|
||||||
|
|
||||||
compute_session(dev, s, sensor);
|
|
||||||
|
|
||||||
s.computed = true;
|
|
||||||
|
|
||||||
DBG(DBG_info, "%s ", __func__);
|
|
||||||
debug_dump(DBG_info, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||||
// line mode
|
// line mode
|
||||||
static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||||
|
@ -876,7 +863,7 @@ void CommandSetGl847::calculate_current_setup(Genesys_Device * dev,
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
session.params.flags = 0;
|
session.params.flags = 0;
|
||||||
|
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
/* compute scan parameters values */
|
/* compute scan parameters values */
|
||||||
/* pixels are allways given at half or full CCD optical resolution */
|
/* pixels are allways given at half or full CCD optical resolution */
|
||||||
|
@ -1131,7 +1118,7 @@ void CommandSetGl847::slow_back_home(Genesys_Device* dev, bool wait_until_home)
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1222,7 +1209,7 @@ void CommandSetGl847::search_start_position(Genesys_Device* dev) const
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1284,7 +1271,7 @@ void CommandSetGl847::init_regs_for_coarse_calibration(Genesys_Device* dev,
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, ®s, session);
|
gl847_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1326,7 +1313,7 @@ static void gl847_feed(Genesys_Device* dev, unsigned int steps)
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_FEEDING |
|
SCAN_FLAG_FEEDING |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
gl847_init_scan_regs(dev, sensor, &local_reg, session);
|
||||||
|
|
||||||
|
@ -1405,7 +1392,7 @@ void CommandSetGl847::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, ®s, session);
|
gl847_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1486,7 +1473,7 @@ void CommandSetGl847::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
session.params.color_filter = dev->settings.color_filter;
|
session.params.color_filter = dev->settings.color_filter;
|
||||||
// backtracking isn't handled well, so don't enable it
|
// backtracking isn't handled well, so don't enable it
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
session.params.flags = SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, &dev->reg, session);
|
gl847_init_scan_regs(dev, sensor, &dev->reg, session);
|
||||||
}
|
}
|
||||||
|
@ -1618,7 +1605,7 @@ SensorExposure CommandSetGl847::led_calibration(Genesys_Device* dev, const Genes
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, ®s, session);
|
gl847_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -1972,7 +1959,7 @@ void CommandSetGl847::search_strip(Genesys_Device* dev, const Genesys_Sensor& se
|
||||||
session.params.color_filter = ColorFilter::RED;
|
session.params.color_filter = ColorFilter::RED;
|
||||||
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
session.params.flags = SCAN_FLAG_DISABLE_SHADING |
|
||||||
SCAN_FLAG_DISABLE_GAMMA;
|
SCAN_FLAG_DISABLE_GAMMA;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
size = pixels * channels * lines * (session.params.depth / 8);
|
size = pixels * channels * lines * (session.params.depth / 8);
|
||||||
std::vector<uint8_t> data(size);
|
std::vector<uint8_t> data(size);
|
||||||
|
@ -2196,7 +2183,7 @@ void CommandSetGl847::offset_calibration(Genesys_Device* dev, const Genesys_Sens
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
gl847_init_scan_regs(dev, sensor, ®s, session);
|
gl847_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
||||||
|
@ -2343,7 +2330,7 @@ void CommandSetGl847::coarse_gain_calibration(Genesys_Device* dev, const Genesys
|
||||||
SCAN_FLAG_DISABLE_GAMMA |
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
SCAN_FLAG_SINGLE_LINE |
|
SCAN_FLAG_SINGLE_LINE |
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
SCAN_FLAG_IGNORE_LINE_DISTANCE;
|
||||||
gl847_compute_session(dev, session, sensor);
|
compute_session(dev, session, sensor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gl847_init_scan_regs(dev, sensor, ®s, session);
|
gl847_init_scan_regs(dev, sensor, ®s, session);
|
||||||
|
|
|
@ -1554,8 +1554,26 @@ void compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.max_color_shift_lines = sanei_genesys_compute_max_shift(dev, s.params.channels,
|
s.color_shift_lines_r = dev->model->ld_shift_r;
|
||||||
s.params.yres, s.params.flags);
|
s.color_shift_lines_g = dev->model->ld_shift_g;
|
||||||
|
s.color_shift_lines_b = dev->model->ld_shift_b;
|
||||||
|
|
||||||
|
if (dev->model->motor_id == MotorId::G4050 && s.params.yres > 600) {
|
||||||
|
// it seems base_dpi of the G4050 motor is changed above 600 dpi
|
||||||
|
s.color_shift_lines_r = (s.color_shift_lines_r * 3800) / dev->motor.base_ydpi;
|
||||||
|
s.color_shift_lines_g = (s.color_shift_lines_g * 3800) / dev->motor.base_ydpi;
|
||||||
|
s.color_shift_lines_b = (s.color_shift_lines_b * 3800) / dev->motor.base_ydpi;
|
||||||
|
}
|
||||||
|
|
||||||
|
s.color_shift_lines_r = (s.color_shift_lines_r * s.params.yres) / dev->motor.base_ydpi;
|
||||||
|
s.color_shift_lines_g = (s.color_shift_lines_g * s.params.yres) / dev->motor.base_ydpi;
|
||||||
|
s.color_shift_lines_b = (s.color_shift_lines_b * s.params.yres) / dev->motor.base_ydpi;
|
||||||
|
|
||||||
|
s.max_color_shift_lines = 0;
|
||||||
|
if (s.params.channels > 1 && !(s.params.flags & SCAN_FLAG_IGNORE_LINE_DISTANCE)) {
|
||||||
|
s.max_color_shift_lines = std::max(s.color_shift_lines_r, std::max(s.color_shift_lines_g,
|
||||||
|
s.color_shift_lines_b));
|
||||||
|
}
|
||||||
|
|
||||||
s.output_line_count = s.params.lines + s.max_color_shift_lines + s.num_staggered_lines;
|
s.output_line_count = s.params.lines + s.max_color_shift_lines + s.num_staggered_lines;
|
||||||
|
|
||||||
|
@ -1653,6 +1671,27 @@ void compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor&
|
||||||
compute_session_buffer_sizes(dev->model->asic_type, s);
|
compute_session_buffer_sizes(dev->model->asic_type, s);
|
||||||
compute_session_pipeline(dev, s);
|
compute_session_pipeline(dev, s);
|
||||||
compute_session_pixel_offsets(dev, s, sensor, sensor_profile);
|
compute_session_pixel_offsets(dev, s, sensor, sensor_profile);
|
||||||
|
|
||||||
|
if (dev->model->asic_type == AsicType::GL124 ||
|
||||||
|
dev->model->asic_type == AsicType::GL845 ||
|
||||||
|
dev->model->asic_type == AsicType::GL846)
|
||||||
|
{
|
||||||
|
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev->model->asic_type == AsicType::GL841 ||
|
||||||
|
dev->model->asic_type == AsicType::GL843)
|
||||||
|
{
|
||||||
|
// no 16 bit gamma for this ASIC
|
||||||
|
if (s.params.depth == 16) {
|
||||||
|
s.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
s.computed = true;
|
||||||
|
|
||||||
|
DBG(DBG_info, "%s ", __func__);
|
||||||
|
debug_dump(DBG_info, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::size_t get_usb_buffer_read_size(AsicType asic, const ScanSession& session)
|
static std::size_t get_usb_buffer_read_size(AsicType asic, const ScanSession& session)
|
||||||
|
@ -1779,10 +1818,10 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session.max_color_shift_lines > 0 && session.params.channels == 3) {
|
if (session.max_color_shift_lines > 0 && session.params.channels == 3) {
|
||||||
std::size_t shift_r = (dev->ld_shift_r * session.params.yres) / dev->motor.base_ydpi;
|
dev->pipeline.push_node<ImagePipelineNodeComponentShiftLines>(
|
||||||
std::size_t shift_g = (dev->ld_shift_g * session.params.yres) / dev->motor.base_ydpi;
|
session.color_shift_lines_r,
|
||||||
std::size_t shift_b = (dev->ld_shift_b * session.params.yres) / dev->motor.base_ydpi;
|
session.color_shift_lines_g,
|
||||||
dev->pipeline.push_node<ImagePipelineNodeComponentShiftLines>(shift_r, shift_g, shift_b);
|
session.color_shift_lines_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBG_LEVEL >= DBG_io2) {
|
if (DBG_LEVEL >= DBG_io2) {
|
||||||
|
@ -2346,39 +2385,6 @@ bool sanei_genesys_is_compatible_calibration(Genesys_Device * dev, const Genesys
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @brief compute maximum line distance shift
|
|
||||||
* compute maximum line distance shift for the motor and sensor
|
|
||||||
* combination. Line distance shift is the distance between different
|
|
||||||
* color component of CCD sensors. Since these components aren't at
|
|
||||||
* the same physical place, they scan diffrent lines. Software must
|
|
||||||
* take this into account to accurately mix color data.
|
|
||||||
* @param dev device session to compute max_shift for
|
|
||||||
* @param channels number of color channels for the scan
|
|
||||||
* @param yres motor resolution used for the scan
|
|
||||||
* @param flags scan flags
|
|
||||||
* @return 0 or line distance shift
|
|
||||||
*/
|
|
||||||
int sanei_genesys_compute_max_shift(Genesys_Device *dev,
|
|
||||||
int channels,
|
|
||||||
int yres,
|
|
||||||
int flags)
|
|
||||||
{
|
|
||||||
int max_shift;
|
|
||||||
|
|
||||||
max_shift=0;
|
|
||||||
if (channels > 1 && !(flags & SCAN_FLAG_IGNORE_LINE_DISTANCE))
|
|
||||||
{
|
|
||||||
max_shift = dev->ld_shift_r;
|
|
||||||
if (dev->ld_shift_b > max_shift)
|
|
||||||
max_shift = dev->ld_shift_b;
|
|
||||||
if (dev->ld_shift_g > max_shift)
|
|
||||||
max_shift = dev->ld_shift_g;
|
|
||||||
max_shift = (max_shift * yres) / dev->motor.base_ydpi;
|
|
||||||
}
|
|
||||||
return max_shift;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief build lookup table for digital enhancements
|
/** @brief build lookup table for digital enhancements
|
||||||
* Function to build a lookup table (LUT), often
|
* Function to build a lookup table (LUT), often
|
||||||
used by scanners to implement brightness/contrast/gamma
|
used by scanners to implement brightness/contrast/gamma
|
||||||
|
|
|
@ -493,24 +493,6 @@ sanei_genesys_is_compatible_calibration (Genesys_Device * dev, const Genesys_Sen
|
||||||
Genesys_Calibration_Cache * cache,
|
Genesys_Calibration_Cache * cache,
|
||||||
int for_overwrite);
|
int for_overwrite);
|
||||||
|
|
||||||
/** @brief compute maximum line distance shift
|
|
||||||
* compute maximum line distance shift for the motor and sensor
|
|
||||||
* combination. Line distance shift is the distance between different
|
|
||||||
* color component of CCD sensors. Since these components aren't at
|
|
||||||
* the same physical place, they scan diffrent lines. Software must
|
|
||||||
* take this into account to accurately mix color data.
|
|
||||||
* @param dev device session to compute max_shift for
|
|
||||||
* @param channels number of color channels for the scan
|
|
||||||
* @param yres motor resolution used for the scan
|
|
||||||
* @param flags scan flags
|
|
||||||
* @return 0 or line distance shift
|
|
||||||
*/
|
|
||||||
extern
|
|
||||||
int sanei_genesys_compute_max_shift(Genesys_Device *dev,
|
|
||||||
int channels,
|
|
||||||
int yres,
|
|
||||||
int flags);
|
|
||||||
|
|
||||||
extern void sanei_genesys_load_lut(unsigned char* lut,
|
extern void sanei_genesys_load_lut(unsigned char* lut,
|
||||||
int in_bits, int out_bits,
|
int in_bits, int out_bits,
|
||||||
int out_min, int out_max,
|
int out_min, int out_max,
|
||||||
|
|
|
@ -203,8 +203,7 @@ void serialize(Stream& str, SetupParams& x)
|
||||||
struct ScanSession {
|
struct ScanSession {
|
||||||
SetupParams params;
|
SetupParams params;
|
||||||
|
|
||||||
// whether the session setup has been computed via gl*_compute_session()
|
// whether the session setup has been computed via compute_session()
|
||||||
// gl843-only
|
|
||||||
bool computed = false;
|
bool computed = false;
|
||||||
|
|
||||||
// specifies the reduction (if any) of hardware dpi on the Genesys chip side.
|
// specifies the reduction (if any) of hardware dpi on the Genesys chip side.
|
||||||
|
@ -260,9 +259,16 @@ struct ScanSession {
|
||||||
unsigned num_staggered_lines = 0;
|
unsigned num_staggered_lines = 0;
|
||||||
|
|
||||||
// the number of lines that color channels shift due to different physical positions of
|
// the number of lines that color channels shift due to different physical positions of
|
||||||
// different color channels
|
// different color channels.
|
||||||
unsigned max_color_shift_lines = 0;
|
unsigned max_color_shift_lines = 0;
|
||||||
|
|
||||||
|
// actual line shift of the red color
|
||||||
|
unsigned color_shift_lines_r = 0;
|
||||||
|
// actual line shift of the green color
|
||||||
|
unsigned color_shift_lines_g = 0;
|
||||||
|
// actual line shift of the blue color
|
||||||
|
unsigned color_shift_lines_b = 0;
|
||||||
|
|
||||||
// the number of scanner segments used in the current scan
|
// the number of scanner segments used in the current scan
|
||||||
unsigned segment_count = 1;
|
unsigned segment_count = 1;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue