summaryrefslogtreecommitdiff
path: root/backend/genesys/gl124.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-07 06:56:10 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-07 06:56:10 +0100
commit43f33c72804e63306580755049c09d5a81ad83e3 (patch)
tree805caeb00a832ed96a331907987d4e6a2056a391 /backend/genesys/gl124.cpp
parent0f86c5490ea7c2218a4394bf4c21bf3f9267a47c (diff)
parent6427d36e269d8c14e6bc55373102a4ebc971ca38 (diff)
Merge branch 'release/debian/1.1.1-1'debian/1.1.1-1
Diffstat (limited to 'backend/genesys/gl124.cpp')
-rw-r--r--backend/genesys/gl124.cpp46
1 files changed, 10 insertions, 36 deletions
diff --git a/backend/genesys/gl124.cpp b/backend/genesys/gl124.cpp
index ed733b8..1fa4d99 100644
--- a/backend/genesys/gl124.cpp
+++ b/backend/genesys/gl124.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
@@ -113,7 +92,7 @@ gl124_init_registers (Genesys_Device * dev)
dev->reg.init_reg(0x09, 0x00);
dev->reg.init_reg(0x0a, 0xc0);
dev->reg.init_reg(0x0b, 0x2a);
- dev->reg.init_reg(0x0c, 0x12);
+ dev->reg.init_reg(0x0c, 0x12); // SENSOR_DEF
dev->reg.init_reg(0x11, 0x00);
dev->reg.init_reg(0x12, 0x00);
dev->reg.init_reg(0x13, 0x0f);
@@ -453,7 +432,6 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
ScanFlag flags)
{
DBG_HELPER(dbg);
- int use_fast_fed;
unsigned int lincnt, fast_dpi;
unsigned int feedl,dist;
uint32_t z1, z2;
@@ -467,9 +445,6 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
feed_steps, static_cast<unsigned>(scan_mode),
static_cast<unsigned>(flags));
- /* we never use fast fed since we do manual feed for the scans */
- use_fast_fed=0;
-
/* enforce motor minimal scan speed
* @TODO extend motor struct for this value */
if (scan_mode == ScanColorMode::COLOR_SINGLE_PASS)
@@ -516,12 +491,6 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
/* compute register 02 value */
uint8_t r02 = REG_0x02_NOTHOME;
- if (use_fast_fed) {
- r02 |= REG_0x02_FASTFED;
- } else {
- r02 &= ~REG_0x02_FASTFED;
- }
-
if (has_flag(flags, ScanFlag::AUTO_GO_HOME)) {
r02 |= REG_0x02_AGOHOME;
}
@@ -573,9 +542,6 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
if (has_flag(flags, ScanFlag::FEEDING)) {
dist *= 2;
}
- if (use_fast_fed) {
- dist += fast_table.table.size() * 2;
- }
/* get sure we don't use insane value */
if (dist < feedl) {
@@ -587,7 +553,7 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
reg->set24(REG_FEEDL, feedl);
/* doesn't seem to matter that much */
- sanei_genesys_calculate_zmod(use_fast_fed,
+ sanei_genesys_calculate_zmod(false,
scan_exposure_time,
scan_table.table,
scan_table.table.size(),
@@ -815,6 +781,8 @@ ScanSession CommandSetGl124::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 = dev->settings.contrast;
+ session.params.brightness_adjustment = dev->settings.brightness;
session.params.flags = ScanFlag::NONE;
compute_session(dev, session, sensor);
@@ -983,6 +951,8 @@ void CommandSetGl124::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 = ColorFilter::RED;
+ session.params.contrast_adjustment = dev->settings.contrast;
+ session.params.brightness_adjustment = dev->settings.brightness;
session.params.flags = ScanFlag::DISABLE_SHADING |
ScanFlag::DISABLE_GAMMA |
ScanFlag::DISABLE_BUFFER_FULL_MOVE;
@@ -1116,6 +1086,8 @@ void move_to_calibration_area(Genesys_Device* dev, const Genesys_Sensor& sensor,
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 = ScanFlag::DISABLE_SHADING |
ScanFlag::DISABLE_GAMMA |
ScanFlag::SINGLE_LINE |
@@ -1202,6 +1174,8 @@ void CommandSetGl124::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
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, sensor);