genesys: Move GL124 sensor profiles to a common sensor array

merge-requests/134/head
Povilas Kanapickas 2019-08-17 11:02:37 +03:00
rodzic 4348451e47
commit 63cc11bce1
4 zmienionych plików z 404 dodań i 137 usunięć

Wyświetl plik

@ -101,50 +101,38 @@ gl124_test_motor_flag_bit (SANE_Byte val)
* @param ccd_size_divisor flag to signal half ccd mode
* @return a pointer to a Sensor_Profile struct
*/
static SensorProfileGl124* get_sensor_profile(int sensor_type, int dpi, unsigned ccd_size_divisor)
static const SensorProfile& get_sensor_profile(const Genesys_Sensor& sensor, unsigned dpi,
unsigned ccd_size_divisor)
{
unsigned int i;
int idx;
i=0;
idx=-1;
while(i<sizeof(sensors)/sizeof(SensorProfileGl124))
{
/* exact match */
if (sensors[i].sensor_type == sensor_type && sensors[i].dpi == dpi &&
sensors[i].ccd_size_divisor == ccd_size_divisor)
int best_i = -1;
for (unsigned i = 0; i < sensor.sensor_profiles.size(); ++i) {
// exact match
if (sensor.sensor_profiles[i].dpi == dpi &&
sensor.sensor_profiles[i].ccd_size_divisor == ccd_size_divisor)
{
return &(sensors[i]);
return sensor.sensor_profiles[i];
}
/* closest match */
if (sensors[i].sensor_type == sensor_type &&
sensors[i].ccd_size_divisor == ccd_size_divisor)
{
if(idx<0)
{
idx=i;
}
else
{
if(sensors[i].dpi>=dpi
&& sensors[i].dpi<sensors[idx].dpi)
// closest match
if (sensor.sensor_profiles[i].ccd_size_divisor == ccd_size_divisor) {
if (best_i < 0) {
best_i = i;
} else {
if (sensor.sensor_profiles[i].dpi >= dpi &&
sensor.sensor_profiles[i].dpi < sensor.sensor_profiles[best_i].dpi)
{
idx=i;
best_i = i;
}
}
}
i++;
}
/* default fallback */
if(idx<0)
{
DBG (DBG_warn,"%s: using default sensor profile\n",__func__);
idx=0;
// default fallback
if (best_i < 0) {
DBG(DBG_warn,"%s: using default sensor profile\n",__func__);
return *s_fallback_sensor_profile_gl124;
}
return &(sensors[idx]);
return sensor.sensor_profiles[best_i];
}
@ -591,9 +579,9 @@ static void gl124_set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor, uint
* @param xres sensor's required resolution
* @param ccd_size_divisor how many CCD pixels are processed for output pixel
*/
static int gl124_compute_exposure(Genesys_Device* dev, int xres, unsigned ccd_size_divisor)
static int gl124_compute_exposure(const Genesys_Sensor& sensor, int xres, unsigned ccd_size_divisor)
{
return get_sensor_profile(dev->model->ccd_type, xres, ccd_size_divisor)->exposure;
return get_sensor_profile(sensor, xres, ccd_size_divisor).exposure_lperiod;
}
@ -818,52 +806,32 @@ static void gl124_setup_sensor(Genesys_Device * dev,
}
// set EXPDUMMY and CKxMAP
SensorProfileGl124* sensor_profile = get_sensor_profile(dev->model->ccd_type, dpihw,
ccd_size_divisor);
const auto& sensor_profile = get_sensor_profile(sensor, dpihw, ccd_size_divisor);
regs->set8(0x18, sensor_profile->reg18);
regs->set8(0x20, sensor_profile->reg20);
regs->set8(0x61, sensor_profile->reg61);
regs->set8(0x98, sensor_profile->reg98);
if (sensor_profile->reg16 != 0) {
regs->set8(0x16, sensor_profile->reg16);
for (auto reg : sensor_profile.custom_regs) {
regs->set8(reg.address, reg.value);
}
if (sensor_profile->reg70 != 0) {
regs->set8(0x70, sensor_profile->reg70);
}
regs->set24(REG_SEGCNT, sensor_profile->segcnt);
regs->set16(REG_TG0CNT, sensor_profile->tg0cnt);
regs->set16(REG_EXPDMY, sensor_profile->expdummy);
/* if no calibration has been done, set default values for exposures */
exp = sensor.exposure.red;
if(exp==0)
{
exp=sensor_profile->expr;
if (exp == 0) {
exp = sensor_profile.exposure.red;
}
regs->set24(REG_EXPR, exp);
exp =sensor.exposure.green;
if(exp==0)
{
exp=sensor_profile->expg;
if(exp == 0) {
exp = sensor_profile.exposure.green;
}
regs->set24(REG_EXPG, exp);
exp = sensor.exposure.blue;
if(exp==0)
{
exp=sensor_profile->expb;
if (exp == 0) {
exp = sensor_profile.exposure.blue;
}
regs->set24(REG_EXPB, exp);
regs->set24(REG_CK1MAP, sensor_profile->ck1map);
regs->set24(REG_CK3MAP, sensor_profile->ck3map);
regs->set24(REG_CK4MAP, sensor_profile->ck4map);
dev->segment_order = sensor_profile->order;
dev->segment_order = sensor_profile.segment_order;
}
/** @brief setup optical related registers
@ -1203,7 +1171,7 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
}
else
{
exposure_time = gl124_compute_exposure(dev, used_res, ccd_size_divisor);
exposure_time = gl124_compute_exposure(sensor, used_res, ccd_size_divisor);
scan_step_type = sanei_genesys_compute_step_type(gl124_motor_profiles,
dev->model->motor_type, exposure_time);
}
@ -1373,7 +1341,7 @@ gl124_calculate_current_setup (Genesys_Device * dev, const Genesys_Sensor& senso
used_pixels = (session.params.pixels * optical_res) / session.params.xres;
DBG (DBG_info, "%s: used_pixels=%d\n", __func__, used_pixels);
exposure_time = gl124_compute_exposure(dev, session.params.xres, ccd_size_divisor);
exposure_time = gl124_compute_exposure(sensor, session.params.xres, ccd_size_divisor);
DBG (DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
max_shift = sanei_genesys_compute_max_shift(dev, session.params.channels,
@ -1382,9 +1350,8 @@ gl124_calculate_current_setup (Genesys_Device * dev, const Genesys_Sensor& senso
// compute hw dpi for sensor
dpihw = sensor.get_register_hwdpi(used_res);
SensorProfileGl124* sensor_profile = get_sensor_profile(dev->model->ccd_type, dpihw,
ccd_size_divisor);
dev->segnb=sensor_profile->reg98 & 0x0f;
const SensorProfile& sensor_profile = get_sensor_profile(sensor, dpihw, ccd_size_divisor);
dev->segnb = sensor_profile.custom_regs.get_value(0x98) & 0x0f;
/* stagger */
if (ccd_size_divisor == 1 && (dev->model->flags & GENESYS_FLAG_STAGGERED_LINE)) {
@ -2311,8 +2278,7 @@ static void gl124_led_calibration(Genesys_Device* dev, Genesys_Sensor& sensor,
unsigned ccd_size_divisor = compute_ccd_size_divisor(sensor, dev->settings.xres);
resolution /= ccd_size_divisor;
SensorProfileGl124* sensor_profile = get_sensor_profile(dev->model->ccd_type, dpihw,
ccd_size_divisor);
const auto& sensor_profile = get_sensor_profile(sensor, dpihw, ccd_size_divisor);
num_pixels = (sensor.sensor_pixels*resolution)/sensor.optical_res;
/* initial calibration reg values */
@ -2341,10 +2307,10 @@ static void gl124_led_calibration(Genesys_Device* dev, Genesys_Sensor& sensor,
total_size = num_pixels * channels * (depth/8) * 1; /* colors * bytes_per_color * scan lines */
std::vector<uint8_t> line(total_size);
/* initial loop values and boundaries */
exp[0]=sensor_profile->expr;
exp[1]=sensor_profile->expg;
exp[2]=sensor_profile->expb;
// initial loop values and boundaries
exp[0] = sensor_profile.exposure.red;
exp[1] = sensor_profile.exposure.green;
exp[2] = sensor_profile.exposure.blue;
target=sensor.gain_white_ref*256;
turn = 0;

Wyświetl plik

@ -362,67 +362,6 @@ static Memory_layout layouts[]={
}
};
/** @brief structure for sensor settings
* this structure describes the sensor settings to use for a given
* exposure. Data settings are identified by
* - sensor id
* - sensor hardware dpi
* - half ccd mode
*/
struct SensorProfileGl124
{
int sensor_type; /**> sensor id */
int dpi; /**> maximum dpi for which data are valid */
unsigned ccd_size_divisor; // how many CCD pixels are processed per output pixel
int exposure; /**> exposure */
int ck1map; /**> CK1MAP */
int ck3map; /**> CK3MAP */
int ck4map; /**> CK4MAP */
int segcnt; /**> SEGCNT */
int tg0cnt; /**> TG0CNT */
int expdummy; /**> exposure dummy */
int expr; /**> initial red exposure */
int expg; /**> initial green exposure */
int expb; /**> initial blue exposure */
std::vector<unsigned> order; // order of sub-segments
uint8_t reg18; /**> register 0x18 value */
uint8_t reg20; /**> register 0x20 value */
uint8_t reg61; /**> register 0x61 value */
uint8_t reg98; /**> register 0x98 value */
uint8_t reg16; /**> register 0x16 value */
uint8_t reg70; /**> register 0x70 value */
};
/** @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.
*/
static SensorProfileGl124 sensors[]={
/* LiDE 110 */
{CIS_CANONLIDE110, 600, 2, 2768, 0x1e, 0x9f, 0x55, 2584, 154, 101, 388, 574, 393, {} , 0x00, 0x0c, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE110, 600, 1, 5360, 0x1e, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {} , 0x00, 0x0a, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE110, 1200, 1, 10528, 0x1e, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {0, 1} , 0x00, 0x08, 0x20, 0x22, 0x00, 0x00},
{CIS_CANONLIDE110, 2400, 1, 20864, 0x1e, 0x9f, 0x55, 5168, 163, 4679, 6839, 8401, 6859, {0, 2, 1, 3}, 0x00, 0x06, 0x20, 0x24, 0x00, 0x00},
/* LiDE 120 */
{CIS_CANONLIDE120, 600, 2, 4608, 0x0f, 0x00, 0x55, 2552, 112, 94, 894, 1044, 994, {} , 0x00, 0x02, 0x20, 0x21, 0x15, 0x00},
{CIS_CANONLIDE120, 600, 1, 5360, 0x0f, 0x00, 0x55, 5104, 139, 94, 1644, 1994, 1844, {} , 0x00, 0x02, 0x20, 0x21, 0x11, 0x1f},
{CIS_CANONLIDE120, 1200, 1, 10528, 0x0f, 0x00, 0x55,10208, 192, 94, 3194, 3794, 3594, {} , 0x00, 0x02, 0x20, 0x21, 0x15, 0x1f},
{CIS_CANONLIDE120, 2400, 1, 20864, 0x0f, 0x00, 0x55,20416, 298, 94, 6244, 7544, 7094, {} , 0x00, 0x02, 0x20, 0x21, 0x11, 0x00},
/* LiDE 210 */
{CIS_CANONLIDE210, 600, 2, 2768, 0x1e, 0x9f, 0x55, 2584, 154, 101, 388, 574, 393, {} , 0x00, 0x0c, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE210, 600, 1, 5360, 0x1e, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {} , 0x00, 0x0a, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE210, 1200, 1, 10528, 0x1e, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {0, 1} , 0x00, 0x08, 0x20, 0x22, 0x00, 0x00},
{CIS_CANONLIDE210, 2400, 1, 20864, 0x1e, 0x9f, 0x55, 5168, 163, 4679, 6839, 8401, 6859, {0, 2, 1, 3}, 0x00, 0x06, 0x20, 0x24, 0x00, 0x00},
/* LiDE 220 */
{CIS_CANONLIDE220, 600, 2, 2768, 0x0f, 0x9f, 0x55, 2584, 154, 101, 388, 574, 393, {} , 0x00, 0x0c, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE220, 600, 1, 5360, 0x0f, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {} , 0x00, 0x0a, 0x20, 0x21, 0x00, 0x00},
{CIS_CANONLIDE220, 1200, 1, 10528, 0x0f, 0x9f, 0x55, 5168, 163, 101, 388, 574, 393, {0, 1} , 0x00, 0x08, 0x20, 0x22, 0x00, 0x00},
{CIS_CANONLIDE220, 2400, 1, 20864, 0x0f, 0x9f, 0x55, 5168, 163, 4679, 6839, 8401, 6859, {0, 2, 1, 3}, 0x00, 0x06, 0x20, 0x24, 0x00, 0x00},
};
#define MOVE_DPI 200
#define MOVE_EXPOSURE 2304

Wyświetl plik

@ -681,6 +681,7 @@ private:
};
extern StaticInit<std::vector<Genesys_Sensor>> s_sensors;
extern StaticInit<SensorProfile> s_fallback_sensor_profile_gl124;
extern StaticInit<std::vector<Genesys_Frontend>> s_frontends;
extern StaticInit<std::vector<Genesys_Gpo>> s_gpo;
extern StaticInit<std::vector<Genesys_Motor>> s_motors;

Wyświetl plik

@ -95,12 +95,17 @@ inline unsigned default_get_hwdpi_divisor_for_dpi(const Genesys_Sensor& sensor,
* registers 0x08-0x0b, 0x10-0x1d and 0x52-0x5e
*/
StaticInit<std::vector<Genesys_Sensor>> s_sensors;
StaticInit<SensorProfile> s_fallback_sensor_profile_gl124;
void genesys_init_sensor_tables()
{
s_sensors.init();
s_fallback_sensor_profile_gl124.init();
Genesys_Sensor sensor;
SensorProfile profile;
sensor = Genesys_Sensor();
sensor.sensor_id = CCD_UMAX;
sensor.optical_res = 1200;
sensor.black_pixels = 48;
@ -1652,6 +1657,95 @@ void genesys_init_sensor_tables()
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 = default_get_ccd_size_divisor_for_dpi;
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 2;
profile.exposure_lperiod = 2768;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0c },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x0a }, { 0x95, 0x18 },
{ 0x96, 0x00 }, { 0x97, 0x9a },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 5360;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0a },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 1200;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 10528;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {0, 1};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x08 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x22 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 2400;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 20864;
profile.exposure = { 6839, 8401, 6859 };
profile.segment_order = {0, 2, 1, 3};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x06 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x12 }, { 0x89, 0x47 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x24 },
};
sensor.sensor_profiles.push_back(profile);
s_sensors->push_back(sensor);
@ -1699,6 +1793,95 @@ void genesys_init_sensor_tables()
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 = default_get_ccd_size_divisor_for_dpi;
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 2;
profile.exposure_lperiod = 4608;
profile.exposure = { 894, 1044, 994 };
profile.segment_order = {};
profile.custom_regs = {
{ 0x16, 0x15 },
{ 0x18, 0x00 },
{ 0x20, 0x02 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x5e },
{ 0x93, 0x00 }, { 0x94, 0x09 }, { 0x95, 0xf8 },
{ 0x96, 0x00 }, { 0x97, 0x70 },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 5360;
profile.exposure = { 1644, 1994, 1844 };
profile.segment_order = {};
profile.custom_regs = {
{ 0x16, 0x11 },
{ 0x18, 0x00 },
{ 0x20, 0x02 },
{ 0x61, 0x20 },
{ 0x70, 0x1f },
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x5e },
{ 0x93, 0x00 }, { 0x94, 0x13 }, { 0x95, 0xf0 },
{ 0x96, 0x00 }, { 0x97, 0x8b },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 1200;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 10528;
profile.exposure = { 3194, 3794, 3594 };
profile.segment_order = {};
profile.custom_regs = {
{ 0x16, 0x15 },
{ 0x18, 0x00 },
{ 0x20, 0x02 },
{ 0x61, 0x20 },
{ 0x70, 0x1f },
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x5e },
{ 0x93, 0x00 }, { 0x94, 0x27 }, { 0x95, 0xe0 },
{ 0x96, 0x00 }, { 0x97, 0xc0 },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 2400;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 20864;
profile.exposure = { 6244, 7544, 7094 };
profile.segment_order = {};
profile.custom_regs = {
{ 0x16, 0x11 },
{ 0x18, 0x00 },
{ 0x20, 0x02 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x5e },
{ 0x93, 0x00 }, { 0x94, 0x4f }, { 0x95, 0xc0 },
{ 0x96, 0x01 }, { 0x97, 0x2a },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
s_sensors->push_back(sensor);
@ -1745,6 +1928,95 @@ void genesys_init_sensor_tables()
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 = default_get_ccd_size_divisor_for_dpi;
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 2;
profile.exposure_lperiod = 2768;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0c },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x0a }, { 0x95, 0x18 },
{ 0x96, 0x00 }, { 0x97, 0x9a },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 5360;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0a },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 1200;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 10528;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {0, 1};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x08 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x22 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 2400;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 20864;
profile.exposure = { 6839, 8401, 6859 };
profile.segment_order = {0, 2, 1, 3};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x06 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x1e },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x12 }, { 0x89, 0x47 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x24 },
};
sensor.sensor_profiles.push_back(profile);
s_sensors->push_back(sensor);
@ -1791,6 +2063,95 @@ void genesys_init_sensor_tables()
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 = default_get_ccd_size_divisor_for_dpi;
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 2;
profile.exposure_lperiod = 2768;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0c },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x0a }, { 0x95, 0x18 },
{ 0x96, 0x00 }, { 0x97, 0x9a },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 600;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 5360;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x0a },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x21 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 1200;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 10528;
profile.exposure = { 388, 574, 393 };
profile.segment_order = {0, 1};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x08 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x00 }, { 0x89, 0x65 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x22 },
};
sensor.sensor_profiles.push_back(profile);
profile = SensorProfile();
profile.dpi = 2400;
profile.ccd_size_divisor = 1;
profile.exposure_lperiod = 20864;
profile.exposure = { 6839, 8401, 6859 };
profile.segment_order = {0, 2, 1, 3};
profile.custom_regs = {
// { 0x16, 0x00 }, // FIXME: check if default value is different
{ 0x18, 0x00 },
{ 0x20, 0x06 },
{ 0x61, 0x20 },
// { 0x70, 0x00 }, // FIXME: check if default value is different
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x0f },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x88, 0x12 }, { 0x89, 0x47 },
{ 0x93, 0x00 }, { 0x94, 0x14 }, { 0x95, 0x30 },
{ 0x96, 0x00 }, { 0x97, 0xa3 },
{ 0x98, 0x24 },
};
sensor.sensor_profiles.push_back(profile);
s_sensors->push_back(sensor);