Commit 46e98476 authored by Povilas Kanapickas's avatar Povilas Kanapickas

Merge branch 'genesys-canoscan-8600f' into 'master'

genesys: Add initial support for 2400 and 4800 dpi transparency scanning on CanoScan 8600F

See merge request !81
parents 6d95bc19 8aa5318f
Pipeline #66434600 passed with stages
in 9 minutes and 16 seconds
This diff is collapsed.
......@@ -374,7 +374,7 @@ cleanup:
* SANE_STATUS_GOOD
*/
static SANE_Status
genesys_deskew(Genesys_Scanner *s)
genesys_deskew(Genesys_Scanner *s, const Genesys_Sensor& sensor)
{
SANE_Status status;
Genesys_Device *dev = s->dev;
......@@ -391,8 +391,8 @@ genesys_deskew(Genesys_Scanner *s)
}
status = sanei_magic_findSkew (&s->params,
dev->img_buffer.data(),
dev->sensor.optical_res,
dev->sensor.optical_res,
sensor.optical_res,
sensor.optical_res,
&x,
&y,
&slope);
......@@ -474,5 +474,3 @@ genesys_derotate (Genesys_Scanner * s)
DBGCOMPLETED;
return SANE_STATUS_GOOD;
}
/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */
This diff is collapsed.
This diff is collapsed.
......@@ -301,228 +301,7 @@
#define REG_TRUEG 0x111
#define REG_TRUEB 0x112
/**
* writable scanner registers */
enum
{
reg_0x01 = 0,
reg_0x02,
reg_0x03,
reg_0x04,
reg_0x05,
reg_0x06,
reg_0x07,
reg_0x08,
reg_0x09,
reg_0x0a,
reg_0x0b,
reg_0x0c,
reg_0x11,
reg_0x12,
reg_0x13,
reg_0x14,
reg_0x15,
reg_0x16,
reg_0x17,
reg_0x18,
reg_0x19,
reg_0x1a,
reg_0x1b,
reg_0x1c,
reg_0x1d,
reg_0x1e,
reg_0x1f,
reg_0x20,
reg_0x21,
reg_0x22,
reg_0x23,
reg_0x24,
reg_0x25,
reg_0x26,
reg_0x27,
reg_0x28,
reg_0x29,
reg_0x2a,
reg_0x2b,
reg_0x2c,
reg_0x2d,
reg_0x3b,
reg_0x3c,
reg_0x3d,
reg_0x3e,
reg_0x3f,
reg_0x40,
reg_0x41,
reg_0x42,
reg_0x43,
reg_0x44,
reg_0x45,
reg_0x46,
reg_0x47,
reg_0x48,
reg_0x49,
reg_0x4f,
reg_0x52,
reg_0x53,
reg_0x54,
reg_0x55,
reg_0x56,
reg_0x57,
reg_0x58,
reg_0x59,
reg_0x5a,
reg_0x5b,
reg_0x5c,
reg_0x5f,
reg_0x60,
reg_0x61,
reg_0x62,
reg_0x63,
reg_0x64,
reg_0x65,
reg_0x66,
reg_0x67,
reg_0x68,
reg_0x69,
reg_0x6a,
reg_0x6b,
reg_0x6c,
reg_0x6d,
reg_0x6e,
reg_0x6f,
reg_0x70,
reg_0x71,
reg_0x72,
reg_0x73,
reg_0x74,
reg_0x75,
reg_0x76,
reg_0x77,
reg_0x78,
reg_0x79,
reg_0x7a,
reg_0x7b,
reg_0x7c,
reg_0x7d,
reg_0x7e,
reg_0x7f,
reg_0x80,
reg_0x81,
reg_0x82,
reg_0x83,
reg_0x84,
reg_0x85,
reg_0x86,
reg_0x87,
reg_0x88,
reg_0x89,
reg_0x8a,
reg_0x8b,
reg_0x8c,
reg_0x8d,
reg_0x8e,
reg_0x8f,
reg_0x90,
reg_0x91,
reg_0x92,
reg_0x93,
reg_0x94,
reg_0x95,
reg_0x96,
reg_0x97,
reg_0x98,
reg_0x99,
reg_0x9a,
reg_0x9b,
reg_0x9c,
reg_0x9d,
reg_0x9e,
reg_0x9f,
reg_0xa0,
reg_0xa1,
reg_0xa2,
reg_0xa3,
reg_0xa4,
reg_0xa5,
reg_0xa6,
reg_0xa7,
reg_0xa8,
reg_0xa9,
reg_0xaa,
reg_0xab,
reg_0xac,
reg_0xad,
reg_0xae,
reg_0xaf,
reg_0xb0,
reg_0xb1,
reg_0xb2,
reg_0xb3,
reg_0xb4,
reg_0xb5,
reg_0xb6,
reg_0xb7,
reg_0xb8,
reg_0xbb,
reg_0xbc,
reg_0xbd,
reg_0xbe,
reg_0xc3,
reg_0xc4,
reg_0xc5,
reg_0xc6,
reg_0xc7,
reg_0xc8,
reg_0xc9,
reg_0xca,
reg_0xcb,
reg_0xcc,
reg_0xcd,
reg_0xce,
reg_0xd0,
reg_0xd1,
reg_0xd2,
reg_0xd3,
reg_0xd4,
reg_0xd5,
reg_0xd6,
reg_0xd7,
reg_0xd8,
reg_0xd9,
reg_0xe0,
reg_0xe1,
reg_0xe2,
reg_0xe3,
reg_0xe4,
reg_0xe5,
reg_0xe6,
reg_0xe7,
reg_0xe8,
reg_0xe9,
reg_0xea,
reg_0xeb,
reg_0xec,
reg_0xed,
reg_0xee,
reg_0xef,
reg_0xf0,
reg_0xf1,
reg_0xf2,
reg_0xf3,
reg_0xf4,
reg_0xf5,
reg_0xf6,
reg_0xf7,
reg_0xf8,
reg_0xf9,
reg_0xfa,
reg_0xfb,
reg_0xfc,
reg_0xff,
GENESYS_GL124_MAX_REGS
};
#define SETREG(adr,val) {dev->reg[reg_##adr].address=adr;dev->reg[reg_##adr].value=val;}
#define SETREG(adr,val) { dev->reg.init_reg(adr, val); }
typedef struct
{
......@@ -616,8 +395,6 @@ typedef struct {
static size_t order_01[]={0,1};
static size_t order_0213[]={0,2,1,3};
/* *INDENT-OFF* */
/** @brief database of sensor profiles
* database of sensor profiles giving for each sensor and a given resolution, the period, and timings
* to setup the sensor for the scan.
......@@ -684,9 +461,9 @@ static Motor_Profile motors[]={
{MOTOR_CANONLIDE210, 20864, 2, lide210_max},
{0, 0, 0, NULL},
};
/* *INDENT-ON* */
static
SANE_Status gl124_init_scan_regs (Genesys_Device * dev,
SANE_Status gl124_init_scan_regs (Genesys_Device * dev, const Genesys_Sensor& sensor,
Genesys_Register_Set * reg,
float xres, /*dpi */
float yres, /*dpi */
......@@ -703,15 +480,16 @@ SANE_Status gl124_init_scan_regs (Genesys_Device * dev,
static SANE_Status gl124_start_action (Genesys_Device * dev);
static SANE_Status
gl124_begin_scan (Genesys_Device * dev, Genesys_Register_Set * reg,
gl124_begin_scan (Genesys_Device * dev, const Genesys_Sensor& sensor, Genesys_Register_Set * reg,
SANE_Bool start_motor);
static SANE_Status
gl124_end_scan (Genesys_Device * dev, Genesys_Register_Set * reg,
SANE_Bool check_stop);
static SANE_Status
gl124_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home);
static SANE_Status gl124_init (Genesys_Device * dev);
static SANE_Status gl124_send_shading_data (Genesys_Device * dev, uint8_t * data, int size);
static SANE_Status gl124_init(Genesys_Device * dev);
static SANE_Status gl124_send_shading_data (Genesys_Device * dev, const Genesys_Sensor& sensor,
uint8_t * data, int size);
static SANE_Status gl124_feed (Genesys_Device * dev, unsigned int steps, int reverse);
......@@ -721,5 +499,3 @@ gl124_stop_action (Genesys_Device * dev);
static SANE_Status
gl124_send_slope_table (Genesys_Device * dev, int table_nr,
uint16_t * slope_table, int steps);
/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */
This diff is collapsed.
......@@ -165,95 +165,11 @@
#include "genesys.h"
enum
{
reg_0x01 = 0,
reg_0x02,
reg_0x03,
reg_0x04,
reg_0x05,
reg_0x06,
reg_0x07,
reg_0x08,
reg_0x09,
reg_0x0a,
reg_0x0b,
reg_0x10,
reg_0x11,
reg_0x12,
reg_0x13,
reg_0x14,
reg_0x15,
reg_0x16,
reg_0x17,
reg_0x18,
reg_0x19,
reg_0x1a,
reg_0x1b,
reg_0x1c,
reg_0x1d,
reg_0x1e,
reg_0x1f,
reg_0x20,
reg_0x21,
reg_0x22,
reg_0x23,
reg_0x24,
reg_0x25,
reg_0x26,
reg_0x27,
reg_0x28,
reg_0x29,
reg_0x2c,
reg_0x2d,
reg_0x2e,
reg_0x2f,
reg_0x30,
reg_0x31,
reg_0x32,
reg_0x33,
reg_0x34,
reg_0x35,
reg_0x36,
reg_0x37,
reg_0x38,
reg_0x39,
reg_0x3d,
reg_0x3e,
reg_0x3f,
reg_0x52,
reg_0x53,
reg_0x54,
reg_0x55,
reg_0x56,
reg_0x57,
reg_0x58,
reg_0x59,
reg_0x5a,
reg_0x5b,
reg_0x5c,
reg_0x5d,
reg_0x5e,
reg_0x60,
reg_0x61,
reg_0x62,
reg_0x63,
reg_0x64,
reg_0x65,
reg_0x66,
reg_0x67,
reg_0x68,
reg_0x69,
reg_0x6a,
reg_0x6b,
reg_0x6c,
reg_0x6d,
GENESYS_GL646_MAX_REGS
};
static SANE_Status gl646_set_fe (Genesys_Device * dev, uint8_t set, int dpi);
static SANE_Status gl646_set_fe(Genesys_Device * dev, const Genesys_Sensor& sensor,
uint8_t set, int dpi);
static SANE_Status gl646_public_set_fe (Genesys_Device * dev, uint8_t set);
static SANE_Status gl646_public_set_fe(Genesys_Device * dev, const Genesys_Sensor& sensor,
uint8_t set);
static
SANE_Status
......@@ -281,6 +197,7 @@ gl646_move_to_ta (Genesys_Device * dev);
*/
static SANE_Status
setup_for_scan (Genesys_Device *device,
const Genesys_Sensor& sensor,
Genesys_Register_Set *regs,
Genesys_Settings settings,
SANE_Bool split,
......@@ -294,6 +211,7 @@ setup_for_scan (Genesys_Device *device,
* */
static SANE_Status
gl646_setup_registers (Genesys_Device * dev,
const Genesys_Sensor& sensor,
Genesys_Register_Set * regs,
Genesys_Settings scan_settings,
uint16_t * slope_table1,
......@@ -327,8 +245,9 @@ simple_move (Genesys_Device * dev, SANE_Int distance);
* @param data pointer that will point to the scanned data
*/
static SANE_Status
simple_scan (Genesys_Device * dev, Genesys_Settings settings, SANE_Bool move, SANE_Bool forward,
SANE_Bool shading, std::vector<uint8_t>& data);
simple_scan(Genesys_Device * dev, const Genesys_Sensor& sensor,
Genesys_Settings settings, SANE_Bool move, SANE_Bool forward,
SANE_Bool shading, std::vector<uint8_t>& data);
/**
* Send the stop scan command
......@@ -339,7 +258,8 @@ end_scan (Genesys_Device * dev, Genesys_Register_Set * reg,
/**
* writes control data to an area behind the last motor table.
*/
static SANE_Status write_control (Genesys_Device * dev, int resolution);
static SANE_Status write_control (Genesys_Device * dev, const Genesys_Sensor& sensor,
int resolution);
/**
......@@ -433,7 +353,6 @@ static uint8_t xp200_gray[6]={0x05, 0x0a, 0x0f, 0xa0, 0x10, 0x10};
* master sensor settings, for a given sensor and dpi,
* it gives exposure and CCD time
*/
/* *INDENT-OFF* */
static Sensor_Master sensor_master[] = {
/* HP3670 master settings */
{CCD_HP3670, 75, SANE_TRUE , 75, 4879, 300, 4, 42, NULL, SANE_FALSE, 0x33, 0x43},
......@@ -678,4 +597,3 @@ static Sensor_Settings sensor_settings[] = {
{0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83} /* half ccd settings */
},
};
/* *INDENT-ON* */
This diff is collapsed.
......@@ -250,131 +250,14 @@
#define REG87_LEDADD 0x04
enum
{
reg_0x01 = 0,
reg_0x02,
reg_0x03,
reg_0x04,
reg_0x05,
reg_0x06,
reg_0x07,
reg_0x08,
reg_0x09,
reg_0x0a,
reg_0x10,
reg_0x11,
reg_0x12,
reg_0x13,
reg_0x14,
reg_0x15,
reg_0x16,
reg_0x17,
reg_0x18,
reg_0x19,
reg_0x1a,
reg_0x1b,
reg_0x1c,
reg_0x1d,
reg_0x1e,
reg_0x1f,
reg_0x20,
reg_0x21,
reg_0x22,
reg_0x23,
reg_0x24,
reg_0x25,
reg_0x26,
reg_0x27,
reg_0x29,
reg_0x2c,
reg_0x2d,
reg_0x2e,
reg_0x2f,
reg_0x30,
reg_0x31,
reg_0x32,
reg_0x33,
reg_0x34,
reg_0x35,
reg_0x36,
reg_0x37,
reg_0x38,
reg_0x39,
reg_0x3d,
reg_0x3e,
reg_0x3f,
reg_0x52,
reg_0x53,
reg_0x54,
reg_0x55,
reg_0x56,
reg_0x57,
reg_0x58,
reg_0x59,
reg_0x5a,
reg_0x5d,
reg_0x5e,
reg_0x5f,
reg_0x60,
reg_0x61,
reg_0x62,
reg_0x63,
reg_0x64,
reg_0x65,
reg_0x66,
reg_0x67,
reg_0x68,
reg_0x69,
reg_0x6a,
reg_0x6b,
reg_0x6c,
reg_0x6d,
reg_0x6e,
reg_0x6f,
reg_0x70,
reg_0x71,
reg_0x72,
reg_0x73,
reg_0x74,
reg_0x75,
reg_0x76,
reg_0x77,
reg_0x78,
reg_0x79,
reg_0x7a,
reg_0x7b,
reg_0x7c,
reg_0x7d,
reg_0x7e,
reg_0x7f,
reg_0x80,
reg_0x81,
reg_0x82,
reg_0x83,
reg_0x84,
reg_0x85,
reg_0x86,
reg_0x87,
reg_0x88,
reg_0x89,
GENESYS_GL841_MAX_REGS
};
#define INITREG(adr,val) {dev->reg[index].address=adr;dev->reg[index].value=val;index++;}
#define INITREG(adr,val) {dev->reg.init_reg(adr, val); }
/**
* prototypes declaration in case of unit testing
*/
static
int gl841_exposure_time(Genesys_Device *dev,
int gl841_exposure_time(Genesys_Device *dev, const Genesys_Sensor& sensor,
float slope_dpi,
int scan_step_type,
int start,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2169,8 +2169,8 @@ sanei_usb_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size)
if (ret < 0)
{
DBG (1, "sanei_usb_read_bulk: read failed: %s\n",
sanei_libusb_strerror (ret));
DBG (1, "sanei_usb_read_bulk: read failed (still got %d bytes): %s\n",
rsize, sanei_libusb_strerror (ret));
read_size = -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment