genesys: Add a way to specify output pixel offset

merge-requests/213/head^2
Povilas Kanapickas 2020-04-13 07:19:57 +03:00
rodzic 94f130cdfa
commit e920d1bbce
5 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -994,6 +994,7 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
// after all adjustments on the optical pixels have been made, compute the number of pixels
// to retrieve from the chip
s.output_pixels = (s.optical_pixels * s.output_resolution) / s.optical_resolution;
s.output_startx = s.params.startx + sensor.output_pixel_offset;
s.num_staggered_lines = 0;
if (!has_flag(s.params.flags, ScanFlag::IGNORE_STAGGER_OFFSET))

Wyświetl plik

@ -130,6 +130,7 @@ std::ostream& operator<<(std::ostream& out, const Genesys_Sensor& sensor)
<< " ccd_size_divisor: " << sensor.ccd_size_divisor << '\n'
<< " shading_factor: " << sensor.shading_factor << '\n'
<< " pixel_count_ratio: " << sensor.pixel_count_ratio << '\n'
<< " output_pixel_offset: " << sensor.output_pixel_offset << '\n'
<< " black_pixels: " << sensor.black_pixels << '\n'
<< " dummy_pixel: " << sensor.dummy_pixel << '\n'
<< " ccd_start_xoffset: " << sensor.ccd_start_xoffset << '\n'

Wyświetl plik

@ -290,6 +290,9 @@ struct Genesys_Sensor {
// the scanner.
Ratio pixel_count_ratio = Ratio{1, 1};
// The offset in pixels in terms of scan resolution that needs to be applied to scan position.
unsigned output_pixel_offset = 0;
int black_pixels = 0;
// value of the dummy register
int dummy_pixel = 0;
@ -365,6 +368,7 @@ struct Genesys_Sensor {
ccd_size_divisor == other.ccd_size_divisor &&
shading_factor == other.shading_factor &&
pixel_count_ratio == other.pixel_count_ratio &&
output_pixel_offset == other.output_pixel_offset &&
black_pixels == other.black_pixels &&
dummy_pixel == other.dummy_pixel &&
ccd_start_xoffset == other.ccd_start_xoffset &&
@ -393,6 +397,7 @@ void serialize(Stream& str, Genesys_Sensor& x)
serialize(str, x.shading_resolution);
serialize(str, x.ccd_size_divisor);
serialize(str, x.shading_factor);
serialize(str, x.output_pixel_offset);
serialize(str, x.pixel_count_ratio);
serialize(str, x.black_pixels);
serialize(str, x.dummy_pixel);

Wyświetl plik

@ -103,6 +103,7 @@ bool ScanSession::operator==(const ScanSession& other) const
optical_pixels_raw == other.optical_pixels_raw &&
optical_line_count == other.optical_line_count &&
output_resolution == other.output_resolution &&
output_startx == other.output_startx &&
output_pixels == other.output_pixels &&
output_channel_bytes == other.output_channel_bytes &&
output_line_bytes == other.output_line_bytes &&
@ -141,6 +142,7 @@ std::ostream& operator<<(std::ostream& out, const ScanSession& session)
<< " optical_pixels_raw: " << session.optical_pixels_raw << '\n'
<< " optical_line_count: " << session.optical_line_count << '\n'
<< " output_resolution: " << session.output_resolution << '\n'
<< " output_startx: " << session.output_startx << '\n'
<< " output_pixels: " << session.output_pixels << '\n'
<< " output_line_bytes: " << session.output_line_bytes << '\n'
<< " output_line_bytes_raw: " << session.output_line_bytes_raw << '\n'

Wyświetl plik

@ -233,6 +233,9 @@ struct ScanSession {
// gl843-only
unsigned output_resolution = 0;
// the offset in pixels from the beginning of output data
unsigned output_startx = 0;
// the number of pixels in output data (after desegmentation)
unsigned output_pixels = 0;
@ -346,6 +349,7 @@ void serialize(Stream& str, ScanSession& x)
serialize(str, x.optical_pixels_raw);
serialize(str, x.optical_line_count);
serialize(str, x.output_resolution);
serialize(str, x.output_startx);
serialize(str, x.output_pixels);
serialize(str, x.output_channel_bytes);
serialize(str, x.output_line_bytes);