kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Use data from session directly when possible
rodzic
779d09a0b5
commit
9662a501a9
|
@ -3498,7 +3498,7 @@ static void calc_parameters(Genesys_Scanner* s)
|
|||
if (s->dev->settings.xres >= 1200 && (
|
||||
s->dev->model->asic_type == AsicType::GL124 ||
|
||||
s->dev->model->asic_type == AsicType::GL847 ||
|
||||
s->dev->current_setup.xres < s->dev->session.params.yres))
|
||||
s->dev->session.params.xres < s->dev->session.params.yres))
|
||||
{
|
||||
if (s->dev->settings.xres < s->dev->settings.yres) {
|
||||
// FIXME: this is an artifact of the fact that the resolution was twice as large than
|
||||
|
|
|
@ -2329,7 +2329,7 @@ void CommandSetGl124::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
|
|||
|
||||
gl124_init_scan_regs(dev, sensor, reg, session);
|
||||
|
||||
num_pixels = dev->current_setup.pixels;
|
||||
num_pixels = session.output_pixels;
|
||||
|
||||
*total_size = num_pixels * 3 * 1; /* colors * bytes_per_color * scan lines */
|
||||
|
||||
|
|
|
@ -1767,23 +1767,21 @@ void CommandSetGl646::search_start_position(Genesys_Device* dev) const
|
|||
std::vector<uint8_t> data;
|
||||
simple_scan(dev, sensor, settings, true, true, false, data);
|
||||
|
||||
/* handle stagger case : reorder gray data and thus loose some lines */
|
||||
if (dev->current_setup.stagger > 0)
|
||||
{
|
||||
// handle stagger case : reorder gray data and thus loose some lines
|
||||
auto staggered_lines = dev->session.num_staggered_lines;
|
||||
if (staggered_lines > 0) {
|
||||
DBG(DBG_proc, "%s: 'un-staggering'\n", __func__);
|
||||
for (y = 0; y < settings.lines - dev->current_setup.stagger; y++)
|
||||
{
|
||||
for (y = 0; y < settings.lines - staggered_lines; y++) {
|
||||
/* one point out of 2 is 'unaligned' */
|
||||
for (x = 0; x < settings.pixels; x += 2)
|
||||
{
|
||||
data[y * settings.pixels + x] =
|
||||
data[(y + dev->current_setup.stagger) * settings.pixels +
|
||||
x];
|
||||
data[y * settings.pixels + x] = data[(y + staggered_lines) * settings.pixels + x];
|
||||
}
|
||||
}
|
||||
/* correct line number */
|
||||
settings.lines -= dev->current_setup.stagger;
|
||||
}
|
||||
settings.lines -= staggered_lines;
|
||||
}
|
||||
|
||||
if (DBG_LEVEL >= DBG_data)
|
||||
{
|
||||
sanei_genesys_write_pnm_file("gl646_search_position.pnm", data.data(), settings.depth, 1,
|
||||
|
@ -3391,17 +3389,16 @@ bool CommandSetGl646::is_compatible_calibration(Genesys_Device* dev, const Genes
|
|||
* computed when during setup for scan
|
||||
*/
|
||||
dev->session.params.channels = dev->settings.get_channels();
|
||||
dev->current_setup.xres = dev->settings.xres;
|
||||
|
||||
DBG(DBG_io, "%s: requested=(%d, %d), tested=(%d, %d)\n", __func__,
|
||||
dev->session.params.channels, dev->current_setup.xres,
|
||||
cache->params.channels, cache->used_setup.xres);
|
||||
dev->session.params.channels, dev->session.params.xres,
|
||||
cache->params.channels, cache->params.xres);
|
||||
|
||||
/* a calibration cache is compatible if color mode and x dpi match the user
|
||||
* requested scan. In the case of CIS scanners, dpi isn't a criteria */
|
||||
if (!dev->model->is_cis) {
|
||||
compatible = (dev->session.params.channels == cache->params.channels) &&
|
||||
(dev->current_setup.xres == cache->used_setup.xres);
|
||||
(dev->session.params.xres == cache->params.xres);
|
||||
} else {
|
||||
compatible = dev->session.params.channels == cache->params.channels;
|
||||
}
|
||||
|
|
|
@ -905,7 +905,7 @@ static void gl841_init_motor_regs(Genesys_Device* dev, const Genesys_Sensor& sen
|
|||
unsigned int action, unsigned int flags)
|
||||
{
|
||||
DBG_HELPER_ARGS(dbg, "feed_steps=%d, action=%d, flags=%x", feed_steps, action, flags);
|
||||
unsigned int fast_exposure;
|
||||
unsigned int fast_exposure = 0;
|
||||
int use_fast_fed = 0;
|
||||
std::vector<uint16_t> fast_slope_table;
|
||||
unsigned int fast_slope_steps = 0;
|
||||
|
@ -3662,7 +3662,7 @@ void CommandSetGl841::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
|
|||
|
||||
gl841_init_scan_regs(dev, sensor, local_reg, session);
|
||||
|
||||
num_pixels = dev->current_setup.pixels;
|
||||
num_pixels = session.output_pixels;
|
||||
|
||||
*total_size = num_pixels * 3 * 2 * 1; /* colors * bytes_per_color * scan lines */
|
||||
|
||||
|
@ -4117,7 +4117,7 @@ void CommandSetGl841::send_shading_data(Genesys_Device* dev, const Genesys_Senso
|
|||
/* compute deletion/average factor */
|
||||
dpiset = dev->reg.get16(REG_DPISET);
|
||||
dpihw = gl841_get_dpihw(dev);
|
||||
unsigned ccd_size_divisor = dev->current_setup.ccd_size_divisor;
|
||||
unsigned ccd_size_divisor = dev->session.ccd_size_divisor;
|
||||
factor=dpihw/dpiset;
|
||||
DBG(DBG_io2, "%s: dpihw=%d, dpiset=%d, ccd_size_divisor=%d, factor=%d\n", __func__, dpihw, dpiset,
|
||||
ccd_size_divisor, factor);
|
||||
|
|
|
@ -1525,7 +1525,7 @@ static void gl843_set_xpa_motor_power(Genesys_Device* dev, bool set)
|
|||
if (set) {
|
||||
val = dev->read_register(0x6c);
|
||||
val &= ~(REG_0x6C_GPIO16 | REG_0x6C_GPIO13);
|
||||
if (dev->current_setup.xres >= 2400) {
|
||||
if (dev->session.output_resolution >= 2400) {
|
||||
val &= ~REG_0x6C_GPIO10;
|
||||
}
|
||||
dev->write_register(0x6c, val);
|
||||
|
@ -1548,7 +1548,7 @@ static void gl843_set_xpa_motor_power(Genesys_Device* dev, bool set)
|
|||
if (set) {
|
||||
val = dev->read_register(REG_0x6C);
|
||||
val &= ~REG_0x6C_GPIO14;
|
||||
if (dev->current_setup.xres >= 2400) {
|
||||
if (dev->session.output_resolution >= 2400) {
|
||||
val |= REG_0x6C_GPIO10;
|
||||
}
|
||||
dev->write_register(REG_0x6C, val);
|
||||
|
@ -2249,8 +2249,8 @@ void CommandSetGl843::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
|
|||
|
||||
gl843_init_scan_regs(dev, calib_sensor, ®s, session);
|
||||
|
||||
// the pixel number may be updated to conform to scanner constraints
|
||||
dev->calib_pixels = dev->current_setup.pixels;
|
||||
// the pixel number may be updated to conform to scanner constraints
|
||||
dev->calib_pixels = session.output_pixels;
|
||||
|
||||
dev->calib_session = session;
|
||||
dev->calib_total_bytes_to_read = session.output_total_bytes_raw;
|
||||
|
|
Ładowanie…
Reference in New Issue