diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 08:20:20 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-09-27 08:20:20 +0200 |
commit | e94622c319e4307617b202f19d3ec05b21a9bb49 (patch) | |
tree | c5ddf44352b9bd47aeb3eb432ba79638079efe25 /backend/genesys_gl841.c | |
parent | 6f2255c9648b175d51e2c8e5e9670557f9dc4ee1 (diff) |
merge to 1.0.25+git20150927
Diffstat (limited to 'backend/genesys_gl841.c')
-rw-r--r-- | backend/genesys_gl841.c | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/backend/genesys_gl841.c b/backend/genesys_gl841.c index 318def8..2b16c67 100644 --- a/backend/genesys_gl841.c +++ b/backend/genesys_gl841.c @@ -2381,56 +2381,60 @@ gl841_init_optical_regs_scan(Genesys_Device * dev, /* AFEMOD should depend on FESET, and we should set these * bits separately */ r->value &= ~(REG04_FILTER | REG04_AFEMOD); - if (channels == 1) + if (flags & OPTICAL_FLAG_ENABLE_LEDADD) + { + r->value |= 0x10; /* no filter */ + } + else if (channels == 1) { switch (color_filter) - { - case 0: - r->value |= 0x14; /* red filter */ - break; - case 1: - r->value |= 0x18; /* green filter */ - break; - case 2: - r->value |= 0x1c; /* blue filter */ - break; - default: - r->value |= 0x10; /* no filter */ - break; - } - } - else - { + { + case 0: + r->value |= 0x14; /* red filter */ + break; + case 1: + r->value |= 0x18; /* green filter */ + break; + case 2: + r->value |= 0x1c; /* blue filter */ + break; + default: + r->value |= 0x10; /* no filter */ + break; + } + } + else + { if (dev->model->ccd_type == CCD_PLUSTEK_3600) { r->value |= 0x22; /* slow color pixel by pixel */ } - else + else { r->value |= 0x10; /* color pixel by pixel */ } - } - + } + /* CIS scanners can do true gray by setting LEDADD */ r = sanei_genesys_get_address (reg, 0x87); r->value &= ~REG87_LEDADD; if (flags & OPTICAL_FLAG_ENABLE_LEDADD) { r->value |= REG87_LEDADD; - sanei_genesys_get_double(reg,REG_EXPR,&expr); - sanei_genesys_get_double(reg,REG_EXPG,&expg); - sanei_genesys_get_double(reg,REG_EXPG,&expb); - - /* use minimal expousre for best image quality */ - expavg=expg; - if(expr<expg) - expavg=expr; - if(expb<expavg) - expavg=expb; - - sanei_genesys_set_double(dev->reg,REG_EXPR,expavg); - sanei_genesys_set_double(dev->reg,REG_EXPG,expavg); - sanei_genesys_set_double(dev->reg,REG_EXPB,expavg); + sanei_genesys_get_double (reg, REG_EXPR, &expr); + sanei_genesys_get_double (reg, REG_EXPG, &expg); + sanei_genesys_get_double (reg, REG_EXPB, &expb); + + /* use minimal exposure for best image quality */ + expavg = expg; + if (expr < expg) + expavg = expr; + if (expb < expavg) + expavg = expb; + + sanei_genesys_set_double (dev->reg, REG_EXPR, expavg); + sanei_genesys_set_double (dev->reg, REG_EXPG, expavg); + sanei_genesys_set_double (dev->reg, REG_EXPB, expavg); } /* enable gamma tables */ @@ -2451,7 +2455,7 @@ gl841_init_optical_regs_scan(Genesys_Device * dev, sanei_genesys_set_double(reg, REG_ENDPIXEL, end); DBG( DBG_io2, "%s: STRPIXEL=%d, ENDPIXEL=%d\n",__FUNCTION__,start,end); -/* words(16bit) before gamma, conversion to 8 bit or lineart*/ + /* words(16bit) before gamma, conversion to 8 bit or lineart*/ words_per_line = (pixels * dpiset) / gl841_get_dpihw(dev); words_per_line *= channels; @@ -4487,6 +4491,7 @@ gl841_init_regs_for_scan (Genesys_Device * dev) if(dev->model->is_cis && dev->settings.true_gray && dev->settings.scan_mode != SCAN_MODE_COLOR) { + DBG (DBG_io, "%s: activating LEDADD\n", __FUNCTION__); flags |= SCAN_FLAG_ENABLE_LEDADD; } |