genesys: Simplify raw_channel_bytes calculation

merge-requests/169/head
Povilas Kanapickas 2019-09-12 22:21:52 +03:00
rodzic 98320f5b81
commit 95a3836f1a
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;