diff --git a/backend/genesys_gl124.cc b/backend/genesys_gl124.cc index 7ca4c4b94..f45ced677 100644 --- a/backend/genesys_gl124.cc +++ b/backend/genesys_gl124.cc @@ -989,6 +989,13 @@ static void gl124_compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor) { DBG_HELPER(dbg); + + /* in case of dynamic lineart, we use an internal 8 bit gray scan + * to generate 1 lineart data */ + if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { + s.params.depth = 8; + } + compute_session(dev, s, sensor); s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray); @@ -1003,7 +1010,7 @@ static void gl124_compute_session(Genesys_Device* dev, ScanSession& s, * this function sets up the scanner to scan in normal or single line mode */ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor, - Genesys_Register_Set* reg, ScanSession& session) + Genesys_Register_Set* reg, const ScanSession& session) { DBG_HELPER(dbg); session.assert_computed(); @@ -1040,13 +1047,6 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time); DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type); - /*** optical parameters ***/ - /* in case of dynamic lineart, we use an internal 8 bit gray scan - * to generate 1 lineart data */ - if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { - session.params.depth = 8; - } - /* we enable true gray for cis scanners only, and just when doing * scan since color calibration is OK for this mode */ diff --git a/backend/genesys_gl646.cc b/backend/genesys_gl646.cc index 0bf09a452..ba5cc82ba 100644 --- a/backend/genesys_gl646.cc +++ b/backend/genesys_gl646.cc @@ -317,7 +317,7 @@ static void gl646_compute_session(Genesys_Device* dev, ScanSession& s, static void gl646_setup_registers(Genesys_Device* dev, const Genesys_Sensor& sensor, Genesys_Register_Set* regs, - ScanSession& session, + const ScanSession& session, std::vector& slope_table1, std::vector& slope_table2, bool xcorrection) diff --git a/backend/genesys_gl841.cc b/backend/genesys_gl841.cc index b2973f4be..3842f51a0 100644 --- a/backend/genesys_gl841.cc +++ b/backend/genesys_gl841.cc @@ -1700,6 +1700,17 @@ static void gl841_compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor) { DBG_HELPER(dbg); + + //in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data + if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { + s.params.depth = 8; + } + + // 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; @@ -1722,7 +1733,7 @@ static void gl841_assert_supported_resolution(const ScanSession& session) // set up registers for an actual scan this function sets up the scanner to scan in normal or single // line mode static void gl841_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor, - Genesys_Register_Set* reg, ScanSession& session) + Genesys_Register_Set* reg, const ScanSession& session) { DBG_HELPER(dbg); session.assert_computed(); @@ -1835,18 +1846,6 @@ dummy \ scanned lines session.optical_pixels); DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time); - /*** optical parameters ***/ - /* in case of dynamic lineart, we use an internal 8 bit gray scan - * to generate 1 lineart data */ - if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { - session.params.depth = 8; - } - - // no 16 bit gamma for this ASIC - if (session.params.depth == 16) { - session.params.flags |= SCAN_FLAG_DISABLE_GAMMA; - } - gl841_init_optical_regs_scan(dev, sensor, reg, exposure_time, session, start); move = session.params.starty; diff --git a/backend/genesys_gl843.cc b/backend/genesys_gl843.cc index f43394185..8cb63d888 100644 --- a/backend/genesys_gl843.cc +++ b/backend/genesys_gl843.cc @@ -1182,6 +1182,16 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens static void gl843_compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor) { + // in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data + if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { + s.params.depth = 8; + } + + // no 16 bit gamma for this ASIC + if (s.params.depth == 16) { + s.params.flags |= SCAN_FLAG_DISABLE_GAMMA; + } + compute_session(dev, s, sensor); // compute physical pixel positions @@ -1207,7 +1217,7 @@ static void gl843_compute_session(Genesys_Device* dev, ScanSession& s, // set up registers for an actual scan this function sets up the scanner to scan in normal or single // line mode static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor, - Genesys_Register_Set* reg, ScanSession& session) + Genesys_Register_Set* reg, const ScanSession& session) { DBG_HELPER(dbg); session.assert_computed(); @@ -1247,18 +1257,6 @@ static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens DBG(DBG_info, "%s : exposure=%d pixels\n", __func__, exposure); DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type); - /*** optical parameters ***/ - /* in case of dynamic lineart, we use an internal 8 bit gray scan - * to generate 1 lineart data */ - if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { - session.params.depth = 8; - } - - /* no 16 bit gamma for this ASIC */ - if (session.params.depth == 16) { - session.params.flags |= SCAN_FLAG_DISABLE_GAMMA; - } - // now _LOGICAL_ optical values used are known, setup registers gl843_init_optical_regs_scan(dev, sensor, reg, exposure, session); diff --git a/backend/genesys_gl846.cc b/backend/genesys_gl846.cc index 6d72a7343..f8a380915 100644 --- a/backend/genesys_gl846.cc +++ b/backend/genesys_gl846.cc @@ -875,6 +875,12 @@ static void gl846_compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor) { DBG_HELPER(dbg); + + // in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data + if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { + s.params.depth = 8; + } + compute_session(dev, s, sensor); s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray); @@ -888,7 +894,7 @@ static void gl846_compute_session(Genesys_Device* dev, ScanSession& s, // set up registers for an actual scan this function sets up the scanner to scan in normal or single // line mode static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor, - Genesys_Register_Set* reg, ScanSession& session) + Genesys_Register_Set* reg, const ScanSession& session) { DBG_HELPER(dbg); session.assert_computed(); @@ -922,13 +928,6 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time); DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type); -/*** optical parameters ***/ - /* in case of dynamic lineart, we use an internal 8 bit gray scan - * to generate 1 lineart data */ - if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { - session.params.depth = 8; - } - /* we enable true gray for cis scanners only, and just when doing * scan since color calibration is OK for this mode */ diff --git a/backend/genesys_gl847.cc b/backend/genesys_gl847.cc index 4cc1f6af9..f189255d2 100644 --- a/backend/genesys_gl847.cc +++ b/backend/genesys_gl847.cc @@ -891,6 +891,12 @@ static void gl847_compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor) { DBG_HELPER(dbg); + + // in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data + if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { + s.params.depth = 8; + } + compute_session(dev, s, sensor); s.computed = true; @@ -902,7 +908,7 @@ static void gl847_compute_session(Genesys_Device* dev, ScanSession& s, // set up registers for an actual scan this function sets up the scanner to scan in normal or single // line mode static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor, - Genesys_Register_Set* reg, ScanSession& session) + Genesys_Register_Set* reg, const ScanSession& session) { DBG_HELPER(dbg); session.assert_computed(); @@ -936,13 +942,6 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time); DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type); -/*** optical parameters ***/ - /* in case of dynamic lineart, we use an internal 8 bit gray scan - * to generate 1 lineart data */ - if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) { - session.params.depth = 8; - } - /* we enable true gray for cis scanners only, and just when doing * scan since color calibration is OK for this mode */