kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Don't modify session in *_init_scan_regs()
rodzic
80d0129f44
commit
322a9a6810
|
@ -989,6 +989,13 @@ static void gl124_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
const Genesys_Sensor& sensor)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
s.params.depth = 8;
|
||||
}
|
||||
|
||||
compute_session(dev, s, sensor);
|
||||
|
||||
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
||||
|
@ -1003,7 +1010,7 @@ static void gl124_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
* this function sets up the scanner to scan in normal or single line mode
|
||||
*/
|
||||
static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* reg, ScanSession& session)
|
||||
Genesys_Register_Set* reg, const ScanSession& session)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
session.assert_computed();
|
||||
|
@ -1040,13 +1047,6 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
|
|||
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
|
||||
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type);
|
||||
|
||||
/*** optical parameters ***/
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
session.params.depth = 8;
|
||||
}
|
||||
|
||||
/* we enable true gray for cis scanners only, and just when doing
|
||||
* scan since color calibration is OK for this mode
|
||||
*/
|
||||
|
|
|
@ -317,7 +317,7 @@ static void gl646_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
static void gl646_setup_registers(Genesys_Device* dev,
|
||||
const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* regs,
|
||||
ScanSession& session,
|
||||
const ScanSession& session,
|
||||
std::vector<uint16_t>& slope_table1,
|
||||
std::vector<uint16_t>& slope_table2,
|
||||
bool xcorrection)
|
||||
|
|
|
@ -1700,6 +1700,17 @@ static void gl841_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
const Genesys_Sensor& sensor)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
|
||||
//in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data
|
||||
if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
s.params.depth = 8;
|
||||
}
|
||||
|
||||
// no 16 bit gamma for this ASIC
|
||||
if (s.params.depth == 16) {
|
||||
s.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
||||
}
|
||||
|
||||
compute_session(dev, s, sensor);
|
||||
|
||||
s.computed = true;
|
||||
|
@ -1722,7 +1733,7 @@ static void gl841_assert_supported_resolution(const ScanSession& session)
|
|||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||
// line mode
|
||||
static void gl841_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* reg, ScanSession& session)
|
||||
Genesys_Register_Set* reg, const ScanSession& session)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
session.assert_computed();
|
||||
|
@ -1835,18 +1846,6 @@ dummy \ scanned lines
|
|||
session.optical_pixels);
|
||||
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
|
||||
|
||||
/*** optical parameters ***/
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
session.params.depth = 8;
|
||||
}
|
||||
|
||||
// no 16 bit gamma for this ASIC
|
||||
if (session.params.depth == 16) {
|
||||
session.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
||||
}
|
||||
|
||||
gl841_init_optical_regs_scan(dev, sensor, reg, exposure_time, session, start);
|
||||
|
||||
move = session.params.starty;
|
||||
|
|
|
@ -1182,6 +1182,16 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
static void gl843_compute_session(Genesys_Device* dev, ScanSession& s,
|
||||
const Genesys_Sensor& sensor)
|
||||
{
|
||||
// in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data
|
||||
if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
s.params.depth = 8;
|
||||
}
|
||||
|
||||
// no 16 bit gamma for this ASIC
|
||||
if (s.params.depth == 16) {
|
||||
s.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
||||
}
|
||||
|
||||
compute_session(dev, s, sensor);
|
||||
|
||||
// compute physical pixel positions
|
||||
|
@ -1207,7 +1217,7 @@ static void gl843_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||
// line mode
|
||||
static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* reg, ScanSession& session)
|
||||
Genesys_Register_Set* reg, const ScanSession& session)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
session.assert_computed();
|
||||
|
@ -1247,18 +1257,6 @@ static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
|
|||
DBG(DBG_info, "%s : exposure=%d pixels\n", __func__, exposure);
|
||||
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type);
|
||||
|
||||
/*** optical parameters ***/
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
session.params.depth = 8;
|
||||
}
|
||||
|
||||
/* no 16 bit gamma for this ASIC */
|
||||
if (session.params.depth == 16) {
|
||||
session.params.flags |= SCAN_FLAG_DISABLE_GAMMA;
|
||||
}
|
||||
|
||||
// now _LOGICAL_ optical values used are known, setup registers
|
||||
gl843_init_optical_regs_scan(dev, sensor, reg, exposure, session);
|
||||
|
||||
|
|
|
@ -875,6 +875,12 @@ static void gl846_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
const Genesys_Sensor& sensor)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
|
||||
// in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data
|
||||
if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
s.params.depth = 8;
|
||||
}
|
||||
|
||||
compute_session(dev, s, sensor);
|
||||
|
||||
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
||||
|
@ -888,7 +894,7 @@ static void gl846_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||
// line mode
|
||||
static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* reg, ScanSession& session)
|
||||
Genesys_Register_Set* reg, const ScanSession& session)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
session.assert_computed();
|
||||
|
@ -922,13 +928,6 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
|
|||
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
|
||||
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type);
|
||||
|
||||
/*** optical parameters ***/
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
session.params.depth = 8;
|
||||
}
|
||||
|
||||
/* we enable true gray for cis scanners only, and just when doing
|
||||
* scan since color calibration is OK for this mode
|
||||
*/
|
||||
|
|
|
@ -891,6 +891,12 @@ static void gl847_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
const Genesys_Sensor& sensor)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
|
||||
// in case of dynamic lineart, we use an internal 8 bit gray scan to generate 1 lineart data
|
||||
if (s.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
s.params.depth = 8;
|
||||
}
|
||||
|
||||
compute_session(dev, s, sensor);
|
||||
|
||||
s.computed = true;
|
||||
|
@ -902,7 +908,7 @@ static void gl847_compute_session(Genesys_Device* dev, ScanSession& s,
|
|||
// set up registers for an actual scan this function sets up the scanner to scan in normal or single
|
||||
// line mode
|
||||
static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
Genesys_Register_Set* reg, ScanSession& session)
|
||||
Genesys_Register_Set* reg, const ScanSession& session)
|
||||
{
|
||||
DBG_HELPER(dbg);
|
||||
session.assert_computed();
|
||||
|
@ -936,13 +942,6 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
|
|||
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
|
||||
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, scan_step_type);
|
||||
|
||||
/*** optical parameters ***/
|
||||
/* in case of dynamic lineart, we use an internal 8 bit gray scan
|
||||
* to generate 1 lineart data */
|
||||
if (session.params.flags & SCAN_FLAG_DYNAMIC_LINEART) {
|
||||
session.params.depth = 8;
|
||||
}
|
||||
|
||||
/* we enable true gray for cis scanners only, and just when doing
|
||||
* scan since color calibration is OK for this mode
|
||||
*/
|
||||
|
|
Ładowanie…
Reference in New Issue