disbale software crop/deskew and despeckle at 16 bit depth

merge-requests/1/head
Stphane Voltz 2011-02-04 06:17:27 +01:00
rodzic e375cef3b0
commit 66716a5666
2 zmienionych plików z 28 dodań i 4 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
2011-02-04 Stéphane Voltz <stef.dev@free.fr>
* backend/genesys.c: disable image processing options at 16 bits since
they can't handle it.
2011-02-02 Stéphane Voltz <stef.dev@free.fr>
* backend/genesys.c backend/genesys_low.c backend/genesys_gl843.c:
more asynchronous parking issues

Wyświetl plik

@ -5835,9 +5835,10 @@ calc_parameters (Genesys_Scanner * s)
s->dev->settings.threshold_curve=0;
/* some digital processing requires the whole picture to be buffered */
/* no digital processing takes place when doing preview */
/* no digital processing takes place when doing preview, or when bit depth is
* higher than 8 bits */
if ((s->val[OPT_SWDESPECK].b || s->val[OPT_SWCROP].b || s->val[OPT_SWDESKEW].b)
&&(!s->val[OPT_PREVIEW].b))
&& (!s->val[OPT_PREVIEW].b) && (s->val[OPT_BIT_DEPTH].w <= 8))
{
s->dev->buffer_image=SANE_TRUE;
}
@ -7425,7 +7426,6 @@ set_option_value (Genesys_Scanner * s, int option, void *val,
*myinfo |= SANE_INFO_RELOAD_PARAMS;
break;
case OPT_RESOLUTION:
case OPT_BIT_DEPTH:
case OPT_THRESHOLD:
case OPT_THRESHOLD_CURVE:
case OPT_DISABLE_DYNAMIC_LINEART:
@ -7451,6 +7451,26 @@ set_option_value (Genesys_Scanner * s, int option, void *val,
RIE (calc_parameters (s));
*myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
break;
/* software enhancement functions only apply to 8 or 1 bits data */
case OPT_BIT_DEPTH:
s->val[option].w = *(SANE_Word *) val;
if(s->val[OPT_BIT_DEPTH].w>8)
{
DISABLE(OPT_SWDESKEW);
DISABLE(OPT_SWDESPECK);
DISABLE(OPT_SWCROP);
DISABLE(OPT_DESPECK);
}
else
{
ENABLE(OPT_SWDESKEW);
ENABLE(OPT_SWDESPECK);
ENABLE(OPT_SWCROP);
ENABLE(OPT_DESPECK);
}
RIE (calc_parameters (s));
*myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
break;
case OPT_SOURCE:
if (strcmp (s->val[option].s, val) != 0)
{ /* something changed */
@ -7872,7 +7892,7 @@ sane_start (SANE_Handle handle)
}
/* crop image if required */
if(s->val[OPT_SWCROP].b == SANE_TRUE)
if(s->val[OPT_SWCROP].b == SANE_TRUE)
{
RIE(genesys_crop(s));
}