kopia lustrzana https://gitlab.com/sane-project/backends
rodzic
6cc0d7641f
commit
c8e84cd579
|
@ -137,6 +137,12 @@ static EpsonCmdRec epson_cmd[] = {
|
|||
|
||||
extern struct mode_param mode_params[];
|
||||
|
||||
/* Define the different scan sources */
|
||||
|
||||
#define FBF_STR SANE_I18N("Flatbed")
|
||||
#define TPU_STR SANE_I18N("Transparency Unit")
|
||||
#define ADF_STR SANE_I18N("Automatic Document Feeder")
|
||||
|
||||
/*
|
||||
* source list need one dummy entry (save device settings is crashing).
|
||||
* NOTE: no const - this list gets created while exploring the capabilities
|
||||
|
|
137
backend/epson2.c
137
backend/epson2.c
|
@ -89,18 +89,24 @@ struct mode_param mode_params[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const mode_list[] = {
|
||||
"Binary",
|
||||
"Gray",
|
||||
"Color",
|
||||
SANE_I18N("Binary"),
|
||||
SANE_I18N("Gray"),
|
||||
SANE_I18N("Color"),
|
||||
NULL
|
||||
};
|
||||
|
||||
static const SANE_String_Const adf_mode_list[] = {
|
||||
"Simplex",
|
||||
"Duplex",
|
||||
SANE_I18N("Simplex"),
|
||||
SANE_I18N("Duplex"),
|
||||
NULL
|
||||
};
|
||||
|
||||
/* Define the different scan sources */
|
||||
|
||||
#define FBF_STR SANE_I18N("Flatbed")
|
||||
#define TPU_STR SANE_I18N("Transparency Unit")
|
||||
#define ADF_STR SANE_I18N("Automatic Document Feeder")
|
||||
|
||||
/*
|
||||
* source list need one dummy entry (save device settings is crashing).
|
||||
* NOTE: no const - this list gets created while exploring the capabilities
|
||||
|
@ -115,16 +121,16 @@ SANE_String_Const source_list[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const film_list[] = {
|
||||
"Positive Film",
|
||||
"Negative Film",
|
||||
"Positive Slide",
|
||||
"Negative Slide",
|
||||
SANE_I18N("Positive Film"),
|
||||
SANE_I18N("Negative Film"),
|
||||
SANE_I18N("Positive Slide"),
|
||||
SANE_I18N("Negative Slide"),
|
||||
NULL
|
||||
};
|
||||
|
||||
static const SANE_String_Const focus_list[] = {
|
||||
"Focus on glass",
|
||||
"Focus 2.5mm above glass",
|
||||
SANE_I18N("Focus on glass"),
|
||||
SANE_I18N("Focus 2.5mm above glass"),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -146,45 +152,45 @@ const int halftone_params[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const halftone_list[] = {
|
||||
"None",
|
||||
"Halftone A (Hard Tone)",
|
||||
"Halftone B (Soft Tone)",
|
||||
"Halftone C (Net Screen)",
|
||||
SANE_I18N("None"),
|
||||
SANE_I18N("Halftone A (Hard Tone)"),
|
||||
SANE_I18N("Halftone B (Soft Tone)"),
|
||||
SANE_I18N("Halftone C (Net Screen)"),
|
||||
NULL
|
||||
};
|
||||
|
||||
static const SANE_String_Const halftone_list_4[] = {
|
||||
"None",
|
||||
"Halftone A (Hard Tone)",
|
||||
"Halftone B (Soft Tone)",
|
||||
"Halftone C (Net Screen)",
|
||||
"Dither A (4x4 Bayer)",
|
||||
"Dither B (4x4 Spiral)",
|
||||
"Dither C (4x4 Net Screen)",
|
||||
"Dither D (8x4 Net Screen)",
|
||||
SANE_I18N("None"),
|
||||
SANE_I18N("Halftone A (Hard Tone)"),
|
||||
SANE_I18N("Halftone B (Soft Tone)"),
|
||||
SANE_I18N("Halftone C (Net Screen)"),
|
||||
SANE_I18N("Dither A (4x4 Bayer)"),
|
||||
SANE_I18N("Dither B (4x4 Spiral)"),
|
||||
SANE_I18N("Dither C (4x4 Net Screen)"),
|
||||
SANE_I18N("Dither D (8x4 Net Screen)"),
|
||||
NULL
|
||||
};
|
||||
|
||||
static const SANE_String_Const halftone_list_7[] = {
|
||||
"None",
|
||||
"Halftone A (Hard Tone)",
|
||||
"Halftone B (Soft Tone)",
|
||||
"Halftone C (Net Screen)",
|
||||
"Dither A (4x4 Bayer)",
|
||||
"Dither B (4x4 Spiral)",
|
||||
"Dither C (4x4 Net Screen)",
|
||||
"Dither D (8x4 Net Screen)",
|
||||
"Text Enhanced Technology",
|
||||
"Download pattern A",
|
||||
"Download pattern B",
|
||||
SANE_I18N("None"),
|
||||
SANE_I18N("Halftone A (Hard Tone)"),
|
||||
SANE_I18N("Halftone B (Soft Tone)"),
|
||||
SANE_I18N("Halftone C (Net Screen)"),
|
||||
SANE_I18N("Dither A (4x4 Bayer)"),
|
||||
SANE_I18N("Dither B (4x4 Spiral)"),
|
||||
SANE_I18N("Dither C (4x4 Net Screen)"),
|
||||
SANE_I18N("Dither D (8x4 Net Screen)"),
|
||||
SANE_I18N("Text Enhanced Technology"),
|
||||
SANE_I18N("Download pattern A"),
|
||||
SANE_I18N("Download pattern B"),
|
||||
NULL
|
||||
};
|
||||
|
||||
static const SANE_String_Const dropout_list[] = {
|
||||
"None",
|
||||
"Red",
|
||||
"Green",
|
||||
"Blue",
|
||||
SANE_I18N("None"),
|
||||
SANE_I18N("Red"),
|
||||
SANE_I18N("Green"),
|
||||
SANE_I18N("Blue"),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -198,12 +204,12 @@ static const SANE_Bool color_userdefined[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const color_list[] = {
|
||||
"No Correction",
|
||||
"User defined",
|
||||
"Impact-dot printers",
|
||||
"Thermal printers",
|
||||
"Ink-jet printers",
|
||||
"CRT monitors",
|
||||
SANE_I18N("No Correction"),
|
||||
SANE_I18N("User defined"),
|
||||
SANE_I18N("Impact-dot printers"),
|
||||
SANE_I18N("Thermal printers"),
|
||||
SANE_I18N("Ink-jet printers"),
|
||||
SANE_I18N("CRT monitors"),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -223,11 +229,11 @@ static int gamma_params_ab[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const gamma_list_ab[] = {
|
||||
"Default",
|
||||
"User defined",
|
||||
"High density printing",
|
||||
"Low density printing",
|
||||
"High contrast printing",
|
||||
SANE_I18N("Default"),
|
||||
SANE_I18N("User defined"),
|
||||
SANE_I18N("High density printing"),
|
||||
SANE_I18N("Low density printing"),
|
||||
SANE_I18N("High contrast printing"),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -245,8 +251,8 @@ static int gamma_params_d[] = {
|
|||
};
|
||||
|
||||
static const SANE_String_Const gamma_list_d[] = {
|
||||
"User defined (Gamma=1.0)",
|
||||
"User defined (Gamma=1.8)",
|
||||
SANE_I18N("User defined (Gamma=1.0)"),
|
||||
SANE_I18N("User defined (Gamma=1.8)"),
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -964,7 +970,7 @@ init_options(Epson_Scanner *s)
|
|||
/* halftone */
|
||||
s->opt[OPT_HALFTONE].name = SANE_NAME_HALFTONE;
|
||||
s->opt[OPT_HALFTONE].title = SANE_TITLE_HALFTONE;
|
||||
s->opt[OPT_HALFTONE].desc = SANE_I18N("Selects the halftone");
|
||||
s->opt[OPT_HALFTONE].desc = SANE_I18N("Selects the halftone.");
|
||||
|
||||
s->opt[OPT_HALFTONE].type = SANE_TYPE_STRING;
|
||||
s->opt[OPT_HALFTONE].size = max_string_size(halftone_list_7);
|
||||
|
@ -986,7 +992,7 @@ init_options(Epson_Scanner *s)
|
|||
/* dropout */
|
||||
s->opt[OPT_DROPOUT].name = "dropout";
|
||||
s->opt[OPT_DROPOUT].title = SANE_I18N("Dropout");
|
||||
s->opt[OPT_DROPOUT].desc = SANE_I18N("Selects the dropout");
|
||||
s->opt[OPT_DROPOUT].desc = SANE_I18N("Selects the dropout.");
|
||||
|
||||
s->opt[OPT_DROPOUT].type = SANE_TYPE_STRING;
|
||||
s->opt[OPT_DROPOUT].size = max_string_size(dropout_list);
|
||||
|
@ -998,7 +1004,7 @@ init_options(Epson_Scanner *s)
|
|||
/* brightness */
|
||||
s->opt[OPT_BRIGHTNESS].name = SANE_NAME_BRIGHTNESS;
|
||||
s->opt[OPT_BRIGHTNESS].title = SANE_TITLE_BRIGHTNESS;
|
||||
s->opt[OPT_BRIGHTNESS].desc = SANE_I18N("Selects the brightness");
|
||||
s->opt[OPT_BRIGHTNESS].desc = SANE_I18N("Selects the brightness.");
|
||||
|
||||
s->opt[OPT_BRIGHTNESS].type = SANE_TYPE_INT;
|
||||
s->opt[OPT_BRIGHTNESS].unit = SANE_UNIT_NONE;
|
||||
|
@ -1024,9 +1030,9 @@ init_options(Epson_Scanner *s)
|
|||
s->opt[OPT_SHARPNESS].cap |= SANE_CAP_INACTIVE;
|
||||
|
||||
/* gamma */
|
||||
s->opt[OPT_GAMMA_CORRECTION].name = "gamma-correction";
|
||||
s->opt[OPT_GAMMA_CORRECTION].title = SANE_I18N("Gamma Correction");
|
||||
s->opt[OPT_GAMMA_CORRECTION].desc = SANE_I18N("Selects the gamma correction value from a list of pre-defined devices or the user defined table, which can be downloaded to the scanner");
|
||||
s->opt[OPT_GAMMA_CORRECTION].name = SANE_NAME_GAMMA_CORRECTION;
|
||||
s->opt[OPT_GAMMA_CORRECTION].title = SANE_TITLE_GAMMA_CORRECTION;
|
||||
s->opt[OPT_GAMMA_CORRECTION].desc = SANE_DESC_GAMMA_CORRECTION;
|
||||
|
||||
s->opt[OPT_GAMMA_CORRECTION].type = SANE_TYPE_STRING;
|
||||
s->opt[OPT_GAMMA_CORRECTION].constraint_type =
|
||||
|
@ -1148,7 +1154,7 @@ init_options(Epson_Scanner *s)
|
|||
s->opt[OPT_COLOR_CORRECTION].title = SANE_I18N("Color correction");
|
||||
s->opt[OPT_COLOR_CORRECTION].desc =
|
||||
SANE_I18N
|
||||
("Sets the color correction table for the selected output device");
|
||||
("Sets the color correction table for the selected output device.");
|
||||
|
||||
s->opt[OPT_COLOR_CORRECTION].type = SANE_TYPE_STRING;
|
||||
s->opt[OPT_COLOR_CORRECTION].size = 32;
|
||||
|
@ -1298,7 +1304,7 @@ init_options(Epson_Scanner *s)
|
|||
/* mirror */
|
||||
s->opt[OPT_MIRROR].name = "mirror";
|
||||
s->opt[OPT_MIRROR].title = SANE_I18N("Mirror image");
|
||||
s->opt[OPT_MIRROR].desc = SANE_I18N("Mirror the image");
|
||||
s->opt[OPT_MIRROR].desc = SANE_I18N("Mirror the image.");
|
||||
|
||||
s->opt[OPT_MIRROR].type = SANE_TYPE_BOOL;
|
||||
s->val[OPT_MIRROR].w = SANE_FALSE;
|
||||
|
@ -1429,9 +1435,9 @@ init_options(Epson_Scanner *s)
|
|||
s->opt[OPT_FILM_TYPE].cap |= SANE_CAP_INACTIVE;
|
||||
|
||||
/* focus position */
|
||||
s->opt[OPT_FOCUS].name = "focus-position";
|
||||
s->opt[OPT_FOCUS].title = SANE_I18N("Focus Position");
|
||||
s->opt[OPT_FOCUS].desc = SANE_I18N("Sets the focus position to either the glass or 2.5mm above the glass");
|
||||
s->opt[OPT_FOCUS].name = SANE_EPSON_FOCUS_NAME;
|
||||
s->opt[OPT_FOCUS].title = SANE_EPSON_FOCUS_TITLE;
|
||||
s->opt[OPT_FOCUS].desc = SANE_EPSON_FOCUS_DESC;
|
||||
s->opt[OPT_FOCUS].type = SANE_TYPE_STRING;
|
||||
s->opt[OPT_FOCUS].size = max_string_size(focus_list);
|
||||
s->opt[OPT_FOCUS].constraint_type = SANE_CONSTRAINT_STRING_LIST;
|
||||
|
@ -1494,9 +1500,10 @@ init_options(Epson_Scanner *s)
|
|||
if (!s->hw->cmd->set_bay)
|
||||
s->opt[OPT_BAY].cap |= SANE_CAP_INACTIVE;
|
||||
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].name = "wait-for-button";
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].title = SANE_I18N("Wait for button");
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].desc = SANE_I18N("After sending the scan command, wait until the button on the scanner is pressed");
|
||||
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].name = SANE_EPSON_WAIT_FOR_BUTTON_NAME;
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].title = SANE_EPSON_WAIT_FOR_BUTTON_TITLE;
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].desc = SANE_EPSON_WAIT_FOR_BUTTON_DESC;
|
||||
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].type = SANE_TYPE_BOOL;
|
||||
s->opt[OPT_WAIT_FOR_BUTTON].unit = SANE_UNIT_NONE;
|
||||
|
|
|
@ -73,23 +73,35 @@
|
|||
#define SANE_EPSON_CONFIG_PIO "pio"
|
||||
#define SANE_EPSON_CONFIG_NET "net"
|
||||
|
||||
/* scan sources */
|
||||
/* string constants for GUI elements that are not defined SANE-wide */
|
||||
|
||||
#define FBF_STR "Flatbed"
|
||||
#define TPU_STR "Transparency Unit"
|
||||
#define ADF_STR "Automatic Document Feeder"
|
||||
#define SANE_NAME_GAMMA_CORRECTION "gamma-correction"
|
||||
#define SANE_TITLE_GAMMA_CORRECTION SANE_I18N("Gamma Correction")
|
||||
#define SANE_DESC_GAMMA_CORRECTION SANE_I18N("Selects the gamma correction value from a list of pre-defined devices or the user defined table, which can be downloaded to the scanner")
|
||||
|
||||
#define SANE_EPSON_FOCUS_NAME "focus-position"
|
||||
#define SANE_EPSON_FOCUS_TITLE SANE_I18N("Focus Position")
|
||||
#define SANE_EPSON_FOCUS_DESC SANE_I18N("Sets the focus position to either the glass or 2.5mm above the glass")
|
||||
#define SANE_EPSON_WAIT_FOR_BUTTON_NAME "wait-for-button"
|
||||
#define SANE_EPSON_WAIT_FOR_BUTTON_TITLE SANE_I18N("Wait for Button")
|
||||
#define SANE_EPSON_WAIT_FOR_BUTTON_DESC SANE_I18N("After sending the scan command, wait until the button on the scanner is pressed to actually start the scan process.");
|
||||
|
||||
/* misc constants */
|
||||
|
||||
#define LINES_SHUFFLE_MAX 17 /* 2 x 8 lines plus 1 */
|
||||
|
||||
#define SANE_EPSON_MAX_RETRIES 120 /* how often do we retry during warmup ? */
|
||||
|
||||
#ifndef MM_PER_INCH
|
||||
#define MM_PER_INCH 25.4
|
||||
#endif
|
||||
|
||||
/* NOTE: you can find these codes with "man ascii". */
|
||||
#define STX 0x02
|
||||
#define ACK 0x06
|
||||
#define NAK 0x15
|
||||
#define CAN 0x18
|
||||
#define ESC 0x1B
|
||||
#define PF 0x19
|
||||
#define FS 0x1C
|
||||
|
||||
#define S_ACK "\006"
|
||||
|
|
Ładowanie…
Reference in New Issue