Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ksanecore for openSUSE:Factory checked in at 2023-08-31 13:43:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ksanecore (Old) and /work/SRC/openSUSE:Factory/.ksanecore.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ksanecore" Thu Aug 31 13:43:26 2023 rev:13 rq:1105762 version:23.08.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ksanecore/ksanecore.changes 2023-07-07 15:47:57.264422580 +0200 +++ /work/SRC/openSUSE:Factory/.ksanecore.new.1766/ksanecore.changes 2023-08-31 13:45:32.535846432 +0200 @@ -1,0 +2,28 @@ +Sun Aug 20 14:00:00 UTC 2023 - Christophe Marin <christo...@krop.fr> + +- Update to 23.08.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/gear/23.08.0/ +- No code change since 23.07.90 + +------------------------------------------------------------------- +Mon Aug 14 08:03:17 UTC 2023 - Christophe Marin <christo...@krop.fr> + +- Update to 23.07.90 + * New feature release +- No code change since 23.07.80 + +------------------------------------------------------------------- +Tue Aug 1 10:14:15 UTC 2023 - Christophe Marin <christo...@krop.fr> + +- Update to 23.07.80 + * New feature release +- Changes since 23.04.3: + * Add explicit moc includes to sources for moc-covered headers + * Crop the image after a scan finished (kde#457097) + * Also call renewImage() for 8-bit Gray images (kde#469683) + * Have export macros header include version header (Qt6-only) + * Support reading the gamma table + +------------------------------------------------------------------- Old: ---- ksanecore-23.04.3.tar.xz ksanecore-23.04.3.tar.xz.sig New: ---- ksanecore-23.08.0.tar.xz ksanecore-23.08.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ksanecore.spec ++++++ --- /var/tmp/diff_new_pack.b6837y/_old 2023-08-31 13:45:33.719888752 +0200 +++ /var/tmp/diff_new_pack.b6837y/_new 2023-08-31 13:45:33.727889038 +0200 @@ -20,7 +20,7 @@ %define lname libKSaneCore %bcond_without released Name: ksanecore -Version: 23.04.3 +Version: 23.08.0 Release: 0 Summary: Qt interface for the SANE library for scanner hardware License: LGPL-2.1-only OR LGPL-3.0-only ++++++ ksanecore-23.04.3.tar.xz -> ksanecore-23.08.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/CMakeLists.txt new/ksanecore-23.08.0/CMakeLists.txt --- old/ksanecore-23.04.3/CMakeLists.txt 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/CMakeLists.txt 2023-08-16 22:26:10.000000000 +0200 @@ -6,8 +6,8 @@ # KDE Applications version, managed by release script. set(RELEASE_SERVICE_VERSION_MAJOR "23") -set(RELEASE_SERVICE_VERSION_MINOR "04") -set(RELEASE_SERVICE_VERSION_MICRO "3") +set(RELEASE_SERVICE_VERSION_MINOR "08") +set(RELEASE_SERVICE_VERSION_MICRO "0") set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(KSaneCore VERSION ${RELEASE_SERVICE_VERSION}) @@ -28,7 +28,7 @@ include(ECMInstallIcons) include(CMakePackageConfigHelpers) include(CheckFunctionExists) -include(GenerateExportHeader) +include(ECMGenerateExportHeader) include(ECMQtDeclareLoggingCategory) include(KDEGitCommitHooks) include(KDEClangFormat) @@ -41,10 +41,11 @@ set(KF_MAJOR_VERSION "5") endif() +set(ksanecore_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/ksanecore_version.h") ecm_setup_version( ${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KSANECORE - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksanecore_version.h" + VERSION_HEADER "${ksanecore_version_header}" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KSaneCoreConfigVersion.cmake" SOVERSION 1 ) @@ -87,7 +88,7 @@ ) install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/ksanecore_version.h" + "${ksanecore_version_header}" DESTINATION "${KDE_INSTALL_INCLUDEDIR}/KSaneCore" COMPONENT Devel ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/po/ca/ksanecore.po new/ksanecore-23.08.0/po/ca/ksanecore.po --- old/ksanecore-23.04.3/po/ca/ksanecore.po 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/po/ca/ksanecore.po 2023-08-16 22:26:10.000000000 +0200 @@ -76,396 +76,3 @@ #, kde-format msgid "Select a predefined page size for the scanning area." msgstr "Selecciona una mida de pà gina predefinida per a l'à rea d'escaneig." - -#~ msgid "Open scan dialog" -#~ msgstr "Obre el dià leg d'escaneig" - -#~ msgid "None" -#~ msgstr "Cap" - -#~ msgid "MH" -#~ msgstr "MH" - -#~ msgid "MR" -#~ msgstr "MR" - -#~ msgid "MMR" -#~ msgstr "MMR" - -#~ msgid "JPEG" -#~ msgstr "JPEG" - -#~ msgid "Auto" -#~ msgstr "Auto" - -#~ msgid "Flatbed" -#~ msgstr "De superfÃcie plana" - -#~ msgid "ADF" -#~ msgstr "ADF" - -#~ msgid "Advanced" -#~ msgstr "Avançat" - -#~ msgid "Compression" -#~ msgstr "Compressió" - -#~ msgid "" -#~ "Selects the scanner compression method for faster scans, possibly at the " -#~ "expense of image quality." -#~ msgstr "" -#~ "Selecciona el mètode de compressió per a accelerar els escaneigs, " -#~ "possiblement a expenses de la qualitat de la imatge." - -#~ msgid "JPEG compression factor" -#~ msgstr "Factor de compressió del JPEG" - -#~ msgid "" -#~ "Sets the scanner JPEG compression factor. Larger numbers mean better " -#~ "compression, and smaller numbers mean better image quality." -#~ msgstr "" -#~ "Defineix el factor de compressió del JPEG de l'escà ner. Els números més " -#~ "grans indiquen una compressió millor, els números més petits indiquen una " -#~ "millor qualitat de la imatge." - -#~ msgid "Batch scan" -#~ msgstr "Escaneig per lots" - -#~ msgid "Enables continuous scanning with automatic document feeder (ADF)." -#~ msgstr "" -#~ "Habilita l'escaneig continu amb un alimentador automà tic de documents " -#~ "(ADF, en anglès)." - -#~ msgid "Duplex" -#~ msgstr "Doble cara" - -#~ msgid "Enables scanning on both sides of the page." -#~ msgstr "Habilita l'escaneig de les dues cares de la pà gina." - -#~ msgid "Geometry" -#~ msgstr "Geometria" - -#~ msgid "Length measurement" -#~ msgstr "Mesura de la longitud" - -#~ msgid "" -#~ "Selects how the scanned image length is measured and reported, which is " -#~ "impossible to know in advance for scrollfed scans." -#~ msgstr "" -#~ "Selecciona com s'ha de mesurar i informar la longitud de la imatge " -#~ "escanejada, la qual és impossible de conèixer per avançat en els escà ners " -#~ "d'alimentació per desplaçament." - -#~ msgid "Unknown" -#~ msgstr "Desconegut" - -#~ msgid "Unlimited" -#~ msgstr "Sense lÃmit" - -#~ msgid "Approximate" -#~ msgstr "Aproximat" - -#~ msgid "Padded" -#~ msgstr "Per farciment" - -#~ msgid "Exact" -#~ msgstr "Exacte" - -#~ msgid "???" -#~ msgstr "???" - -#~ msgid "" -#~ "<html>The SANE (Scanner Access Now Easy) system could not find any device." -#~ "<br>Check that the scanner is plugged in and turned on<br>or check your " -#~ "systems scanner setup.<br>For details about SANE see the <a href='http://" -#~ "www.sane-project.org/'>SANE homepage</a>.</html>" -#~ msgstr "" -#~ "<html>El sistema de SANE (Scanner Access Now Easy) no ha pogut trobar cap " -#~ "dispositiu.<br>Verifiqueu que l'escà ner estigui connectat i encès<br>o " -#~ "verifiqueu la configuració de l'escà ner en el sistema.<br>Per als detalls " -#~ "quant al SANE, vegeu la <a href='http://www.sane-project.org/'>pà gina web " -#~ "de SANE</a>.</html>" - -#~ msgid "Reload devices list" -#~ msgstr "Actualitza la llista de dispositius" - -#~ msgid "Looking for devices. Please wait." -#~ msgstr "S'estan cercant dispositius. Espereu, si us plau." - -#~ msgid "Sorry. No devices found." -#~ msgstr "No s'ha trobat cap dispositiu." - -#~ msgid "Found devices:" -#~ msgstr "Dispositius trobats:" - -#~ msgid "Zoom In" -#~ msgstr "Apropa" - -#~ msgid "Zoom Out" -#~ msgstr "Allunya" - -#~ msgid "Zoom to Selection" -#~ msgstr "Zoom a la selecció" - -#~ msgid "Zoom to Fit" -#~ msgstr "Zoom fins que ajusti" - -#~ msgid "Clear Selections" -#~ msgstr "Neteja les seleccions" - -#~ msgid "Waiting for the scan to start." -#~ msgstr "S'està esperant que s'iniciï l'escaneig." - -#~ msgid "Cancel current scan operation" -#~ msgstr "Cancel·la l'operació actual d'escaneig" - -#~ msgid "Scan Preview Image (%1)" -#~ msgstr "Escaneja una vista prèvia de la imatge (%1)" - -#~ msgctxt "Preview button text" -#~ msgid "Preview" -#~ msgstr "Vista prèvia" - -#~ msgid "Scan Final Image (%1)" -#~ msgstr "Escaneja la imatge final (%1)" - -#~ msgctxt "Final scan button text" -#~ msgid "Scan" -#~ msgstr "Escaneja" - -#~ msgid "Basic Options" -#~ msgstr "Opcions bà siques" - -#~ msgid "Advanced Options" -#~ msgstr "Opcions avançades" - -#~ msgid "Scanner Specific Options" -#~ msgstr "Opcions especÃfiques de l'escà ner" - -#~ msgid "Authentication required for resource: %1" -#~ msgstr "Es requereix autenticació per al recurs: %1" - -#~ msgid "" -#~ "The image data contained 16 bits per color, but the color depth has been " -#~ "truncated to 8 bits per color." -#~ msgstr "" -#~ "Les dades de la imatge tenien 16 bits per color, però la profunditat de " -#~ "color s'ha truncat a 8 bits per color." - -#~ msgid "Scan Area Size" -#~ msgstr "Mida de l'à rea d'escaneig" - -#~ msgid " mm" -#~ msgstr " mm" - -#~ msgid " inch" -#~ msgstr " polzada" - -#~ msgid "Width" -#~ msgstr "Amplada" - -#~ msgid "Height" -#~ msgstr "Alçada" - -#~ msgid "X Offset" -#~ msgstr "Desplaçament X" - -#~ msgid "Y Offset" -#~ msgstr "Desplaçament Y" - -#~ msgid "Image intensity" -#~ msgstr "Intensitat de la imatge" - -#~ msgid "" -#~ "Gamma-correction table. In color mode this option equally affects the " -#~ "red, green, and blue channels simultaneously (i.e., it is an intensity " -#~ "gamma table)." -#~ msgstr "" -#~ "Taula de la correcció gamma. En el mode de color aquesta opció afecta " -#~ "igualment els canals vermell, verd i blau simultà niament (és a dir, és " -#~ "una taula d'intensitat de la gamma)." - -#~ msgid "Separate color intensity tables" -#~ msgstr "Separa les taules d'intensitat del color" - -#~ msgctxt "This is compared to the option string returned by sane" -#~ msgid "Transparency" -#~ msgstr "Transparència" - -#~ msgctxt "This is compared to the option string returned by sane" -#~ msgid "Negative" -#~ msgstr "Negatiu" - -#~ msgid "Next scan starts in %1 s." -#~ msgstr "L'escaneig següent comença dintre de %1 s." - -#~ msgctxt "@title:window" -#~ msgid "General Error" -#~ msgstr "Error general" - -#~ msgctxt "@title:window" -#~ msgid "Information" -#~ msgstr "Informació" - -#~ msgid "Custom" -#~ msgstr "Personalitzat" - -#~ msgctxt "Page size landscape" -#~ msgid " Landscape" -#~ msgstr " Apaïsat" - -#~ msgctxt "Label for a scanner option" -#~ msgid "%1:" -#~ msgstr "%1:" - -#~ msgctxt "Parameter and Unit" -#~ msgid "%1 Pixel" -#~ msgid_plural "%1 Pixels" -#~ msgstr[0] "%1 pÃxel" -#~ msgstr[1] "%1 pÃxels" - -#~ msgctxt "Parameter and Unit" -#~ msgid "%1 Bit" -#~ msgid_plural "%1 Bits" -#~ msgstr[0] "%1 bit" -#~ msgstr[1] "%1 bits" - -#~ msgctxt "Parameter and Unit (Millimeter)" -#~ msgid "%1 mm" -#~ msgstr "%1 mm" - -#~ msgctxt "Parameter and Unit (Dots Per Inch)" -#~ msgid "%1 DPI" -#~ msgstr "%1 PPP" - -#~ msgctxt "Parameter and Unit (Percentage)" -#~ msgid "%1 %" -#~ msgstr "%1%" - -#~ msgctxt "Parameter and Unit (Microseconds)" -#~ msgid "%1 µs" -#~ msgstr "%1 µs" - -#~ msgctxt "Parameter and Unit (seconds)" -#~ msgid "%1 s" -#~ msgstr "%1 s" - -#~ msgid "%1" -#~ msgstr "%1" - -#~ msgctxt "Label for button to reset text in a KLineEdit" -#~ msgid "Reset" -#~ msgstr "Reinicialitza" - -#~ msgctxt "Label for button to write text in a KLineEdit to sane" -#~ msgid "Set" -#~ msgstr "Defineix" - -#~ msgctxt "Double numbers. SpinBox parameter unit" -#~ msgid " Pixels" -#~ msgstr " pÃxels" - -#~ msgctxt "Double numbers. SpinBox parameter unit" -#~ msgid " Bits" -#~ msgstr " bits" - -#~ msgctxt "Double numbers. SpinBox parameter unit (Millimeter)" -#~ msgid " mm" -#~ msgstr " mm" - -#~ msgctxt "Double numbers. SpinBox parameter unit (Dots Per Inch)" -#~ msgid " DPI" -#~ msgstr " PPP" - -#~ msgctxt "Double numbers. SpinBox parameter unit (Percentage)" -#~ msgid " %" -#~ msgstr " %" - -#~ msgctxt "Double numbers. SpinBox parameter unit (Microseconds)" -#~ msgid " µs" -#~ msgstr " µs" - -#~ msgctxt "SpinBox parameter unit (seconds), float" -#~ msgid " s" -#~ msgstr " s" - -#~ msgid "Brightness" -#~ msgstr "Lluminositat" - -#~ msgid "Contrast" -#~ msgstr "Contrast" - -#~ msgid "Gamma" -#~ msgstr "Gamma" - -#~ msgctxt "SpinBox parameter unit" -#~ msgid " Pixel" -#~ msgid_plural " Pixels" -#~ msgstr[0] " pÃxel" -#~ msgstr[1] " pÃxels" - -#~ msgctxt "SpinBox parameter unit" -#~ msgid " Bit" -#~ msgid_plural " Bits" -#~ msgstr[0] " bit" -#~ msgstr[1] " bits" - -#~ msgctxt "SpinBox parameter unit (Millimeter)" -#~ msgid " mm" -#~ msgid_plural " mm" -#~ msgstr[0] " mm" -#~ msgstr[1] " mm" - -#~ msgctxt "SpinBox parameter unit (Dots Per Inch)" -#~ msgid " DPI" -#~ msgid_plural " DPI" -#~ msgstr[0] " PPP" -#~ msgstr[1] " PPP" - -#~ msgctxt "SpinBox parameter unit (Percentage)" -#~ msgid " %" -#~ msgid_plural " %" -#~ msgstr[0] " %" -#~ msgstr[1] " %" - -#~ msgctxt "SpinBox parameter unit (Microseconds)" -#~ msgid " µs" -#~ msgid_plural " µs" -#~ msgstr[0] " µs" -#~ msgstr[1] " µs" - -#~ msgctxt "SpinBox parameter unit (seconds)" -#~ msgid " s" -#~ msgid_plural " s" -#~ msgstr[0] " s" -#~ msgstr[1] " s" - -#~ msgid "%1 Pixel" -#~ msgid_plural "%1 Pixels" -#~ msgstr[0] "%1 pÃxel" -#~ msgstr[1] "%1 pÃxels" - -#~ msgid "%1 Bit" -#~ msgid_plural "%1 Bits" -#~ msgstr[0] "%1 bit" -#~ msgstr[1] "%1 bits" - -#~ msgid "%1 mm" -#~ msgid_plural "%1 mm" -#~ msgstr[0] "%1 mm" -#~ msgstr[1] "%1 mm" - -#~ msgid "%1 DPI" -#~ msgid_plural "%1 DPI" -#~ msgstr[0] "%1 PPP" -#~ msgstr[1] "%1 PPP" - -#~ msgid "%1 %" -#~ msgid_plural "%1 %" -#~ msgstr[0] "%1 %" -#~ msgstr[1] "%1 %" - -#~ msgid "%1 µs" -#~ msgid_plural "%1 µs" -#~ msgstr[0] "%1 µs" -#~ msgstr[1] "%1 µs" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/po/zh_CN/ksanecore.po new/ksanecore-23.08.0/po/zh_CN/ksanecore.po --- old/ksanecore-23.04.3/po/zh_CN/ksanecore.po 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/po/zh_CN/ksanecore.po 2023-08-16 22:26:10.000000000 +0200 @@ -3,7 +3,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2023-02-01 00:55+0000\n" -"PO-Revision-Date: 2023-07-03 11:41\n" +"PO-Revision-Date: 2023-08-02 12:45\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/CMakeLists.txt new/ksanecore-23.08.0/src/CMakeLists.txt --- old/ksanecore-23.04.3/src/CMakeLists.txt 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/CMakeLists.txt 2023-08-16 22:26:10.000000000 +0200 @@ -5,6 +5,12 @@ add_library(KSaneCore) add_library(KSane::Core ALIAS KSaneCore) +set_target_properties(KSaneCore PROPERTIES + VERSION ${KSANECORE_VERSION} + SOVERSION ${KSANECORE_SOVERSION} + EXPORT_NAME "Core" +) + target_compile_definitions(KSaneCore PRIVATE -DTRANSLATION_DOMAIN=\"ksanecore\") target_sources(KSaneCore PRIVATE @@ -37,7 +43,24 @@ CATEGORY_NAME org.kde.ksane.core ) -generate_export_header(KSaneCore BASE_NAME KSaneCore) +if (QT_MAJOR_VERSION STREQUAL "5") + set(_generate_export_header_version_args) +else() + # For Qt6/KF6 world transitively include the version header + if(ECM_VERSION VERSION_LESS "5.106") + set(include_version_header_code "#include <ksanecore_version.h>\n") + set(_generate_export_header_version_args CUSTOM_CONTENT_FROM_VARIABLE include_version_header_code) + else() + set(_generate_export_header_version_args USE_VERSION_HEADER) + endif() +endif() + +ecm_generate_export_header(KSaneCore + BASE_NAME KSaneCore + VERSION ${KSANECORE_VERSION} + DEPRECATED_BASE_VERSION 0 + ${_generate_export_header_version_args} +) target_include_directories(KSaneCore INTERFACE @@ -55,13 +78,6 @@ KF${KF_MAJOR_VERSION}::I18n ) -set_target_properties(KSaneCore - PROPERTIES VERSION ${KSANECORE_VERSION} - SOVERSION ${KSANECORE_SOVERSION} - EXPORT_NAME "Core" -) - - ecm_generate_headers(KSaneCore_HEADERS HEADER_NAMES Interface diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/finddevicesthread.cpp new/ksanecore-23.08.0/src/finddevicesthread.cpp --- old/ksanecore-23.04.3/src/finddevicesthread.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/finddevicesthread.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -116,3 +116,5 @@ } } // namespace KSaneCore + +#include "moc_finddevicesthread.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/interface.cpp new/ksanecore-23.08.0/src/interface.cpp --- old/ksanecore-23.04.3/src/interface.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/interface.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -323,3 +323,5 @@ } } // NameSpace KSaneCore + +#include "moc_interface.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/interface_p.cpp new/ksanecore-23.08.0/src/interface_p.cpp --- old/ksanecore-23.04.3/src/interface_p.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/interface_p.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -429,3 +429,5 @@ } } // NameSpace KSaneCore + +#include "moc_interface_p.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/internaloption.cpp new/ksanecore-23.08.0/src/internaloption.cpp --- old/ksanecore-23.04.3/src/internaloption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/internaloption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -23,3 +23,5 @@ } } // namespace KSaneCore + +#include "moc_internaloption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/option.cpp new/ksanecore-23.08.0/src/option.cpp --- old/ksanecore-23.04.3/src/option.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/option.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -166,3 +166,5 @@ } } // namespace KSaneCore + +#include "moc_option.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/actionoption.cpp new/ksanecore-23.08.0/src/options/actionoption.cpp --- old/ksanecore-23.04.3/src/options/actionoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/actionoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -26,3 +26,5 @@ } } // namespace KSaneCore + +#include "moc_actionoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/baseoption.cpp new/ksanecore-23.08.0/src/options/baseoption.cpp --- old/ksanecore-23.04.3/src/options/baseoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/baseoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -368,3 +368,5 @@ } } // namespace KSaneCore + +#include "moc_baseoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/batchdelayoption.cpp new/ksanecore-23.08.0/src/options/batchdelayoption.cpp --- old/ksanecore-23.04.3/src/options/batchdelayoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/batchdelayoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -78,3 +78,5 @@ } } // NameSpace KSaneCore + +#include "moc_batchdelayoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/batchmodeoption.cpp new/ksanecore-23.08.0/src/options/batchmodeoption.cpp --- old/ksanecore-23.04.3/src/options/batchmodeoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/batchmodeoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -65,3 +65,5 @@ } } // NameSpace KSaneCore + +#include "moc_batchmodeoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/booloption.cpp new/ksanecore-23.08.0/src/options/booloption.cpp --- old/ksanecore-23.04.3/src/options/booloption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/booloption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -82,3 +82,5 @@ } } // namespace KSaneCore + +#include "moc_booloption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/doubleoption.cpp new/ksanecore-23.08.0/src/options/doubleoption.cpp --- old/ksanecore-23.04.3/src/options/doubleoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/doubleoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -139,3 +139,5 @@ } } // namespace KSaneCore + +#include "moc_doubleoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/gammaoption.cpp new/ksanecore-23.08.0/src/options/gammaoption.cpp --- old/ksanecore-23.04.3/src/options/gammaoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/gammaoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -59,11 +59,7 @@ } return true; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (static_cast<QMetaType::Type>(value.type()) == QMetaType::QVariantList) { -#else - if (value.userType() == QMetaType::QVariantList) { -#endif + if (value.canConvert<QVariantList>()) { // It's a list QVariantList copy = value.toList(); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (copy.size() != 3 || static_cast<QMetaType::Type>(copy.at(0).type()) != QMetaType::Int @@ -84,25 +80,31 @@ return false; } -void GammaOption::readOption() +void GammaOption::readValue() { - beginOptionReload(); + if (state() == Option::StateHidden) { + return; + } - if (m_optDesc) { - int size = m_optDesc->size / sizeof(SANE_Word); - m_gammaTable.resize(size); - for (int i = 0; i < m_gammaTable.size(); i++) { - m_gammaTable[i] = i; - } + QVarLengthArray<unsigned char> data(m_optDesc->size); + SANE_Status status; + SANE_Int res; + status = sane_control_option(m_handle, m_index, SANE_ACTION_GET_VALUE, data.data(), &res); + if (status != SANE_STATUS_GOOD) { + return; } - endOptionReload(); -} + QVector<int> gammaTable; + gammaTable.reserve(data.size() / sizeof(int)); + for (int i = 0; i < data.size(); i += sizeof(SANE_Word)) gammaTable.append(toSANE_Word(&data[i])); -void GammaOption::readValue() -{ - // Unfortunately gamma table to brightness, contrast and gamma is - // not easy nor fast.. ergo not done + if (gammaTable != m_gammaTable) { + m_gammaTable = gammaTable; + + m_gammaTableMax = m_optDesc->constraint.range->max; + + calculateBCGwriteData(); + } } QVariant GammaOption::value() const @@ -143,7 +145,8 @@ double gamma = 100.0 / m_gamma; double contrast = (200.0 / (100.0 - m_contrast)) - 1; double halfMax = maxValue / 2.0; - double brightness = (m_brightness / halfMax) * maxValue; + // NOTE: This used to add the value times 2, not scaled to maxValue + double brightness = m_brightness * maxValue / 100.0; double x; for (int i = 0; i < m_gammaTable.size(); i++) { @@ -172,4 +175,100 @@ Q_EMIT valueChanged(values); } +void GammaOption::calculateBCGwriteData() { + int beginIndex = 0; + int endIndex = m_gammaTable.size() - 1; + // Find the start and end of the curve, to skip the flat regions + while (beginIndex < endIndex && m_gammaTable[beginIndex] == m_gammaTable[0]) + beginIndex++; + while (endIndex > beginIndex && m_gammaTable[endIndex] == m_gammaTable[m_gammaTable.size()-1]) + endIndex--; + + float gamma = 0, contrast = 0, brightness = 0; + const QVector<int> &gammaTable = m_gammaTable; + const int &gammaTableMax = m_gammaTableMax; + + auto guessGamma = [&gammaTable, &gamma](int i1, int i2, int step) { + int diff1 = gammaTable[i1 + step] - gammaTable[i1 - step]; + int diff2 = gammaTable[i2 + step] - gammaTable[i2 - step]; + if (diff1 == 0 || diff2 == 0) + return; + float stepProportion = static_cast<float>(i2) / i1; + float diffProportion = static_cast<float>(diff2) / diff1; + float guessedGamma = log(stepProportion * diffProportion) / log(stepProportion); + gamma += guessedGamma; + }; + + auto guessContrast = [&gammaTable, &gammaTableMax, &gamma, &contrast](int i1, int i2, int) { + int prevVal = gammaTable[i1], nextVal = gammaTable[i2]; + float scaledDiff = static_cast<float>(nextVal - prevVal) / gammaTableMax; + float scaledPrevIndex = static_cast<float>(i1) / gammaTable.size(); + float scaledNextIndex = static_cast<float>(i2) / gammaTable.size(); + float guessedContrast = scaledDiff / (pow(scaledNextIndex, gamma) - pow(scaledPrevIndex, gamma)); + contrast += guessedContrast; + }; + + auto guessBrightness = [&gammaTable, &gammaTableMax, &gamma, &contrast, &brightness](int i, int, int) { + float scaledThisVal = static_cast<float>(gammaTable[i]) / gammaTableMax; + float scaledIndex = static_cast<float>(i) / gammaTable.size(); + float guessedBrightness = scaledThisVal - ((pow(scaledIndex, gamma) - 0.5) * contrast + 0.5); + brightness += guessedBrightness; + }; + + const int numberOfApproximations = 16; + + auto passValuePairsAndSteps = [&beginIndex, &endIndex](auto func) { + const int step = (endIndex - beginIndex) / 8; + for (int i = 0; i < numberOfApproximations;) { + // Calculate step, even if not passed to the function, to separate the samples + int i1 = rand() % (endIndex - beginIndex - 2 * step - 2) + beginIndex + step + 1; + int i2 = rand() % (endIndex - beginIndex - 2 * step - 2) + beginIndex + step + 1; + if (i2 - i1 >= 4 * step) { + func(i1, i2, step); + i++; + } + } + }; + + if (endIndex == beginIndex) { + qCDebug(KSANECORE_LOG()) << "Ignoring gamma table: horizontal line at" << m_gammaTable[0]; + setValue(QVariantList{0, 0, 100}); // Ignore the table, it's wrong + return; + } + + if (endIndex - beginIndex <= 32) { // Table too small, make single guesses + if (endIndex - beginIndex > 4) { // Measurements don't overlap by just one value + guessGamma(beginIndex + 2, endIndex - 2, 2); + } else { + gamma = 1.0; // Assume linear gamma + } + guessContrast(beginIndex, endIndex, 0); + guessBrightness((beginIndex + endIndex) / 2, 0, 0); + } else { + passValuePairsAndSteps(guessGamma); + gamma /= numberOfApproximations; + + passValuePairsAndSteps(guessContrast); + contrast /= numberOfApproximations; + + passValuePairsAndSteps(guessBrightness); + brightness /= numberOfApproximations; + } + + int newGamma = 100.0 / gamma; + int newContrast = 100.0 - 200.0 / (contrast + 1.0); + int newBrightness = brightness * 100.0; + + if (m_gamma != newGamma || m_contrast != newContrast || m_brightness != newBrightness) { + m_gamma = newGamma; + m_contrast = newContrast; + m_brightness = newBrightness; + + QVariantList values = { m_brightness, m_contrast, m_gamma }; + Q_EMIT valueChanged(values); + } +} + } // namespace KSaneCore + +#include "moc_gammaoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/gammaoption.h new/ksanecore-23.08.0/src/options/gammaoption.h --- old/ksanecore-23.04.3/src/options/gammaoption.h 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/gammaoption.h 2023-08-16 22:26:10.000000000 +0200 @@ -20,7 +20,6 @@ GammaOption(const SANE_Handle handle, const int index); void readValue() override; - void readOption() override; QVariant maximumValue() const override; QVariant value() const override; @@ -32,11 +31,13 @@ private: void calculateGTwriteData(); + void calculateBCGwriteData(); int m_brightness; int m_contrast; int m_gamma; QVector<int> m_gammaTable; + int m_gammaTableMax; }; } // namespace KSane diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/integeroption.cpp new/ksanecore-23.08.0/src/options/integeroption.cpp --- old/ksanecore-23.04.3/src/options/integeroption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/integeroption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -113,3 +113,5 @@ } } // namespace KSaneCore + +#include "moc_integeroption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/invertoption.cpp new/ksanecore-23.08.0/src/options/invertoption.cpp --- old/ksanecore-23.04.3/src/options/invertoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/invertoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -64,3 +64,5 @@ } } // namespace KSaneCore + +#include "moc_invertoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/listoption.cpp new/ksanecore-23.08.0/src/options/listoption.cpp --- old/ksanecore-23.04.3/src/options/listoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/listoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -327,3 +327,5 @@ } } // namespace KSaneCore + +#include "moc_listoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/pagesizeoption.cpp new/ksanecore-23.08.0/src/options/pagesizeoption.cpp --- old/ksanecore-23.04.3/src/options/pagesizeoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/pagesizeoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -229,3 +229,5 @@ } } // namespace KSaneCore + +#include "moc_pagesizeoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/options/stringoption.cpp new/ksanecore-23.08.0/src/options/stringoption.cpp --- old/ksanecore-23.04.3/src/options/stringoption.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/options/stringoption.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -78,3 +78,5 @@ } } // namespace KSaneCore + +#include "moc_stringoption.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksanecore-23.04.3/src/scanthread.cpp new/ksanecore-23.08.0/src/scanthread.cpp --- old/ksanecore-23.04.3/src/scanthread.cpp 2023-07-04 07:02:32.000000000 +0200 +++ new/ksanecore-23.08.0/src/scanthread.cpp 2023-08-16 22:26:10.000000000 +0200 @@ -240,3 +240,5 @@ } } // namespace KSaneCore + +#include "moc_scanthread.cpp"