kopia lustrzana https://gitlab.com/sane-project/backends
Make LEDADD work for LiDE 35 and 80
rodzic
5b66dd64c5
commit
60eba116f3
|
@ -2378,6 +2378,8 @@ gl841_init_optical_regs_scan(Genesys_Device * dev,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* AFEMOD should depend on FESET, and we should set these
|
||||||
|
* bits separately */
|
||||||
r->value &= ~(REG04_FILTER | REG04_AFEMOD);
|
r->value &= ~(REG04_FILTER | REG04_AFEMOD);
|
||||||
if (channels == 1)
|
if (channels == 1)
|
||||||
{
|
{
|
||||||
|
@ -2386,14 +2388,17 @@ gl841_init_optical_regs_scan(Genesys_Device * dev,
|
||||||
case 0:
|
case 0:
|
||||||
r->value |= 0x14; /* red filter */
|
r->value |= 0x14; /* red filter */
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
r->value |= 0x18; /* green filter */
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
r->value |= 0x1c; /* blue filter */
|
r->value |= 0x1c; /* blue filter */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
r->value |= 0x18; /* green filter */
|
r->value |= 0x10; /* no filter */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dev->model->ccd_type == CCD_PLUSTEK_3600)
|
if (dev->model->ccd_type == CCD_PLUSTEK_3600)
|
||||||
|
@ -2405,17 +2410,13 @@ gl841_init_optical_regs_scan(Genesys_Device * dev,
|
||||||
r->value |= 0x10; /* color pixel by pixel */
|
r->value |= 0x10; /* color pixel by pixel */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CIS scanners can do true gray by setting LEDADD */
|
/* CIS scanners can do true gray by setting LEDADD */
|
||||||
if (dev->model->is_cis == SANE_TRUE)
|
r = sanei_genesys_get_address (reg, 0x87);
|
||||||
|
r->value &= ~REG87_LEDADD;
|
||||||
|
if (flags & OPTICAL_FLAG_ENABLE_LEDADD)
|
||||||
{
|
{
|
||||||
r = sanei_genesys_get_address (reg, 0x87);
|
r->value |= REG87_LEDADD;
|
||||||
r->value &= ~REG87_LEDADD;
|
|
||||||
/* we set up LEDADD only when asked */
|
|
||||||
if (channels==1 && (flags & OPTICAL_FLAG_ENABLE_LEDADD))
|
|
||||||
{
|
|
||||||
r->value |= REG87_LEDADD;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable gamma tables */
|
/* enable gamma tables */
|
||||||
|
@ -2604,6 +2605,7 @@ gl841_init_scan_regs (Genesys_Device * dev,
|
||||||
SANE_Bool half_ccd; /* false: full CCD res is used, true, half max CCD res is used */
|
SANE_Bool half_ccd; /* false: full CCD res is used, true, half max CCD res is used */
|
||||||
int optical_res;
|
int optical_res;
|
||||||
SANE_Status status;
|
SANE_Status status;
|
||||||
|
unsigned int oflags; /**> optical flags */
|
||||||
|
|
||||||
DBG (DBG_info,
|
DBG (DBG_info,
|
||||||
"gl841_init_scan_regs settings:\n"
|
"gl841_init_scan_regs settings:\n"
|
||||||
|
@ -2776,15 +2778,31 @@ dummy \ scanned lines
|
||||||
&scan_power_mode);
|
&scan_power_mode);
|
||||||
DBG (DBG_info, "%s : exposure_time=%d pixels\n", __FUNCTION__, exposure_time);
|
DBG (DBG_info, "%s : exposure_time=%d pixels\n", __FUNCTION__, exposure_time);
|
||||||
|
|
||||||
/*** optical parameters ***/
|
/*** optical parameters ***/
|
||||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||||
* to generate 1 lineart data */
|
* to generate 1 lineart data */
|
||||||
if(flags & SCAN_FLAG_DYNAMIC_LINEART)
|
if(flags & SCAN_FLAG_DYNAMIC_LINEART)
|
||||||
{
|
{
|
||||||
depth=8;
|
depth=8;
|
||||||
}
|
}
|
||||||
if (depth == 16)
|
|
||||||
flags |= SCAN_FLAG_DISABLE_GAMMA;
|
oflags=0;
|
||||||
|
if (flags & SCAN_FLAG_DISABLE_SHADING)
|
||||||
|
{
|
||||||
|
oflags |= OPTICAL_FLAG_DISABLE_SHADING;
|
||||||
|
}
|
||||||
|
if ((flags & SCAN_FLAG_DISABLE_GAMMA) || (depth==16))
|
||||||
|
{
|
||||||
|
oflags |= OPTICAL_FLAG_DISABLE_GAMMA;
|
||||||
|
}
|
||||||
|
if (flags & SCAN_FLAG_DISABLE_LAMP)
|
||||||
|
{
|
||||||
|
oflags |= OPTICAL_FLAG_DISABLE_LAMP;
|
||||||
|
}
|
||||||
|
if (flags & SCAN_FLAG_ENABLE_LEDADD)
|
||||||
|
{
|
||||||
|
oflags |= OPTICAL_FLAG_ENABLE_LEDADD;
|
||||||
|
}
|
||||||
|
|
||||||
status = gl841_init_optical_regs_scan(dev,
|
status = gl841_init_optical_regs_scan(dev,
|
||||||
reg,
|
reg,
|
||||||
|
@ -2796,16 +2814,11 @@ dummy \ scanned lines
|
||||||
depth,
|
depth,
|
||||||
half_ccd,
|
half_ccd,
|
||||||
color_filter,
|
color_filter,
|
||||||
((flags & SCAN_FLAG_DISABLE_SHADING)?
|
oflags);
|
||||||
OPTICAL_FLAG_DISABLE_SHADING:0) |
|
|
||||||
((flags & SCAN_FLAG_DISABLE_GAMMA)?
|
|
||||||
OPTICAL_FLAG_DISABLE_GAMMA:0) |
|
|
||||||
((flags & SCAN_FLAG_DISABLE_LAMP)?
|
|
||||||
OPTICAL_FLAG_DISABLE_LAMP:0)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (status != SANE_STATUS_GOOD)
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/*** motor parameters ***/
|
/*** motor parameters ***/
|
||||||
|
|
||||||
|
@ -4456,13 +4469,13 @@ gl841_init_regs_for_scan (Genesys_Device * dev)
|
||||||
*/
|
*/
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
|
/* true gray (led add for cis scanners) */
|
||||||
if(dev->model->is_cis && dev->settings.true_gray
|
if(dev->model->is_cis && dev->settings.true_gray
|
||||||
&&dev->settings.scan_mode != SCAN_MODE_COLOR
|
&& dev->settings.scan_mode != SCAN_MODE_COLOR)
|
||||||
&&dev->model->ccd_type != CCD_CANONLIDE35
|
|
||||||
&&dev->model->ccd_type != CIS_CANONLIDE80)
|
|
||||||
{
|
{
|
||||||
flags |= OPTICAL_FLAG_ENABLE_LEDADD;
|
flags |= SCAN_FLAG_ENABLE_LEDADD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable emulated lineart from gray data */
|
/* enable emulated lineart from gray data */
|
||||||
if(dev->settings.scan_mode == SCAN_MODE_LINEART
|
if(dev->settings.scan_mode == SCAN_MODE_LINEART
|
||||||
&& dev->settings.dynamic_lineart)
|
&& dev->settings.dynamic_lineart)
|
||||||
|
|
|
@ -163,6 +163,9 @@
|
||||||
#define REG1E_LINESEL 0x0f
|
#define REG1E_LINESEL 0x0f
|
||||||
#define REG1ES_LINESEL 0
|
#define REG1ES_LINESEL 0
|
||||||
|
|
||||||
|
#define REG_EXPR 0x10
|
||||||
|
#define REG_EXPG 0x12
|
||||||
|
#define REG_EXPB 0x14
|
||||||
#define REG_STEPNO 0x21
|
#define REG_STEPNO 0x21
|
||||||
#define REG_FWDSTEP 0x22
|
#define REG_FWDSTEP 0x22
|
||||||
#define REG_BWDSTEP 0x23
|
#define REG_BWDSTEP 0x23
|
||||||
|
|
|
@ -859,7 +859,7 @@ typedef struct {
|
||||||
#define SCAN_FLAG_CALIBRATION 0x100
|
#define SCAN_FLAG_CALIBRATION 0x100
|
||||||
#define SCAN_FLAG_FEEDING 0x200
|
#define SCAN_FLAG_FEEDING 0x200
|
||||||
#define SCAN_FLAG_USE_XPA 0x400
|
#define SCAN_FLAG_USE_XPA 0x400
|
||||||
|
#define SCAN_FLAG_ENABLE_LEDADD 0x800
|
||||||
#define MOTOR_FLAG_AUTO_GO_HOME 0x01
|
#define MOTOR_FLAG_AUTO_GO_HOME 0x01
|
||||||
#define MOTOR_FLAG_DISABLE_BUFFER_FULL_MOVE 0x02
|
#define MOTOR_FLAG_DISABLE_BUFFER_FULL_MOVE 0x02
|
||||||
#define MOTOR_FLAG_FEED 0x04
|
#define MOTOR_FLAG_FEED 0x04
|
||||||
|
|
Ładowanie…
Reference in New Issue