Skip to content

directly save image data to a QImage

Alexander Stippich requested to merge astippich/libksane:unifyScanning into master

Since Qt 5.13, QImage supports all internal data formats that SANE requires to store the raw scanned image data. Hence, the different code paths of the preview and final scan can be combined. The scanned data is now always written directly to a QImage. This also automatically enables saving for 16 bit scans in all pictures formats supported by Qt, either in 16 bit for formats that support 16 bit color depth or truncated to 8 bit. This simplifies code and should also improve performance as the entire image data is copied now only once instead of previously two times when using the toQImage functions.

The old signals and functions working with QByteArray are now deprecated, but are kept for compatibility. They now need an extra loop to copy the data over to the old QByteArray data layout again. Thus, all apps should be ported to the new QImage API.

Merge request reports