kopia lustrzana https://gitlab.com/sane-project/backends
* backend/hp3900_sane.c: use 1.1.0 well-known option group strings.
* backend/hp3900_config.c, backend/hp3900_debug.c, backend/hp3900_rts8822.c, backend/hp3900_types.c, backend/hp3900_usb.c: fixed reference position detection for HP3800/HPG2710 scanners. Code clean up.merge-requests/1/head
rodzic
e154d2eb11
commit
041f5cd20c
|
@ -1,3 +1,10 @@
|
|||
2008-05-22 Jonathan Bravo Lopez <jkdsoft@gmail.com>
|
||||
* backend/hp3900_sane.c: use 1.1.0 well-known option group strings.
|
||||
* backend/hp3900_config.c, backend/hp3900_debug.c,
|
||||
backend/hp3900_rts8822.c, backend/hp3900_types.c,
|
||||
backend/hp3900_usb.c: Fixed reference position detection for
|
||||
HP3800/HPG2710 scanners. Code clean up.
|
||||
|
||||
2008-05-22 Stéphane Voltz <stef.dev@free.fr>
|
||||
* backend/rts8891.c:
|
||||
minor tweak for scanjet 4470cx
|
||||
|
|
|
@ -202,11 +202,7 @@ enum ConfigFiles
|
|||
|
||||
enum fcsec6
|
||||
{
|
||||
SONY_LAMP = 0, TOSHIBA_LAMP,
|
||||
|
||||
CHECKSTABLE,
|
||||
|
||||
CALIBREFLECTIVE, CALIBTRANSPARENT, CALIBNEGATIVEFILM,
|
||||
CALIBREFLECTIVE = 0, CALIBTRANSPARENT, CALIBNEGATIVEFILM,
|
||||
|
||||
SCANINFO,
|
||||
SCAN_CALI,
|
||||
|
@ -281,8 +277,6 @@ enum fcsec6
|
|||
DPIGAINCONTROL_TA600,
|
||||
DPIGAINCONTROL_NEG600,
|
||||
|
||||
DPILUMPING100,
|
||||
|
||||
CRVS, MLOCK,
|
||||
ENABLEWARMUP,
|
||||
|
||||
|
@ -293,7 +287,7 @@ enum fcsec6
|
|||
STABLEDIFF,
|
||||
DELTAPWM,
|
||||
|
||||
PWMLAMPENABLED, PWMLAMPLEVEL,
|
||||
PWMLAMPLEVEL,
|
||||
|
||||
TMAPWMDUTY,
|
||||
|
||||
|
@ -1068,6 +1062,7 @@ static void cfg_autoref_get(struct st_autoref *reg)
|
|||
|
||||
struct st_reg myreg[] =
|
||||
{
|
||||
/* x and y offsets are based on 2400 dpi */
|
||||
/* device, { type , x , y , resolution, extern_boundary}*/
|
||||
{ BQ5550 , {REF_NONE , -40, -40, 600 , 40}},
|
||||
{ UA4900 , {REF_NONE , -40, -40, 600 , 40}},
|
||||
|
@ -5371,7 +5366,7 @@ static int srt_hp3800_scanparam_get(int option, int defvalue)
|
|||
int rst = defvalue;
|
||||
|
||||
/* t_rtinifile */
|
||||
int value3[] = {1, 0, 0, 0, 1, 0, 12, 0, 1, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 0};
|
||||
int value3[] = {1, 0, 0, 0, 1, 12, 0, 1, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 0};
|
||||
|
||||
int *value = value3;
|
||||
|
||||
|
@ -5383,22 +5378,20 @@ static int srt_hp3800_scanparam_get(int option, int defvalue)
|
|||
case TA_X_START: rst = value[2]; break;
|
||||
case TA_Y_START: rst = value[3]; break;
|
||||
case DPIGAINCONTROL600: rst = value[4]; break;
|
||||
case DPILUMPING100: rst = value[5]; break;
|
||||
case CRVS: rst = value[6]; break;
|
||||
case MLOCK: rst = value[7]; break;
|
||||
case ENABLEWARMUP: rst = value[8]; break;
|
||||
case NMAXTARGET: rst = value[9]; break;
|
||||
case NMINTARGET: rst = value[10]; break;
|
||||
case NMAXTARGETTA: rst = value[11]; break;
|
||||
case NMINTARGETTA: rst = value[12]; break;
|
||||
case NMAXTARGETNEG: rst = value[13]; break;
|
||||
case NMINTARGETNEG: rst = value[14]; break;
|
||||
case STABLEDIFF: rst = value[15]; break;
|
||||
case DELTAPWM: rst = value[16]; break;
|
||||
case PWMLAMPENABLED: rst = value[17]; break;
|
||||
case PWMLAMPLEVEL: rst = value[18]; break;
|
||||
case TMAPWMDUTY: rst = value[19]; break;
|
||||
case LEFTLEADING: rst = value[20]; break;
|
||||
case CRVS: rst = value[5]; break;
|
||||
case MLOCK: rst = value[6]; break;
|
||||
case ENABLEWARMUP: rst = value[7]; break;
|
||||
case NMAXTARGET: rst = value[8]; break;
|
||||
case NMINTARGET: rst = value[9]; break;
|
||||
case NMAXTARGETTA: rst = value[10]; break;
|
||||
case NMINTARGETTA: rst = value[11]; break;
|
||||
case NMAXTARGETNEG: rst = value[12]; break;
|
||||
case NMINTARGETNEG: rst = value[13]; break;
|
||||
case STABLEDIFF: rst = value[14]; break;
|
||||
case DELTAPWM: rst = value[15]; break;
|
||||
case PWMLAMPLEVEL: rst = value[16]; break;
|
||||
case TMAPWMDUTY: rst = value[17]; break;
|
||||
case LEFTLEADING: rst = value[18]; break;
|
||||
}
|
||||
|
||||
return rst;
|
||||
|
@ -5408,13 +5401,13 @@ static int srt_hp3970_scanparam_get(int file, int option, int defvalue)
|
|||
{
|
||||
int rst = defvalue;
|
||||
/* s_rtinifile */
|
||||
int value1[] = {1, 0, 150, 0, 1, 0, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 360};
|
||||
int value1[] = {1, 0, 150, 0, 1, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 360};
|
||||
/* s_usb1inifile */
|
||||
int value2[] = {1, 0, 150, 0, 1, 0, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 360};
|
||||
int value2[] = {1, 0, 150, 0, 1, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 360};
|
||||
/* t_rtinifile */
|
||||
int value3[] = {1, 0, 150, 0, 1, 0, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 0};
|
||||
int value3[] = {1, 0, 150, 0, 1, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 0};
|
||||
/* t_usb1inifile */
|
||||
int value4[] = {1, 0, 150, 0, 1, 0, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 0};
|
||||
int value4[] = {1, 0, 150, 0, 1, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 0};
|
||||
|
||||
int *value = NULL;
|
||||
|
||||
|
@ -5434,22 +5427,20 @@ static int srt_hp3970_scanparam_get(int file, int option, int defvalue)
|
|||
case TA_X_START: rst = value[2]; break;
|
||||
case TA_Y_START: rst = value[3]; break;
|
||||
case DPIGAINCONTROL600: rst = value[4]; break;
|
||||
case DPILUMPING100: rst = value[5]; break;
|
||||
case CRVS: rst = value[6]; break;
|
||||
case MLOCK: rst = value[7]; break;
|
||||
case ENABLEWARMUP: rst = value[8]; break;
|
||||
case NMAXTARGET: rst = value[9]; break;
|
||||
case NMINTARGET: rst = value[10]; break;
|
||||
case NMAXTARGETTA: rst = value[11]; break;
|
||||
case NMINTARGETTA: rst = value[12]; break;
|
||||
case NMAXTARGETNEG: rst = value[13]; break;
|
||||
case NMINTARGETNEG: rst = value[14]; break;
|
||||
case STABLEDIFF: rst = value[15]; break;
|
||||
case DELTAPWM: rst = value[16]; break;
|
||||
case PWMLAMPENABLED: rst = value[17]; break;
|
||||
case PWMLAMPLEVEL: rst = value[18]; break;
|
||||
case TMAPWMDUTY: rst = value[19]; break;
|
||||
case LEFTLEADING: rst = value[20]; break;
|
||||
case CRVS: rst = value[5]; break;
|
||||
case MLOCK: rst = value[6]; break;
|
||||
case ENABLEWARMUP: rst = value[7]; break;
|
||||
case NMAXTARGET: rst = value[8]; break;
|
||||
case NMINTARGET: rst = value[9]; break;
|
||||
case NMAXTARGETTA: rst = value[10]; break;
|
||||
case NMINTARGETTA: rst = value[11]; break;
|
||||
case NMAXTARGETNEG: rst = value[12]; break;
|
||||
case NMINTARGETNEG: rst = value[13]; break;
|
||||
case STABLEDIFF: rst = value[14]; break;
|
||||
case DELTAPWM: rst = value[15]; break;
|
||||
case PWMLAMPLEVEL: rst = value[16]; break;
|
||||
case TMAPWMDUTY: rst = value[17]; break;
|
||||
case LEFTLEADING: rst = value[18]; break;
|
||||
}
|
||||
|
||||
return rst;
|
||||
|
@ -5458,13 +5449,13 @@ static int srt_hp3970_scanparam_get(int file, int option, int defvalue)
|
|||
static int srt_hp4370_scanparam_get(int file, int option, int defvalue)
|
||||
{
|
||||
/* s_rtinifile */
|
||||
int value1[] = {1, 0, 150, 0, 1, 0, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 360};
|
||||
int value1[] = {1, 0, 150, 0, 1, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 360};
|
||||
/* s_usb1inifile */
|
||||
int value2[] = {1, 0, 150, 0, 1, 0, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 360};
|
||||
int value2[] = {1, 0, 150, 0, 1, 6, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 360};
|
||||
/* t_rtinifile */
|
||||
int value3[] = {1, 0, 150, 0, 1, 0, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 0};
|
||||
int value3[] = {1, 0, 150, 0, 1, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 0};
|
||||
/* t_usb1inifile */
|
||||
int value4[] = {1, 0, 150, 0, 1, 0, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 1, 0, 36, 0};
|
||||
int value4[] = {1, 0, 150, 0, 1, 12, 0, 0, 170, 140, 40, 30, 40, 30, 1500, 20, 0, 36, 0};
|
||||
int *value = NULL;
|
||||
|
||||
int rst = defvalue;
|
||||
|
@ -5485,22 +5476,20 @@ static int srt_hp4370_scanparam_get(int file, int option, int defvalue)
|
|||
case TA_X_START: rst = value[2]; break;
|
||||
case TA_Y_START: rst = value[3]; break;
|
||||
case DPIGAINCONTROL600: rst = value[4]; break;
|
||||
case DPILUMPING100: rst = value[5]; break;
|
||||
case CRVS: rst = value[6]; break;
|
||||
case MLOCK: rst = value[7]; break;
|
||||
case ENABLEWARMUP: rst = value[8]; break;
|
||||
case NMAXTARGET: rst = value[9]; break;
|
||||
case NMINTARGET: rst = value[10]; break;
|
||||
case NMAXTARGETTA: rst = value[11]; break;
|
||||
case NMINTARGETTA: rst = value[12]; break;
|
||||
case NMAXTARGETNEG: rst = value[13]; break;
|
||||
case NMINTARGETNEG: rst = value[14]; break;
|
||||
case STABLEDIFF: rst = value[15]; break;
|
||||
case DELTAPWM: rst = value[16]; break;
|
||||
case PWMLAMPENABLED: rst = value[17]; break;
|
||||
case PWMLAMPLEVEL: rst = value[18]; break;
|
||||
case TMAPWMDUTY: rst = value[19]; break;
|
||||
case LEFTLEADING: rst = value[20]; break;
|
||||
case CRVS: rst = value[5]; break;
|
||||
case MLOCK: rst = value[6]; break;
|
||||
case ENABLEWARMUP: rst = value[7]; break;
|
||||
case NMAXTARGET: rst = value[8]; break;
|
||||
case NMINTARGET: rst = value[9]; break;
|
||||
case NMAXTARGETTA: rst = value[10]; break;
|
||||
case NMINTARGETTA: rst = value[11]; break;
|
||||
case NMAXTARGETNEG: rst = value[12]; break;
|
||||
case NMINTARGETNEG: rst = value[13]; break;
|
||||
case STABLEDIFF: rst = value[14]; break;
|
||||
case DELTAPWM: rst = value[15]; break;
|
||||
case PWMLAMPLEVEL: rst = value[16]; break;
|
||||
case TMAPWMDUTY: rst = value[17]; break;
|
||||
case LEFTLEADING: rst = value[18]; break;
|
||||
}
|
||||
|
||||
return rst;
|
||||
|
|
|
@ -55,14 +55,14 @@
|
|||
/* headers */
|
||||
|
||||
static void dump_shading (struct st_calibration *myCalib);
|
||||
static char *dbg_scantype (char *text, SANE_Int type);
|
||||
static char *dbg_scantype (SANE_Int type);
|
||||
static void dbg_scanmodes (struct st_device *dev);
|
||||
static void dbg_motorcurves (struct st_device *dev);
|
||||
static void dbg_motormoves (struct st_device *dev);
|
||||
static void dbg_hwdcfg (struct st_hwdconfig *params);
|
||||
static void dbg_ScanParams (struct st_scanparams *params);
|
||||
static void dbg_calibtable (struct st_gain_offset *params);
|
||||
static char *dbg_colour (char *text, SANE_Int colour);
|
||||
static char *dbg_colour (SANE_Int colour);
|
||||
static void dbg_motorcfg (struct st_motorcfg *motorcfg);
|
||||
static void dbg_buttons (struct st_buttons *buttons);
|
||||
static void dbg_sensor (struct st_sensorcfg *sensor);
|
||||
|
@ -129,26 +129,23 @@ dump_shading (struct st_calibration *myCalib)
|
|||
}
|
||||
|
||||
static char *
|
||||
dbg_scantype (char *text, SANE_Int type)
|
||||
dbg_scantype (SANE_Int type)
|
||||
{
|
||||
if (text != NULL)
|
||||
switch (type)
|
||||
{
|
||||
case ST_NORMAL:
|
||||
strcpy (text, "ST_NORMAL");
|
||||
break;
|
||||
case ST_TA:
|
||||
strcpy (text, "ST_TA");
|
||||
break;
|
||||
case ST_NEG:
|
||||
strcpy (text, "ST_NEG");
|
||||
break;
|
||||
default:
|
||||
snprintf (text, 10, "%i", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
switch (type)
|
||||
{
|
||||
case ST_NORMAL:
|
||||
return "ST_NORMAL";
|
||||
break;
|
||||
case ST_TA:
|
||||
return "ST_TA";
|
||||
break;
|
||||
case ST_NEG:
|
||||
return "ST_NEG";
|
||||
break;
|
||||
default:
|
||||
return "Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -239,7 +236,6 @@ dbg_scanmodes (struct st_device *dev)
|
|||
{
|
||||
SANE_Int a;
|
||||
struct st_scanmode *reg;
|
||||
char sdebug[20], scm[20];
|
||||
|
||||
DBG (DBG_FNC,
|
||||
" -> ##, ST , CM , RES , TM, CV, SR, CLK, CTPC , BKS , STT, DML, { Exposure times }, { Max exposure times }, MP , MExp16, MExpF, MExp, MRI, MSI, MMTIR, MMTIRH, SK\n");
|
||||
|
@ -252,15 +248,13 @@ dbg_scanmodes (struct st_device *dev)
|
|||
{
|
||||
DBG (DBG_FNC,
|
||||
" -> %2i, %9s, %10s, %4i, %2i, %2i, %2i, %3i, %6i, %4i, %3i, %3i, {%6i, %6i, %6i}, {%6i, %6i, %6i}, %3i, %6i, %5i, %4i, %3i, %3i, %5i, %6i, %2i\n",
|
||||
a, dbg_scantype (sdebug, reg->scantype), dbg_colour (scm,
|
||||
reg->
|
||||
colormode),
|
||||
reg->resolution, reg->timing, reg->motorcurve,
|
||||
reg->samplerate, reg->systemclock, reg->ctpc,
|
||||
reg->motorbackstep, reg->scanmotorsteptype, reg->dummyline,
|
||||
reg->expt[0], reg->expt[1], reg->expt[2], reg->mexpt[0],
|
||||
reg->mexpt[1], reg->mexpt[2], reg->motorplus,
|
||||
reg->multiexposurefor16bitmode,
|
||||
a, dbg_scantype (reg->scantype),
|
||||
dbg_colour (reg->colormode), reg->resolution, reg->timing,
|
||||
reg->motorcurve, reg->samplerate, reg->systemclock,
|
||||
reg->ctpc, reg->motorbackstep, reg->scanmotorsteptype,
|
||||
reg->dummyline, reg->expt[0], reg->expt[1], reg->expt[2],
|
||||
reg->mexpt[0], reg->mexpt[1], reg->mexpt[2],
|
||||
reg->motorplus, reg->multiexposurefor16bitmode,
|
||||
reg->multiexposureforfullspeed, reg->multiexposure,
|
||||
reg->mri, reg->msi, reg->mmtir, reg->mmtirh,
|
||||
reg->skiplinecount);
|
||||
|
@ -421,8 +415,6 @@ dbg_hwdcfg (struct st_hwdconfig *params)
|
|||
{
|
||||
if (params != NULL)
|
||||
{
|
||||
char sdebug[20];
|
||||
|
||||
DBG (DBG_FNC, " -> Low level config:\n");
|
||||
DBG (DBG_FNC, " -> startpos = %i\n", params->startpos);
|
||||
DBG (DBG_FNC, " -> arrangeline = %s\n",
|
||||
|
@ -431,7 +423,7 @@ dbg_hwdcfg (struct st_hwdconfig *params)
|
|||
FIX_BY_HARD) ? "FIX_BY_HARD" :
|
||||
"FIX_BY_NONE");
|
||||
DBG (DBG_FNC, " -> scantype = %s\n",
|
||||
dbg_scantype (sdebug, params->scantype));
|
||||
dbg_scantype (params->scantype));
|
||||
DBG (DBG_FNC, " -> compression = %i\n", params->compression);
|
||||
DBG (DBG_FNC, " -> use_gamma_tables = %i\n",
|
||||
params->use_gamma_tables);
|
||||
|
@ -460,11 +452,9 @@ dbg_ScanParams (struct st_scanparams *params)
|
|||
{
|
||||
if (params != NULL)
|
||||
{
|
||||
char scm[20], ssc[20];
|
||||
|
||||
DBG (DBG_FNC, " -> Scan params:\n");
|
||||
DBG (DBG_FNC, " -> colormode = %s\n",
|
||||
dbg_colour (scm, params->colormode));
|
||||
dbg_colour (params->colormode));
|
||||
DBG (DBG_FNC, " -> depth = %i\n", params->depth);
|
||||
DBG (DBG_FNC, " -> samplerate = %i\n", params->samplerate);
|
||||
DBG (DBG_FNC, " -> timing = %i\n", params->timing);
|
||||
|
@ -485,7 +475,7 @@ dbg_ScanParams (struct st_scanparams *params)
|
|||
DBG (DBG_FNC, " *> ser = %i\n", params->ser);
|
||||
DBG (DBG_FNC, " *> ler = %i\n", params->ler);
|
||||
DBG (DBG_FNC, " *> scantype = %s\n",
|
||||
dbg_scantype (ssc, params->scantype));
|
||||
dbg_scantype (params->scantype));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,6 +485,8 @@ dbg_calibtable (struct st_gain_offset *params)
|
|||
if (params != NULL)
|
||||
{
|
||||
DBG (DBG_FNC, " -> Calib table:\n");
|
||||
DBG (DBG_FNC, " -> type R G B\n");
|
||||
DBG (DBG_FNC, " -> ----- --- --- ---B\n");
|
||||
DBG (DBG_FNC, " -> edcg1 = %3i , %3i , %3i\n", params->edcg1[0],
|
||||
params->edcg1[1], params->edcg1[2]);
|
||||
DBG (DBG_FNC, " -> edcg2 = %3i , %3i , %3i\n", params->edcg2[0],
|
||||
|
@ -513,26 +505,23 @@ dbg_calibtable (struct st_gain_offset *params)
|
|||
}
|
||||
|
||||
static char *
|
||||
dbg_colour (char *text, SANE_Int colour)
|
||||
dbg_colour (SANE_Int colour)
|
||||
{
|
||||
if (text != NULL)
|
||||
switch (colour)
|
||||
{
|
||||
case CM_COLOR:
|
||||
strcpy (text, "CM_COLOR");
|
||||
break;
|
||||
case CM_GRAY:
|
||||
strcpy (text, "CM_GRAY");
|
||||
break;
|
||||
case CM_LINEART:
|
||||
strcpy (text, "CM_LINEART");
|
||||
break;
|
||||
default:
|
||||
snprintf (text, 20, "%i", colour);
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
switch (colour)
|
||||
{
|
||||
case CM_COLOR:
|
||||
return "CM_COLOR";
|
||||
break;
|
||||
case CM_GRAY:
|
||||
return "CM_GRAY";
|
||||
break;
|
||||
case CM_LINEART:
|
||||
return "CM_LINEART";
|
||||
break;
|
||||
default:
|
||||
return "Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -102,7 +102,7 @@ typedef enum
|
|||
opt_infoupdate,
|
||||
|
||||
/* supported buttons. RTS8822 supports up to 6 buttons */
|
||||
grp_buttons,
|
||||
grp_sensors,
|
||||
opt_button_0,
|
||||
opt_button_1,
|
||||
opt_button_2,
|
||||
|
@ -167,7 +167,6 @@ typedef struct
|
|||
|
||||
SANE_Int scan_count;
|
||||
SANE_Int fScanning; /* TRUE if actively scanning */
|
||||
SANE_Int fCanceled;
|
||||
} TScanner;
|
||||
|
||||
/* functions to manage backend's options */
|
||||
|
@ -1230,9 +1229,9 @@ options_init (TScanner * scanner)
|
|||
break;
|
||||
|
||||
case grp_geometry:
|
||||
pDesc->name = "grp_geometry";
|
||||
pDesc->title = SANE_I18N ("Geometry");
|
||||
pDesc->desc = "";
|
||||
pDesc->name = SANE_NAME_GEOMETRY;
|
||||
pDesc->title = SANE_TITLE_GEOMETRY;
|
||||
pDesc->desc = SANE_DESC_GEOMETRY;
|
||||
pDesc->type = SANE_TYPE_GROUP;
|
||||
pDesc->unit = SANE_UNIT_NONE;
|
||||
pDesc->size = 0;
|
||||
|
@ -1559,7 +1558,7 @@ options_init (TScanner * scanner)
|
|||
pDesc->type = SANE_TYPE_STRING;
|
||||
pDesc->constraint_type = SANE_CONSTRAINT_NONE;
|
||||
pDesc->cap =
|
||||
SANE_CAP_ADVANCED | SANE_CAP_HARD_SELECT |
|
||||
SANE_CAP_ADVANCED | SANE_CAP_SOFT_SELECT |
|
||||
SANE_CAP_SOFT_DETECT;
|
||||
pVal->s = strdup (SANE_I18N ("Unknown"));
|
||||
break;
|
||||
|
@ -1572,7 +1571,7 @@ options_init (TScanner * scanner)
|
|||
pDesc->unit = SANE_UNIT_NONE;
|
||||
pDesc->constraint_type = SANE_CONSTRAINT_NONE;
|
||||
pDesc->cap =
|
||||
SANE_CAP_ADVANCED | SANE_CAP_HARD_SELECT |
|
||||
SANE_CAP_ADVANCED | SANE_CAP_SOFT_SELECT |
|
||||
SANE_CAP_SOFT_DETECT;
|
||||
pVal->w = -1;
|
||||
break;
|
||||
|
@ -1586,7 +1585,7 @@ options_init (TScanner * scanner)
|
|||
pDesc->unit = SANE_UNIT_NONE;
|
||||
pDesc->constraint_type = SANE_CONSTRAINT_NONE;
|
||||
pDesc->cap =
|
||||
SANE_CAP_ADVANCED | SANE_CAP_HARD_SELECT |
|
||||
SANE_CAP_ADVANCED | SANE_CAP_SOFT_SELECT |
|
||||
SANE_CAP_SOFT_DETECT;
|
||||
pVal->w = -1;
|
||||
break;
|
||||
|
@ -1605,10 +1604,10 @@ options_init (TScanner * scanner)
|
|||
break;
|
||||
|
||||
/* buttons support */
|
||||
case grp_buttons:
|
||||
pDesc->name = "grp_buttons";
|
||||
pDesc->title = SANE_I18N ("Buttons");
|
||||
pDesc->desc = "";
|
||||
case grp_sensors:
|
||||
pDesc->name = SANE_NAME_SENSORS;
|
||||
pDesc->title = SANE_TITLE_SENSORS;
|
||||
pDesc->desc = SANE_DESC_SENSORS;
|
||||
pDesc->type = SANE_TYPE_GROUP;
|
||||
pDesc->unit = SANE_UNIT_NONE;
|
||||
pDesc->size = 0;
|
||||
|
@ -2176,6 +2175,14 @@ option_set (TScanner * scanner, SANE_Int optid, void *value, SANE_Int * pInfo)
|
|||
if (bknd_info (scanner) == SANE_STATUS_GOOD)
|
||||
info |= SANE_INFO_RELOAD_OPTIONS;
|
||||
break;
|
||||
|
||||
case opt_chipname:
|
||||
case opt_chipid:
|
||||
case opt_scancount:
|
||||
bknd_info (scanner);
|
||||
info |= SANE_INFO_RELOAD_OPTIONS;
|
||||
break;
|
||||
|
||||
default:
|
||||
rst = SANE_STATUS_INVAL;
|
||||
break;
|
||||
|
@ -2341,10 +2348,7 @@ sane_start (SANE_Handle h)
|
|||
s->cnv.colormode = -1;
|
||||
|
||||
/* setting channel for colormodes different than CM_COLOR */
|
||||
if (colormode != CM_COLOR)
|
||||
channel = 1;
|
||||
else
|
||||
channel = 0;
|
||||
channel = (colormode != CM_COLOR) ? 1 : 0;
|
||||
|
||||
/* negative colors */
|
||||
s->cnv.negative =
|
||||
|
@ -2445,7 +2449,7 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
|
|||
SANE_Status rst = SANE_STATUS_GOOD;
|
||||
TScanner *s = (TScanner *) h;
|
||||
|
||||
DBG (DBG_FNC, "> sane_read\n");
|
||||
DBG (DBG_FNC, "+ sane_read\n");
|
||||
|
||||
if ((s != NULL) && (buf != NULL) && (len != NULL))
|
||||
{
|
||||
|
@ -2454,13 +2458,14 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
|
|||
|
||||
/* if we read all the lines return EOF */
|
||||
if ((s->mylin == s->ScanParams.coords.height)
|
||||
|| (device->Reading->Cancel == TRUE))
|
||||
|| (device->status->cancel == TRUE))
|
||||
{
|
||||
rst =
|
||||
(device->status->cancel ==
|
||||
TRUE) ? SANE_STATUS_CANCELLED : SANE_STATUS_EOF;
|
||||
|
||||
RTS_Scanner_StopScan (device, FALSE);
|
||||
img_buffers_free (s);
|
||||
|
||||
DBG (DBG_FNC, "> sane_read: All lines read\n");
|
||||
rst = SANE_STATUS_EOF;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2537,8 +2542,6 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
|
|||
&transferred) != OK)
|
||||
{
|
||||
/* error, exit function */
|
||||
DBG (DBG_FNC,
|
||||
"> sane_read: Read_Image returned ERROR\n");
|
||||
rst = SANE_STATUS_EOF;
|
||||
break;
|
||||
}
|
||||
|
@ -2640,6 +2643,8 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
|
|||
else
|
||||
rst = SANE_STATUS_EOF;
|
||||
|
||||
DBG (DBG_FNC, "- sane_read: %s\n", sane_strstatus (rst));
|
||||
|
||||
return rst;
|
||||
}
|
||||
|
||||
|
@ -2651,7 +2656,7 @@ sane_cancel (SANE_Handle h)
|
|||
/* silence gcc */
|
||||
h = h;
|
||||
|
||||
device->Reading->Cancel = TRUE;
|
||||
device->status->cancel = TRUE;
|
||||
}
|
||||
|
||||
SANE_Status
|
||||
|
|
|
@ -639,6 +639,13 @@ struct st_buttons
|
|||
SANE_Int mask[6]; /* up to 6 buttons */
|
||||
};
|
||||
|
||||
struct st_status
|
||||
{
|
||||
SANE_Byte warmup;
|
||||
SANE_Byte parkhome;
|
||||
SANE_Byte cancel;
|
||||
};
|
||||
|
||||
struct st_device
|
||||
{
|
||||
/* next var handles usb device, used for every usb operations */
|
||||
|
@ -686,6 +693,9 @@ struct st_device
|
|||
|
||||
/* next structure will be used to arrange color channels while scanning */
|
||||
struct st_scanning *scanning;
|
||||
|
||||
/* next structure will contain some status which can be requested */
|
||||
struct st_status *status;
|
||||
};
|
||||
|
||||
/* Unknown vars */
|
||||
|
@ -710,10 +720,8 @@ SANE_Byte gain[3];
|
|||
static SANE_Int usbfile = -1;
|
||||
SANE_Int scantype;
|
||||
|
||||
SANE_Byte pwmlampenabled;
|
||||
SANE_Byte pwmlamplevel;
|
||||
|
||||
SANE_Byte dpi100Lumping;
|
||||
SANE_Byte arrangeline;
|
||||
SANE_Byte binarythresholdh;
|
||||
SANE_Byte binarythresholdl;
|
||||
|
|
Ładowanie…
Reference in New Issue