genesys: Remove uses of calib_total_bytes_to_read

merge-requests/340/head
Povilas Kanapickas 2020-02-03 00:42:05 +02:00
rodzic 328f39e39e
commit 9a142d6acc
7 zmienionych plików z 5 dodań i 14 usunięć

Wyświetl plik

@ -239,7 +239,6 @@ std::ostream& operator<<(std::ostream& out, const Genesys_Device& dev)
<< static_cast<unsigned>(dev.control[4]) << ' '
<< static_cast<unsigned>(dev.control[5]) << '\n' << std::dec
<< " average_size: " << dev.average_size << '\n'
<< " calib_total_bytes_to_read: " << dev.calib_total_bytes_to_read << '\n'
<< " calib_session: " << format_indent_braced_list(4, dev.calib_session) << '\n'
<< " gamma_override_tables[0].size(): " << dev.gamma_override_tables[0].size() << '\n'
<< " gamma_override_tables[1].size(): " << dev.gamma_override_tables[1].size() << '\n'

Wyświetl plik

@ -269,8 +269,6 @@ struct Genesys_Device
std::uint8_t control[6] = {};
size_t average_size = 0;
// bytes to read from USB when calibrating. If 0, this is not set
size_t calib_total_bytes_to_read = 0;
// the session that was configured for calibration
ScanSession calib_session;

Wyświetl plik

@ -1690,11 +1690,9 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
}
// FIXME: the current calculation is likely incorrect on non-GL843 implementations,
// but this needs checking
if (dev->calib_total_bytes_to_read > 0) {
size = dev->calib_total_bytes_to_read;
} else if (dev->model->asic_type == AsicType::GL843) {
size = channels * 2 * pixels_per_line * dev->calib_session.params.lines;
// but this needs checking. Note the extra line when computing size.
if (dev->model->asic_type == AsicType::GL843) {
size = dev->calib_session.output_total_bytes_raw;
} else {
size = channels * 2 * pixels_per_line * (dev->calib_session.params.lines + 1);
}
@ -1941,8 +1939,8 @@ static void genesys_dark_white_shading_calibration(Genesys_Device* dev,
dev->dark_average_data.clear();
dev->dark_average_data.resize(dev->average_size);
if (dev->calib_total_bytes_to_read > 0) {
size = dev->calib_total_bytes_to_read;
if (dev->model->asic_type == AsicType::GL843) {
size = dev->calib_session.output_total_bytes_raw;
} else {
size = channels * 2 * pixels_per_line * dev->calib_session.params.lines;
}

Wyświetl plik

@ -1194,7 +1194,6 @@ void CommandSetGl124::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
const auto& calib_sensor = sanei_genesys_find_sensor(dev, resolution, channels,
dev->settings.scan_method);
dev->calib_total_bytes_to_read = 0;
factor = calib_sensor.optical_res / resolution;
/* distance to move to reach white target at high resolution */

Wyświetl plik

@ -1770,7 +1770,6 @@ void CommandSetGl843::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
init_regs_for_scan_session(dev, calib_sensor, &regs, session);
dev->calib_session = session;
dev->calib_total_bytes_to_read = session.output_total_bytes_raw;
}
/** @brief set up registers for the actual scan

Wyświetl plik

@ -963,7 +963,6 @@ void CommandSetGl846::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
const auto& calib_sensor = sanei_genesys_find_sensor(dev, resolution, channels,
dev->settings.scan_method);
dev->calib_total_bytes_to_read = 0;
unsigned calib_lines = dev->model->shading_lines;
if (resolution == 4800) {
calib_lines *= 2;

Wyświetl plik

@ -972,7 +972,6 @@ void CommandSetGl847::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
const auto& calib_sensor = sanei_genesys_find_sensor(dev, resolution, channels,
dev->settings.scan_method);
dev->calib_total_bytes_to_read = 0;
unsigned calib_lines = dev->model->shading_lines;
if (resolution == 4800) {
calib_lines *= 2;