kopia lustrzana https://gitlab.com/sane-project/backends
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!78merge-requests/80/head
commit
ceec219cec
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue