kopia lustrzana https://gitlab.com/sane-project/backends
working 4800 dpi scans
rodzic
9f9a157801
commit
a7652acdcc
|
@ -5079,13 +5079,7 @@ genesys_fill_read_buffer (Genesys_Device * dev)
|
||||||
else if (dev->segnb>1)
|
else if (dev->segnb>1)
|
||||||
{
|
{
|
||||||
/* multi-segment sensors processing */
|
/* multi-segment sensors processing */
|
||||||
/*
|
status = genesys_fill_segmented_buffer (dev, work_buffer_dst, size);
|
||||||
if (!(dev->model->flags & GENESYS_FLAG_SIS_SENSOR)) */
|
|
||||||
status = genesys_fill_segmented_buffer (dev, work_buffer_dst, size);
|
|
||||||
/*
|
|
||||||
else
|
|
||||||
status = genesys_fill_oe_buffer (dev, work_buffer_dst, size);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else /* regular case with no extra copy */
|
else /* regular case with no extra copy */
|
||||||
{
|
{
|
||||||
|
@ -5743,11 +5737,14 @@ calc_parameters (Genesys_Scanner * s)
|
||||||
|| s->dev->model->asic_type == GENESYS_GL124
|
|| s->dev->model->asic_type == GENESYS_GL124
|
||||||
|| s->dev->model->asic_type == GENESYS_GL843)
|
|| s->dev->model->asic_type == GENESYS_GL843)
|
||||||
{
|
{
|
||||||
s->params.pixels_per_line = (s->params.pixels_per_line/4)*4;
|
if (s->dev->settings.xres <= 1200)
|
||||||
|
s->params.pixels_per_line = (s->params.pixels_per_line/4)*4;
|
||||||
|
else
|
||||||
|
s->params.pixels_per_line = (s->params.pixels_per_line/16)*16;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* corner case for true lineart for sensor with several segments
|
/* corner case for true lineart for sensor with several segments
|
||||||
* or when xres is doubled to mathc yres */
|
* or when xres is doubled to match yres */
|
||||||
if (s->dev->settings.xres >= 1200
|
if (s->dev->settings.xres >= 1200
|
||||||
&& ( s->dev->model->asic_type == GENESYS_GL124
|
&& ( s->dev->model->asic_type == GENESYS_GL124
|
||||||
|| s->dev->current_setup.xres < s->dev->current_setup.yres
|
|| s->dev->current_setup.xres < s->dev->current_setup.yres
|
||||||
|
|
|
@ -2356,7 +2356,6 @@ gl124_feed (Genesys_Device * dev, unsigned int steps)
|
||||||
memset (local_reg, 0, sizeof (local_reg));
|
memset (local_reg, 0, sizeof (local_reg));
|
||||||
memcpy (local_reg, dev->reg, GENESYS_GL124_MAX_REGS * sizeof (Genesys_Register_Set));
|
memcpy (local_reg, dev->reg, GENESYS_GL124_MAX_REGS * sizeof (Genesys_Register_Set));
|
||||||
|
|
||||||
|
|
||||||
resolution=MOVE_DPI;
|
resolution=MOVE_DPI;
|
||||||
gl124_init_scan_regs (dev,
|
gl124_init_scan_regs (dev,
|
||||||
local_reg,
|
local_reg,
|
||||||
|
|
|
@ -2409,6 +2409,83 @@ gl847_init_regs_for_shading (Genesys_Device * dev)
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief moves the slider to steps at motor base dpi
|
||||||
|
* @param dev device to work on
|
||||||
|
* @param steps number of steps to move
|
||||||
|
* */
|
||||||
|
#ifndef UNIT_TESTING
|
||||||
|
static
|
||||||
|
#endif
|
||||||
|
SANE_Status
|
||||||
|
gl847_feed (Genesys_Device * dev, unsigned int steps)
|
||||||
|
{
|
||||||
|
Genesys_Register_Set local_reg[GENESYS_GL847_MAX_REGS];
|
||||||
|
SANE_Status status;
|
||||||
|
Genesys_Register_Set *r;
|
||||||
|
float resolution;
|
||||||
|
uint8_t val;
|
||||||
|
|
||||||
|
DBGSTART;
|
||||||
|
|
||||||
|
/* prepare local registers */
|
||||||
|
memset (local_reg, 0, sizeof (local_reg));
|
||||||
|
memcpy (local_reg, dev->reg, GENESYS_GL847_MAX_REGS * sizeof (Genesys_Register_Set));
|
||||||
|
|
||||||
|
resolution=300;
|
||||||
|
gl847_init_scan_regs (dev,
|
||||||
|
local_reg,
|
||||||
|
resolution,
|
||||||
|
resolution,
|
||||||
|
0,
|
||||||
|
steps,
|
||||||
|
100,
|
||||||
|
3,
|
||||||
|
8,
|
||||||
|
3,
|
||||||
|
dev->settings.color_filter,
|
||||||
|
SCAN_FLAG_DISABLE_SHADING |
|
||||||
|
SCAN_FLAG_DISABLE_GAMMA |
|
||||||
|
SCAN_FLAG_FEEDING |
|
||||||
|
SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE |
|
||||||
|
SCAN_FLAG_IGNORE_LINE_DISTANCE);
|
||||||
|
sanei_genesys_set_triple(local_reg,REG_EXPR,0);
|
||||||
|
sanei_genesys_set_triple(local_reg,REG_EXPG,0);
|
||||||
|
sanei_genesys_set_triple(local_reg,REG_EXPB,0);
|
||||||
|
|
||||||
|
/* clear scan and feed count */
|
||||||
|
RIE (sanei_genesys_write_register (dev, REG0D, REG0D_CLRLNCNT));
|
||||||
|
RIE (sanei_genesys_write_register (dev, REG0D, REG0D_CLRMCNT));
|
||||||
|
|
||||||
|
/* set up for no scan */
|
||||||
|
r = sanei_genesys_get_address (local_reg, REG01);
|
||||||
|
r->value &= ~REG01_SCAN;
|
||||||
|
|
||||||
|
/* send registers */
|
||||||
|
RIE (gl847_bulk_write_register (dev, local_reg, GENESYS_GL847_MAX_REGS));
|
||||||
|
|
||||||
|
status = gl847_start_action (dev);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: failed to start motor: %s\n", __FUNCTION__, sane_strstatus (status));
|
||||||
|
gl847_stop_action (dev);
|
||||||
|
|
||||||
|
/* restore original registers */
|
||||||
|
gl847_bulk_write_register (dev, dev->reg, GENESYS_GL847_MAX_REGS);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wait until feed count reaches the required value, but do not
|
||||||
|
* exceed 30s */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = sanei_genesys_get_status (dev, &val);
|
||||||
|
}
|
||||||
|
while (status == SANE_STATUS_GOOD && !(val & FEEDFSH));
|
||||||
|
|
||||||
|
DBGCOMPLETED;
|
||||||
|
return SANE_STATUS_GOOD;
|
||||||
|
}
|
||||||
|
|
||||||
/** @brief set up registers for the actual scan
|
/** @brief set up registers for the actual scan
|
||||||
*/
|
*/
|
||||||
static SANE_Status
|
static SANE_Status
|
||||||
|
@ -2470,6 +2547,18 @@ gl847_init_regs_for_scan (Genesys_Device * dev)
|
||||||
move = (move * move_dpi) / MM_PER_INCH;
|
move = (move * move_dpi) / MM_PER_INCH;
|
||||||
DBG (DBG_info, "gl847_init_regs_for_scan: move=%f steps\n", move);
|
DBG (DBG_info, "gl847_init_regs_for_scan: move=%f steps\n", move);
|
||||||
|
|
||||||
|
/* at high res we do fast move to scan area */
|
||||||
|
if(dev->settings.xres>1200)
|
||||||
|
{
|
||||||
|
status = gl847_feed (dev, move);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: failed to move to scan area\n",__FUNCTION__);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
move=0;
|
||||||
|
}
|
||||||
|
|
||||||
/* clear scancnt and fedcnt */
|
/* clear scancnt and fedcnt */
|
||||||
val = REG0D_CLRLNCNT;
|
val = REG0D_CLRLNCNT;
|
||||||
RIE (sanei_genesys_write_register (dev, REG0D, val));
|
RIE (sanei_genesys_write_register (dev, REG0D, val));
|
||||||
|
|
Ładowanie…
Reference in New Issue