kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'genesys-canon-4400f' into 'master'
genesys: Implement transparency support for Canon 4400F See merge request sane-project/backends!335merge-requests/336/merge
commit
1fa3086cab
|
@ -82,6 +82,7 @@ void CommandSetCommon::set_xpa_lamp_power(Genesys_Device& dev, bool set) const
|
|||
// FIXME: BUG: we're not clearing the registers to the previous state when returning back when
|
||||
// turning off the lamp
|
||||
LampSettings settings[] = {
|
||||
{ ModelId::CANON_4400F, ScanMethod::TRANSPARENCY, {}, {} },
|
||||
{ ModelId::CANON_8400F, ScanMethod::TRANSPARENCY, {
|
||||
{ 0xa6, 0x34, 0xf4 },
|
||||
}, {
|
||||
|
|
|
@ -481,11 +481,11 @@ enum class ModelFlag : unsigned
|
|||
// the scanner always uses maximum hwdpi to setup the sensor
|
||||
FULL_HWDPI_MODE = 1 << 19,
|
||||
|
||||
// scanner calibration is handled on the host side
|
||||
CALIBRATION_HOST_SIDE = 1 << 21,
|
||||
|
||||
// the scanner outputs 16-bit data that is byte-inverted
|
||||
INVERTED_16BIT_DATA = 1 << 22,
|
||||
INVERTED_16BIT_DATA = 1 << 20,
|
||||
|
||||
// the scanner has transparency, but it's implemented using only one motor
|
||||
UTA_NO_SECONDARY_MOTOR = 1 << 21
|
||||
};
|
||||
|
||||
inline ModelFlag operator|(ModelFlag left, ModelFlag right)
|
||||
|
|
|
@ -506,10 +506,6 @@ void sanei_genesys_init_shading_data(Genesys_Device* dev, const Genesys_Sensor&
|
|||
{
|
||||
DBG_HELPER_ARGS(dbg, "pixels_per_line: %d", pixels_per_line);
|
||||
|
||||
if (has_flag(dev->model->flags, ModelFlag::CALIBRATION_HOST_SIDE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int channels;
|
||||
int i;
|
||||
|
||||
|
@ -903,7 +899,9 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
|
|||
const auto& sensor = sanei_genesys_find_sensor(&dev, resolution, 3, scan_method);
|
||||
|
||||
bool uses_secondary_head = (scan_method == ScanMethod::TRANSPARENCY ||
|
||||
scan_method == ScanMethod::TRANSPARENCY_INFRARED);
|
||||
scan_method == ScanMethod::TRANSPARENCY_INFRARED) &&
|
||||
(!has_flag(dev.model->flags, ModelFlag::UTA_NO_SECONDARY_MOTOR));
|
||||
|
||||
bool uses_secondary_pos = uses_secondary_head &&
|
||||
dev.model->default_method == ScanMethod::FLATBED;
|
||||
|
||||
|
@ -1043,10 +1041,11 @@ void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home)
|
|||
}
|
||||
|
||||
// FIXME: also check whether the scanner actually has a secondary head
|
||||
if (!dev.is_head_pos_known(ScanHeadId::SECONDARY) ||
|
||||
if ((!dev.is_head_pos_known(ScanHeadId::SECONDARY) ||
|
||||
dev.head_pos(ScanHeadId::SECONDARY) > 0 ||
|
||||
dev.settings.scan_method == ScanMethod::TRANSPARENCY ||
|
||||
dev.settings.scan_method == ScanMethod::TRANSPARENCY_INFRARED)
|
||||
dev.settings.scan_method == ScanMethod::TRANSPARENCY_INFRARED) &&
|
||||
(!has_flag(dev.model->flags, ModelFlag::UTA_NO_SECONDARY_MOTOR)))
|
||||
{
|
||||
scanner_move_back_home_ta(dev);
|
||||
}
|
||||
|
@ -2532,7 +2531,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
|
|||
{
|
||||
DBG_HELPER(dbg);
|
||||
|
||||
if (has_flag(dev->model->flags, ModelFlag::CALIBRATION_HOST_SIDE)) {
|
||||
if (sensor.use_host_side_calib) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4709,7 +4708,7 @@ static void probe_genesys_devices()
|
|||
of Genesys_Calibration_Cache as is.
|
||||
*/
|
||||
static const char* CALIBRATION_IDENT = "sane_genesys";
|
||||
static const int CALIBRATION_VERSION = 25;
|
||||
static const int CALIBRATION_VERSION = 26;
|
||||
|
||||
bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration,
|
||||
const std::string& path)
|
||||
|
|
|
@ -816,7 +816,7 @@ static void gl124_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
|
||||
dev->line_count = 0;
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
// MAXWD is expressed in 2 words unit
|
||||
|
||||
|
|
|
@ -550,7 +550,7 @@ void CommandSetGl646::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
|||
dev->read_buffer.clear();
|
||||
dev->read_buffer.alloc(session.buffer_size_read);
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
dev->read_active = true;
|
||||
|
||||
|
|
|
@ -1615,7 +1615,7 @@ dummy \ scanned lines
|
|||
dev->read_buffer.clear();
|
||||
dev->read_buffer.alloc(session.buffer_size_read);
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
dev->read_active = true;
|
||||
|
||||
|
|
|
@ -792,6 +792,7 @@ void CommandSetGl843::set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
|||
static bool should_use_new_fast_table(const Genesys_Device& dev)
|
||||
{
|
||||
switch (dev.model->model_id) {
|
||||
case ModelId::CANON_4400F:
|
||||
case ModelId::CANON_8600F:
|
||||
case ModelId::CANON_8400F:
|
||||
case ModelId::PLUSTEK_OPTICFILM_7200I:
|
||||
|
@ -1056,7 +1057,7 @@ static void gl843_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
r = sanei_genesys_get_address (reg, REG_0x01);
|
||||
if (has_flag(session.params.flags, ScanFlag::DISABLE_SHADING) ||
|
||||
has_flag(dev->model->flags, ModelFlag::NO_CALIBRATION) ||
|
||||
has_flag(dev->model->flags, ModelFlag::CALIBRATION_HOST_SIDE))
|
||||
session.use_host_side_calib)
|
||||
{
|
||||
r->value &= ~REG_0x01_DVDSET;
|
||||
} else {
|
||||
|
@ -1239,7 +1240,7 @@ void CommandSetGl843::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
|||
dev->read_buffer.clear();
|
||||
dev->read_buffer.alloc(session.buffer_size_read);
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
dev->read_active = true;
|
||||
|
||||
|
@ -1257,6 +1258,9 @@ static float get_model_x_offset_ta(const Genesys_Device& dev,
|
|||
if (dev.model->model_id == ModelId::CANON_8600F && settings.xres == 4800) {
|
||||
return 85.0f;
|
||||
}
|
||||
if (dev.model->model_id == ModelId::CANON_4400F && settings.xres == 4800) {
|
||||
return dev.model->x_offset_ta - 10.0;
|
||||
}
|
||||
return dev.model->x_offset_ta;
|
||||
}
|
||||
|
||||
|
@ -1300,7 +1304,9 @@ ScanSession CommandSetGl843::calculate_scan_session(const Genesys_Device* dev,
|
|||
}
|
||||
start = start + settings.tl_x;
|
||||
|
||||
if (dev->model->model_id == ModelId::CANON_8400F ||
|
||||
if ((dev->model->model_id == ModelId::CANON_4400F &&
|
||||
settings.scan_method == ScanMethod::TRANSPARENCY) ||
|
||||
dev->model->model_id == ModelId::CANON_8400F ||
|
||||
dev->model->model_id == ModelId::CANON_8600F)
|
||||
{
|
||||
// FIXME: this is probably just an artifact of a bug elsewhere
|
||||
|
@ -1684,6 +1690,9 @@ static bool should_calibrate_only_active_area(const Genesys_Device& dev,
|
|||
if (settings.scan_method == ScanMethod::TRANSPARENCY ||
|
||||
settings.scan_method == ScanMethod::TRANSPARENCY_INFRARED)
|
||||
{
|
||||
if (dev.model->model_id == ModelId::CANON_4400F && settings.xres >= 4800) {
|
||||
return true;
|
||||
}
|
||||
if (dev.model->model_id == ModelId::CANON_8600F && settings.xres == 4800) {
|
||||
return true;
|
||||
}
|
||||
|
@ -2597,7 +2606,8 @@ void CommandSetGl843::move_to_ta(Genesys_Device* dev) const
|
|||
float resolution = resolution_settings.get_min_resolution_y();
|
||||
|
||||
unsigned multiplier = 16;
|
||||
if (dev->model->model_id == ModelId::CANON_8400F) {
|
||||
if (dev->model->model_id == ModelId::CANON_8400F ||
|
||||
dev->model->model_id == ModelId::CANON_4400F) {
|
||||
multiplier = 4;
|
||||
}
|
||||
unsigned feed = static_cast<unsigned>(multiplier * (dev->model->y_offset_sensor_to_ta * resolution) /
|
||||
|
|
|
@ -662,7 +662,7 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
reg->set16(REG_STRPIXEL, session.pixel_startx);
|
||||
reg->set16(REG_ENDPIXEL, session.pixel_endx);
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
/* MAXWD is expressed in 4 words unit */
|
||||
// BUG: we shouldn't multiply by channels here
|
||||
|
|
|
@ -669,7 +669,7 @@ static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
reg->set16(REG_STRPIXEL, session.pixel_startx);
|
||||
reg->set16(REG_ENDPIXEL, session.pixel_endx);
|
||||
|
||||
build_image_pipeline(dev, session);
|
||||
build_image_pipeline(dev, sensor, session);
|
||||
|
||||
/* MAXWD is expressed in 4 words unit */
|
||||
// BUG: we shouldn't multiply by channels here
|
||||
|
|
|
@ -952,7 +952,13 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s,
|
|||
s.pixel_endx /= s.hwdpi_divisor;
|
||||
|
||||
// in case of stagger we have to start at an odd coordinate
|
||||
bool stagger_starts_even = dev->model->model_id == ModelId::CANON_8400F;
|
||||
bool stagger_starts_even = false;
|
||||
if (dev->model->model_id == ModelId::CANON_4400F ||
|
||||
dev->model->model_id == ModelId::CANON_8400F)
|
||||
{
|
||||
stagger_starts_even = true;
|
||||
}
|
||||
|
||||
if (s.num_staggered_lines > 0) {
|
||||
if (!stagger_starts_even && (s.pixel_startx & 1) == 0) {
|
||||
s.pixel_startx++;
|
||||
|
@ -1186,6 +1192,8 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
|
|||
s.enable_ledadd = (s.params.channels == 1 && dev->model->is_cis && dev->settings.true_gray);
|
||||
}
|
||||
|
||||
s.use_host_side_calib = sensor.use_host_side_calib;
|
||||
|
||||
if (dev->model->asic_type == AsicType::GL841 ||
|
||||
dev->model->asic_type == AsicType::GL843)
|
||||
{
|
||||
|
@ -1244,7 +1252,8 @@ static FakeBufferModel get_fake_usb_buffer_model(const ScanSession& session)
|
|||
return model;
|
||||
}
|
||||
|
||||
void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
|
||||
void build_image_pipeline(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
const ScanSession& session)
|
||||
{
|
||||
static unsigned s_pipeline_index = 0;
|
||||
|
||||
|
@ -1349,13 +1358,18 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
|
|||
"_3_after_stagger.pnm");
|
||||
}
|
||||
|
||||
if (has_flag(dev->model->flags, ModelFlag::CALIBRATION_HOST_SIDE) &&
|
||||
if (session.use_host_side_calib &&
|
||||
!has_flag(dev->model->flags, ModelFlag::NO_CALIBRATION) &&
|
||||
!has_flag(session.params.flags, ScanFlag::DISABLE_SHADING))
|
||||
{
|
||||
unsigned pixel_shift = session.params.startx * dev->calib_session.params.xres /
|
||||
sensor.optical_res;
|
||||
if (dev->model->model_id == ModelId::CANON_4400F) {
|
||||
pixel_shift = session.params.startx;
|
||||
}
|
||||
dev->pipeline.push_node<ImagePipelineNodeCalibrate>(dev->dark_average_data,
|
||||
dev->white_average_data,
|
||||
dev->calib_session.params.startx *
|
||||
pixel_shift *
|
||||
dev->calib_session.params.channels);
|
||||
|
||||
if (DBG_LEVEL >= DBG_io2) {
|
||||
|
|
|
@ -407,7 +407,8 @@ extern void sanei_genesys_generate_gamma_buffer(Genesys_Device* dev,
|
|||
|
||||
void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor);
|
||||
|
||||
void build_image_pipeline(Genesys_Device* dev, const ScanSession& session);
|
||||
void build_image_pipeline(Genesys_Device* dev, const Genesys_Sensor& sensor,
|
||||
const ScanSession& session);
|
||||
|
||||
std::uint8_t compute_frontend_gain(float value, float target_value,
|
||||
FrontendType frontend_type);
|
||||
|
|
|
@ -157,6 +157,7 @@ std::ostream& operator<<(std::ostream& out, const Genesys_Sensor& sensor)
|
|||
<< " segment_order: "
|
||||
<< format_indent_braced_list(4, format_vector_unsigned(4, sensor.segment_order)) << '\n'
|
||||
<< " stagger_config: " << format_indent_braced_list(4, sensor.stagger_config) << '\n'
|
||||
<< " use_host_side_calib: " << sensor.use_host_side_calib << '\n'
|
||||
<< " custom_base_regs: " << format_indent_braced_list(4, sensor.custom_base_regs) << '\n'
|
||||
<< " custom_regs: " << format_indent_braced_list(4, sensor.custom_regs) << '\n'
|
||||
<< " custom_fe_regs: " << format_indent_braced_list(4, sensor.custom_fe_regs) << '\n'
|
||||
|
|
|
@ -399,6 +399,9 @@ struct Genesys_Sensor {
|
|||
// high-enough resolution, every other pixel column is shifted
|
||||
StaggerConfig stagger_config;
|
||||
|
||||
// True if calibration should be performed on host-side
|
||||
bool use_host_side_calib = false;
|
||||
|
||||
GenesysRegisterSettingSet custom_base_regs; // gl646-specific
|
||||
GenesysRegisterSettingSet custom_regs;
|
||||
GenesysRegisterSettingSet custom_fe_regs;
|
||||
|
@ -460,6 +463,7 @@ struct Genesys_Sensor {
|
|||
segment_size == other.segment_size &&
|
||||
segment_order == other.segment_order &&
|
||||
stagger_config == other.stagger_config &&
|
||||
use_host_side_calib == other.use_host_side_calib &&
|
||||
custom_base_regs == other.custom_base_regs &&
|
||||
custom_regs == other.custom_regs &&
|
||||
custom_fe_regs == other.custom_fe_regs &&
|
||||
|
@ -493,6 +497,8 @@ void serialize(Stream& str, Genesys_Sensor& x)
|
|||
serialize_newline(str);
|
||||
serialize(str, x.stagger_config);
|
||||
serialize_newline(str);
|
||||
serialize(str, x.use_host_side_calib);
|
||||
serialize_newline(str);
|
||||
serialize(str, x.custom_base_regs);
|
||||
serialize_newline(str);
|
||||
serialize(str, x.custom_regs);
|
||||
|
|
|
@ -129,6 +129,7 @@ bool ScanSession::operator==(const ScanSession& other) const
|
|||
buffer_size_shrink == other.buffer_size_shrink &&
|
||||
buffer_size_out == other.buffer_size_out &&
|
||||
enable_ledadd == other.enable_ledadd &&
|
||||
use_host_side_calib == other.use_host_side_calib &&
|
||||
pipeline_needs_reorder == other.pipeline_needs_reorder &&
|
||||
pipeline_needs_ccd == other.pipeline_needs_ccd &&
|
||||
pipeline_needs_shrink == other.pipeline_needs_shrink;
|
||||
|
@ -165,6 +166,8 @@ std::ostream& operator<<(std::ostream& out, const ScanSession& session)
|
|||
<< " buffer_size_read: " << session.buffer_size_lines << '\n'
|
||||
<< " buffer_size_shrink: " << session.buffer_size_shrink << '\n'
|
||||
<< " buffer_size_out: " << session.buffer_size_out << '\n'
|
||||
<< " enable_ledadd: " << session.enable_ledadd << '\n'
|
||||
<< " use_host_side_calib: " << session.use_host_side_calib << '\n'
|
||||
<< " filters: "
|
||||
<< (session.pipeline_needs_reorder ? " reorder": "")
|
||||
<< (session.pipeline_needs_ccd ? " ccd": "")
|
||||
|
|
|
@ -309,6 +309,9 @@ struct ScanSession {
|
|||
// whether to enable ledadd functionality
|
||||
bool enable_ledadd = false;
|
||||
|
||||
// whether calibration should be performed host-side
|
||||
bool use_host_side_calib = false;
|
||||
|
||||
// what pipeline modifications are needed
|
||||
bool pipeline_needs_reorder = false;
|
||||
bool pipeline_needs_ccd = false;
|
||||
|
@ -364,6 +367,7 @@ void serialize(Stream& str, ScanSession& x)
|
|||
serialize(str, x.buffer_size_shrink);
|
||||
serialize(str, x.buffer_size_out);
|
||||
serialize(str, x.enable_ledadd);
|
||||
serialize(str, x.use_host_side_calib);
|
||||
serialize(str, x.pipeline_needs_reorder);
|
||||
serialize(str, x.pipeline_needs_ccd);
|
||||
serialize(str, x.pipeline_needs_shrink);
|
||||
|
|
|
@ -438,6 +438,10 @@ void genesys_init_usb_device_tables()
|
|||
{ ScanMethod::FLATBED },
|
||||
{ 1200, 600, 300 },
|
||||
{ 1200, 600, 300 },
|
||||
}, {
|
||||
{ ScanMethod::TRANSPARENCY },
|
||||
{ 4800, 2400, 1200 },
|
||||
{ 9600, 4800, 2400, 1200 },
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -452,13 +456,13 @@ void genesys_init_usb_device_tables()
|
|||
model.y_offset_calib_white = 0.0;
|
||||
model.x_offset_calib_black = 0.0;
|
||||
|
||||
model.x_offset_ta = 8.0;
|
||||
model.y_offset_ta = 13.00;
|
||||
model.x_size_ta = 217.9;
|
||||
model.y_size_ta = 250.0;
|
||||
model.x_offset_ta = 115.0;
|
||||
model.y_offset_ta = 60.0;
|
||||
model.x_size_ta = 35.0;
|
||||
model.y_size_ta = 230.0;
|
||||
|
||||
model.y_offset_sensor_to_ta = 0.0;
|
||||
model.y_offset_calib_white_ta = 40.0;
|
||||
model.y_offset_sensor_to_ta = 46.0;
|
||||
model.y_offset_calib_white_ta = 47.0;
|
||||
|
||||
model.post_scan = 0.0;
|
||||
model.eject_feed = 0.0;
|
||||
|
@ -480,10 +484,12 @@ void genesys_init_usb_device_tables()
|
|||
ModelFlag::DARK_CALIBRATION |
|
||||
ModelFlag::FULL_HWDPI_MODE |
|
||||
ModelFlag::CUSTOM_GAMMA |
|
||||
ModelFlag::SHADING_REPARK;
|
||||
ModelFlag::SHADING_REPARK |
|
||||
ModelFlag::UTA_NO_SECONDARY_MOTOR;
|
||||
|
||||
model.buttons = GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW;
|
||||
model.shading_lines = 100;
|
||||
model.shading_ta_lines = 0;
|
||||
model.shading_ta_lines = 50;
|
||||
model.search_lines = 100;
|
||||
|
||||
s_usb_devices->emplace_back(0x04a9, 0x2228, model);
|
||||
|
@ -2621,7 +2627,6 @@ void genesys_init_usb_device_tables()
|
|||
ModelFlag::DARK_CALIBRATION |
|
||||
ModelFlag::OFFSET_CALIBRATION |
|
||||
ModelFlag::SHADING_REPARK |
|
||||
ModelFlag::CALIBRATION_HOST_SIDE |
|
||||
ModelFlag::INVERTED_16BIT_DATA;
|
||||
|
||||
model.shading_lines = 7;
|
||||
|
@ -2684,8 +2689,7 @@ void genesys_init_usb_device_tables()
|
|||
ModelFlag::SKIP_WARMUP |
|
||||
ModelFlag::DARK_CALIBRATION |
|
||||
ModelFlag::OFFSET_CALIBRATION |
|
||||
ModelFlag::SHADING_REPARK |
|
||||
ModelFlag::CALIBRATION_HOST_SIDE;
|
||||
ModelFlag::SHADING_REPARK;
|
||||
|
||||
model.shading_lines = 7;
|
||||
model.shading_ta_lines = 50;
|
||||
|
@ -2747,8 +2751,7 @@ void genesys_init_usb_device_tables()
|
|||
ModelFlag::SKIP_WARMUP |
|
||||
ModelFlag::DARK_CALIBRATION |
|
||||
ModelFlag::OFFSET_CALIBRATION |
|
||||
ModelFlag::SHADING_REPARK |
|
||||
ModelFlag::CALIBRATION_HOST_SIDE;
|
||||
ModelFlag::SHADING_REPARK;
|
||||
|
||||
model.shading_lines = 7;
|
||||
model.shading_ta_lines = 50;
|
||||
|
|
|
@ -245,8 +245,27 @@ void genesys_init_motor_tables()
|
|||
motor.id = MotorId::CANON_4400F;
|
||||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 9600;
|
||||
motor.profiles.push_back({MotorSlope::create_from_steps(49152, 484, 1014),
|
||||
StepType::HALF, 11640});
|
||||
|
||||
profile = MotorProfile();
|
||||
profile.slope = MotorSlope::create_from_steps(28597 * 2, 727 * 2, 200);
|
||||
profile.step_type = StepType::QUARTER;
|
||||
profile.motor_vref = 1;
|
||||
profile.resolutions = { 300, 600 };
|
||||
motor.profiles.push_back(std::move(profile));
|
||||
|
||||
profile = MotorProfile();
|
||||
profile.slope = MotorSlope::create_from_steps(28597 * 2, 727 * 2, 200);
|
||||
profile.step_type = StepType::QUARTER;
|
||||
profile.motor_vref = 0;
|
||||
profile.resolutions = { 1200, 2400, 4800, 9600 };
|
||||
motor.profiles.push_back(std::move(profile));
|
||||
|
||||
profile = MotorProfile();
|
||||
profile.slope = MotorSlope::create_from_steps(28597 * 2, 279 * 2, 1000);
|
||||
profile.step_type = StepType::QUARTER;
|
||||
profile.motor_vref = 0;
|
||||
motor.fast_profiles.push_back(std::move(profile));
|
||||
|
||||
s_motors->push_back(std::move(motor));
|
||||
|
||||
|
||||
|
|
|
@ -2261,6 +2261,7 @@ void genesys_init_sensor_tables()
|
|||
sensor.fau_gain_white_ref = 160;
|
||||
sensor.gain_white_ref = 160;
|
||||
sensor.exposure = { 0x9c40, 0x9c40, 0x9c40 };
|
||||
sensor.stagger_config = StaggerConfig{4800, 8};
|
||||
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; };
|
||||
|
@ -2271,110 +2272,62 @@ void genesys_init_sensor_tables()
|
|||
struct CustomSensorSettings {
|
||||
ResolutionFilter resolutions;
|
||||
int exposure_lperiod;
|
||||
bool use_host_side_calib;
|
||||
std::vector<ScanMethod> methods;
|
||||
GenesysRegisterSettingSet extra_custom_regs;
|
||||
GenesysRegisterSettingSet extra_custom_fe_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 },
|
||||
{ { 300, 600, 1200 }, 11640, false, { 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 },
|
||||
{ { 1200 }, 33300, true, { 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 },
|
||||
{ { 2400 }, 33300, true, { ScanMethod::TRANSPARENCY }, {
|
||||
{ 0x16, 0x13 }, { 0x17, 0x15 }, { 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 },
|
||||
}, {
|
||||
{ 0x03, 0x1f },
|
||||
}
|
||||
},
|
||||
{ { 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 },
|
||||
{ { 4800 }, 33300, true, { ScanMethod::TRANSPARENCY }, {
|
||||
{ 0x16, 0x13 }, { 0x17, 0x15 }, { 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 },
|
||||
}
|
||||
}, {}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2383,8 +2336,10 @@ void genesys_init_sensor_tables()
|
|||
for (auto method : setting.methods) {
|
||||
sensor.resolutions = setting.resolutions;
|
||||
sensor.exposure_lperiod = setting.exposure_lperiod;
|
||||
sensor.use_host_side_calib = setting.use_host_side_calib;
|
||||
sensor.method = method;
|
||||
sensor.custom_regs = setting.extra_custom_regs;
|
||||
sensor.custom_fe_regs = setting.extra_custom_fe_regs;
|
||||
s_sensors->push_back(sensor);
|
||||
}
|
||||
}
|
||||
|
@ -3209,6 +3164,7 @@ void genesys_init_sensor_tables()
|
|||
sensor.gain_white_ref = 230;
|
||||
sensor.exposure = { 0x0000, 0x0000, 0x0000 };
|
||||
sensor.stagger_config = StaggerConfig{7200, 4};
|
||||
sensor.use_host_side_calib = true;
|
||||
sensor.custom_regs = {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x00 },
|
||||
|
@ -3300,6 +3256,7 @@ void genesys_init_sensor_tables()
|
|||
sensor.exposure = { 0x0000, 0x0000, 0x0000 };
|
||||
sensor.exposure_lperiod = 0x2f44;
|
||||
sensor.stagger_config = StaggerConfig{7200, 4};
|
||||
sensor.use_host_side_calib = true;
|
||||
sensor.custom_regs = {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x00 },
|
||||
|
@ -3374,6 +3331,7 @@ void genesys_init_sensor_tables()
|
|||
sensor.gain_white_ref = 230;
|
||||
sensor.exposure = { 0x0000, 0x0000, 0x0000 };
|
||||
sensor.stagger_config = StaggerConfig{7200, 4};
|
||||
sensor.use_host_side_calib = true;
|
||||
sensor.custom_regs = {
|
||||
{ 0x08, 0x00 },
|
||||
{ 0x09, 0x00 },
|
||||
|
|
Ładowanie…
Reference in New Issue