kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Simplify raw_channel_bytes calculation
rodzic
98320f5b81
commit
95a3836f1a
|
@ -812,7 +812,9 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
}
|
||||
|
||||
/* words(16bit) before gamma, conversion to 8 bit or lineart*/
|
||||
words_per_line = ((endx - startx) * session.params.xres) / sensor.get_register_hwdpi(session.params.xres * ccd_pixels_per_system_pixel);
|
||||
words_per_line = (session.optical_pixels_raw * session.params.xres) /
|
||||
session.hwdpi_divisor / session.segment_count /
|
||||
sensor.get_register_hwdpi(session.params.xres * ccd_pixels_per_system_pixel);
|
||||
dev->deseg.raw_channel_bytes = multiply_by_depth_ceil(words_per_line, session.params.depth);
|
||||
dev->deseg.pixel_groups = multiply_by_depth_ceil(dev->deseg.pixel_groups, session.params.depth);
|
||||
|
||||
|
|
|
@ -828,8 +828,10 @@ static void gl847_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
|
|||
}
|
||||
|
||||
/* words(16bit) before gamma, conversion to 8 bit or lineart*/
|
||||
dev->deseg.raw_channel_bytes = multiply_by_depth_ceil(((endx - startx) * session.params.xres) / dpihw,
|
||||
session.params.depth);
|
||||
dev->deseg.raw_channel_bytes = multiply_by_depth_ceil(
|
||||
(session.optical_pixels_raw * session.params.xres) / session.hwdpi_divisor /
|
||||
session.segment_count / sensor.get_register_hwdpi(session.params.xres * ccd_pixels_per_system_pixel),
|
||||
session.params.depth);
|
||||
dev->deseg.pixel_groups = multiply_by_depth_ceil(dev->deseg.pixel_groups, session.params.depth);
|
||||
|
||||
dev->deseg.curr_byte = 0;
|
||||
|
|
Ładowanie…
Reference in New Issue