genesys: Add a way to override pixel coordinate divisor

fix-build-obselete-jpeg
Povilas Kanapickas 2020-03-20 23:29:00 +02:00
rodzic 559b2e314f
commit b2b569a743
5 zmienionych plików z 21 dodań i 2 usunięć

Wyświetl plik

@ -941,9 +941,12 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s,
}
s.pixel_count_multiplier = sensor.pixel_count_multiplier;
s.pixel_count_divisor = sensor.pixel_count_divisor;
s.pixel_startx *= sensor.pixel_count_multiplier;
s.pixel_endx *= sensor.pixel_count_multiplier;
s.pixel_startx /= sensor.pixel_count_divisor;
s.pixel_endx /= sensor.pixel_count_divisor;
}
void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Sensor& sensor)

Wyświetl plik

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

Wyświetl plik

@ -284,8 +284,10 @@ struct Genesys_Sensor {
// CCD may present itself as half or quarter-size CCD on certain resolutions
int ccd_size_divisor = 1;
// Some scanners need an additional multiplier over the scan coordinates
// This defines the ratio between logical pixel coordinates and the pixel coordinates sent to
// the scanner.
int pixel_count_multiplier = 1;
int pixel_count_divisor = 1;
int black_pixels = 0;
// value of the dummy register

Wyświetl plik

@ -121,6 +121,7 @@ bool ScanSession::operator==(const ScanSession& other) const
pixel_startx == other.pixel_startx &&
pixel_endx == other.pixel_endx &&
pixel_count_multiplier == other.pixel_count_multiplier &&
pixel_count_divisor == other.pixel_count_divisor &&
conseq_pixel_dist == other.conseq_pixel_dist &&
output_segment_pixel_group_count == other.output_segment_pixel_group_count &&
output_segment_start_offset == other.output_segment_start_offset &&

Wyświetl plik

@ -283,8 +283,19 @@ struct ScanSession {
unsigned pixel_startx = 0;
unsigned pixel_endx = 0;
// certain scanners require the logical pixel count to be multiplied on certain resolutions
/* The following defines the ratio between logical pixel count and pixel count setting sent to
the scanner. The ratio is affected by the following:
- Certain scanners just like to multiply the pixel number by a multiplier that depends on
the resolution.
- The sensor may be configured to output one value per multiple physical pixels
- The scanner will automatically average the pixels that come from the sensor using a
certain ratio.
*/
unsigned pixel_count_multiplier = 1;
unsigned pixel_count_divisor = 1;
// Distance in pixels between consecutive pixels, e.g. between odd and even pixels. Note that
// the number of segments can be large.
@ -356,6 +367,7 @@ void serialize(Stream& str, ScanSession& x)
serialize(str, x.pixel_startx);
serialize(str, x.pixel_endx);
serialize(str, x.pixel_count_multiplier);
serialize(str, x.pixel_count_divisor);
serialize(str, x.conseq_pixel_dist);
serialize(str, x.output_segment_pixel_group_count);
serialize(str, x.output_segment_start_offset);