Merge branch 'genesys-misc-cleanup' into 'master'

genesys: Miscellaneous cleanup

See merge request sane-project/backends!196
merge-requests/197/head
Povilas Kanapickas 2019-09-29 19:18:59 +00:00
commit 1dc1da5942
10 zmienionych plików z 18 dodań i 24 usunięć

Wyświetl plik

@ -1594,6 +1594,9 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
bool is_dark, const std::string& log_filename_prefix)
{
DBG_HELPER(dbg);
debug_dump(DBG_info, dev->calib_session);
size_t size;
uint32_t pixels_per_line;
uint8_t channels;

Wyświetl plik

@ -257,6 +257,10 @@ struct Genesys_Device
size_t calib_resolution = 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;
// certain scanners support much higher resolution when scanning transparency, but we can't
// read whole width of the scanner as a single line at that resolution. Thus for stuff like
// calibration we want to read only the possible calibration area.

Wyświetl plik

@ -2654,8 +2654,6 @@ static void gl124_update_hardware_sensors(Genesys_Scanner* s)
/** the gl124 command set */
Genesys_Command_Set gl124_cmd_set = {
"gl124-generic", /* the name of this set */
[](Genesys_Device* dev) -> bool { (void) dev; return true; },
gl124_init,

Wyświetl plik

@ -3773,8 +3773,6 @@ static void gl646_search_strip(Genesys_Device* dev, const Genesys_Sensor& sensor
/** the gl646 command set */
Genesys_Command_Set gl646_cmd_set = {
"gl646-generic", /* the name of this set */
gl646_needs_home_before_init_regs_for_scan,
gl646_init,

Wyświetl plik

@ -4354,8 +4354,6 @@ static void gl841_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
/** the gl841 command set */
Genesys_Command_Set gl841_cmd_set = {
"gl841-generic", /* the name of this set */
[](Genesys_Device* dev) -> bool { (void) dev; return true; },
gl841_init,

Wyświetl plik

@ -2269,6 +2269,7 @@ static void gl843_init_regs_for_shading(Genesys_Device* dev, const Genesys_Senso
// the pixel number may be updated to conform to scanner constraints
dev->calib_pixels = dev->current_setup.pixels;
dev->calib_session = session;
dev->calib_total_bytes_to_read = session.output_total_bytes_raw;
dev->scanhead_position_in_steps += dev->calib_lines + move;
@ -3430,8 +3431,6 @@ static void gl843_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
/** the gl843 command set */
Genesys_Command_Set gl843_cmd_set = {
"gl843-generic", /* the name of this set */
[](Genesys_Device* dev) -> bool { (void) dev; return true; },
gl843_init,

Wyświetl plik

@ -2474,8 +2474,6 @@ static void gl846_coarse_gain_calibration(Genesys_Device* dev, const Genesys_Sen
/** the gl846 command set */
Genesys_Command_Set gl846_cmd_set = {
"gl846-generic", /* the name of this set */
nullptr,
gl846_init,

Wyświetl plik

@ -2579,8 +2579,6 @@ static void gl847_coarse_gain_calibration(Genesys_Device* dev, const Genesys_Sen
/** the gl847 command set */
Genesys_Command_Set gl847_cmd_set = {
"gl847-generic", /* the name of this set */
nullptr,
gl847_init,

Wyświetl plik

@ -1698,6 +1698,12 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
get_fake_usb_buffer_model(session), read_data_from_usb);
}
if (DBG_LEVEL >= DBG_io2) {
dev->pipeline.push_node<ImagePipelineNodeDebug>("gl_pipeline_" +
std::to_string(s_pipeline_index) +
"_0_before_swap.pnm");
}
#ifdef WORDS_BIGENDIAN
if (get_pixel_format_depth(format) == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
@ -1707,7 +1713,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
if (DBG_LEVEL >= DBG_io2) {
dev->pipeline.push_node<ImagePipelineNodeDebug>("gl_pipeline_" +
std::to_string(s_pipeline_index) +
"_0_after_swap.pnm");
"_1_after_swap.pnm");
}
if (dev->model->is_cis && session.params.channels == 3) {
@ -1732,7 +1738,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
if (DBG_LEVEL >= DBG_io2) {
dev->pipeline.push_node<ImagePipelineNodeDebug>("gl_pipeline_" +
std::to_string(s_pipeline_index) +
"_1_after_shift.pnm");
"_2_after_shift.pnm");
}
if (session.num_staggered_lines > 0) {
@ -1743,7 +1749,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
if (DBG_LEVEL >= DBG_io2) {
dev->pipeline.push_node<ImagePipelineNodeDebug>("gl_pipeline_" +
std::to_string(s_pipeline_index) +
"_2_after_stagger.pnm");
"_3_after_stagger.pnm");
}
if ((dev->model->flags & GENESYS_FLAG_CALIBRATION_HOST_SIDE) &&
@ -1755,7 +1761,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
if (DBG_LEVEL >= DBG_io2) {
dev->pipeline.push_node<ImagePipelineNodeDebug>("gl_pipeline_" +
std::to_string(s_pipeline_index) +
"_3_after_calibrate.pnm");
"_4_after_calibrate.pnm");
}
}

Wyświetl plik

@ -219,14 +219,6 @@ typedef struct Genesys_Calibration_Cache Genesys_Calibration_Cache;
*/
struct Genesys_Command_Set
{
/** @name Identification */
/*@{ */
/** Name of this command set */
SANE_String_Const name;
/*@} */
bool (*needs_home_before_init_regs_for_scan) (Genesys_Device* dev);
/** For ASIC initialization */