diff options
Diffstat (limited to 'backend/genesys/gl847.cpp')
-rw-r--r-- | backend/genesys/gl847.cpp | 59 |
1 files changed, 11 insertions, 48 deletions
diff --git a/backend/genesys/gl847.cpp b/backend/genesys/gl847.cpp index 91ac4eb..13f9dd9 100644 --- a/backend/genesys/gl847.cpp +++ b/backend/genesys/gl847.cpp @@ -17,27 +17,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. - - As a special exception, the authors of SANE give permission for - additional uses of the libraries contained in this release of SANE. - - The exception is that, if you link a SANE library with other files - to produce an executable, this does not by itself cause the - resulting executable to be covered by the GNU General Public - License. Your use of that executable is in no way restricted on - account of linking the SANE library code into it. - - This exception does not, however, invalidate any other reasons why - the executable file might be covered by the GNU General Public - License. - - If you submit changes to SANE to the maintainers to be included in - a subsequent release, you agree by submitting the changes that - those changes may be distributed with this exception intact. - - If you write modifications of your own for SANE, it is your choice - whether to permit this exception to apply to your modifications. - If you do not wish that, delete this exception notice. */ #define DEBUG_DECLARE_ONLY @@ -338,25 +317,13 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev, unsigned step_multiplier = gl847_get_step_multiplier (reg); - bool use_fast_fed = false; - if (dev->settings.yres == 4444 && feed_steps > 100 && !has_flag(flags, ScanFlag::FEEDING)) { - use_fast_fed = true; - } - if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) { - use_fast_fed = false; - } - reg->set24(REG_LINCNT, scan_lines); reg->set8(REG_0x02, 0); sanei_genesys_set_motor_power(*reg, true); std::uint8_t reg02 = reg->get8(REG_0x02); - if (use_fast_fed) { - reg02 |= REG_0x02_FASTFED; - } else { - reg02 &= ~REG_0x02_FASTFED; - } + reg02 &= ~REG_0x02_FASTFED; if (has_flag(flags, ScanFlag::AUTO_GO_HOME)) { reg02 |= REG_0x02_AGOHOME | REG_0x02_NOTHOME; @@ -402,19 +369,11 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev, // correct move distance by acceleration and deceleration amounts unsigned feedl = feed_steps; unsigned dist = 0; - if (use_fast_fed) - { - feedl <<= static_cast<unsigned>(fast_step_type); - dist = (scan_table.table.size() + 2 * fast_table.table.size()); - // TODO read and decode REG_0xAB - dist += (reg->get8(0x5e) & 31); - dist += reg->get8(REG_FEDCNT); - } else { - feedl <<= static_cast<unsigned>(motor_profile.step_type); - dist = scan_table.table.size(); - if (has_flag(flags, ScanFlag::FEEDING)) { - dist *= 2; - } + + feedl <<= static_cast<unsigned>(motor_profile.step_type); + dist = scan_table.table.size(); + if (has_flag(flags, ScanFlag::FEEDING)) { + dist *= 2; } // check for overflow @@ -456,7 +415,7 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev, reg->set8(REG_BWDSTEP, min_restep); std::uint32_t z1, z2; - sanei_genesys_calculate_zmod(use_fast_fed, + sanei_genesys_calculate_zmod(false, scan_exposure_time * ccdlmt * tgtime, scan_table.table, scan_table.table.size(), @@ -735,6 +694,8 @@ ScanSession CommandSetGl847::calculate_scan_session(const Genesys_Device* dev, session.params.scan_method = settings.scan_method; session.params.scan_mode = settings.scan_mode; session.params.color_filter = settings.color_filter; + session.params.contrast_adjustment = settings.contrast; + session.params.brightness_adjustment = settings.brightness; session.params.flags = flags; compute_session(dev, session, sensor); @@ -900,6 +861,8 @@ void CommandSetGl847::init_regs_for_shading(Genesys_Device* dev, const Genesys_S session.params.scan_method = dev->settings.scan_method; session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS; session.params.color_filter = dev->settings.color_filter; + session.params.contrast_adjustment = dev->settings.contrast; + session.params.brightness_adjustment = dev->settings.brightness; session.params.flags = flags; compute_session(dev, session, calib_sensor); |