kopia lustrzana https://gitlab.com/sane-project/backends
Added flag to allow only 1- and 8-bit scanmodes. The Q-Scan does
not seem to support 14-bit modes.merge-requests/1/head
rodzic
5b31b57a3a
commit
d6261ec5df
|
@ -48,7 +48,7 @@
|
||||||
* - changed DCapsDef, lamp -> misc_io
|
* - changed DCapsDef, lamp -> misc_io
|
||||||
* - bPCB is now ushort to be "missused" by non Plustek
|
* - bPCB is now ushort to be "missused" by non Plustek
|
||||||
* devices (as threshhold for resetting sensor order)
|
* devices (as threshhold for resetting sensor order)
|
||||||
* - added _WAF_LOFF_ON_START
|
* - added _WAF_LOFF_ON_START and _WAF_ONLY_8BIT
|
||||||
* .
|
* .
|
||||||
* <hr>
|
* <hr>
|
||||||
* This file is part of the SANE package.
|
* This file is part of the SANE package.
|
||||||
|
@ -255,7 +255,8 @@ enum _WORKAROUNDS
|
||||||
_WAF_MISC_IO_BUTTONS = 0x00000200, /* special handling for buttons */
|
_WAF_MISC_IO_BUTTONS = 0x00000200, /* special handling for buttons */
|
||||||
_WAF_USE_ALT_DESC = 0x00000400, /* use alternate manufacturer */
|
_WAF_USE_ALT_DESC = 0x00000400, /* use alternate manufacturer */
|
||||||
_WAF_RESET_SO_TO_RGB = 0x00000800, /* set sensororder to RGB(CIS only)*/
|
_WAF_RESET_SO_TO_RGB = 0x00000800, /* set sensororder to RGB(CIS only)*/
|
||||||
_WAF_LOFF_ON_START = 0x00001000 /* switch lamp off before scanning */
|
_WAF_LOFF_ON_START = 0x00001000, /* switch lamp off before scanning */
|
||||||
|
_WAF_ONLY_8BIT = 0x00002000 /* scanner allows only 8 bit modes */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** for lamps connected to the misc I/O pins*/
|
/** for lamps connected to the misc I/O pins*/
|
||||||
|
|
|
@ -772,7 +772,7 @@ static DCapsDef Cap0x0A53_0x1000 =
|
||||||
0, /* number of buttons */
|
0, /* number of buttons */
|
||||||
kNEC8861, /* use default settings during calibration */
|
kNEC8861, /* use default settings during calibration */
|
||||||
200, /* threshold for resetting sensor-order */
|
200, /* threshold for resetting sensor-order */
|
||||||
(_WAF_MISC_IO_LAMPS | _WAF_RESET_SO_TO_RGB),
|
(_WAF_MISC_IO_LAMPS | _WAF_RESET_SO_TO_RGB | _WAF_ONLY_8BIT),
|
||||||
_PS_INP1
|
_PS_INP1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@
|
||||||
#include "../include/sane/sanei.h"
|
#include "../include/sane/sanei.h"
|
||||||
#include "../include/sane/saneopts.h"
|
#include "../include/sane/saneopts.h"
|
||||||
|
|
||||||
#define BACKEND_VERSION "0.52-1"
|
#define BACKEND_VERSION "0.52-2"
|
||||||
|
|
||||||
#define BACKEND_NAME plustek
|
#define BACKEND_NAME plustek
|
||||||
#include "../include/sane/sanei_access.h"
|
#include "../include/sane/sanei_access.h"
|
||||||
|
@ -694,8 +694,9 @@ static SANE_Status
|
||||||
init_options( Plustek_Scanner *s )
|
init_options( Plustek_Scanner *s )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Plustek_Device *dev = s->hw;
|
Plustek_Device *dev = s->hw;
|
||||||
AdjDef *adj = &dev->adj;
|
AdjDef *adj = &dev->adj;
|
||||||
|
DCapsDef *caps = &dev->usbDev.Caps;
|
||||||
|
|
||||||
memset(s->opt, 0, sizeof(s->opt));
|
memset(s->opt, 0, sizeof(s->opt));
|
||||||
|
|
||||||
|
@ -743,6 +744,9 @@ init_options( Plustek_Scanner *s )
|
||||||
s->opt[OPT_BIT_DEPTH].constraint.word_list = bpp_lm9832_list;
|
s->opt[OPT_BIT_DEPTH].constraint.word_list = bpp_lm9832_list;
|
||||||
s->val[OPT_BIT_DEPTH].w = 8;
|
s->val[OPT_BIT_DEPTH].w = 8;
|
||||||
|
|
||||||
|
if (caps->workaroundFlag & _WAF_ONLY_8BIT)
|
||||||
|
_DISABLE(OPT_BIT_DEPTH);
|
||||||
|
|
||||||
/* scan source */
|
/* scan source */
|
||||||
s->opt[OPT_EXT_MODE].name = SANE_NAME_SCAN_SOURCE;
|
s->opt[OPT_EXT_MODE].name = SANE_NAME_SCAN_SOURCE;
|
||||||
s->opt[OPT_EXT_MODE].title = SANE_TITLE_SCAN_SOURCE;
|
s->opt[OPT_EXT_MODE].title = SANE_TITLE_SCAN_SOURCE;
|
||||||
|
@ -1778,6 +1782,14 @@ do_calibration( void *args )
|
||||||
|
|
||||||
for ( ; scanmode < 5; scanmode++ ) {
|
for ( ; scanmode < 5; scanmode++ ) {
|
||||||
|
|
||||||
|
if (caps->workaroundFlag & _WAF_ONLY_8BIT) {
|
||||||
|
|
||||||
|
if ((modes[scanmode] == COLOR_GRAY16) ||
|
||||||
|
(modes[scanmode] == COLOR_TRUE48)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dev->scanning.dwFlag |= SCANFLAG_Calibration;
|
dev->scanning.dwFlag |= SCANFLAG_Calibration;
|
||||||
|
|
||||||
if (SANE_STATUS_GOOD == local_sane_start(s, modes[scanmode])) {
|
if (SANE_STATUS_GOOD == local_sane_start(s, modes[scanmode])) {
|
||||||
|
@ -1812,9 +1824,10 @@ SANE_Status
|
||||||
sane_control_option( SANE_Handle handle, SANE_Int option,
|
sane_control_option( SANE_Handle handle, SANE_Int option,
|
||||||
SANE_Action action, void *value, SANE_Int *info )
|
SANE_Action action, void *value, SANE_Int *info )
|
||||||
{
|
{
|
||||||
Plustek_Scanner *s = (Plustek_Scanner *)handle;
|
Plustek_Scanner *s = (Plustek_Scanner *)handle;
|
||||||
Plustek_Device *dev = s->hw;
|
Plustek_Device *dev = s->hw;
|
||||||
AdjDef *adj = &dev->adj;
|
AdjDef *adj = &dev->adj;
|
||||||
|
DCapsDef *caps = &dev->usbDev.Caps;
|
||||||
SANE_Status status;
|
SANE_Status status;
|
||||||
const SANE_String_Const *optval;
|
const SANE_String_Const *optval;
|
||||||
int scanmode;
|
int scanmode;
|
||||||
|
@ -2135,12 +2148,15 @@ sane_control_option( SANE_Handle handle, SANE_Int option,
|
||||||
_ENABLE(OPT_CONTRAST);
|
_ENABLE(OPT_CONTRAST);
|
||||||
_ENABLE(OPT_BIT_DEPTH);
|
_ENABLE(OPT_BIT_DEPTH);
|
||||||
_ENABLE(OPT_CUSTOM_GAMMA);
|
_ENABLE(OPT_CUSTOM_GAMMA);
|
||||||
if( scanmode == COLOR_BW ) {
|
if (scanmode == COLOR_BW) {
|
||||||
_DISABLE(OPT_CONTRAST);
|
_DISABLE(OPT_CONTRAST);
|
||||||
_DISABLE(OPT_CUSTOM_GAMMA);
|
_DISABLE(OPT_CUSTOM_GAMMA);
|
||||||
_DISABLE(OPT_BIT_DEPTH);
|
_DISABLE(OPT_BIT_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (caps->workaroundFlag & _WAF_ONLY_8BIT)
|
||||||
|
_DISABLE(OPT_BIT_DEPTH);
|
||||||
|
|
||||||
_DISABLE(OPT_GAMMA_VECTOR);
|
_DISABLE(OPT_GAMMA_VECTOR);
|
||||||
_DISABLE(OPT_GAMMA_VECTOR_R);
|
_DISABLE(OPT_GAMMA_VECTOR_R);
|
||||||
_DISABLE(OPT_GAMMA_VECTOR_G);
|
_DISABLE(OPT_GAMMA_VECTOR_G);
|
||||||
|
|
Ładowanie…
Reference in New Issue