genesys: Use correct sensor for calibration on gl846

merge-requests/213/head
Povilas Kanapickas 2019-12-08 11:42:23 +02:00
rodzic 4dfa7d25a3
commit 6c8c4bb74f
1 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -1011,11 +1011,18 @@ void CommandSetGl846::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
regs = dev->reg;
dev->calib_resolution = sensor.get_register_hwdpi(dev->settings.xres);
const auto& calib_sensor = sanei_genesys_find_sensor(dev, dev->calib_resolution,
dev->calib_channels,
dev->settings.scan_method);
dev->calib_total_bytes_to_read = 0;
dev->calib_lines = dev->model->shading_lines;
if(dev->calib_resolution==4800)
dev->calib_lines *= 2;
dev->calib_pixels = (sensor.sensor_pixels*dev->calib_resolution)/sensor.optical_res;
if (dev->calib_resolution==4800) {
dev->calib_lines *= 2;
}
dev->calib_pixels = (calib_sensor.sensor_pixels * dev->calib_resolution) /
calib_sensor.optical_res;
DBG(DBG_io, "%s: calib_lines = %zu\n", __func__, dev->calib_lines);
DBG(DBG_io, "%s: calib_pixels = %zu\n", __func__, dev->calib_pixels);
@ -1043,9 +1050,9 @@ void CommandSetGl846::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
ScanFlag::DISABLE_GAMMA |
ScanFlag::DISABLE_BUFFER_FULL_MOVE |
ScanFlag::IGNORE_LINE_DISTANCE;
compute_session(dev, session, sensor);
compute_session(dev, session, calib_sensor);
init_regs_for_scan_session(dev, sensor, &regs, session);
init_regs_for_scan_session(dev, calib_sensor, &regs, session);
dev->interface->write_registers(regs);