kopia lustrzana https://gitlab.com/sane-project/backends
modified color filter option to enable true gray for cis GL841 scanners
rodzic
54e8a24da6
commit
7724df7c8b
|
@ -102,6 +102,14 @@ static SANE_String_Const color_filter_list[] = {
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static SANE_String_Const cis_color_filter_list[] = {
|
||||||
|
SANE_I18N ("None"),
|
||||||
|
SANE_I18N ("Red"),
|
||||||
|
SANE_I18N ("Green"),
|
||||||
|
SANE_I18N ("Blue"),
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static SANE_String_Const source_list[] = {
|
static SANE_String_Const source_list[] = {
|
||||||
SANE_I18N ("Flatbed"),
|
SANE_I18N ("Flatbed"),
|
||||||
SANE_I18N ("Transparency Adapter"),
|
SANE_I18N ("Transparency Adapter"),
|
||||||
|
@ -5149,6 +5157,9 @@ calc_parameters (Genesys_Scanner * s)
|
||||||
else
|
else
|
||||||
s->dev->settings.color_filter = 1;
|
s->dev->settings.color_filter = 1;
|
||||||
|
|
||||||
|
if (strcmp (color_filter, "None") == 0)
|
||||||
|
s->dev->settings.true_gray = 1;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5442,9 +5453,18 @@ init_options (Genesys_Scanner * s)
|
||||||
("When using gray or lineart this option selects the used color.");
|
("When using gray or lineart this option selects the used color.");
|
||||||
s->opt[OPT_COLOR_FILTER].type = SANE_TYPE_STRING;
|
s->opt[OPT_COLOR_FILTER].type = SANE_TYPE_STRING;
|
||||||
s->opt[OPT_COLOR_FILTER].constraint_type = SANE_CONSTRAINT_STRING_LIST;
|
s->opt[OPT_COLOR_FILTER].constraint_type = SANE_CONSTRAINT_STRING_LIST;
|
||||||
s->opt[OPT_COLOR_FILTER].size = max_string_size (color_filter_list);
|
if(!model->is_cis)
|
||||||
s->opt[OPT_COLOR_FILTER].constraint.string_list = color_filter_list;
|
{
|
||||||
s->val[OPT_COLOR_FILTER].s = strdup ("Green");
|
s->opt[OPT_COLOR_FILTER].size = max_string_size (color_filter_list);
|
||||||
|
s->opt[OPT_COLOR_FILTER].constraint.string_list = color_filter_list;
|
||||||
|
s->val[OPT_COLOR_FILTER].s = strdup (s->opt[OPT_COLOR_FILTER].constraint.string_list[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s->opt[OPT_COLOR_FILTER].size = max_string_size (cis_color_filter_list);
|
||||||
|
s->opt[OPT_COLOR_FILTER].constraint.string_list = cis_color_filter_list;
|
||||||
|
s->val[OPT_COLOR_FILTER].s = strdup (s->opt[OPT_COLOR_FILTER].constraint.string_list[0]);
|
||||||
|
}
|
||||||
|
|
||||||
/* for GL646 cis scanners we're using true gray so ther is no filter */
|
/* for GL646 cis scanners we're using true gray so ther is no filter */
|
||||||
if (model->asic_type == GENESYS_GL646 && model->is_cis)
|
if (model->asic_type == GENESYS_GL646 && model->is_cis)
|
||||||
|
|
|
@ -2578,8 +2578,6 @@ gl841_init_optical_regs_scan(Genesys_Device * dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
r->value &= ~(REG04_FILTER | REG04_AFEMOD);
|
r->value &= ~(REG04_FILTER | REG04_AFEMOD);
|
||||||
/* we could make the color filter used an advanced option of the
|
|
||||||
backend */
|
|
||||||
if (channels == 1) {
|
if (channels == 1) {
|
||||||
switch (color_filter) {
|
switch (color_filter) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -4609,6 +4607,7 @@ static SANE_Status
|
||||||
gl841_init_regs_for_scan (Genesys_Device * dev)
|
gl841_init_regs_for_scan (Genesys_Device * dev)
|
||||||
{
|
{
|
||||||
int channels;
|
int channels;
|
||||||
|
int flags;
|
||||||
int depth;
|
int depth;
|
||||||
float move;
|
float move;
|
||||||
int move_dpi;
|
int move_dpi;
|
||||||
|
@ -4678,6 +4677,17 @@ gl841_init_regs_for_scan (Genesys_Device * dev)
|
||||||
|
|
||||||
start = (start * dev->sensor.optical_res) / MM_PER_INCH;
|
start = (start * dev->sensor.optical_res) / MM_PER_INCH;
|
||||||
|
|
||||||
|
flags=0;
|
||||||
|
|
||||||
|
/* we aneable true gray for cis scanners only, and just when doing
|
||||||
|
* scan since color calibration is OK for this mode
|
||||||
|
*/
|
||||||
|
flags = 0;
|
||||||
|
if(dev->model->is_cis && dev->settings.true_gray)
|
||||||
|
{
|
||||||
|
flags |= OPTICAL_FLAG_ENABLE_LEDADD;
|
||||||
|
}
|
||||||
|
|
||||||
status = gl841_init_scan_regs (dev,
|
status = gl841_init_scan_regs (dev,
|
||||||
dev->reg,
|
dev->reg,
|
||||||
dev->settings.xres,
|
dev->settings.xres,
|
||||||
|
@ -4689,7 +4699,7 @@ gl841_init_regs_for_scan (Genesys_Device * dev)
|
||||||
depth,
|
depth,
|
||||||
channels,
|
channels,
|
||||||
dev->settings.color_filter,
|
dev->settings.color_filter,
|
||||||
OPTICAL_FLAG_ENABLE_LEDADD);
|
flags);
|
||||||
|
|
||||||
if (status != SANE_STATUS_GOOD)
|
if (status != SANE_STATUS_GOOD)
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -481,21 +481,23 @@ typedef struct
|
||||||
{
|
{
|
||||||
int scan_method; /* todo: change >=2: Transparency, 0x88: negative film */
|
int scan_method; /* todo: change >=2: Transparency, 0x88: negative film */
|
||||||
int scan_mode; /* todo: change 0,1 = lineart, halftone; 2 = gray, 3 = 3pass color, 4=single pass color */
|
int scan_mode; /* todo: change 0,1 = lineart, halftone; 2 = gray, 3 = 3pass color, 4=single pass color */
|
||||||
int xres; /* dpi */
|
int xres; /**> horizontal dpi */
|
||||||
int yres; /* dpi */
|
int yres; /**> vertical dpi */
|
||||||
|
|
||||||
double tl_x; /* x start on scan table in mm */
|
double tl_x; /* x start on scan table in mm */
|
||||||
double tl_y; /* y start on scan table in mm */
|
double tl_y; /* y start on scan table in mm */
|
||||||
|
|
||||||
unsigned int lines; /* number of lines at scan resolution */
|
unsigned int lines; /**> number of lines at scan resolution */
|
||||||
unsigned int pixels; /* number of pixels at scan resolution */
|
unsigned int pixels; /**> number of pixels at scan resolution */
|
||||||
|
|
||||||
unsigned int depth;/* bit depth of the scan */
|
unsigned int depth;/* bit depth of the scan */
|
||||||
|
|
||||||
/* todo : remove these fields ? */
|
/* todo : remove these fields ? */
|
||||||
int exposure_time;
|
int exposure_time;
|
||||||
|
|
||||||
unsigned int color_filter; /* todo: check, may be make it an advanced option */
|
unsigned int color_filter;
|
||||||
|
|
||||||
|
int true_gray; /**> true if scan is true gray, false if monochrome scan */
|
||||||
|
|
||||||
/* BW threshold */
|
/* BW threshold */
|
||||||
int threshold;
|
int threshold;
|
||||||
|
|
Ładowanie…
Reference in New Issue