genesys: Add a way to set custom FE registers depending on scan mode

merge-requests/81/head
Povilas Kanapickas 2019-06-02 11:48:01 +03:00
rodzic c05b0c1598
commit ba778a7d84
3 zmienionych plików z 17 dodań i 2 usunięć

Wyświetl plik

@ -1296,6 +1296,7 @@ void genesys_init_sensor_tables()
int exposure;
int is_transparency;
GenesysRegisterSettingSet extra_custom_regs;
GenesysRegisterSettingSet custom_fe_regs;
};
CustomSensorSettings custom_settings[] = {
@ -1325,7 +1326,8 @@ void genesys_init_sensor_tables()
{ 0x58, 0x6b },
{ 0x59, 0x00 },
{ 0x5a, 0x40 },
}
},
{},
},
{ -1, 1200, 0x5dc0, true, {
{ 0x74, 0x03 }, { 0x75, 0xf0 }, { 0x76, 0xf0 },
@ -1354,6 +1356,7 @@ void genesys_init_sensor_tables()
{ 0x59, 0x00 },
{ 0x5a, 0x40 },
},
{},
},
{ 2400, 2400, 0x5dc0, true, {
{ 0x74, 0x03 }, { 0x75, 0xfe }, { 0x76, 0x00 },
@ -1381,7 +1384,8 @@ void genesys_init_sensor_tables()
{ 0x58, 0x6b },
{ 0x59, 0x00 },
{ 0x5a, 0x40 },
}
},
{},
},
{ 4800, 4800, 0x5dc0, true, {
{ 0x74, 0x03 }, { 0x75, 0xff }, { 0x76, 0xff },
@ -1412,6 +1416,8 @@ void genesys_init_sensor_tables()
{ 0x59, 0x00 },
{ 0x5a, 0x40 },
},
{ { 0x03, 0x1f },
},
},
};
@ -1424,6 +1430,7 @@ void genesys_init_sensor_tables()
sensor.exposure_lperiod = setting.exposure;
sensor.custom_regs = base_custom_regs;
sensor.custom_regs.merge(setting.extra_custom_regs);
sensor.custom_fe_regs = setting.custom_fe_regs;
s_sensors->push_back(sensor);
}
}

Wyświetl plik

@ -793,6 +793,13 @@ gl843_set_fe (Genesys_Device * dev, const Genesys_Sensor& sensor, uint8_t set)
return status;
}
}
for (const auto& reg : sensor.custom_fe_regs) {
status = sanei_genesys_fe_write_data(dev, reg.address, reg.value);
if (status != SANE_STATUS_GOOD) {
DBG(DBG_error, "%s: writing reg[%d] failed: %s\n", __func__, i, sane_strstatus(status));
return status;
}
}
for (i = 0; i < 3; i++)
{

Wyświetl plik

@ -578,6 +578,7 @@ struct Genesys_Sensor {
int exposure_lperiod = -1;
GenesysRegisterSettingSet custom_regs;
GenesysRegisterSettingSet custom_fe_regs;
// red, green and blue gamma coefficient for default gamma tables
AssignableArray<float, 3> gamma;