kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Add initial support for flatbed mode on Canon 4400F
rodzic
7e7f02773e
commit
f366073b08
|
@ -266,6 +266,7 @@ enum class AdcId : unsigned
|
|||
CANON_LIDE_120,
|
||||
CANON_LIDE_200,
|
||||
CANON_LIDE_700F,
|
||||
CANON_4400F,
|
||||
CANON_8400F,
|
||||
CANON_8600F,
|
||||
G4050,
|
||||
|
@ -346,6 +347,7 @@ enum class MotorId : unsigned
|
|||
CANON_LIDE_35,
|
||||
CANON_LIDE_700,
|
||||
CANON_LIDE_80,
|
||||
CANON_4400F,
|
||||
CANON_8400F,
|
||||
CANON_8600F,
|
||||
DP665,
|
||||
|
|
|
@ -2710,7 +2710,9 @@ static void genesys_flatbed_calibration(Genesys_Device* dev, Genesys_Sensor& sen
|
|||
coarse_res = 1600;
|
||||
}
|
||||
|
||||
if (dev->model->model_id == ModelId::CANON_8600F) {
|
||||
if (dev->model->model_id == ModelId::CANON_4400F ||
|
||||
dev->model->model_id == ModelId::CANON_8600F)
|
||||
{
|
||||
coarse_res = 1200;
|
||||
}
|
||||
|
||||
|
@ -4491,7 +4493,7 @@ static void probe_genesys_devices()
|
|||
of Genesys_Calibration_Cache as is.
|
||||
*/
|
||||
static const char* CALIBRATION_IDENT = "sane_genesys";
|
||||
static const int CALIBRATION_VERSION = 17;
|
||||
static const int CALIBRATION_VERSION = 18;
|
||||
|
||||
bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration,
|
||||
const std::string& path)
|
||||
|
|
|
@ -291,8 +291,12 @@ gl843_init_registers (Genesys_Device * dev)
|
|||
|
||||
SETREG(0x22, 0x01);
|
||||
SETREG(0x23, 0x01);
|
||||
if (dev->model->model_id == ModelId::CANON_4400F ||
|
||||
dev->model->model_id == ModelId::CANON_8600F)
|
||||
if (dev->model->model_id == ModelId::CANON_4400F)
|
||||
{
|
||||
SETREG(0x22, 0x64);
|
||||
SETREG(0x23, 0x64);
|
||||
}
|
||||
if (dev->model->model_id == ModelId::CANON_8600F)
|
||||
{
|
||||
SETREG(0x22, 0xc8);
|
||||
SETREG(0x23, 0xc8);
|
||||
|
@ -370,7 +374,7 @@ gl843_init_registers (Genesys_Device * dev)
|
|||
// 0x5b-0x5c: GMMADDR[0:15] address for gamma or motor tables download
|
||||
// SENSOR_DEF
|
||||
|
||||
// DECSEL[0:2]: The number of deceleratino steps after touching home sensor
|
||||
// DECSEL[0:2]: The number of deceleration steps after touching home sensor
|
||||
// STOPTIM[0:4]: The stop duration between change of directions in
|
||||
// backtracking
|
||||
SETREG(0x5e, 0x23);
|
||||
|
@ -896,9 +900,13 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
fast_step_type = step_type;
|
||||
}
|
||||
|
||||
unsigned fast_yres = sanei_genesys_get_lowest_ydpi(dev);
|
||||
if (dev->model->model_id == ModelId::CANON_4400F) {
|
||||
fast_yres = scan_yres;
|
||||
}
|
||||
sanei_genesys_slope_table(fast_table,
|
||||
&fast_steps,
|
||||
sanei_genesys_get_lowest_ydpi(dev),
|
||||
fast_yres,
|
||||
exposure,
|
||||
dev->motor.base_ydpi,
|
||||
fast_step_type,
|
||||
|
@ -3360,7 +3368,9 @@ void CommandSetGl843::send_shading_data(Genesys_Device* dev, const Genesys_Senso
|
|||
strpixel = dev->session.pixel_startx;
|
||||
endpixel = dev->session.pixel_endx;
|
||||
|
||||
if (dev->model->model_id == ModelId::CANON_8600F) {
|
||||
if (dev->model->model_id == ModelId::CANON_4400F ||
|
||||
dev->model->model_id == ModelId::CANON_8600F)
|
||||
{
|
||||
int half_ccd_factor = dev->session.optical_resolution /
|
||||
sensor.get_logical_hwdpi(dev->session.output_resolution);
|
||||
strpixel /= half_ccd_factor * sensor.ccd_pixels_per_system_pixel();
|
||||
|
|
|
@ -514,6 +514,28 @@ void genesys_init_frontend_tables()
|
|||
s_frontends->push_back(fe);
|
||||
|
||||
|
||||
fe = Genesys_Frontend();
|
||||
fe.id = AdcId::CANON_4400F;
|
||||
fe.layout = wolfson_layout;
|
||||
fe.regs = {
|
||||
{ 0x00, 0x00 },
|
||||
{ 0x01, 0x23 },
|
||||
{ 0x02, 0x24 },
|
||||
{ 0x03, 0x2f },
|
||||
{ 0x20, 0x6d },
|
||||
{ 0x21, 0x67 },
|
||||
{ 0x22, 0x5b },
|
||||
{ 0x24, 0x00 },
|
||||
{ 0x25, 0x00 },
|
||||
{ 0x26, 0x00 },
|
||||
{ 0x28, 0xd8 },
|
||||
{ 0x29, 0xd1 },
|
||||
{ 0x2a, 0xb9 },
|
||||
};
|
||||
fe.reg2 = {0x00, 0x00, 0x00};
|
||||
s_frontends->push_back(fe);
|
||||
|
||||
|
||||
fe = Genesys_Frontend();
|
||||
fe.id = AdcId::CANON_8400F;
|
||||
fe.layout = wolfson_layout;
|
||||
|
|
|
@ -439,8 +439,8 @@ void genesys_init_usb_device_tables()
|
|||
model.resolutions = {
|
||||
{
|
||||
{ ScanMethod::FLATBED },
|
||||
{ 4800, 2400, 1200, 600, 400, 300, 200, 150, 100 },
|
||||
{ 4800, 2400, 1200, 600, 400, 300, 200, 150, 100 },
|
||||
{ 1200, 600, 300 },
|
||||
{ 1200, 600, 300 },
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -448,11 +448,11 @@ void genesys_init_usb_device_tables()
|
|||
model.bpp_color_values = { 8, 16 };
|
||||
|
||||
model.x_offset = 6.0;
|
||||
model.y_offset = 13.00;
|
||||
model.x_size = 217.9;
|
||||
model.y_size = 315.0;
|
||||
model.y_offset = 12.00;
|
||||
model.x_size = 215.9;
|
||||
model.y_size = 297.0;
|
||||
|
||||
model.y_offset_calib_white = 3.0;
|
||||
model.y_offset_calib_white = 0.0;
|
||||
model.x_offset_calib_black = 0.0;
|
||||
|
||||
model.x_offset_ta = 8.0;
|
||||
|
@ -466,25 +466,25 @@ void genesys_init_usb_device_tables()
|
|||
model.post_scan = 0.0;
|
||||
model.eject_feed = 0.0;
|
||||
|
||||
model.ld_shift_r = 0;
|
||||
model.ld_shift_g = 24;
|
||||
model.ld_shift_b = 48;
|
||||
model.ld_shift_r = 96;
|
||||
model.ld_shift_g = 48;
|
||||
model.ld_shift_b = 0;
|
||||
|
||||
model.line_mode_color_order = ColorOrder::RGB;
|
||||
|
||||
model.is_cis = false;
|
||||
model.is_sheetfed = false;
|
||||
model.sensor_id = SensorId::CCD_CANON_4400F;
|
||||
model.adc_id = AdcId::G4050;
|
||||
model.adc_id = AdcId::CANON_4400F;
|
||||
model.gpio_id = GpioId::CANON_4400F;
|
||||
model.motor_id = MotorId::G4050;
|
||||
model.flags = GENESYS_FLAG_NO_CALIBRATION |
|
||||
GENESYS_FLAG_OFFSET_CALIBRATION |
|
||||
model.motor_id = MotorId::CANON_4400F;
|
||||
model.flags = GENESYS_FLAG_OFFSET_CALIBRATION |
|
||||
GENESYS_FLAG_STAGGERED_LINE |
|
||||
GENESYS_FLAG_SKIP_WARMUP |
|
||||
GENESYS_FLAG_DARK_CALIBRATION |
|
||||
GENESYS_FLAG_FULL_HWDPI_MODE |
|
||||
GENESYS_FLAG_CUSTOM_GAMMA;
|
||||
GENESYS_FLAG_CUSTOM_GAMMA |
|
||||
GENESYS_FLAG_SHADING_REPARK;
|
||||
model.buttons = GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW;
|
||||
model.shading_lines = 100;
|
||||
model.shading_ta_lines = 0;
|
||||
|
|
|
@ -482,6 +482,35 @@ void genesys_init_motor_tables()
|
|||
s_motors->push_back(std::move(motor));
|
||||
|
||||
|
||||
motor = Genesys_Motor();
|
||||
motor.id = MotorId::CANON_4400F;
|
||||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
s_motors->push_back(std::move(motor));
|
||||
|
||||
|
||||
motor = Genesys_Motor();
|
||||
motor.id = MotorId::CANON_8400F;
|
||||
motor.base_ydpi = 1600;
|
||||
|
|
|
@ -527,7 +527,7 @@ static uint32_t g4050_xpa[] = {
|
|||
0
|
||||
};
|
||||
|
||||
static uint32_t cs4400f_fast[] = {
|
||||
static uint32_t motor_speeds_cs4400f_1[] = {
|
||||
49152, 49152, 31144, 23652, 19538, 16822, 14908, 13442, 12288, 11356,
|
||||
10590, 9922, 9362, 8886, 8456, 8064, 7728, 7418, 7148, 6882,
|
||||
6664, 6446, 6252, 6060, 5890, 5740, 5586, 5450, 5322, 5198,
|
||||
|
@ -780,10 +780,10 @@ static std::uint32_t motor_speeds_plustek_7500i_2[] = {
|
|||
Motor_Profile gl843_motor_profiles[] = {
|
||||
{ MotorId::KVSS080, 8000, StepType::HALF, kvss080 },
|
||||
{ MotorId::G4050, 8016, StepType::HALF, g4050_fast },
|
||||
{ MotorId::G4050, 11640, StepType::HALF, cs4400f_fast },
|
||||
{ MotorId::G4050, 15624, StepType::HALF, g4050_xpa },
|
||||
{ MotorId::G4050, 42752, StepType::QUARTER, g4050_max },
|
||||
{ MotorId::G4050, 56064, StepType::HALF, g4050_high },
|
||||
{ MotorId::CANON_4400F, 11640, StepType::HALF, motor_speeds_cs4400f_1},
|
||||
{ MotorId::CANON_8400F, 50000, StepType::QUARTER, cs8400f_fast },
|
||||
{ MotorId::CANON_8600F, 0x59d8, StepType::QUARTER, motor_speeds_cs8600f }, // FIXME: if the exposure is lower then we'll select another motor
|
||||
{ MotorId::PLUSTEK_OPTICFILM_7200I, 0x19c8, StepType::HALF, motor_speeds_plustek_7200i_1},
|
||||
|
|
|
@ -2223,43 +2223,138 @@ void genesys_init_sensor_tables()
|
|||
sensor.dummy_pixel = 20;
|
||||
sensor.ccd_start_xoffset = 152;
|
||||
// 5360 max at 600 dpi
|
||||
sensor.sensor_pixels = 5360*8;
|
||||
sensor.sensor_pixels = 5700 * 8;
|
||||
sensor.fau_gain_white_ref = 160;
|
||||
sensor.gain_white_ref = 160;
|
||||
sensor.exposure = { 0x9c40, 0x9c40, 0x9c40 };
|
||||
sensor.exposure_lperiod = 11640;
|
||||
sensor.custom_regs = {
|
||||
{ 0x74, 0x00 }, { 0x75, 0xf8 }, { 0x76, 0x38 },
|
||||
{ 0x77, 0x00 }, { 0x78, 0xfc }, { 0x79, 0x00 },
|
||||
{ 0x7a, 0x00 }, { 0x7b, 0x92 }, { 0x7c, 0xa4 },
|
||||
{ 0x0c, 0x00 },
|
||||
{ 0x70, 0x00 },
|
||||
{ 0x71, 0x02 },
|
||||
{ 0x9e, 0x2d },
|
||||
{ 0x16, 0x13 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x10 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x30 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x00 },
|
||||
{ 0x1d, 0x6b },
|
||||
{ 0x52, 0x0a },
|
||||
{ 0x53, 0x0d },
|
||||
{ 0x54, 0x00 },
|
||||
{ 0x55, 0x03 },
|
||||
{ 0x56, 0x06 },
|
||||
{ 0x57, 0x08 },
|
||||
{ 0x58, 0x5b },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0x40 },
|
||||
};
|
||||
sensor.gamma = { 1.0f, 1.0f, 1.0f };
|
||||
sensor.get_logical_hwdpi_fun = get_sensor_optical_with_ccd_divisor;
|
||||
sensor.get_register_hwdpi_fun = [](const Genesys_Sensor&, unsigned) { return 4800; };
|
||||
sensor.get_hwdpi_divisor_fun = [](const Genesys_Sensor&, unsigned) { return 1; };
|
||||
sensor.get_ccd_size_divisor_fun = default_get_ccd_size_divisor_for_dpi;
|
||||
s_sensors->push_back(sensor);
|
||||
|
||||
{
|
||||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
int exposure_lperiod;
|
||||
std::vector<ScanMethod> methods;
|
||||
GenesysRegisterSettingSet extra_custom_regs;
|
||||
};
|
||||
|
||||
CustomSensorSettings custom_settings[] = {
|
||||
{ { 300, 600, 1200 }, 11640, { ScanMethod::FLATBED }, {
|
||||
{ 0x16, 0x13 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x10 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x30 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x00 },
|
||||
{ 0x1d, 0x6b },
|
||||
{ 0x52, 0x0a },
|
||||
{ 0x53, 0x0d },
|
||||
{ 0x54, 0x00 },
|
||||
{ 0x55, 0x03 },
|
||||
{ 0x56, 0x06 },
|
||||
{ 0x57, 0x08 },
|
||||
{ 0x58, 0x5b },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0x40 },
|
||||
{ 0x70, 0x00 }, { 0x71, 0x02 }, { 0x72, 0x01 }, { 0x73, 0x03 },
|
||||
{ 0x74, 0x00 }, { 0x75, 0xf8 }, { 0x76, 0x38 },
|
||||
{ 0x77, 0x00 }, { 0x78, 0xfc }, { 0x79, 0x00 },
|
||||
{ 0x7a, 0x00 }, { 0x7b, 0x92 }, { 0x7c, 0xa4 },
|
||||
{ 0x9e, 0x2d },
|
||||
}
|
||||
},
|
||||
{ { 300, 600, 1200 }, 33300, { ScanMethod::TRANSPARENCY }, {
|
||||
{ 0x16, 0x13 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x10 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x30 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x00 },
|
||||
{ 0x1d, 0x6b },
|
||||
{ 0x52, 0x0a },
|
||||
{ 0x53, 0x0d },
|
||||
{ 0x54, 0x00 },
|
||||
{ 0x55, 0x03 },
|
||||
{ 0x56, 0x06 },
|
||||
{ 0x57, 0x08 },
|
||||
{ 0x58, 0x5b },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0x40 },
|
||||
{ 0x70, 0x00 }, { 0x71, 0x02 }, { 0x72, 0x00 }, { 0x73, 0x02 },
|
||||
{ 0x74, 0x00 }, { 0x75, 0xf8 }, { 0x76, 0x38 },
|
||||
{ 0x77, 0x00 }, { 0x78, 0xfc }, { 0x79, 0x00 },
|
||||
{ 0x7a, 0x00 }, { 0x7b, 0x92 }, { 0x7c, 0xa4 },
|
||||
{ 0x9e, 0x2d },
|
||||
}
|
||||
},
|
||||
{ { 2400 }, 33300, { ScanMethod::TRANSPARENCY }, {
|
||||
{ 0x16, 0x13 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x10 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x30 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x01 },
|
||||
{ 0x1d, 0x75 },
|
||||
{ 0x52, 0x0b },
|
||||
{ 0x53, 0x0d },
|
||||
{ 0x54, 0x00 },
|
||||
{ 0x55, 0x03 },
|
||||
{ 0x56, 0x06 },
|
||||
{ 0x57, 0x09 },
|
||||
{ 0x58, 0x53 },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0x40 },
|
||||
{ 0x70, 0x00 }, { 0x71, 0x02 }, { 0x72, 0x02 }, { 0x73, 0x04 },
|
||||
{ 0x74, 0x00 }, { 0x75, 0xff }, { 0x76, 0x00 },
|
||||
{ 0x77, 0x00 }, { 0x78, 0xff }, { 0x79, 0x00 },
|
||||
{ 0x7a, 0x00 }, { 0x7b, 0x54 }, { 0x7c, 0x92 },
|
||||
{ 0x9e, 0x2d },
|
||||
}
|
||||
},
|
||||
{ { 4800 }, 33300, { ScanMethod::TRANSPARENCY }, {
|
||||
{ 0x16, 0x13 },
|
||||
{ 0x17, 0x0a },
|
||||
{ 0x18, 0x10 },
|
||||
{ 0x19, 0x2a },
|
||||
{ 0x1a, 0x30 },
|
||||
{ 0x1b, 0x00 },
|
||||
{ 0x1c, 0x61 },
|
||||
{ 0x1d, 0x75 },
|
||||
{ 0x52, 0x02 },
|
||||
{ 0x53, 0x05 },
|
||||
{ 0x54, 0x08 },
|
||||
{ 0x55, 0x0b },
|
||||
{ 0x56, 0x0d },
|
||||
{ 0x57, 0x0f },
|
||||
{ 0x58, 0x1b },
|
||||
{ 0x59, 0x00 },
|
||||
{ 0x5a, 0x40 },
|
||||
{ 0x70, 0x08 }, { 0x71, 0x0a }, { 0x72, 0x0a }, { 0x73, 0x0c },
|
||||
{ 0x74, 0x00 }, { 0x75, 0xff }, { 0x76, 0xff },
|
||||
{ 0x77, 0x00 }, { 0x78, 0xff }, { 0x79, 0xff },
|
||||
{ 0x7a, 0x00 }, { 0x7b, 0x54 }, { 0x7c, 0x92 },
|
||||
{ 0x9e, 0x2d },
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (const CustomSensorSettings& setting : custom_settings)
|
||||
{
|
||||
for (auto method : setting.methods) {
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.method = method;
|
||||
sensor.custom_regs = setting.extra_custom_regs;
|
||||
s_sensors->push_back(sensor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sensor = Genesys_Sensor();
|
||||
|
|
|
@ -184,11 +184,11 @@
|
|||
:status :complete
|
||||
:comment "GL124+ based, resolution from 75 to 4800 dpi"
|
||||
|
||||
:model "CanoScan 4400f"
|
||||
:model "CanoScan 4400F"
|
||||
:interface "USB"
|
||||
:usbid "0x04a9" "0x2228"
|
||||
:status :unsupported
|
||||
:comment "GL843 based, to be added to the genesys backend"
|
||||
:status :basic
|
||||
:comment "GL843 based"
|
||||
|
||||
:model "CanoScan 5600F"
|
||||
:interface "USB"
|
||||
|
|
|
@ -305,13 +305,6 @@
|
|||
:status :unsupported
|
||||
:comment "Probably unsupported. See link."
|
||||
|
||||
:model "CanoScan 4400F"
|
||||
:url "unsupported/canon-4400.html"
|
||||
:interface "USB"
|
||||
:usbid "0x04a9" "0x2228"
|
||||
:status :unsupported
|
||||
:comment "GL843 based, to be added to genesys backend"
|
||||
|
||||
:model "CanoScan 5000F"
|
||||
:url "unsupported/canon-5000f.html"
|
||||
:interface "USB"
|
||||
|
|
Ładowanie…
Reference in New Issue