summaryrefslogtreecommitdiff
path: root/backend/genesys/gl846.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-01 15:25:04 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-01 15:25:04 +0100
commit8e5d399808d2270ae9d56c96560a021e594d18a4 (patch)
treecb83e4c8216cf0e8bcaa17a6f2cb64cf4d7f469a /backend/genesys/gl846.cpp
parent97e55bdc5cdf59304af739e65f416320bcbcf599 (diff)
parent302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff)
Update upstream source from tag 'upstream/1.1.1'
Update to upstream version '1.1.1' with Debian dir 4cb81ae9eaa2503b9c320ac1e8125f9df6e7f7b3
Diffstat (limited to 'backend/genesys/gl846.cpp')
-rw-r--r--backend/genesys/gl846.cpp58
1 files changed, 11 insertions, 47 deletions
diff --git a/backend/genesys/gl846.cpp b/backend/genesys/gl846.cpp
index c8907b2..b427376 100644
--- a/backend/genesys/gl846.cpp
+++ b/backend/genesys/gl846.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.
*/
/** @file
@@ -374,25 +353,13 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
unsigned step_multiplier = gl846_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;
@@ -446,18 +413,11 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
unsigned feedl = feed_steps;
unsigned dist = 0;
- if (use_fast_fed) {
- feedl <<= static_cast<unsigned>(fast_profile->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
@@ -513,7 +473,7 @@ static void gl846_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(),
@@ -759,6 +719,8 @@ ScanSession CommandSetGl846::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;
// backtracking isn't handled well, so don't enable it
session.params.flags = flags;
@@ -882,6 +844,8 @@ void CommandSetGl846::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);