Merge branch 'genesys-opticfilm-7200i' into 'master'

genesys: Implement support for Plustek Opticfilm 7200i

See merge request sane-project/backends!197
merge-requests/199/head
Povilas Kanapickas 2019-09-29 22:15:02 +00:00
commit 9824dfe8b0
14 zmienionych plików z 321 dodań i 27 usunięć

Wyświetl plik

@ -1666,6 +1666,14 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
dev->cmd_set->end_scan(dev, &dev->calib_reg, SANE_TRUE);
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
for (std::size_t i = 0; i < size / 2; ++i) {
auto value = calibration_data[i];
value = ((value >> 8) & 0xff) | ((value << 8) & 0xff00);
calibration_data[i] = value;
}
}
std::fill(out_average_data.begin(),
out_average_data.begin() + dev->calib_pixels_offset * channels, 0);
@ -2590,6 +2598,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
case CCD_CS4400F:
case CCD_CS8400F:
case CCD_CS8600F:
case CCD_PLUSTEK_7200I:
target_code = 0xe000;
o = 0;
compute_coefficients (dev,

Wyświetl plik

@ -124,6 +124,9 @@ usb 0x03f0 0x4605
# Plustek OpticBook 3600
usb 0x07b3 0x0900
# Plustek OpticFilm 7200i
usb 0x07b3 0x0c04
# Primax Electronics, Ltd Xerox 2400 Onetouch
usb 0x0461 0x038b

Wyświetl plik

@ -141,6 +141,9 @@ struct Genesys_Model
// Start of white strip in transparency mode in mm
SANE_Fixed y_offset_calib_white_ta = 0;
// Start of black strip in transparency mode in mm
SANE_Fixed y_offset_calib_black_ta = 0;
// Size of scan area after paper sensor stop sensing document in mm
SANE_Fixed post_scan = 0;

Wyświetl plik

@ -159,6 +159,7 @@ enum Genesys_Model_Type
MODEL_XEROX_2400,
MODEL_XEROX_TRAVELSCANNER_100,
MODEL_PLUSTEK_OPTICPRO_3600,
MODEL_PLUSTEK_OPTICFILM_7200I,
MODEL_HP_SCANJET_N6310,
MODEL_PLUSTEK_OPTICBOOK_3800,
MODEL_CANON_IMAGE_FORMULA_101
@ -186,6 +187,7 @@ enum Genesys_Sensor_Type
CCD_G4050,
CIS_CANONLIDE110,
CCD_PLUSTEK_3600,
CCD_PLUSTEK_7200I,
CCD_HP_N6310,
CIS_CANONLIDE700,
CCD_CS4400F,
@ -217,6 +219,7 @@ enum Genesys_Dac_Type
DAC_G4050,
DAC_CANONLIDE110,
DAC_PLUSTEK_3600,
DAC_PLUSTEK_7200I,
DAC_CANONLIDE700,
DAC_CS8400F,
DAC_CS8600F,
@ -245,6 +248,7 @@ enum Genesys_Gpo_Type
GPO_G4050,
GPO_CANONLIDE110,
GPO_PLUSTEK_3600,
GPO_PLUSTEK_7200I,
GPO_CANONLIDE210,
GPO_HP_N6310,
GPO_CANONLIDE700,
@ -277,6 +281,7 @@ enum Genesys_Motor_Type
MOTOR_G4050,
MOTOR_CANONLIDE110,
MOTOR_PLUSTEK_3600,
MOTOR_PLUSTEK_7200I,
MOTOR_CANONLIDE700,
MOTOR_CS8400F,
MOTOR_CS8600F,

Wyświetl plik

@ -67,6 +67,15 @@ static void gl843_set_buffer_address(Genesys_Device* dev, uint32_t addr)
dev->write_register(0x5c, (addr & 0xff));
}
static void gl843_set_ram_address(Genesys_Device* dev, uint32_t addr)
{
DBG_HELPER_ARGS(dbg, "setting address to 0x%05x", addr & 0x1fffff);
dev->write_register(0x29, ((addr >> 16) & 0x1f));
dev->write_register(0x2a, ((addr >> 8) & 0xff));
dev->write_register(0x2b, (addr & 0xff));
}
/**
* writes a block of data to RAM
* @param dev USB device
@ -198,7 +207,9 @@ static void gl843_setup_sensor(Genesys_Device* dev, const Genesys_Sensor& sensor
for (const auto& custom_reg : sensor.custom_regs) {
regs->set8(custom_reg.address, custom_reg.value);
}
if (!(dev->model->flags & GENESYS_FLAG_FULL_HWDPI_MODE)) {
if (!(dev->model->flags & GENESYS_FLAG_FULL_HWDPI_MODE) &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I)
{
regs->set8(0x7d, 0x90);
}
@ -246,6 +257,9 @@ gl843_init_registers (Genesys_Device * dev)
}
SETREG(0x04, 0x10);
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
SETREG(0x04, 0x22);
}
// fine tune upon device description
SETREG (0x05, 0x80);
@ -267,6 +281,9 @@ gl843_init_registers (Genesys_Device * dev)
{
SETREG(0x06, 0xd8); /* SCANMOD=110, PWRBIT and GAIN4 */
}
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
SETREG(0x06, 0xd0);
}
if (dev->model->model_id == MODEL_CANON_CANOSCAN_4400F) {
SETREG(0x06, 0xf0); /* SCANMOD=111, PWRBIT and no GAIN4 */
}
@ -294,6 +311,9 @@ gl843_init_registers (Genesys_Device * dev)
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F) {
SETREG(0x0b, 0x89);
}
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
SETREG(0x0b, 0x2a);
}
if (dev->model->model_id == MODEL_HP_SCANJET_G4010 ||
dev->model->model_id == MODEL_HP_SCANJET_G4050 ||
dev->model->model_id == MODEL_HP_SCANJET_4850C)
@ -301,7 +321,9 @@ gl843_init_registers (Genesys_Device * dev)
SETREG(0x0b, 0x69);
}
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F) {
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I)
{
SETREG (0x0c, 0x00);
}
@ -511,6 +533,9 @@ gl843_init_registers (Genesys_Device * dev)
{
SETREG(0x6b, 0xf4);
}
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
SETREG(0x6b, 0x31);
}
// 0x6c, 0x6d, 0x6e, 0x6f are set according to gpio tables. See
// gl843_init_gpio.
@ -614,7 +639,9 @@ gl843_init_registers (Genesys_Device * dev)
}
// MTRPLS[0:7]: The width of the ADF motor trigger signal pulse.
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F) {
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I)
{
SETREG(0x94, 0xff);
}
@ -647,6 +674,7 @@ gl843_init_registers (Genesys_Device * dev)
if (dev->model->model_id == MODEL_CANON_CANOSCAN_4400F ||
dev->model->model_id == MODEL_CANON_CANOSCAN_8400F ||
dev->model->model_id == MODEL_CANON_CANOSCAN_8600F ||
dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I ||
dev->model->model_id == MODEL_HP_SCANJET_G4010 ||
dev->model->model_id == MODEL_HP_SCANJET_G4050 ||
dev->model->model_id == MODEL_HP_SCANJET_4850C)
@ -656,7 +684,8 @@ gl843_init_registers (Genesys_Device * dev)
// SEL3INV, TGSTIME[0:2], TGWTIME[0:2]
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F)
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I)
{
SETREG(0x9e, 0x00); // SENSOR_DEF
}
@ -671,14 +700,16 @@ gl843_init_registers (Genesys_Device * dev)
// 0xa6-0xa9: controls gpio, see gl843_gpio_init
// not documented
if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F
&& dev->model->model_id != MODEL_CANON_CANOSCAN_8400F)
if (dev->model->model_id != MODEL_CANON_CANOSCAN_4400F &&
dev->model->model_id != MODEL_CANON_CANOSCAN_8400F &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I)
{
SETREG(0xaa, 0x00);
}
// GPOM9, MULSTOP[0-2], NODECEL, TB3TB1, TB5TB2, FIX16CLK.
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F) {
// GPOM9, MULSTOP[0-2], NODECEL, TB3TB1, TB5TB2, FIX16CLK. Not documented
if (dev->model->model_id != MODEL_CANON_CANOSCAN_8400F &&
dev->model->model_id != MODEL_PLUSTEK_OPTICFILM_7200I) {
SETREG(0xab, 0x50);
}
if (dev->model->model_id == MODEL_CANON_CANOSCAN_4400F) {
@ -704,6 +735,19 @@ gl843_init_registers (Genesys_Device * dev)
}
dev->calib_reg = dev->reg;
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
gl843_set_ram_address(dev, 0x03ff00);
uint8_t data[32] = {
0x8c, 0x8f, 0xc9, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x6a, 0x73, 0x63, 0x68, 0x69, 0x65, 0x6e, 0x00,
};
sanei_genesys_bulk_write_data(dev, 0x3c, data, 32);
}
}
// Send slope table for motor movement slope_table in machine byte order
@ -738,6 +782,12 @@ static void gl843_send_slope_table(Genesys_Device* dev, int table_nr,
write_data(dev, 0x4000 + 0x800 * table_nr, steps * 2, table.data());
}
static void gl843_set_ad_fe(Genesys_Device* dev)
{
for (const auto& reg : dev->frontend.regs) {
sanei_genesys_fe_write_data(dev, reg.address, reg.value);
}
}
// Set values of analog frontend
static void gl843_set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor, uint8_t set)
@ -757,12 +807,13 @@ static void gl843_set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor, uint
// check analog frontend type
// FIXME: looks like we write to that register with initial data
uint8_t val = dev->read_register(REG04);
if ((val & REG04_FESET) != 0x00)
{
// for now there is no support for AD fe
throw SaneException(SANE_STATUS_UNSUPPORTED, "unsupported frontend type %d",
val & REG04_FESET);
uint8_t fe_type = dev->read_register(REG04) & REG04_FESET;
if (fe_type == 2) {
gl843_set_ad_fe(dev);
return;
}
if (fe_type != 0) {
throw SaneException(SANE_STATUS_UNSUPPORTED, "unsupported frontend type %d", fe_type);
}
DBG(DBG_proc, "%s(): frontend reset complete\n", __func__);
@ -1136,7 +1187,17 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
break; // should not happen
}
} else {
r->value |= 0x10; /* mono */
switch (dev->frontend.layout.type) {
case FrontendType::WOLFSON:
r->value |= 0x10; // pixel by pixel
break;
case FrontendType::ANALOG_DEVICES:
r->value |= 0x20; // slow color pixel by pixel
break;
default:
throw SaneException("Invalid frontend type %d",
static_cast<unsigned>(dev->frontend.layout.type));
}
}
sanei_genesys_set_dpihw(*reg, sensor, dpihw);
@ -2593,7 +2654,7 @@ static void gl843_offset_calibration(Genesys_Device* dev, const Genesys_Sensor&
{
DBG_HELPER(dbg);
if (dev->frontend.layout.type == FrontendType::UNKNOWN)
if (dev->frontend.layout.type != FrontendType::WOLFSON)
return;
unsigned int channels, bpp;
@ -2816,7 +2877,7 @@ static void gl843_coarse_gain_calibration(Genesys_Device* dev, const Genesys_Sen
int resolution;
int bpp;
if (dev->frontend.layout.type == FrontendType::UNKNOWN)
if (dev->frontend.layout.type != FrontendType::WOLFSON)
return;
dpihw = sensor.get_logical_hwdpi(dpi);
@ -3072,9 +3133,15 @@ static void gl843_boot(Genesys_Device* dev, SANE_Bool cold)
}
/* CLKSET */
int clock_freq = REG0B_48MHZ;
if (dev->model->model_id == MODEL_CANON_CANOSCAN_8600F)
clock_freq = REG0B_60MHZ;
int clock_freq = REG0B_48MHZ;
switch (dev->model->model_id) {
case MODEL_CANON_CANOSCAN_8600F:
clock_freq = REG0B_60MHZ;
break;
case MODEL_PLUSTEK_OPTICFILM_7200I:
clock_freq = REG0B_30MHZ;
break;
}
val = (dev->reg.find_reg(0x0b).value & ~REG0B_CLKSET) | clock_freq;

Wyświetl plik

@ -850,6 +850,10 @@ Image read_unshuffled_image_from_scanner(Genesys_Device* dev, const ScanSession&
ImagePipelineStack pipeline;
pipeline.push_first_node<ImagePipelineNodeImageSource>(image);
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I && session.params.depth == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
}
#ifdef WORDS_BIGENDIAN
if (depth == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
@ -1468,6 +1472,10 @@ void compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor&
// ensure the number of optical pixels is divisible by 2.
// In quarter-CCD mode optical_pixels is 4x larger than the actual physical number
s.optical_pixels = align_int_up(s.optical_pixels, 2 * s.ccd_size_divisor);
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
s.optical_pixels = align_int_up(s.optical_pixels, 16);
}
}
// after all adjustments on the optical pixels have been made, compute the number of pixels
@ -1661,6 +1669,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
auto format = create_pixel_format(session.params.depth,
dev->model->is_cis ? 1 : session.params.channels,
dev->model->line_mode_color_order);
auto depth = get_pixel_format_depth(format);
auto width = get_pixels_from_row_bytes(format, session.output_line_bytes_raw);
auto read_data_from_usb = [dev](std::size_t size, std::uint8_t* data)
@ -1704,8 +1713,12 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
"_0_before_swap.pnm");
}
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I && depth == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
}
#ifdef WORDS_BIGENDIAN
if (get_pixel_format_depth(format) == 16) {
if (depth == 16) {
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
}
#endif

Wyświetl plik

@ -56,6 +56,10 @@ void genesys_init_frontend_tables()
wolfson_layout.offset_addr = { 0x20, 0x21, 0x22 };
wolfson_layout.gain_addr = { 0x28, 0x29, 0x2a };
GenesysFrontendLayout analog_devices;
analog_devices.type = FrontendType::ANALOG_DEVICES;
Genesys_Frontend fe;
fe.fe_id = DAC_WOLFSON_UMAX;
fe.layout = wolfson_layout;
@ -457,6 +461,23 @@ void genesys_init_frontend_tables()
s_frontends->push_back(fe);
fe = Genesys_Frontend();
fe.fe_id = DAC_PLUSTEK_7200I;
fe.layout = analog_devices;
fe.regs = {
{ 0x00, 0xf8 },
{ 0x01, 0x80 },
{ 0x02, 0x0a },
{ 0x03, 0x06 },
{ 0x04, 0x0f },
{ 0x05, 0x56 },
{ 0x06, 0x64 },
{ 0x07, 0x56 },
};
fe.reg2 = {0x00, 0x00, 0x00};
s_frontends->push_back(fe);
fe = Genesys_Frontend();
fe.fe_id = DAC_CS8400F;
fe.layout = wolfson_layout;

Wyświetl plik

@ -290,6 +290,21 @@ void genesys_init_gpo_tables()
s_gpo->push_back(gpo);
gpo = Genesys_Gpo();
gpo.gpo_id = GPO_PLUSTEK_7200I;
gpo.regs = {
{ 0x6c, 0x4c },
{ 0x6d, 0x80 },
{ 0x6e, 0x4c },
{ 0x6f, 0x80 },
{ 0xa6, 0x00 },
{ 0xa7, 0x07 },
{ 0xa8, 0x20 },
{ 0xa9, 0x01 },
};
s_gpo->push_back(gpo);
gpo = Genesys_Gpo();
gpo.gpo_id = GPO_CS4400F;
gpo.regs = {

Wyświetl plik

@ -2329,6 +2329,64 @@ void genesys_init_usb_device_tables()
s_usb_devices->emplace_back(0x07b3, 0x0900, model);
model = Genesys_Model();
model.name = "plustek-opticfilm-7200i";
model.vendor = "PLUSTEK";
model.model = "OpticFilm 7200i";
model.model_id = MODEL_PLUSTEK_OPTICFILM_7200I;
model.asic_type = AsicType::GL843;
model.xdpi_values = { 7200, 3600, 1800, 900 };
model.ydpi_values = { 7200, 3600, 1800, 900 };
model.bpp_gray_values = { 16 };
model.bpp_color_values = { 16 };
model.default_method = ScanMethod::TRANSPARENCY;
model.x_offset = SANE_FIX(0.0);
model.y_offset = SANE_FIX(0.0);
model.x_size = SANE_FIX(36.0);
model.y_size = SANE_FIX(44.0);
model.y_offset_calib_white = SANE_FIX(0.0);
model.x_offset_calib_black = SANE_FIX(6.5);
model.x_offset_ta = SANE_FIX(0.0);
model.y_offset_ta = SANE_FIX(29.0);
model.x_size_ta = SANE_FIX(36.0);
model.y_size_ta = SANE_FIX(24.0);
model.y_offset_sensor_to_ta = SANE_FIX(0.0);
model.y_offset_calib_black_ta = SANE_FIX(6.5);
model.y_offset_calib_white_ta = SANE_FIX(0.0);
model.post_scan = SANE_FIX(0.0);
model.eject_feed = SANE_FIX(0.0);
model.ld_shift_r = 0;
model.ld_shift_g = 12;
model.ld_shift_b = 24;
model.line_mode_color_order = ColorOrder::RGB;
model.is_cis = false;
model.is_sheetfed = false;
model.ccd_type = CCD_PLUSTEK_7200I;
model.dac_type = DAC_PLUSTEK_7200I;
model.gpo_type = GPO_PLUSTEK_7200I;
model.motor_type = MOTOR_PLUSTEK_7200I;
model.flags = GENESYS_FLAG_HAS_UTA |
GENESYS_FLAG_CUSTOM_GAMMA |
GENESYS_FLAG_SKIP_WARMUP |
GENESYS_FLAG_DARK_CALIBRATION |
GENESYS_FLAG_OFFSET_CALIBRATION |
GENESYS_HAS_NO_BUTTONS |
GENESYS_FLAG_SHADING_REPARK |
GENESYS_FLAG_CALIBRATION_HOST_SIDE;
model.shading_lines = 7;
model.shading_ta_lines = 50;
model.search_lines = 200;
s_usb_devices->emplace_back(0x07b3, 0x0c04, model);
model = Genesys_Model();
model.name = "hewlett-packard-scanjet-N6310";
model.vendor = "Hewlett Packard";

Wyświetl plik

@ -611,6 +611,14 @@ void genesys_init_motor_tables()
s_motors->push_back(std::move(motor));
motor = Genesys_Motor();
motor.motor_id = MOTOR_PLUSTEK_7200I;
motor.base_ydpi = 3600;
motor.optical_ydpi = 3600;
motor.max_step_type = 0; // only used on GL841
s_motors->push_back(std::move(motor));
motor = Genesys_Motor();
motor.motor_id = MOTOR_IMG101;
motor.base_ydpi = 600;

Wyświetl plik

@ -740,6 +740,13 @@ static uint32_t motor_speeds_cs8600f[] = {
1540, 1536, 1528, 1524, 1520, 1516, 1512, 1508, 1500, 0
};
static uint32_t motor_speeds_plustek_7200i_1[] = {
11000, 11000, 0
};
static uint32_t motor_speeds_plustek_7200i_2[] = {
15880, 15880, 0
};
Motor_Profile gl843_motor_profiles[] = {
{ MOTOR_KVSS080, 8000, 1, kvss080 },
{ MOTOR_G4050, 8016, 1, g4050_fast },
@ -749,6 +756,8 @@ Motor_Profile gl843_motor_profiles[] = {
{ MOTOR_G4050, 56064, 1, g4050_high },
{ MOTOR_CS8400F, 50000, 2, cs8400f_fast },
{ MOTOR_CS8600F, 0x59d8, 2, motor_speeds_cs8600f }, // FIXME: if the exposure is lower then we'll select another motor
{ MOTOR_PLUSTEK_7200I, 0x19c8, 1, motor_speeds_plustek_7200i_1},
{ MOTOR_PLUSTEK_7200I, 0x2538, 1, motor_speeds_plustek_7200i_2},
{ 0, 0, 0, NULL },
};

Wyświetl plik

@ -3310,6 +3310,90 @@ void genesys_init_sensor_tables()
s_sensors->push_back(sensor);
sensor = Genesys_Sensor();
sensor.sensor_id = CCD_PLUSTEK_7200I;
sensor.optical_res = 7200;
sensor.register_dpihw_override = 1200;
sensor.black_pixels = 88; // TODO
sensor.dummy_pixel = 20;
sensor.CCD_start_xoffset = 0;
sensor.sensor_pixels = 10200; // TODO
sensor.fau_gain_white_ref = 210;
sensor.gain_white_ref = 230;
sensor.exposure = { 0x0000, 0x0000, 0x0000 };
sensor.custom_regs = {
{ 0x08, 0x00 },
{ 0x09, 0x00 },
{ 0x0a, 0x00 },
{ 0x16, 0x23 },
{ 0x17, 0x0c },
{ 0x18, 0x10 },
{ 0x19, 0x2a },
{ 0x1a, 0x00 },
{ 0x1b, 0x00 },
{ 0x1c, 0x21 },
{ 0x1d, 0x84 },
{ 0x52, 0x0a },
{ 0x53, 0x0d },
{ 0x54, 0x10 },
{ 0x55, 0x01 },
{ 0x56, 0x04 },
{ 0x57, 0x07 },
{ 0x58, 0x3a },
{ 0x59, 0x81 },
{ 0x5a, 0xc0 },
{ 0x70, 0x0a },
{ 0x71, 0x0b },
{ 0x72, 0x0c },
{ 0x73, 0x0d },
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x00 },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x00 },
};
sensor.gamma = {1.0, 1.0, 1.0};
sensor.get_logical_hwdpi_fun = default_get_logical_hwdpi;
sensor.get_register_hwdpi_fun = default_get_logical_hwdpi;
sensor.get_hwdpi_divisor_fun = default_get_hwdpi_divisor_for_dpi;
sensor.get_ccd_size_divisor_fun = get_ccd_size_divisor_exact;
{
struct CustomSensorSettings
{
ResolutionFilter resolutions;
ScanMethod method;
unsigned ccd_size_divisor;
unsigned logical_dpihw_override;
unsigned pixel_count_multiplier;
unsigned exposure_lperiod;
unsigned dpiset_override;
GenesysRegisterSettingSet custom_fe_regs;
};
CustomSensorSettings custom_settings[] = {
{ { 900 }, ScanMethod::TRANSPARENCY, 1, 900, 8, 0x2538, 150, {} },
{ { 1800 }, ScanMethod::TRANSPARENCY, 1, 1800, 4, 0x2538, 300, {} },
{ { 3600 }, ScanMethod::TRANSPARENCY, 1, 3600, 2, 0x2538, 600, {} },
{ { 7200 }, ScanMethod::TRANSPARENCY, 1, 7200, 1, 0x19c8, 1200, {
{ 0x02, 0x1b },
{ 0x03, 0x14 },
{ 0x04, 0x20 },
}
},
};
for (const CustomSensorSettings& setting : custom_settings) {
sensor.resolutions = setting.resolutions;
sensor.method = setting.method;
sensor.ccd_size_divisor = setting.ccd_size_divisor;
sensor.logical_dpihw_override = setting.logical_dpihw_override;
sensor.pixel_count_multiplier = setting.pixel_count_multiplier;
sensor.exposure_lperiod = setting.exposure_lperiod;
sensor.dpiset_override = setting.dpiset_override;
sensor.custom_fe_regs = setting.custom_fe_regs;
s_sensors->push_back(sensor);
}
}
sensor = Genesys_Sensor();
sensor.sensor_id = CCD_IMG101;
sensor.optical_res = 1200;

Wyświetl plik

@ -17,6 +17,11 @@
:status :basic
:comment "Has a Primax USB ID"
:model "OpticFilm 7200i"
:interface "USB"
:usbid "0x07b3" "0x0c04"
:status :basic
; -----------------------------------------------------------------------------
:mfg "Medion/Lifetec/Tevion/Cytron"

Wyświetl plik

@ -1759,12 +1759,6 @@
:status :unsupported
:comment "GL842 based, maybe to be added to genesys backend"
:model "OpticFilm 7200i"
:interface "USB"
:usbid "0x07b3" "0x0c04"
:status :unsupported
:comment "GL843 based, maybe to be added to genesys backend"
:model "OpticPro A3U"
:interface "USB"
:status :unsupported