kopia lustrzana https://gitlab.com/sane-project/backends
limit hardware lineart up to 600 dpi for gl847 scanners
- due to interleaving at bit level and uneven sub sensor length, hardware lineart is almost unworkable when resolution exceeds 600.merge-requests/1/head
rodzic
d89087c6c6
commit
fd47a2512c
|
@ -4544,7 +4544,7 @@ genesys_fill_segmented_buffer (Genesys_Device * dev, uint8_t *work_buffer_dst, s
|
|||
{
|
||||
work_buffer_dst[count+n] = 0;
|
||||
}
|
||||
/* interleaving is a bit level */
|
||||
/* interleaving is at bit level */
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
k=count+(i*dev->segnb)/8;
|
||||
|
@ -5288,8 +5288,9 @@ calc_parameters (Genesys_Scanner * s)
|
|||
/* corner case for true lineart for sensor with several segments
|
||||
* or when xres is doubled to match yres */
|
||||
if (s->dev->settings.xres >= 1200
|
||||
&& ( s->dev->model->asic_type == GENESYS_GL124
|
||||
|| s->dev->current_setup.xres < s->dev->current_setup.yres
|
||||
&& ( s->dev->model->asic_type == GENESYS_GL124
|
||||
|| s->dev->model->asic_type == GENESYS_GL847
|
||||
|| s->dev->current_setup.xres < s->dev->current_setup.yres
|
||||
)
|
||||
)
|
||||
{
|
||||
|
@ -5359,11 +5360,22 @@ calc_parameters (Genesys_Scanner * s)
|
|||
&&s->dev->settings.scan_mode == SCAN_MODE_LINEART)
|
||||
{
|
||||
s->dev->settings.dynamic_lineart = SANE_TRUE;
|
||||
/* threshold curve for dynamic ratserization */
|
||||
if(s->dev->settings.dynamic_lineart==SANE_TRUE)
|
||||
s->dev->settings.threshold_curve=s->val[OPT_THRESHOLD_CURVE].w;
|
||||
}
|
||||
|
||||
/* hardware lineart works only when we don't have interleave data
|
||||
* for GL847 scanners, ie up to 600 DPI, then we have to rely on
|
||||
* dynamic_lineart */
|
||||
if(s->dev->settings.xres > 600
|
||||
&& s->dev->model->asic_type==GENESYS_GL847
|
||||
&& s->dev->settings.scan_mode == SCAN_MODE_LINEART)
|
||||
{
|
||||
s->dev->settings.dynamic_lineart = SANE_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* threshold curve for dynamic rasterization */
|
||||
s->dev->settings.threshold_curve=s->val[OPT_THRESHOLD_CURVE].w;
|
||||
|
||||
/* some digital processing requires the whole picture to be buffered */
|
||||
/* no digital processing takes place when doing preview, or when bit depth is
|
||||
* higher than 8 bits */
|
||||
|
|
|
@ -1329,18 +1329,12 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
|
|||
}*/
|
||||
}
|
||||
|
||||
sanei_genesys_set_double(reg,REG_DPISET,dpiset);
|
||||
DBG (DBG_io2, "%s: dpiset used=%d\n", __FUNCTION__, dpiset);
|
||||
|
||||
sanei_genesys_set_double(reg,REG_STRPIXEL,startx);
|
||||
sanei_genesys_set_double(reg,REG_ENDPIXEL,endx);
|
||||
|
||||
/* words(16bit) before gamma, conversion to 8 bit or lineart*/
|
||||
words_per_line = (used_pixels * dpiset) / dpihw;
|
||||
bytes=depth/8;
|
||||
if (depth == 1)
|
||||
{
|
||||
words_per_line = (words_per_line >> 3) + ((words_per_line & 7) ? 1 : 0);
|
||||
words_per_line = (words_per_line+7)/8 ;
|
||||
dev->len = (dev->len >> 3) + ((dev->len & 7) ? 1 : 0);
|
||||
dev->dist = (dev->dist >> 3) + ((dev->dist & 7) ? 1 : 0);
|
||||
}
|
||||
|
@ -1356,6 +1350,14 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
|
|||
dev->segnb=segnb;
|
||||
dev->line_interp = 0;
|
||||
|
||||
sanei_genesys_set_double(reg,REG_DPISET,dpiset);
|
||||
DBG (DBG_io2, "%s: dpiset used=%d\n", __FUNCTION__, dpiset);
|
||||
|
||||
sanei_genesys_set_double(reg,REG_STRPIXEL,startx);
|
||||
sanei_genesys_set_double(reg,REG_ENDPIXEL,endx);
|
||||
DBG (DBG_io2, "%s: startx=%d\n", __FUNCTION__, startx);
|
||||
DBG (DBG_io2, "%s: endx =%d\n", __FUNCTION__, endx);
|
||||
|
||||
DBG (DBG_io2, "%s: used_pixels=%d\n", __FUNCTION__, used_pixels);
|
||||
DBG (DBG_io2, "%s: pixels =%d\n", __FUNCTION__, pixels);
|
||||
DBG (DBG_io2, "%s: depth =%d\n", __FUNCTION__, depth);
|
||||
|
|
Ładowanie…
Reference in New Issue