genesys: Rename Genesys_Sensor::{optical_res => full_resolution}

merge-requests/456/head
Povilas Kanapickas 2020-05-18 06:35:19 +03:00
rodzic 4295425182
commit b5430cc039
14 zmienionych plików z 123 dodań i 128 usunięć

Wyświetl plik

@ -198,7 +198,7 @@ void genesys_deskew(Genesys_Scanner *s, const Genesys_Sensor& sensor)
bg=0xff;
}
TIE(sanei_magic_findSkew(&s->params, dev->img_buffer.data(),
sensor.optical_res, sensor.optical_res,
sensor.full_resolution, sensor.full_resolution,
&x, &y, &slope));
DBG(DBG_info, "%s: slope=%f => %f\n", __func__, slope, slope * 180 / M_PI);

Wyświetl plik

@ -1498,13 +1498,13 @@ void scanner_offset_calibration(Genesys_Device& dev, const Genesys_Sensor& senso
}
}
unsigned target_pixels = dev.model->x_size_calib_mm * sensor.optical_res / MM_PER_INCH;
unsigned target_pixels = dev.model->x_size_calib_mm * sensor.full_resolution / MM_PER_INCH;
unsigned start_pixel = 0;
unsigned black_pixels = (sensor.black_pixels * sensor.optical_res) / sensor.optical_res;
unsigned black_pixels = (sensor.black_pixels * sensor.full_resolution) / sensor.full_resolution;
unsigned channels = 3;
unsigned lines = 1;
unsigned resolution = sensor.optical_res;
unsigned resolution = sensor.full_resolution;
const Genesys_Sensor* calib_sensor = &sensor;
if (dev.model->asic_type == AsicType::GL843) {
@ -1514,7 +1514,7 @@ void scanner_offset_calibration(Genesys_Device& dev, const Genesys_Sensor& senso
const auto& dpihw_sensor = sanei_genesys_find_sensor(&dev, dev.settings.xres, channels,
dev.settings.scan_method);
resolution = dpihw_sensor.shading_resolution;
unsigned factor = sensor.optical_res / resolution;
unsigned factor = sensor.full_resolution / resolution;
calib_sensor = &sanei_genesys_find_sensor(&dev, resolution, channels,
dev.settings.scan_method);
@ -1794,7 +1794,7 @@ void scanner_coarse_gain_calibration(Genesys_Device& dev, const Genesys_Sensor&
// coarse gain calibration is always done in color mode
unsigned channels = 3;
unsigned resolution = sensor.optical_res;
unsigned resolution = sensor.full_resolution;
if (dev.model->asic_type == AsicType::GL841) {
const auto& dpihw_sensor = sanei_genesys_find_sensor(&dev, dev.settings.xres, channels,
dev.settings.scan_method);
@ -1818,7 +1818,7 @@ void scanner_coarse_gain_calibration(Genesys_Device& dev, const Genesys_Sensor&
dev.model->asic_type == AsicType::GL847 ||
dev.model->asic_type == AsicType::GL124)
{
if (dev.settings.xres < sensor.optical_res) {
if (dev.settings.xres < sensor.full_resolution) {
coeff = 0.9f;
}
}
@ -2385,7 +2385,7 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
// BUG: we are using wrong pixel number here
unsigned start_offset =
dev->calib_session.params.startx * sensor.optical_res / dev->calib_session.params.xres;
dev->calib_session.params.startx * sensor.full_resolution / dev->calib_session.params.xres;
unsigned out_pixels_per_line = pixels_per_line + start_offset;
// FIXME: we set this during both dark and white calibration. A cleaner approach should
@ -2509,7 +2509,7 @@ static void genesys_dummy_dark_shading(Genesys_Device* dev, const Genesys_Sensor
// BUG: we are using wrong pixel number here
unsigned start_offset =
dev->calib_session.params.startx * sensor.optical_res / dev->calib_session.params.xres;
dev->calib_session.params.startx * sensor.full_resolution / dev->calib_session.params.xres;
unsigned out_pixels_per_line = pixels_per_line + start_offset;
@ -2519,8 +2519,7 @@ static void genesys_dummy_dark_shading(Genesys_Device* dev, const Genesys_Sensor
/* we average values on 'the left' where CCD pixels are under casing and
give darkest values. We then use these as dummy dark calibration */
if (dev->settings.xres <= sensor.optical_res / 2)
{
if (dev->settings.xres <= sensor.full_resolution / 2) {
skip = 4;
xend = 36;
}
@ -2636,7 +2635,7 @@ static void genesys_dark_white_shading_calibration(Genesys_Device* dev,
// BUG: we are using wrong pixel number here
unsigned start_offset =
dev->calib_session.params.startx * sensor.optical_res / dev->calib_session.params.xres;
dev->calib_session.params.startx * sensor.full_resolution / dev->calib_session.params.xres;
unsigned out_pixels_per_line = pixels_per_line + start_offset;
@ -2873,8 +2872,8 @@ compute_averaged_planar (Genesys_Device * dev, const Genesys_Sensor& sensor,
res *= 2;
}
/* this should be evenly dividable */
basepixels = sensor.optical_res / res;
// this should be evenly dividable
basepixels = sensor.full_resolution / res;
/* gl841 supports 1/1 1/2 1/3 1/4 1/5 1/6 1/8 1/10 1/12 1/15 averaging */
if (basepixels < 1)
@ -3159,9 +3158,10 @@ compute_shifted_coefficients (Genesys_Device * dev,
auto cmat = color_order_to_cmat(color_order);
x = dev->settings.xres;
if (sensor.get_ccd_size_divisor_for_dpi(dev->settings.xres) > 1)
x *= 2; /* scanner is using half-ccd mode */
basepixels = sensor.optical_res / x; /*this should be evenly dividable */
if (sensor.get_ccd_size_divisor_for_dpi(dev->settings.xres) > 1) {
x *= 2; // scanner is using half-ccd mode
}
basepixels = sensor.full_resolution / x; // this should be evenly dividable
/* gl841 supports 1/1 1/2 1/3 1/4 1/5 1/6 1/8 1/10 1/12 1/15 averaging */
if (basepixels < 1)
@ -3247,7 +3247,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
// BUG: we are using wrong pixel number here
unsigned start_offset =
dev->calib_session.params.startx * sensor.optical_res / dev->calib_session.params.xres;
dev->calib_session.params.startx * sensor.full_resolution / dev->calib_session.params.xres;
if (dev->model->asic_type == AsicType::GL842 ||
dev->model->asic_type == AsicType::GL843)
@ -3315,13 +3315,10 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
}
/* compute avg factor */
if(dev->settings.xres>sensor.optical_res)
{
factor=1;
}
else
{
factor=sensor.optical_res/dev->settings.xres;
if (dev->settings.xres > sensor.full_resolution) {
factor = 1;
} else {
factor = sensor.full_resolution / dev->settings.xres;
}
/* for GL646, shading data is planar if REG_0x01_FASTMOD is set and
@ -3370,10 +3367,9 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
case SensorId::CCD_HP2300:
target_code = 0xdc00;
o = 2;
if(dev->settings.xres<=sensor.optical_res/2)
{
o = o - sensor.dummy_pixel / 2;
}
if (dev->settings.xres <= sensor.full_resolution / 2) {
o = o - sensor.dummy_pixel / 2;
}
compute_coefficients (dev,
shading_data.data(),
pixels_per_line,
@ -3386,7 +3382,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
case SensorId::CCD_5345:
target_code = 0xe000;
o = 4;
if(dev->settings.xres<=sensor.optical_res/2)
if(dev->settings.xres<=sensor.full_resolution/2)
{
o = o - sensor.dummy_pixel;
}
@ -3628,8 +3624,8 @@ static void genesys_flatbed_calibration(Genesys_Device* dev, Genesys_Sensor& sen
DBG_HELPER(dbg);
uint32_t pixels_per_line;
unsigned coarse_res = sensor.optical_res;
if (dev->settings.yres <= sensor.optical_res / 2) {
unsigned coarse_res = sensor.full_resolution;
if (dev->settings.yres <= sensor.full_resolution / 2) {
coarse_res /= 2;
}
@ -3758,7 +3754,7 @@ static void genesys_sheetfed_calibration(Genesys_Device* dev, Genesys_Sensor& se
// first step, load document
dev->cmd_set->load_document(dev);
unsigned coarse_res = sensor.optical_res;
unsigned coarse_res = sensor.full_resolution;
/* the afe needs to sends valid data even before calibration */
@ -3862,7 +3858,7 @@ static void genesys_sheetfed_calibration(Genesys_Device* dev, Genesys_Sensor& se
dev->cmd_set->eject_document(dev);
// restore settings
dev->settings.xres = sensor.optical_res;
dev->settings.xres = sensor.full_resolution;
}
/**
@ -4347,10 +4343,10 @@ static void calc_parameters(Genesys_Scanner* s)
const auto& sensor = sanei_genesys_find_sensor_any(s->dev);
// hardware settings
if (static_cast<unsigned>(s->resolution) > sensor.optical_res &&
if (static_cast<unsigned>(s->resolution) > sensor.full_resolution &&
s->dev->settings.disable_interpolation)
{
s->dev->settings.xres = sensor.optical_res;
s->dev->settings.xres = sensor.full_resolution;
} else {
s->dev->settings.xres = s->resolution;
}

Wyświetl plik

@ -367,7 +367,7 @@ gl124_init_registers (Genesys_Device * dev)
// fine tune upon device description
const auto& sensor = sanei_genesys_find_sensor_any(dev);
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res,
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.full_resolution,
3, ScanMethod::FLATBED);
sanei_genesys_set_dpihw(dev->reg, dpihw_sensor.register_dpihw);
}
@ -528,7 +528,7 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
r02 |= REG_0x02_AGOHOME;
}
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (yres >= sensor.optical_res))
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (yres >= sensor.full_resolution))
{
r02 |= REG_0x02_ACDCDIS;
}
@ -1230,11 +1230,11 @@ void CommandSetGl124::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
}
ScanSession session;
session.params.xres = sensor.optical_res;
session.params.xres = sensor.full_resolution;
session.params.yres = dev->motor.base_ydpi;
session.params.startx = dev->model->x_size_calib_mm * sensor.optical_res / MM_PER_INCH / 4;
session.params.startx = dev->model->x_size_calib_mm * sensor.full_resolution / MM_PER_INCH / 4;
session.params.starty = 0;
session.params.pixels = dev->model->x_size_calib_mm * sensor.optical_res / MM_PER_INCH / 2;
session.params.pixels = dev->model->x_size_calib_mm * sensor.full_resolution / MM_PER_INCH / 2;
session.params.lines = 1;
session.params.depth = dev->model->bpp_color_values.front();
session.params.channels = 3;

Wyświetl plik

@ -600,7 +600,7 @@ void CommandSetGl646::init_regs_for_scan_session(Genesys_Device* dev, const Gene
break;
}
sanei_genesys_set_dpihw(*regs, sensor.optical_res);
sanei_genesys_set_dpihw(*regs, sensor.full_resolution);
/* gamma enable for scans */
if (has_flag(dev->model->flags, ModelFlag::GAMMA_14BIT)) {
@ -932,7 +932,7 @@ gl646_init_regs (Genesys_Device * dev)
const auto& sensor = sanei_genesys_find_sensor_any(dev);
dev->reg.find_reg(0x05).value = 0x00; /* 12 bits gamma, disable gamma, 24 clocks/pixel */
sanei_genesys_set_dpihw(dev->reg, sensor.optical_res);
sanei_genesys_set_dpihw(dev->reg, sensor.full_resolution);
if (has_flag(dev->model->flags, ModelFlag::GAMMA_14BIT)) {
dev->reg.find_reg(0x05).value |= REG_0x05_GMM14BIT;
@ -1116,8 +1116,7 @@ static void gl646_wm_hp3670(Genesys_Device* dev, const Genesys_Sensor& sensor, u
default: /* AFE_SET */
/* mode setup */
i = dev->frontend.regs.get_value(0x03);
if (dpi > sensor.optical_res / 2)
{
if (dpi > sensor.full_resolution / 2) {
/* fe_reg_0x03 must be 0x12 for 1200 dpi in WOLFSON_HP3670.
* WOLFSON_HP2400 in 1200 dpi mode works well with
* fe_reg_0x03 set to 0x32 or 0x12 but not to 0x02 */
@ -1819,7 +1818,7 @@ void CommandSetGl646::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
unsigned ccd_size_divisor = sensor.get_ccd_size_divisor_for_dpi(dev->settings.xres);
unsigned cksel = get_cksel(dev->model->sensor_id, dev->settings.xres, channels);
unsigned resolution = sensor.optical_res / ccd_size_divisor / cksel;
unsigned resolution = sensor.full_resolution / ccd_size_divisor / cksel;
// FIXME: we select wrong calibration sensor
const auto& calib_sensor = sanei_genesys_find_sensor(dev, dev->settings.xres, channels,
dev->settings.scan_method);
@ -1951,11 +1950,11 @@ SensorExposure CommandSetGl646::led_calibration(Genesys_Device* dev, const Genes
}
// offset calibration is always done in color mode
unsigned pixels = dev->model->x_size_calib_mm * sensor.optical_res / MM_PER_INCH;
unsigned pixels = dev->model->x_size_calib_mm * sensor.full_resolution / MM_PER_INCH;
ScanSession session;
session.params.xres = sensor.optical_res;
session.params.yres = sensor.optical_res;
session.params.xres = sensor.full_resolution;
session.params.yres = sensor.full_resolution;
session.params.startx = 0;
session.params.starty = 0;
session.params.pixels = pixels;
@ -2121,11 +2120,11 @@ static void ad_fe_offset_calibration(Genesys_Device* dev, const Genesys_Sensor&
channels = 3;
// FIXME: maybe reuse `sensor`
const auto& calib_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res, 3,
const auto& calib_sensor = sanei_genesys_find_sensor(dev, sensor.full_resolution, 3,
ScanMethod::FLATBED);
black_pixels = (calib_sensor.black_pixels * sensor.optical_res) / calib_sensor.optical_res;
black_pixels = (calib_sensor.black_pixels * sensor.full_resolution) / calib_sensor.full_resolution;
unsigned pixels = dev->model->x_size_calib_mm * sensor.optical_res / MM_PER_INCH;
unsigned pixels = dev->model->x_size_calib_mm * sensor.full_resolution / MM_PER_INCH;
unsigned lines = CALIBRATION_LINES;
if (dev->model->is_cis) {
@ -2133,8 +2132,8 @@ static void ad_fe_offset_calibration(Genesys_Device* dev, const Genesys_Sensor&
}
ScanSession session;
session.params.xres = sensor.optical_res;
session.params.yres = sensor.optical_res;
session.params.xres = sensor.full_resolution;
session.params.yres = sensor.full_resolution;
session.params.startx = 0;
session.params.starty = 0;
session.params.pixels = pixels;
@ -2236,7 +2235,7 @@ void CommandSetGl646::offset_calibration(Genesys_Device* dev, const Genesys_Sens
const auto& calib_sensor = sanei_genesys_find_sensor(dev, resolution, channels,
ScanMethod::FLATBED);
black_pixels = (calib_sensor.black_pixels * resolution) / calib_sensor.optical_res;
black_pixels = (calib_sensor.black_pixels * resolution) / calib_sensor.full_resolution;
unsigned pixels = dev->model->x_size_calib_mm * resolution / MM_PER_INCH;
unsigned lines = CALIBRATION_LINES;
@ -2579,7 +2578,7 @@ void CommandSetGl646::init(Genesys_Device* dev) const
// Init shading data
sanei_genesys_init_shading_data(dev, sensor,
dev->model->x_size_calib_mm * sensor.optical_res /
dev->model->x_size_calib_mm * sensor.full_resolution /
MM_PER_INCH);
dev->initial_regs = dev->reg;
@ -2635,7 +2634,7 @@ void CommandSetGl646::init(Genesys_Device* dev) const
if (dev->model->gpio_id != GpioId::HP3670 &&
dev->model->gpio_id != GpioId::HP2400)
{
switch (sensor.optical_res)
switch (sensor.full_resolution)
{
case 600:
addr = 0x08200;
@ -2957,7 +2956,7 @@ static void write_control(Genesys_Device* dev, const Genesys_Sensor& sensor, int
/* MD6471/G2410/HP2300 and XP200 read/write data from an undocumented memory area which
* is after the second slope table */
switch (sensor.optical_res)
switch (sensor.full_resolution)
{
case 600:
addr = 0x08200;

Wyświetl plik

@ -189,8 +189,8 @@ gl841_init_registers (Genesys_Device * dev)
dev->reg.init_reg(0x2c, 0x00);
dev->reg.init_reg(0x2d, 0x00);
if (dev->model->model_id == ModelId::CANON_LIDE_80) {
dev->reg.init_reg(0x2c, sensor.optical_res >> 8);
dev->reg.init_reg(0x2d, sensor.optical_res & 0xff);
dev->reg.init_reg(0x2c, sensor.full_resolution >> 8);
dev->reg.init_reg(0x2d, sensor.full_resolution & 0xff);
}
dev->reg.init_reg(0x2e, 0x80);
dev->reg.init_reg(0x2f, 0x80);
@ -2160,7 +2160,7 @@ void CommandSetGl841::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
}
ScanSession session;
session.params.xres = sensor.optical_res;
session.params.xres = sensor.full_resolution;
session.params.yres = dev->settings.yres;
session.params.startx = sensor.dummy_pixel;
session.params.starty = 0;

Wyświetl plik

@ -277,7 +277,7 @@ static void gl842_init_motor_regs_scan(Genesys_Device* dev,
// disable backtracking if needed
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) ||
(scan_yres >= 2400) ||
(scan_yres >= sensor.optical_res))
(scan_yres >= sensor.full_resolution))
{
reg02 |= REG_0x02_ACDCDIS;
}
@ -857,7 +857,7 @@ void CommandSetGl842::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
ScanSession session;
session.params.xres = resolution;
session.params.yres = resolution;
session.params.startx = (num_pixels / 2) * resolution / calib_sensor.optical_res;
session.params.startx = (num_pixels / 2) * resolution / calib_sensor.full_resolution;
session.params.starty = 0;
session.params.pixels = num_pixels;
session.params.lines = 1;

Wyświetl plik

@ -123,7 +123,7 @@ gl843_init_registers (Genesys_Device * dev)
initial_scan_method = ScanMethod::TRANSPARENCY;
}
const auto& sensor = sanei_genesys_find_sensor_any(dev);
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res,
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.full_resolution,
3, initial_scan_method);
sanei_genesys_set_dpihw(dev->reg, dpihw_sensor.register_dpihw);
@ -729,9 +729,9 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
}
/* disable backtracking */
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE)
||(scan_yres>=2400 && dev->model->model_id != ModelId::CANON_4400F)
||(scan_yres>=sensor.optical_res))
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) ||
(scan_yres>=2400 && dev->model->model_id != ModelId::CANON_4400F) ||
(scan_yres>=sensor.full_resolution))
{
reg02 |= REG_0x02_ACDCDIS;
}
@ -836,7 +836,7 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
// FIXME: take this information from motor struct
std::uint8_t reg_vref = reg->get8(0x80);
reg_vref = 0x50;
unsigned coeff = sensor.optical_res / scan_yres;
unsigned coeff = sensor.full_resolution / scan_yres;
if (dev->model->motor_id == MotorId::KVSS080) {
if (coeff >= 1) {
reg_vref |= 0x05;
@ -1539,7 +1539,7 @@ void CommandSetGl843::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
ScanSession session;
session.params.xres = resolution;
session.params.yres = resolution;
session.params.startx = (num_pixels / 2) * resolution / calib_sensor.optical_res;
session.params.startx = (num_pixels / 2) * resolution / calib_sensor.full_resolution;
session.params.starty = 0;
session.params.pixels = num_pixels;
session.params.lines = 1;

Wyświetl plik

@ -299,7 +299,7 @@ gl846_init_registers (Genesys_Device * dev)
}
const auto& sensor = sanei_genesys_find_sensor_any(dev);
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res,
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.full_resolution,
3, dev->model->default_method);
sanei_genesys_set_dpihw(dev->reg, dpihw_sensor.register_dpihw);
}
@ -398,7 +398,7 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
reg02 |= REG_0x02_AGOHOME | REG_0x02_NOTHOME;
}
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (scan_yres>=sensor.optical_res)) {
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (scan_yres>=sensor.full_resolution)) {
reg02 |= REG_0x02_ACDCDIS;
}
if (has_flag(flags, ScanFlag::REVERSE)) {
@ -938,7 +938,7 @@ void CommandSetGl846::send_shading_data(Genesys_Device* dev, const Genesys_Senso
// we're using SHDAREA, thus we only need to upload part of the line
unsigned offset = dev->session.pixel_count_ratio.apply(
dev->session.params.startx * sensor.optical_res / dev->session.params.xres);
dev->session.params.startx * sensor.full_resolution / dev->session.params.xres);
unsigned pixels = dev->session.pixel_count_ratio.apply(dev->session.optical_pixels_raw);
// turn pixel value into bytes 2x16 bits words

Wyświetl plik

@ -210,7 +210,7 @@ gl847_init_registers (Genesys_Device * dev)
}
const auto& sensor = sanei_genesys_find_sensor_any(dev);
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res,
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.full_resolution,
3, ScanMethod::FLATBED);
sanei_genesys_set_dpihw(dev->reg, dpihw_sensor.register_dpihw);
}
@ -291,7 +291,7 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
reg02 |= REG_0x02_AGOHOME | REG_0x02_NOTHOME;
}
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (scan_yres >= sensor.optical_res)) {
if (has_flag(flags, ScanFlag::DISABLE_BUFFER_FULL_MOVE) || (scan_yres >= sensor.full_resolution)) {
reg02 |= REG_0x02_ACDCDIS;
}
if (has_flag(flags, ScanFlag::REVERSE)) {
@ -779,7 +779,7 @@ void CommandSetGl847::send_shading_data(Genesys_Device* dev, const Genesys_Senso
// we're using SHDAREA, thus we only need to upload part of the line
unsigned offset = dev->session.pixel_count_ratio.apply(
dev->session.params.startx * sensor.optical_res / dev->session.params.xres);
dev->session.params.startx * sensor.full_resolution / dev->session.params.xres);
unsigned pixels = dev->session.pixel_count_ratio.apply(dev->session.optical_pixels_raw);
// turn pixel value into bytes 2x16 bits words

Wyświetl plik

@ -808,7 +808,7 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s,
const Genesys_Sensor& sensor)
{
if (dev->model->asic_type == AsicType::GL646) {
s.pixel_startx += s.output_startx * sensor.optical_res / s.params.xres;
s.pixel_startx += s.output_startx * sensor.full_resolution / s.params.xres;
s.pixel_endx = s.pixel_startx + s.optical_pixels * s.ccd_size_divisor;
} else if (dev->model->asic_type == AsicType::GL841 ||
@ -823,7 +823,7 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s,
dev->model->asic_type == AsicType::GL847 ||
dev->model->asic_type == AsicType::GL124)
{
s.pixel_startx = s.output_startx * sensor.optical_res / s.params.xres;
s.pixel_startx = s.output_startx * sensor.full_resolution / s.params.xres;
s.pixel_endx = s.pixel_startx + s.optical_pixels_raw;
}
@ -900,7 +900,7 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
s.ccd_size_divisor = sensor.get_ccd_size_divisor_for_dpi(s.params.xres);
s.pixel_count_ratio = sensor.pixel_count_ratio;
s.optical_resolution = sensor.optical_res / s.ccd_size_divisor;
s.optical_resolution = sensor.full_resolution / s.ccd_size_divisor;
s.output_resolution = s.params.xres;
if (s.output_resolution > s.optical_resolution) {
@ -1005,7 +1005,7 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
}
s.output_line_bytes_raw = multiply_by_depth_ceil(
(s.optical_pixels_raw * s.output_resolution) / sensor.optical_res / s.segment_count,
(s.optical_pixels_raw * s.output_resolution) / sensor.full_resolution / s.segment_count,
s.params.depth);
}

Wyświetl plik

@ -121,7 +121,7 @@ std::ostream& operator<<(std::ostream& out, const Genesys_Sensor& sensor)
{
out << "Genesys_Sensor{\n"
<< " sensor_id: " << static_cast<unsigned>(sensor.sensor_id) << '\n'
<< " optical_res: " << sensor.optical_res << '\n'
<< " full_resolution: " << sensor.full_resolution << '\n'
<< " resolutions: " << format_indent_braced_list(4, sensor.resolutions) << '\n'
<< " channels: " << format_vector_unsigned(4, sensor.channels) << '\n'
<< " method: " << sensor.method << '\n'

Wyświetl plik

@ -258,7 +258,7 @@ struct Genesys_Sensor {
// sensor resolution in CCD pixels. Note that we may read more than one CCD pixel per logical
// pixel, see ccd_pixels_per_system_pixel()
unsigned optical_res = 0;
unsigned full_resolution = 0;
// the resolution list that the sensor is usable at.
ValueFilterAny<unsigned> resolutions = VALUE_FILTER_ANY;
@ -361,7 +361,7 @@ struct Genesys_Sensor {
bool operator==(const Genesys_Sensor& other) const
{
return sensor_id == other.sensor_id &&
optical_res == other.optical_res &&
full_resolution == other.full_resolution &&
resolutions == other.resolutions &&
method == other.method &&
shading_resolution == other.shading_resolution &&
@ -390,7 +390,7 @@ template<class Stream>
void serialize(Stream& str, Genesys_Sensor& x)
{
serialize(str, x.sensor_id);
serialize(str, x.optical_res);
serialize(str, x.full_resolution);
serialize(str, x.resolutions);
serialize(str, x.method);
serialize(str, x.shading_resolution);

Wyświetl plik

@ -50,7 +50,7 @@ namespace genesys {
inline unsigned get_sensor_optical_with_ccd_divisor(const Genesys_Sensor& sensor, unsigned xres)
{
unsigned hwres = sensor.optical_res / sensor.get_ccd_size_divisor_for_dpi(xres);
unsigned hwres = sensor.full_resolution / sensor.get_ccd_size_divisor_for_dpi(xres);
if (xres <= hwres / 4) {
return hwres / 4;
@ -63,10 +63,10 @@ inline unsigned get_sensor_optical_with_ccd_divisor(const Genesys_Sensor& sensor
inline unsigned default_get_ccd_size_divisor_for_dpi(const Genesys_Sensor& sensor, unsigned xres)
{
if (sensor.ccd_size_divisor >= 4 && xres * 4 <= static_cast<unsigned>(sensor.optical_res)) {
if (sensor.ccd_size_divisor >= 4 && xres * 4 <= static_cast<unsigned>(sensor.full_resolution)) {
return 4;
}
if (sensor.ccd_size_divisor >= 2 && xres * 2 <= static_cast<unsigned>(sensor.optical_res)) {
if (sensor.ccd_size_divisor >= 2 && xres * 2 <= static_cast<unsigned>(sensor.full_resolution)) {
return 2;
}
return 1;
@ -97,7 +97,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_UMAX; // gl646
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 48;
sensor.dummy_pixel = 64;
sensor.fau_gain_white_ref = 210;
@ -140,7 +140,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_ST12; // gl646
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.black_pixels = 48;
sensor.dummy_pixel = 85;
sensor.fau_gain_white_ref = 210;
@ -181,7 +181,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_ST24; // gl646
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 48;
sensor.dummy_pixel = 64;
sensor.fau_gain_white_ref = 210;
@ -224,7 +224,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_5345; // gl646
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 48;
sensor.dummy_pixel = 16;
@ -346,7 +346,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_HP2400; // gl646
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 48;
sensor.dummy_pixel = 15;
sensor.fau_gain_white_ref = 210;
@ -438,7 +438,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_HP2300; // gl646
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 48;
sensor.dummy_pixel = 20;
@ -514,7 +514,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_35; // gl841
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 87;
@ -563,7 +563,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_60; // gl841
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 87;
@ -612,7 +612,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_XP200; // gl646
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.black_pixels = 5;
sensor.dummy_pixel = 38;
sensor.fau_gain_white_ref = 200;
@ -666,7 +666,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_HP3670; // gl646
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 48;
sensor.dummy_pixel = 16;
sensor.fau_gain_white_ref = 210;
@ -767,7 +767,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_DP665; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.black_pixels = 27;
@ -810,7 +810,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_ROADWARRIOR; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.black_pixels = 27;
@ -854,7 +854,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_DSMOBILE600; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.black_pixels = 28;
@ -897,7 +897,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_XP300; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 1200; // FIXME: could be incorrect, but previous code used this value
sensor.shading_resolution = 600;
sensor.black_pixels = 27;
@ -940,7 +940,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_DOCKETPORT_487; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.black_pixels = 27;
@ -983,10 +983,10 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_DP685; // gl841
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.black_pixels = 27;
sensor.dummy_pixel = 27;
sensor.fau_gain_white_ref = 210;
@ -1027,7 +1027,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_200; // gl847
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.black_pixels = 87*4;
sensor.dummy_pixel = 16*4;
sensor.fau_gain_white_ref = 210;
@ -1189,7 +1189,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_700F; // gl847
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.black_pixels = 73*8; // black pixels 73 at 600 dpi
sensor.dummy_pixel = 16*8;
sensor.fau_gain_white_ref = 210;
@ -1333,7 +1333,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_100; // gl847
sensor.optical_res = 2400;
sensor.full_resolution = 2400;
sensor.black_pixels = 87*4;
sensor.dummy_pixel = 16*4;
sensor.fau_gain_white_ref = 210;
@ -1464,7 +1464,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_KVSS080; // gl843
sensor.optical_res = 600;
sensor.full_resolution = 600;
sensor.register_dpihw = 600;
sensor.shading_resolution = 600;
sensor.black_pixels = 38;
@ -1532,7 +1532,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_G4050; // gl843
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.black_pixels = 50*8;
// 31 at 600 dpi dummy_pixels 58 at 1200
sensor.dummy_pixel = 58;
@ -1660,7 +1660,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_HP_4850C; // gl843
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.black_pixels = 100;
sensor.dummy_pixel = 58;
sensor.fau_gain_white_ref = 160;
@ -1783,7 +1783,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_CANON_4400F; // gl843
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.register_dpihw = 4800;
sensor.ccd_size_divisor = 4;
sensor.black_pixels = 50*8;
@ -1907,7 +1907,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_CANON_8400F; // gl843
sensor.optical_res = 3200;
sensor.full_resolution = 3200;
sensor.register_dpihw = 4800;
sensor.ccd_size_divisor = 1;
sensor.black_pixels = 50*8;
@ -2068,7 +2068,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_CANON_8600F; // gl843
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.register_dpihw = 4800;
sensor.ccd_size_divisor = 4;
sensor.black_pixels = 31;
@ -2241,7 +2241,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_HP_N6310; // gl847
sensor.optical_res = 2400;
sensor.full_resolution = 2400;
// sensor.ccd_size_divisor = 2; Possibly half CCD, needs checking
sensor.black_pixels = 96;
sensor.dummy_pixel = 26;
@ -2304,7 +2304,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_110; // gl124
sensor.optical_res = 2400;
sensor.full_resolution = 2400;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 16;
@ -2473,7 +2473,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_120; // gl124
sensor.optical_res = 2400;
sensor.full_resolution = 2400;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 16;
@ -2643,7 +2643,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_210; // gl124
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 16;
@ -2838,7 +2838,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_220; // gl124
sensor.optical_res = 4800;
sensor.full_resolution = 4800;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 16;
@ -3033,7 +3033,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICPRO_3600; // gl841
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 87;
sensor.dummy_pixel = 87;
@ -3081,7 +3081,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7200; // gl842
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
sensor.dummy_pixel = 19;
@ -3134,7 +3134,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7200I; // gl843
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
sensor.dummy_pixel = 20;
@ -3221,7 +3221,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7300; // gl843
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.method = ScanMethod::TRANSPARENCY;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
@ -3295,7 +3295,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7400; // gl845
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.method = ScanMethod::TRANSPARENCY;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
@ -3347,7 +3347,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7500I; // gl843
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
sensor.dummy_pixel = 20;
@ -3427,7 +3427,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_8200I; // gl845
sensor.optical_res = 7200;
sensor.full_resolution = 7200;
sensor.method = ScanMethod::TRANSPARENCY;
sensor.register_dpihw = 1200;
sensor.black_pixels = 88; // TODO
@ -3489,7 +3489,7 @@ void genesys_init_sensor_tables()
sensor.exposure_lperiod = 11000;
sensor.segment_size = 5136;
sensor.segment_order = {0, 1};
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 31;
sensor.dummy_pixel = 31;
sensor.fau_gain_white_ref = 210;
@ -3544,7 +3544,7 @@ void genesys_init_sensor_tables()
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICBOOK_3800; // gl845
sensor.resolutions = { 75, 100, 150, 300, 600, 1200 };
sensor.exposure_lperiod = 11000;
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 31;
sensor.dummy_pixel = 31;
sensor.fau_gain_white_ref = 210;
@ -3594,7 +3594,7 @@ void genesys_init_sensor_tables()
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CIS_CANON_LIDE_80; // gl841
sensor.optical_res = 1200; // real hardware limit is 2400
sensor.full_resolution = 1200; // real hardware limit is 2400
sensor.register_dpihw = 1200;
sensor.ccd_size_divisor = 2;
sensor.black_pixels = 20;

Wyświetl plik

@ -66,7 +66,7 @@ Genesys_Calibration_Cache create_fake_calibration_entry()
Genesys_Sensor sensor;
sensor.sensor_id = SensorId::CCD_UMAX;
sensor.optical_res = 1200;
sensor.full_resolution = 1200;
sensor.black_pixels = 48;
sensor.dummy_pixel = 64;
sensor.fau_gain_white_ref = 210;