genesys: Pass start pixel to *_init_optical_regs_scan() via session

merge-requests/164/head
Povilas Kanapickas 2019-09-12 22:40:55 +03:00
rodzic c0e465784e
commit 80d0129f44
3 zmienionych plików z 25 dodań i 44 usunięć

Wyświetl plik

@ -778,10 +778,9 @@ static void gl124_setup_sensor(Genesys_Device * dev,
*/
static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sensor& sensor,
Genesys_Register_Set* reg, unsigned int exposure_time,
const ScanSession& session, unsigned int start)
const ScanSession& session)
{
DBG_HELPER_ARGS(dbg, "exposure_time=%d, start=%d\n",
exposure_time, start);
DBG_HELPER_ARGS(dbg, "exposure_time=%d", exposure_time);
unsigned int segcnt;
unsigned int startx, endx;
unsigned int dpihw;
@ -804,6 +803,12 @@ static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
/* start and end coordinate in optical dpi coordinates */
/* startx = start / ccd_pixels_per_system_pixel + sensor.dummy_pixel; XXX STEF XXX */
unsigned start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
startx = start / ccd_pixels_per_system_pixel;
endx = startx + session.optical_pixels / ccd_pixels_per_system_pixel;
@ -1003,7 +1008,6 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
DBG_HELPER(dbg);
session.assert_computed();
int start;
int move;
unsigned int mflags;
int exposure_time;
@ -1014,15 +1018,6 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
DBG (DBG_info, "%s: optical_res=%d\n", __func__, session.optical_resolution);
/* compute scan parameters values */
/* pixels are allways given at full optical resolution */
/* use detected left margin and fixed value */
start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
/* cis color scan is effectively a gray scan with 3 gray lines per color line and a FILTER of 0 */
if (dev->model->is_cis) {
slope_dpi = session.params.yres * session.params.channels;
@ -1057,7 +1052,7 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
*/
// now _LOGICAL_ optical values used are known, setup registers
gl124_init_optical_regs_scan(dev, sensor, reg, exposure_time, session, start);
gl124_init_optical_regs_scan(dev, sensor, reg, exposure_time, session);
/* add tl_y to base movement */
move = session.params.starty;

Wyświetl plik

@ -681,9 +681,9 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
*/
static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sensor& sensor,
Genesys_Register_Set* reg, unsigned int exposure_time,
const ScanSession& session, unsigned int start)
const ScanSession& session)
{
DBG_HELPER_ARGS(dbg, "exposure_time=%d, start=%d", exposure_time, start);
DBG_HELPER_ARGS(dbg, "exposure_time=%d", exposure_time);
unsigned int words_per_line;
unsigned int dpihw;
GenesysRegister *r;
@ -702,6 +702,11 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
gl846_setup_sensor(dev, sensor, sensor_profile, reg);
// start and end coordinate in optical dpi coordinates
unsigned start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
unsigned startx = start / ccd_pixels_per_system_pixel + sensor.CCD_start_xoffset;
unsigned endx = startx + session.optical_pixels / ccd_pixels_per_system_pixel;
@ -888,7 +893,6 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
DBG_HELPER(dbg);
session.assert_computed();
int start;
int move;
unsigned int mflags; /**> motor flags */
int exposure_time;
@ -897,17 +901,6 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
int dummy = 0;
int scan_step_type = 1;
/* compute scan parameters values */
/* pixels are allways given at full optical resolution */
/* use detected left margin and fixed value */
/* start */
/* add x coordinates */
start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
dummy = 3-session.params.channels;
/* slope_dpi */
@ -939,7 +932,7 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
/* we enable true gray for cis scanners only, and just when doing
* scan since color calibration is OK for this mode
*/
gl846_init_optical_regs_scan(dev, sensor, reg, exposure_time, session, start);
gl846_init_optical_regs_scan(dev, sensor, reg, exposure_time, session);
/*** motor parameters ***/

Wyświetl plik

@ -698,9 +698,9 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
*/
static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sensor& sensor,
Genesys_Register_Set* reg, unsigned int exposure_time,
const ScanSession& session, unsigned int start)
const ScanSession& session)
{
DBG_HELPER_ARGS(dbg, "exposure_time=%d, start=%d", exposure_time, start);
DBG_HELPER_ARGS(dbg, "exposure_time=%d", exposure_time);
unsigned dpiset, dpihw;
GenesysRegister *r;
@ -718,6 +718,11 @@ static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
gl847_setup_sensor(dev, sensor, sensor_profile, reg);
dpiset = session.params.xres * ccd_pixels_per_system_pixel;
unsigned start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
// start and end coordinate in optical dpi coordinates
unsigned startx = start / ccd_pixels_per_system_pixel + sensor.CCD_start_xoffset;
unsigned endx = startx + session.optical_pixels / ccd_pixels_per_system_pixel;
@ -902,7 +907,6 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
DBG_HELPER(dbg);
session.assert_computed();
int start;
int move;
unsigned int mflags; /**> motor flags */
int exposure_time;
@ -911,17 +915,6 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
int dummy = 0;
int scan_step_type = 1;
/* compute scan parameters values */
/* pixels are allways given at full optical resolution */
/* use detected left margin and fixed value */
/* start */
/* add x coordinates */
start = session.params.startx;
if (session.num_staggered_lines > 0) {
start |= 1;
}
dummy = 3 - session.params.channels;
/* slope_dpi */
@ -953,7 +946,7 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
/* we enable true gray for cis scanners only, and just when doing
* scan since color calibration is OK for this mode
*/
gl847_init_optical_regs_scan(dev, sensor, reg, exposure_time, session, start);
gl847_init_optical_regs_scan(dev, sensor, reg, exposure_time, session);
move = session.params.starty;
DBG(DBG_info, "%s: move=%d steps\n", __func__, move);