Merge branch 'genesys-fix-gl843-calib-pixel-count' into 'master'

genesys: Fix read pixel count calculation during calibration on GL843

See merge request sane-project/backends!78
merge-requests/80/head
Povilas Kanapickas 2019-05-30 20:51:27 +00:00
commit ceec219cec
2 zmienionych plików z 15 dodań i 4 usunięć

Wyświetl plik

@ -1713,8 +1713,13 @@ genesys_dark_shading_calibration (Genesys_Device * dev)
dev->dark_average_data.clear();
dev->dark_average_data.resize(dev->average_size);
/* size is size in bytes for scanarea: bytes_per_line * lines */
size = channels * 2 * pixels_per_line * (dev->calib_lines + 1);
// FIXME: the current calculation is likely incorrect on non-GENESYS_GL843 implementations,
// but this needs checking
if (dev->model->asic_type == GENESYS_GL843) {
size = channels * 2 * pixels_per_line * dev->calib_lines;
} else {
size = channels * 2 * pixels_per_line * (dev->calib_lines + 1);
}
std::vector<uint8_t> calibration_data(size);
@ -1897,7 +1902,13 @@ genesys_white_shading_calibration (Genesys_Device * dev)
dev->white_average_data.clear();
dev->white_average_data.resize(channels * 2 * pixels_per_line);
size = channels * 2 * pixels_per_line * (dev->calib_lines + 1);
// FIXME: the current calculation is likely incorrect on non-GENESYS_GL843 implementations,
// but this needs checking
if (dev->model->asic_type == GENESYS_GL843) {
size = channels * 2 * pixels_per_line * dev->calib_lines;
} else {
size = channels * 2 * pixels_per_line * (dev->calib_lines + 1);
}
std::vector<uint8_t> calibration_data(size);

Wyświetl plik

@ -3343,7 +3343,7 @@ gl843_coarse_gain_calibration (Genesys_Device * dev, int dpi)
RIE (dev->model->cmd_set->bulk_write_register
(dev, dev->calib_reg, GENESYS_GL843_MAX_REGS));
total_size = pixels * channels * (16/bpp) * lines;
total_size = pixels * channels * (bpp/8) * lines;
std::vector<uint8_t> line(total_size);