kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Remove low-level handling of xdpi < ydpi case
The high-level code ensures that the xdpi is always natively supported by the scanner.merge-requests/152/head
rodzic
548eff4a32
commit
50e5c80434
|
@ -5157,7 +5157,7 @@ probe_genesys_devices (void)
|
|||
of Genesys_Calibration_Cache as is.
|
||||
*/
|
||||
static const char* CALIBRATION_IDENT = "sane_genesys";
|
||||
static const int CALIBRATION_VERSION = 7;
|
||||
static const int CALIBRATION_VERSION = 8;
|
||||
|
||||
bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration,
|
||||
const std::string& path)
|
||||
|
|
|
@ -592,7 +592,7 @@ static void gl646_setup_registers(Genesys_Device* dev,
|
|||
|
||||
/* words_per_line must be computed according to the scan's resolution */
|
||||
/* in fact, words_per_line _gives_ the actual scan resolution */
|
||||
words_per_line = (((endx - startx) * sensor.real_resolution) / sensor.optical_res);
|
||||
words_per_line = (((endx - startx) * session.output_resolution) / sensor.optical_res);
|
||||
bpp = session.params.depth/8;
|
||||
if (session.params.depth == 1) {
|
||||
words_per_line = (words_per_line+7)/8 ;
|
||||
|
@ -609,7 +609,7 @@ static void gl646_setup_registers(Genesys_Device* dev,
|
|||
DBG(DBG_info, "%s: wpl=%d\n", __func__, words_per_line);
|
||||
regs->set24(REG_MAXWD, words_per_line);
|
||||
|
||||
regs->set16(REG_DPISET, sensor.real_resolution * session.ccd_size_divisor *
|
||||
regs->set16(REG_DPISET, session.output_resolution * session.ccd_size_divisor *
|
||||
sensor.ccd_pixels_per_system_pixel());
|
||||
regs->set16(REG_LPERIOD, sensor.exposure_lperiod);
|
||||
|
||||
|
@ -790,10 +790,10 @@ static void gl646_setup_registers(Genesys_Device* dev,
|
|||
dev->read_active = SANE_TRUE;
|
||||
|
||||
dev->session = session;
|
||||
dev->current_setup.pixels = ((endx - startx) * sensor.real_resolution) / sensor.optical_res;
|
||||
dev->current_setup.pixels = ((endx - startx) * session.output_resolution) / sensor.optical_res;
|
||||
dev->current_setup.lines = linecnt;
|
||||
dev->current_setup.exposure_time = sensor.exposure_lperiod;
|
||||
dev->current_setup.xres = sensor.real_resolution;
|
||||
dev->current_setup.xres = session.output_resolution;
|
||||
dev->current_setup.ccd_size_divisor = session.ccd_size_divisor;
|
||||
dev->current_setup.stagger = session.num_staggered_lines;
|
||||
dev->current_setup.max_shift = max_shift + session.num_staggered_lines;
|
||||
|
|
|
@ -253,10 +253,6 @@ struct Genesys_Sensor {
|
|||
// the resolution list that the sensor is usable at.
|
||||
ResolutionFilter resolutions = ResolutionFilter::ANY;
|
||||
|
||||
// the actual resolution of the sensor. If 0, then it's equivalent to the requested resolution.
|
||||
// gl646-only.
|
||||
unsigned real_resolution = 0;
|
||||
|
||||
// the channel list that the sensor is usable at
|
||||
std::vector<unsigned> channels = { 1, 3 };
|
||||
|
||||
|
@ -334,7 +330,6 @@ struct Genesys_Sensor {
|
|||
return sensor_id == other.sensor_id &&
|
||||
optical_res == other.optical_res &&
|
||||
resolutions == other.resolutions &&
|
||||
real_resolution == other.real_resolution &&
|
||||
method == other.method &&
|
||||
ccd_size_divisor == other.ccd_size_divisor &&
|
||||
black_pixels == other.black_pixels &&
|
||||
|
@ -359,7 +354,6 @@ void serialize(Stream& str, Genesys_Sensor& x)
|
|||
serialize(str, x.sensor_id);
|
||||
serialize(str, x.optical_res);
|
||||
serialize(str, x.resolutions);
|
||||
serialize(str, x.real_resolution);
|
||||
serialize(str, x.method);
|
||||
serialize(str, x.ccd_size_divisor);
|
||||
serialize(str, x.black_pixels);
|
||||
|
|
|
@ -307,14 +307,13 @@ void genesys_init_sensor_tables()
|
|||
{
|
||||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
unsigned real_resolution;
|
||||
unsigned exposure_lperiod;
|
||||
unsigned ccd_size_divisor;
|
||||
GenesysRegisterSettingSet custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 50 }, 50, 12000, 2, {
|
||||
{ { 50 }, 12000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -342,7 +341,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 75 }, 75, 11000, 2, {
|
||||
{ { 75 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -370,7 +369,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 100 }, 100, 11000, 2, {
|
||||
{ { 100 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -398,7 +397,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 150 }, 150, 11000, 2, {
|
||||
{ { 150 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -426,7 +425,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 200 }, 200, 11000, 2, {
|
||||
{ { 200 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -454,7 +453,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 300 }, 300, 11000, 2, {
|
||||
{ { 300 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -482,7 +481,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 400 }, 400, 11000, 2, {
|
||||
{ { 400 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -510,7 +509,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 600 }, 600, 11000, 2, {
|
||||
{ { 600 }, 11000, 2, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -538,35 +537,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 1200 }, 1200, 11000, 1, {
|
||||
{ 0x08, 0x0d },
|
||||
{ 0x09, 0x0f },
|
||||
{ 0x0a, 0x11 },
|
||||
{ 0x0b, 0x13 },
|
||||
{ 0x16, 0x0b },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x30 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x00 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x00 },
|
||||
{ 0x1d, 0x03 },
|
||||
{ 0x52, 0x03 },
|
||||
{ 0x53, 0x07 },
|
||||
{ 0x54, 0x0b },
|
||||
{ 0x55, 0x0f },
|
||||
{ 0x56, 0x13 },
|
||||
{ 0x57, 0x17 },
|
||||
{ 0x58, 0x23 },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0xc1 },
|
||||
{ 0x5b, 0x00 },
|
||||
{ 0x5c, 0x00 },
|
||||
{ 0x5d, 0x00 },
|
||||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 2400 }, 1200, 11000, 1, {
|
||||
{ { 1200 }, 11000, 1, {
|
||||
{ 0x08, 0x0d },
|
||||
{ 0x09, 0x0f },
|
||||
{ 0x0a, 0x11 },
|
||||
|
@ -599,7 +570,6 @@ void genesys_init_sensor_tables()
|
|||
for (const CustomSensorSettings& setting : custom_settings)
|
||||
{
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.real_resolution = setting.real_resolution;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.ccd_size_divisor = setting.ccd_size_divisor;
|
||||
sensor.custom_regs = setting.custom_regs;
|
||||
|
@ -654,13 +624,12 @@ void genesys_init_sensor_tables()
|
|||
{
|
||||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
unsigned real_resolution;
|
||||
unsigned exposure_lperiod;
|
||||
GenesysRegisterSettingSet custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 50 }, 50, 7211, {
|
||||
{ { 50 }, 7211, {
|
||||
{ 0x08, 0x14 },
|
||||
{ 0x09, 0x15 },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -688,7 +657,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 100 }, 100, 7211, {
|
||||
{ { 100 }, 7211, {
|
||||
{ 0x08, 0x14 },
|
||||
{ 0x09, 0x15 },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -716,7 +685,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 150 }, 150, 7211, {
|
||||
{ { 150 }, 7211, {
|
||||
{ 0x08, 0x14 },
|
||||
{ 0x09, 0x15 },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -744,7 +713,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 300 }, 300, 8751, {
|
||||
{ { 300 }, 8751, {
|
||||
{ 0x08, 0x14 },
|
||||
{ 0x09, 0x15 },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -772,7 +741,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 600 }, 600, 18760, {
|
||||
{ { 600 }, 18760, {
|
||||
{ 0x08, 0x0e },
|
||||
{ 0x09, 0x0f },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -800,7 +769,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 1200 }, 1200, 21749, {
|
||||
{ { 1200 }, 21749, {
|
||||
{ 0x08, 0x02 },
|
||||
{ 0x09, 0x04 },
|
||||
{ 0x0a, 0x00 },
|
||||
|
@ -833,7 +802,6 @@ void genesys_init_sensor_tables()
|
|||
for (const CustomSensorSettings& setting : custom_settings)
|
||||
{
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.real_resolution = setting.real_resolution;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.custom_regs = setting.custom_regs;
|
||||
s_sensors->push_back(sensor);
|
||||
|
@ -888,14 +856,13 @@ void genesys_init_sensor_tables()
|
|||
{
|
||||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
unsigned real_resolution;
|
||||
unsigned exposure_lperiod;
|
||||
unsigned ccd_size_divisor;
|
||||
GenesysRegisterSettingSet custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 75 }, 75, 4480, 2, {
|
||||
{ { 75 }, 4480, 2, {
|
||||
{ 0x08, 0x16 },
|
||||
{ 0x09, 0x00 },
|
||||
{ 0x0a, 0x01 },
|
||||
|
@ -923,7 +890,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x16 }
|
||||
}
|
||||
},
|
||||
{ { 150 }, 150, 4350, 2, {
|
||||
{ { 150 }, 4350, 2, {
|
||||
{ 0x08, 0x16 },
|
||||
{ 0x09, 0x00 },
|
||||
{ 0x0a, 0x01 },
|
||||
|
@ -951,7 +918,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x16 }
|
||||
}
|
||||
},
|
||||
{ { 300 }, 300, 4350, 2, {
|
||||
{ { 300 }, 4350, 2, {
|
||||
{ 0x08, 0x16 },
|
||||
{ 0x09, 0x00 },
|
||||
{ 0x0a, 0x01 },
|
||||
|
@ -979,35 +946,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x16 }
|
||||
}
|
||||
},
|
||||
{ { 600 }, 600, 8700, 1, {
|
||||
{ 0x08, 0x01 },
|
||||
{ 0x09, 0x03 },
|
||||
{ 0x0a, 0x04 },
|
||||
{ 0x0b, 0x06 },
|
||||
{ 0x16, 0xb7 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x20 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x6a },
|
||||
{ 0x1b, 0x8a },
|
||||
{ 0x1c, 0x00 },
|
||||
{ 0x1d, 0x05 },
|
||||
{ 0x52, 0x0f },
|
||||
{ 0x53, 0x13 },
|
||||
{ 0x54, 0x17 },
|
||||
{ 0x55, 0x03 },
|
||||
{ 0x56, 0x07 },
|
||||
{ 0x57, 0x0b },
|
||||
{ 0x58, 0x83 },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0xc1 },
|
||||
{ 0x5b, 0x06 },
|
||||
{ 0x5c, 0x0b },
|
||||
{ 0x5d, 0x10 },
|
||||
{ 0x5e, 0x16 }
|
||||
}
|
||||
},
|
||||
{ { 1200 }, 600, 8700, 1, {
|
||||
{ { 600 }, 8700, 1, {
|
||||
{ 0x08, 0x01 },
|
||||
{ 0x09, 0x03 },
|
||||
{ 0x0a, 0x04 },
|
||||
|
@ -1040,7 +979,6 @@ void genesys_init_sensor_tables()
|
|||
for (const CustomSensorSettings& setting : custom_settings)
|
||||
{
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.real_resolution = setting.real_resolution;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.ccd_size_divisor = setting.ccd_size_divisor;
|
||||
sensor.custom_regs = setting.custom_regs;
|
||||
|
@ -1243,13 +1181,12 @@ void genesys_init_sensor_tables()
|
|||
{
|
||||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
unsigned real_resolution;
|
||||
unsigned exposure_lperiod;
|
||||
GenesysRegisterSettingSet custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 75 }, 75, 4879, {
|
||||
{ { 75 }, 4879, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x0a },
|
||||
{ 0x0a, 0x0b },
|
||||
|
@ -1277,7 +1214,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 100 }, 100, 4487, {
|
||||
{ { 100 }, 4487, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x0a },
|
||||
{ 0x0a, 0x0b },
|
||||
|
@ -1305,7 +1242,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 150 }, 150, 4879, {
|
||||
{ { 150 }, 4879, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x0a },
|
||||
{ 0x0a, 0x0b },
|
||||
|
@ -1333,7 +1270,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 300 }, 300, 4503, {
|
||||
{ { 300 }, 4503, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x0a },
|
||||
{ 0x0a, 0x0b },
|
||||
|
@ -1361,7 +1298,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 600 }, 600, 10251, {
|
||||
{ { 600 }, 10251, {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x05 },
|
||||
{ 0x0a, 0x06 },
|
||||
|
@ -1389,35 +1326,7 @@ void genesys_init_sensor_tables()
|
|||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 1200 }, 1200, 12750, {
|
||||
{ 0x08, 0x0d },
|
||||
{ 0x09, 0x0f },
|
||||
{ 0x0a, 0x11 },
|
||||
{ 0x0b, 0x13 },
|
||||
{ 0x16, 0x2b },
|
||||
{ 0x17, 0x07 },
|
||||
{ 0x18, 0x30 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x00 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0xc0 },
|
||||
{ 0x1d, 0x43 },
|
||||
{ 0x52, 0x03 },
|
||||
{ 0x53, 0x07 },
|
||||
{ 0x54, 0x0b },
|
||||
{ 0x55, 0x0f },
|
||||
{ 0x56, 0x13 },
|
||||
{ 0x57, 0x17 },
|
||||
{ 0x58, 0x23 },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0xc1 },
|
||||
{ 0x5b, 0x00 },
|
||||
{ 0x5c, 0x00 },
|
||||
{ 0x5d, 0x00 },
|
||||
{ 0x5e, 0x00 }
|
||||
}
|
||||
},
|
||||
{ { 2400 }, 1200, 12750, {
|
||||
{ { 1200 }, 12750, {
|
||||
{ 0x08, 0x0d },
|
||||
{ 0x09, 0x0f },
|
||||
{ 0x0a, 0x11 },
|
||||
|
@ -1450,7 +1359,6 @@ void genesys_init_sensor_tables()
|
|||
for (const CustomSensorSettings& setting : custom_settings)
|
||||
{
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.real_resolution = setting.real_resolution;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.custom_regs = setting.custom_regs;
|
||||
s_sensors->push_back(sensor);
|
||||
|
|
Ładowanie…
Reference in New Issue