Bug Summary

File:/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp
Warning:line 220, column 19
Assigned value is garbage or undefined

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name sharpenfilter.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/gilles/devel/GIT/8.x/build.scan/core/libs/dimg -fcoverage-compilation-dir=/home/gilles/devel/GIT/8.x/build.scan/core/libs/dimg -resource-dir /usr/lib/llvm-18/lib/clang/18 -D BUILDING_XMPCOMPAREANDMERGE_AS_STATIC=1 -D BUILDING_XMPCOMPAREANDMERGE_LIB=1 -D BanAllEntityUsage=1 -D CMS_NO_REGISTER_KEYWORD=1 -D EnablePluginManager=0 -D HAVE_FFMPEG_VERSION5 -D LIBPGF_DISABLE_OPENMP -D LINKING_XMPCORE_LIB=1 -D MAGICKCORE_HDRI_ENABLE=0 -D MAGICKCORE_QUANTUM_DEPTH=16 -D QT_DEPRECATED_WARNINGS -D QT_DEPRECATED_WARNINGS_SINCE=0x060000 -D QT_DISABLE_DEPRECATED_BEFORE=0x050E00 -D QT_NO_CAST_FROM_ASCII -D QT_NO_CAST_FROM_BYTEARRAY -D QT_NO_CAST_TO_ASCII -D QT_NO_KEYWORDS -D QT_NO_NARROWING_CONVERSIONS_IN_CONNECT -D QT_NO_URL_CAST_FROM_STRING -D QT_STRICT_ITERATORS -D QT_USE_QSTRINGBUILDER -D TRANSLATION_DOMAIN="digikam" -D UNIX_ENV=1 -D USE_JASPER -D USE_JPEG -D USE_JPEG8 -D XMP_COMPONENT_INT_NAMESPACE=AdobeXMPCompareAndMerge_Int -D XMP_StaticBuild=1 -D _GNU_SOURCE -D _LARGEFILE64_SOURCE -D digikamcore_EXPORTS -D qDNGDebug=0 -D qDNGLittleEndian=1 -D qDNGThreadSafe=1 -D qDNGUseLibJPEG=1 -D qDNGUseStdInt=1 -D qDNGUseXMP=1 -D qDNGValidateTarget=1 -D qDNGXMPDocOps=0 -D qDNGXMPFiles=0 -D qLinux=1 -D qMacOS=0 -D qWinOS=0 -I /home/gilles/devel/GIT/8.x/build.scan/core/libs/dimg -I /home/gilles/devel/GIT/8.x/core/libs/dimg -I /home/gilles/devel/GIT/8.x/build.scan/core/libs/dimg/core_dimg_obj_autogen/include -I /home/gilles/devel/GIT/8.x/core/libs/video/player/qtmm -I /home/gilles/devel/GIT/8.x/core/libs/album/engine -I /home/gilles/devel/GIT/8.x/core/libs/album/manager -I /home/gilles/devel/GIT/8.x/core/libs/album/treeview -I /home/gilles/devel/GIT/8.x/core/libs/album/widgets -I /home/gilles/devel/GIT/8.x/core/libs/database/collection -I /home/gilles/devel/GIT/8.x/core/libs/database/coredb -I /home/gilles/devel/GIT/8.x/core/libs/database/dbjobs -I /home/gilles/devel/GIT/8.x/core/libs/database/engine -I /home/gilles/devel/GIT/8.x/core/libs/database/haar -I /home/gilles/devel/GIT/8.x/core/libs/database/history -I /home/gilles/devel/GIT/8.x/core/libs/database/item/containers -I /home/gilles/devel/GIT/8.x/core/libs/database/item/lister -I /home/gilles/devel/GIT/8.x/core/libs/database/item/query -I /home/gilles/devel/GIT/8.x/core/libs/database/item/scanner -I /home/gilles/devel/GIT/8.x/core/libs/database/models -I /home/gilles/devel/GIT/8.x/core/libs/database/server -I /home/gilles/devel/GIT/8.x/core/libs/database/similaritydb -I /home/gilles/devel/GIT/8.x/core/libs/database/tags -I /home/gilles/devel/GIT/8.x/core/libs/database/thumbsdb -I /home/gilles/devel/GIT/8.x/core/libs/database/utils/ifaces -I /home/gilles/devel/GIT/8.x/core/libs/database/utils/scan -I /home/gilles/devel/GIT/8.x/core/libs/database/utils/widgets -I /home/gilles/devel/GIT/8.x/core/libs/dialogs -I /home/gilles/devel/GIT/8.x/core/libs/dimg/color -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/auto -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/bcg -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/bw -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/cb -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/curves -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/decorate -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/film -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration/cimg -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/hotpixels -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/hsl -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/icc -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/lc -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/lens -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/levels -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/nr -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/raw -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/redeye -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/transform -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/wb -I /home/gilles/devel/GIT/8.x/core/libs/dimg/history -I /home/gilles/devel/GIT/8.x/core/libs/dimg/loaders -I /home/gilles/devel/GIT/8.x/core/libs/dngwriter -I /home/gilles/devel/GIT/8.x/core/libs/dplugins/core -I /home/gilles/devel/GIT/8.x/core/libs/dplugins/iface -I /home/gilles/devel/GIT/8.x/core/libs/dplugins/setup -I /home/gilles/devel/GIT/8.x/core/libs/dplugins/webservices -I /home/gilles/devel/GIT/8.x/core/libs/dplugins/widgets -I /home/gilles/devel/GIT/8.x/core/libs/dragdrop -I /home/gilles/devel/GIT/8.x/core/libs/dtrash -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/common -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/detection -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/detection/opencv-dnn -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/facedb -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/preprocessing -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/preprocessing/recognition -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/preprocessing/shape-predictor -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/recognition -I /home/gilles/devel/GIT/8.x/core/libs/facesengine/recognition/opencv-dnn -I /home/gilles/devel/GIT/8.x/core/libs/fileactionmanager -I /home/gilles/devel/GIT/8.x/core/libs/filters -I /home/gilles/devel/GIT/8.x/core/libs/imgqsort/detectors -I /home/gilles/devel/GIT/8.x/core/libs/imgqsort -I /home/gilles/devel/GIT/8.x/core/libs/iojobs -I /home/gilles/devel/GIT/8.x/core/libs/jpegutils -I /home/gilles/devel/GIT/8.x/core/libs/metadataengine/containers -I /home/gilles/devel/GIT/8.x/core/libs/metadataengine/dmetadata -I /home/gilles/devel/GIT/8.x/core/libs/metadataengine/engine -I /home/gilles/devel/GIT/8.x/core/libs/metadataengine/exiftool -I /home/gilles/devel/GIT/8.x/core/libs/metadataengine/focuspoint -I /home/gilles/devel/GIT/8.x/core/libs/models -I /home/gilles/devel/GIT/8.x/core/libs/networkmanager -I /home/gilles/devel/GIT/8.x/core/libs/notificationmanager -I /home/gilles/devel/GIT/8.x/core/libs/onlineversion -I /home/gilles/devel/GIT/8.x/core/libs/pgfutils -I /home/gilles/devel/GIT/8.x/core/libs/progressmanager -I /home/gilles/devel/GIT/8.x/core/libs/properties/captions -I /home/gilles/devel/GIT/8.x/core/libs/properties/geolocation -I /home/gilles/devel/GIT/8.x/core/libs/properties/history -I /home/gilles/devel/GIT/8.x/core/libs/properties/import -I /home/gilles/devel/GIT/8.x/core/libs/properties -I /home/gilles/devel/GIT/8.x/core/libs/rawengine -I /home/gilles/devel/GIT/8.x/core/libs/settings -I /home/gilles/devel/GIT/8.x/core/libs/tags/autoassignment -I /home/gilles/devel/GIT/8.x/core/libs/tags/autoassignment/model -I /home/gilles/devel/GIT/8.x/core/libs/tags/engine -I /home/gilles/devel/GIT/8.x/core/libs/tags/manager/models -I /home/gilles/devel/GIT/8.x/core/libs/tags/manager -I /home/gilles/devel/GIT/8.x/core/libs/tags/widgets -I /home/gilles/devel/GIT/8.x/core/libs/template -I /home/gilles/devel/GIT/8.x/core/libs/threadimageio/engine -I /home/gilles/devel/GIT/8.x/core/libs/threadimageio/fileio -I /home/gilles/devel/GIT/8.x/core/libs/threadimageio/preview -I /home/gilles/devel/GIT/8.x/core/libs/threadimageio/thumb -I /home/gilles/devel/GIT/8.x/core/libs/threadimageio/video -I /home/gilles/devel/GIT/8.x/core/libs/threads -I /home/gilles/devel/GIT/8.x/core/libs/timeadjust -I /home/gilles/devel/GIT/8.x/core/libs/transitionmngr -I /home/gilles/devel/GIT/8.x/core/libs/versionmanager -I /home/gilles/devel/GIT/8.x/core/libs/video -I /home/gilles/devel/GIT/8.x/core/libs/video/manager -I /home/gilles/devel/GIT/8.x/core/libs/video/osd -I /home/gilles/devel/GIT/8.x/core/libs/video/player -I /home/gilles/devel/GIT/8.x/core/libs/widgets/colors -I /home/gilles/devel/GIT/8.x/core/libs/widgets/combo -I /home/gilles/devel/GIT/8.x/core/libs/widgets/files -I /home/gilles/devel/GIT/8.x/core/libs/widgets/fonts -I /home/gilles/devel/GIT/8.x/core/libs/widgets/graphicsview -I /home/gilles/devel/GIT/8.x/core/libs/widgets/history -I /home/gilles/devel/GIT/8.x/core/libs/widgets/iccprofiles -I /home/gilles/devel/GIT/8.x/core/libs/widgets/itemview -I /home/gilles/devel/GIT/8.x/core/libs/widgets/layout -I /home/gilles/devel/GIT/8.x/core/libs/widgets/mainview -I /home/gilles/devel/GIT/8.x/core/libs/widgets/metadata/config -I /home/gilles/devel/GIT/8.x/core/libs/widgets/metadata/exiftool -I /home/gilles/devel/GIT/8.x/core/libs/widgets/metadata/exiv2 -I /home/gilles/devel/GIT/8.x/core/libs/widgets/metadata/labels -I /home/gilles/devel/GIT/8.x/core/libs/widgets/metadata/utils -I /home/gilles/devel/GIT/8.x/core/libs/widgets/range -I /home/gilles/devel/GIT/8.x/core/libs/widgets/text -I /home/gilles/devel/GIT/8.x/core/libs/jpegutils/libjpeg/84 -I /home/gilles/devel/GIT/8.x/core/app/utils -I /home/gilles/devel/GIT/8.x/build.scan/core/app/utils -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/common -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/parser -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/parser/modifiers -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/parser/options -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/parser/options/database -I /home/gilles/devel/GIT/8.x/core/utilities/advancedrename/parser/options/database/keys -I /home/gilles/devel/GIT/8.x/core/utilities/extrasupport/addressbook -I /home/gilles/devel/GIT/8.x/core/utilities/extrasupport/filesindexer -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/bench -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/database -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/items -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/threads -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/widgets -I /home/gilles/devel/GIT/8.x/core/utilities/facemanagement/workers -I /home/gilles/devel/GIT/8.x/core/utilities/firstrun -I /home/gilles/devel/GIT/8.x/core/utilities/focuspointmanagement -I /home/gilles/devel/GIT/8.x/core/utilities/fuzzysearch -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/astro -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/blendings -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/core -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/data -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/graphicsitem -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/handlers/dgml -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/handlers/kml -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/parser -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/scene -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/writer -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/writers/dgml -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/geodata/writers/kml -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/graphicsview -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/layers -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/models -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/osm -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/atmosphere -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/compass -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/crosshairs -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/graticule -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/mapscale -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/measure -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/navigation -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/overviewmap -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/render/progress -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/cache -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/gpsbabel -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/gpx -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/gpx/handlers -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/json -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/kml -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/nominatim-reversegeocoding -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/osm -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/osm/o5mreader -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/osm/translators -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/osm/writers -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/pn2 -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/plugins/runner/pnt -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/projections -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/runners -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/settings -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/storage -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/tile -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/backends -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/bookmark -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/core -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/correlator -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/dragdrop -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/items -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/lookup -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/reversegeocoding -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/tiles -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/tracks -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/widgets -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/geomapwrapper -I /home/gilles/devel/GIT/8.x/core/utilities/geolocation/mapsearches -I /home/gilles/devel/GIT/8.x/core/utilities/imageeditor/core -I /home/gilles/devel/GIT/8.x/core/utilities/imageeditor/dialogs -I /home/gilles/devel/GIT/8.x/core/utilities/imageeditor/editor -I /home/gilles/devel/GIT/8.x/core/utilities/imageeditor/main -I /home/gilles/devel/GIT/8.x/core/utilities/imageeditor/widgets -I /home/gilles/devel/GIT/8.x/core/utilities/import/backend -I /home/gilles/devel/GIT/8.x/core/utilities/import/dialogs -I /home/gilles/devel/GIT/8.x/core/utilities/import/items -I /home/gilles/devel/GIT/8.x/core/utilities/import/main -I /home/gilles/devel/GIT/8.x/core/utilities/import/models -I /home/gilles/devel/GIT/8.x/core/utilities/import/views -I /home/gilles/devel/GIT/8.x/core/utilities/import/widgets -I /home/gilles/devel/GIT/8.x/core/utilities/lighttable -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/main -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/manager -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/autotags -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/dbcleaner -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/dbscan -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/duplicates -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/facesmanagement -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/fingerprints -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/imgqsort -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/metaremover -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/metasync -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/tools/thumbs -I /home/gilles/devel/GIT/8.x/core/utilities/maintenance/utils -I /home/gilles/devel/GIT/8.x/core/utilities/queuemanager/dplugins -I /home/gilles/devel/GIT/8.x/core/utilities/queuemanager/main -I /home/gilles/devel/GIT/8.x/core/utilities/queuemanager/manager -I /home/gilles/devel/GIT/8.x/core/utilities/queuemanager/views -I /home/gilles/devel/GIT/8.x/core/utilities/searchwindow -I /home/gilles/devel/GIT/8.x/core/utilities/setup/album -I /home/gilles/devel/GIT/8.x/core/utilities/setup/camera -I /home/gilles/devel/GIT/8.x/core/utilities/setup/collections -I /home/gilles/devel/GIT/8.x/core/utilities/setup/downloader -I /home/gilles/devel/GIT/8.x/core/utilities/setup/editor -I /home/gilles/devel/GIT/8.x/core/utilities/setup/metadata -I /home/gilles/devel/GIT/8.x/core/utilities/setup/misc -I /home/gilles/devel/GIT/8.x/core/utilities/setup -I /home/gilles/devel/GIT/8.x/core/app/main -I /home/gilles/devel/GIT/8.x/core/app/date -I /home/gilles/devel/GIT/8.x/core/app/dragdrop -I /home/gilles/devel/GIT/8.x/core/app/views/stack -I /home/gilles/devel/GIT/8.x/core/app/views/utils -I /home/gilles/devel/GIT/8.x/core/app/items/utils -I /home/gilles/devel/GIT/8.x/core/app/items/delegate -I /home/gilles/devel/GIT/8.x/core/app/views/sidebar -I /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/transform/lqr -I /usr/include/opencv4 -I /usr/include/ImageMagick-6 -I /usr/include/x86_64-linux-gnu/ImageMagick-6 -I /opt/qt6/include/QtMultimedia -I /opt/qt6/include -I /opt/qt6/include/QtCore -I /opt/qt6/mkspecs/linux-g++ -I /opt/qt6/include/QtGui -I /opt/qt6/include/QtNetwork -I /opt/qt6/include/QtMultimediaWidgets -I /opt/qt6/include/QtWidgets -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/lensfun -I /usr/include/eigen3 -I /opt/qt6/include/QtConcurrent -I /opt/qt6/include/QtXml -I /opt/qt6/include/KF6/KCoreAddons -I /opt/qt6/include/KF6/KConfig -I /opt/qt6/include/KF6/KConfigCore -I /opt/qt6/include/KF6/KI18n -I /opt/qt6/include/KF6/KWidgetsAddons -I /opt/qt6/include/QtGui/6.7.0 -I /opt/qt6/include/QtGui/6.7.0/QtGui -I /opt/qt6/include/QtCore/6.7.0 -I /opt/qt6/include/QtCore/6.7.0/QtCore -I /opt/qt6/include/QtDBus/6.7.0 -I /opt/qt6/include/QtDBus/6.7.0/QtDBus -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-long-long -Wno-deprecated-copy -std=c++20 -fdeprecated-macro -ferror-limit 19 -fvisibility=hidden -fvisibility-inlines-hidden -fno-operator-names -fopenmp -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /mnt/data2/devel/GIT/8.x/project/reports/report.scan/2024-07-19-181803-1488604-1 -x c++ /home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp

/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp

1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2005-17-07
7 * Description : A Sharpen threaded image filter.
8 *
9 * SPDX-FileCopyrightText: 2005-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
11 * SPDX-FileCopyrightText: 2002 by Daniel M. Duley <mosfet at kde dot org>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17#define SQ2PI2.50662827463100024161235523934010416269302368164062 2.50662827463100024161235523934010416269302368164062
18#define Epsilon1.0e-12 1.0e-12
19
20#include "sharpenfilter.h"
21
22// C++ includes
23
24#include <cmath>
25#include <cstdlib>
26
27// Qt includes
28
29#include <QtConcurrent> // krazy:exclude=includes
30
31// Local includes
32
33#include "digikam_debug.h"
34#include "digikam_globals_p.h" // For KF6::Ki18n deprecated
35
36namespace Digikam
37{
38
39SharpenFilter::SharpenFilter(QObject* const parent)
40 : DImgThreadedFilter(parent)
41{
42 initFilter();
43}
44
45SharpenFilter::SharpenFilter(DImg* const orgImage, QObject* const parent, double radius, double sigma)
46 : DImgThreadedFilter(orgImage, parent, QLatin1String("Sharpen"))
47{
48 m_radius = radius;
49 m_sigma = sigma;
50 initFilter();
51}
52
53SharpenFilter::SharpenFilter(DImgThreadedFilter* const parentFilter,
54 const DImg& orgImage, const DImg& destImage,
55 int progressBegin, int progressEnd, double radius, double sigma)
56 : DImgThreadedFilter(parentFilter, orgImage, destImage, progressBegin, progressEnd,
57 parentFilter->filterName() + QLatin1String(": Sharpen"))
58{
59 m_radius = radius;
60 m_sigma = sigma;
61
62 // We need to provide support for orgImage == destImage.
63 // The algorithm does not support this out of the box, so use a temporary.
64
65 if (orgImage.bits() == destImage.bits())
1
Assuming the condition is false
2
Taking false branch
66 {
67 m_destImage = DImg(destImage.width(), destImage.height(), destImage.sixteenBit());
68 }
69
70 this->filterImage();
3
Calling 'SharpenFilter::filterImage'
71
72 if (orgImage.bits() == destImage.bits())
73 {
74 memcpy(destImage.bits(), m_destImage.bits(), m_destImage.numBytes());
75 }
76}
77
78SharpenFilter::~SharpenFilter()
79{
80 cancelFilter();
81}
82
83QString SharpenFilter::DisplayableName()
84{
85 return QString::fromUtf8(I18N_NOOP("Sharpen")kli18n("Sharpen").untranslatedText());
86}
87
88void SharpenFilter::filterImage()
89{
90 sharpenImage(m_radius, m_sigma);
4
Calling 'SharpenFilter::sharpenImage'
91}
92
93/**
94 * Function to apply the sharpen filter on an image
95 */
96void SharpenFilter::sharpenImage(double radius, double sigma)
97{
98 if (m_orgImage.isNull())
5
Assuming the condition is false
6
Taking false branch
99 {
100 qCWarning(DIGIKAM_DIMG_LOG)for (QLoggingCategoryMacroHolder<QtWarningMsg> qt_category
((DIGIKAM_DIMG_LOG)()); qt_category; qt_category.control = false
) QMessageLogger(static_cast<const char *>("/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp"
), 100, static_cast<const char *>(__PRETTY_FUNCTION__),
qt_category.name()).warning()
<< "No image data available!";
101
102 return;
103 }
104
105 if (radius <= 0.0)
7
Assuming the condition is false
8
Taking false branch
106 {
107 m_destImage = m_orgImage;
108
109 return;
110 }
111
112 double alpha, normalize = 0.0;
113 long i = 0, u, v;
114
115 int kernelWidth = getOptimalKernelWidth(radius, sigma);
116 int halfKernelWidth = kernelWidth / 2;
117
118 if ((int)m_orgImage.width() < kernelWidth)
9
Assuming the condition is false
10
Taking false branch
119 {
120 qCWarning(DIGIKAM_DIMG_LOG)for (QLoggingCategoryMacroHolder<QtWarningMsg> qt_category
((DIGIKAM_DIMG_LOG)()); qt_category; qt_category.control = false
) QMessageLogger(static_cast<const char *>("/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp"
), 120, static_cast<const char *>(__PRETTY_FUNCTION__),
qt_category.name()).warning()
<< "Image is smaller than radius!";
121
122 return;
123 }
124
125 QScopedArrayPointer<double> kernel(new double[kernelWidth * kernelWidth]{});
11
Storing uninitialized value
12
Calling constructor for 'QScopedArrayPointer<double, QScopedPointerArrayDeleter<double>>'
15
Returning from constructor for 'QScopedArrayPointer<double, QScopedPointerArrayDeleter<double>>'
126
127 if (kernel.isNull())
16
Taking false branch
128 {
129 qCWarning(DIGIKAM_DIMG_LOG)for (QLoggingCategoryMacroHolder<QtWarningMsg> qt_category
((DIGIKAM_DIMG_LOG)()); qt_category; qt_category.control = false
) QMessageLogger(static_cast<const char *>("/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp"
), 129, static_cast<const char *>(__PRETTY_FUNCTION__),
qt_category.name()).warning()
<< "Unable to allocate memory!";
130
131 return;
132 }
133
134 for (v = -halfKernelWidth ; v <= halfKernelWidth ; ++v)
17
Assuming 'v' is > 'halfKernelWidth'
18
Loop condition is false. Execution continues on line 145
135 {
136 for (u = -halfKernelWidth ; u <= halfKernelWidth ; ++u)
137 {
138 alpha = exp(-((double) u * u + v * v) / (2.0 * sigma * sigma));
139 kernel[i] = alpha / (2.0 * M_PI3.14159265358979323846 * sigma * sigma);
140 normalize += kernel[i];
141 ++i;
142 }
143 }
144
145 kernel[i / 2] = (-2.0) * normalize;
146 convolveImage(kernelWidth, kernel.data());
19
Calling 'SharpenFilter::convolveImage'
147}
148
149void SharpenFilter::convolveImageMultithreaded(const Args& prm)
150{
151 double maxClamp = m_destImage.sixteenBit() ? 16777215.0 : 65535.0;
152 double* k = nullptr;
153 double red, green, blue, alpha;
154 int mx, my, sx, sy, mcx, mcy;
155 DColor color;
156
157 for (uint x = prm.start ; runningFlag() && (x < prm.stop) ; ++x)
158 {
159 k = prm.normal_kernel;
160 red = green = blue = alpha = 0;
161 sy = prm.y - prm.halfKernelWidth;
162
163 for (mcy = 0 ; runningFlag() && (mcy < prm.kernelWidth) ; ++mcy, ++sy)
164 {
165 my = (sy < 0) ? 0 : (sy > (int)m_destImage.height() - 1) ? m_destImage.height() - 1 : sy;
166 sx = x + (-prm.halfKernelWidth);
167
168 for (mcx = 0 ; runningFlag() && (mcx < prm.kernelWidth) ; ++mcx, ++sx)
169 {
170 mx = (sx < 0) ? 0 : (sx > (int)m_destImage.width() - 1) ? m_destImage.width() - 1 : sx;
171 color = m_orgImage.getPixelColor(mx, my);
172 red += (*k) * (color.red() * 257.0);
173 green += (*k) * (color.green() * 257.0);
174 blue += (*k) * (color.blue() * 257.0);
175 alpha += (*k) * (color.alpha() * 257.0);
176 ++k;
177 }
178 }
179
180 red = red < 0.0 ? 0.0 : (red > maxClamp) ? maxClamp : red + 0.5;
181 green = green < 0.0 ? 0.0 : (green > maxClamp) ? maxClamp : green + 0.5;
182 blue = blue < 0.0 ? 0.0 : (blue > maxClamp) ? maxClamp : blue + 0.5;
183 alpha = alpha < 0.0 ? 0.0 : (alpha > maxClamp) ? maxClamp : alpha + 0.5;
184
185 m_destImage.setPixelColor(x, prm.y, DColor((int)(red / 257UL), (int)(green / 257UL),
186 (int)(blue / 257UL), (int)(alpha / 257UL),
187 m_destImage.sixteenBit()));
188 }
189}
190
191bool SharpenFilter::convolveImage(const unsigned int order, const double* const kernel)
192{
193 uint y;
194 int progress;
195 long i;
196 double normalize = 0.0;
197
198 Args prm;
199 prm.kernelWidth = order;
200 prm.halfKernelWidth = prm.kernelWidth / 2;
201
202 if ((prm.kernelWidth % 2) == 0)
20
Assuming the condition is false
21
Taking false branch
203 {
204 qCWarning(DIGIKAM_DIMG_LOG)for (QLoggingCategoryMacroHolder<QtWarningMsg> qt_category
((DIGIKAM_DIMG_LOG)()); qt_category; qt_category.control = false
) QMessageLogger(static_cast<const char *>("/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp"
), 204, static_cast<const char *>(__PRETTY_FUNCTION__),
qt_category.name()).warning()
<< "Kernel width must be an odd number!";
205
206 return false;
207 }
208
209 QScopedArrayPointer<double> normal_kernel(new double[prm.kernelWidth * prm.kernelWidth]{});
210
211 if (normal_kernel.isNull())
22
Taking false branch
212 {
213 qCWarning(DIGIKAM_DIMG_LOG)for (QLoggingCategoryMacroHolder<QtWarningMsg> qt_category
((DIGIKAM_DIMG_LOG)()); qt_category; qt_category.control = false
) QMessageLogger(static_cast<const char *>("/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/sharp/sharpenfilter.cpp"
), 213, static_cast<const char *>(__PRETTY_FUNCTION__),
qt_category.name()).warning()
<< "Unable to allocate memory!";
214
215 return false;
216 }
217
218 for (i = 0 ; i < (prm.kernelWidth * prm.kernelWidth) ; ++i)
23
Assuming the condition is true
24
Loop condition is true. Entering loop body
25
The value 1 is assigned to 'i'
26
Assuming the condition is true
27
Loop condition is true. Entering loop body
219 {
220 normalize += kernel[i];
28
Assigned value is garbage or undefined
221 }
222
223 if (fabs(normalize) <= Epsilon1.0e-12)
224 {
225 normalize = 1.0;
226 }
227
228 normalize = 1.0 / normalize;
229
230 for (i = 0 ; i < (prm.kernelWidth * prm.kernelWidth) ; ++i)
231 {
232 normal_kernel[i] = normalize * kernel[i];
233 }
234
235 prm.normal_kernel = normal_kernel.data();
236 QList<int> vals = multithreadedSteps(m_destImage.width());
237
238 for (y = 0 ; runningFlag() && (y < m_destImage.height()) ; ++y)
239 {
240 QList <QFuture<void> > tasks;
241
242 for (int j = 0 ; runningFlag() && (j < vals.count()-1) ; ++j)
243 {
244 prm.start = vals[j];
245 prm.stop = vals[j+1];
246 prm.y = y;
247
248 tasks.append(QtConcurrent::run(
249
250#if (QT_VERSION((6<<16)|(7<<8)|(0)) >= QT_VERSION_CHECK(6, 0, 0)((6<<16)|(0<<8)|(0)))
251
252 &SharpenFilter::convolveImageMultithreaded, this,
253
254#else
255
256 this, &SharpenFilter::convolveImageMultithreaded,
257
258#endif
259
260 prm
261 )
262 );
263 }
264
265 Q_FOREACH (QFuture<void> t, tasks)for (auto _container_265 = QtPrivate::qMakeForeachContainer(tasks
); _container_265.i != _container_265.e; ++_container_265.i) if
(QFuture<void> t = *_container_265.i; false) {} else
266 {
267 t.waitForFinished();
268 }
269
270 progress = (int)(((double)y * 100.0) / m_destImage.height());
271
272 if ((progress % 5) == 0)
273 {
274 postProgress(progress);
275 }
276 }
277
278 return true;
279}
280
281int SharpenFilter::getOptimalKernelWidth(double radius, double sigma)
282{
283 double normalize, value;
284 long kernelWidth;
285 long u;
286
287 if (radius > 0.0)
288 {
289 return((int)(2.0 * ceil(radius) + 1.0));
290 }
291
292 for (kernelWidth = 5 ; ; )
293 {
294 normalize = 0.0;
295
296 for (u = (-kernelWidth / 2) ; u <= (kernelWidth / 2) ; ++u)
297 {
298 normalize += exp(-((double) u * u) / (2.0 * sigma * sigma)) / (SQ2PI2.50662827463100024161235523934010416269302368164062 * sigma);
299 }
300
301 u = kernelWidth / 2;
302 value = exp(-((double) u * u) / (2.0 * sigma * sigma)) / (SQ2PI2.50662827463100024161235523934010416269302368164062 * sigma) / normalize;
303
304 if ((long)(65535 * value) <= 0)
305 {
306 break;
307 }
308
309 kernelWidth += 2;
310 }
311
312 return ((int)kernelWidth - 2);
313}
314
315FilterAction SharpenFilter::filterAction()
316{
317 FilterAction action(FilterIdentifier(), CurrentVersion());
318 action.setDisplayableName(DisplayableName());
319
320 action.addParameter(QLatin1String("radius"), m_radius);
321 action.addParameter(QLatin1String("sigma"), m_sigma);
322
323 return action;
324}
325
326void SharpenFilter::readParameters(const Digikam::FilterAction& action)
327{
328 m_radius = action.parameter(QLatin1String("radius")).toDouble();
329 m_sigma = action.parameter(QLatin1String("sigma")).toDouble();
330}
331
332} // namespace Digikam
333
334#include "moc_sharpenfilter.cpp"

/opt/qt6/include/QtCore/qscopedpointer.h

1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSCOPEDPOINTER_H
5#define QSCOPEDPOINTER_H
6
7#include <QtCore/qglobal.h>
8
9#include <stdlib.h>
10
11QT_BEGIN_NAMESPACE
12
13template <typename T>
14struct QScopedPointerDeleter
15{
16 static inline void cleanup(T *pointer) noexcept
17 {
18 // Enforce a complete type.
19 // If you get a compile error here, read the section on forward declared
20 // classes in the QScopedPointer documentation.
21 typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
22 (void) sizeof(IsIncompleteType);
23
24 delete pointer;
25 }
26 void operator()(T *pointer) const noexcept
27 {
28 cleanup(pointer);
29 }
30};
31
32template <typename T>
33struct QScopedPointerArrayDeleter
34{
35 static inline void cleanup(T *pointer) noexcept
36 {
37 // Enforce a complete type.
38 // If you get a compile error here, read the section on forward declared
39 // classes in the QScopedPointer documentation.
40 typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
41 (void) sizeof(IsIncompleteType);
42
43 delete[] pointer;
44 }
45 void operator()(T *pointer) const noexcept
46 {
47 cleanup(pointer);
48 }
49};
50
51struct QScopedPointerPodDeleter
52{
53 static inline void cleanup(void *pointer) noexcept { free(pointer); }
54 void operator()(void *pointer) const noexcept { cleanup(pointer); }
55};
56
57#ifndef QT_NO_QOBJECT
58template <typename T>
59struct QScopedPointerObjectDeleteLater
60{
61 static inline void cleanup(T *pointer) { if (pointer) pointer->deleteLater(); }
62 void operator()(T *pointer) const { cleanup(pointer); }
63};
64
65class QObject;
66typedef QScopedPointerObjectDeleteLater<QObject> QScopedPointerDeleteLater;
67#endif
68
69template <typename T, typename Cleanup = QScopedPointerDeleter<T> >
70class QScopedPointer
71{
72public:
73 Q_NODISCARD_CTOR[[nodiscard]]
74 explicit QScopedPointer(T *p = nullptr) noexcept : d(p)
75 {
76 }
77
78 inline ~QScopedPointer()
79 {
80 T *oldD = this->d;
81 Cleanup::cleanup(oldD);
82 }
83
84 inline T &operator*() const
85 {
86 Q_ASSERT(d)((d) ? static_cast<void>(0) : qt_assert("d", "/opt/qt6/include/QtCore/qscopedpointer.h"
, 86))
;
87 return *d;
88 }
89
90 T *operator->() const noexcept
91 {
92 return d;
93 }
94
95 bool operator!() const noexcept
96 {
97 return !d;
98 }
99
100 explicit operator bool() const
101 {
102 return !isNull();
103 }
104
105 T *data() const noexcept
106 {
107 return d;
108 }
109
110 T *get() const noexcept
111 {
112 return d;
113 }
114
115 bool isNull() const noexcept
116 {
117 return !d;
118 }
119
120 void reset(T *other = nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval<T *>())))
121 {
122 if (d == other)
123 return;
124 T *oldD = std::exchange(d, other);
125 Cleanup::cleanup(oldD);
126 }
127
128#if QT_DEPRECATED_SINCE(6, 1)(((6<<16)|(1<<8)|(0)) > 0x050E00)
129 QT_DEPRECATED_VERSION_X_6_1("Use std::unique_ptr instead, and call release().")
130 T *take() noexcept
131 {
132 T *oldD = std::exchange(d, nullptr);
133 return oldD;
134 }
135#endif
136
137#if QT_DEPRECATED_SINCE(6, 2)(((6<<16)|(2<<8)|(0)) > 0x050E00)
138 QT_DEPRECATED_VERSION_X_6_2("Use std::unique_ptr instead of QScopedPointer.")
139 void swap(QScopedPointer<T, Cleanup> &other) noexcept
140 {
141 qt_ptr_swap(d, other.d);
142 }
143#endif
144
145 typedef T *pointer;
146
147 friend bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
148 {
149 return lhs.data() == rhs.data();
150 }
151
152 friend bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
153 {
154 return lhs.data() != rhs.data();
155 }
156
157 friend bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
158 {
159 return lhs.isNull();
160 }
161
162 friend bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
163 {
164 return rhs.isNull();
165 }
166
167 friend bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
168 {
169 return !lhs.isNull();
170 }
171
172 friend bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
173 {
174 return !rhs.isNull();
175 }
176
177#if QT_DEPRECATED_SINCE(6, 2)(((6<<16)|(2<<8)|(0)) > 0x050E00)
178 QT_DEPRECATED_VERSION_X_6_2("Use std::unique_ptr instead of QScopedPointer.")
179 friend void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) noexcept
180 { p1.swap(p2); }
181#endif
182
183protected:
184 T *d;
185
186private:
187 Q_DISABLE_COPY_MOVE(QScopedPointer)QScopedPointer(const QScopedPointer &) = delete; QScopedPointer
&operator=(const QScopedPointer &) = delete; QScopedPointer
(QScopedPointer &&) = delete; QScopedPointer &operator
=(QScopedPointer &&) = delete;
188};
189
190template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
191class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
192{
193 template <typename Ptr>
194 using if_same_type = typename std::enable_if<std::is_same<typename std::remove_cv<T>::type, Ptr>::value, bool>::type;
195public:
196 Q_NODISCARD_CTOR[[nodiscard]]
197 inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(nullptr) {}
198 inline ~QScopedArrayPointer() = default;
199
200 template <typename D, if_same_type<D> = true>
201 Q_NODISCARD_CTOR[[nodiscard]]
202 explicit QScopedArrayPointer(D *p)
203 : QScopedPointer<T, Cleanup>(p)
13
Calling default constructor for 'QScopedPointer<double, QScopedPointerArrayDeleter<double>>'
14
Returning from default constructor for 'QScopedPointer<double, QScopedPointerArrayDeleter<double>>'
204 {
205 }
206
207 T &operator[](qsizetype i)
208 {
209 return this->d[i];
210 }
211
212 const T &operator[](qsizetype i) const
213 {
214 return this->d[i];
215 }
216
217#if QT_DEPRECATED_SINCE(6, 2)(((6<<16)|(2<<8)|(0)) > 0x050E00)
218 QT_DEPRECATED_VERSION_X_6_2("Use std::unique_ptr instead of QScopedArrayPointer.")
219 void swap(QScopedArrayPointer &other) noexcept // prevent QScopedPointer <->QScopedArrayPointer swaps
220 { QScopedPointer<T, Cleanup>::swap(other); }
221#endif
222
223private:
224 explicit inline QScopedArrayPointer(void *)
225 {
226 // Enforce the same type.
227
228 // If you get a compile error here, make sure you declare
229 // QScopedArrayPointer with the same template type as you pass to the
230 // constructor. See also the QScopedPointer documentation.
231
232 // Storing a scalar array as a pointer to a different type is not
233 // allowed and results in undefined behavior.
234 }
235
236 Q_DISABLE_COPY_MOVE(QScopedArrayPointer)QScopedArrayPointer(const QScopedArrayPointer &) = delete
; QScopedArrayPointer &operator=(const QScopedArrayPointer
&) = delete; QScopedArrayPointer(QScopedArrayPointer &&
) = delete; QScopedArrayPointer &operator=(QScopedArrayPointer
&&) = delete;
237};
238
239#if QT_DEPRECATED_SINCE(6, 2)(((6<<16)|(2<<8)|(0)) > 0x050E00)
240template <typename T, typename Cleanup>
241QT_DEPRECATED_VERSION_X_6_2("Use std::unique_ptr instead of QScopedArrayPointer.")
242inline void swap(QScopedArrayPointer<T, Cleanup> &lhs, QScopedArrayPointer<T, Cleanup> &rhs) noexcept
243{ lhs.swap(rhs); }
244#endif
245
246QT_END_NAMESPACE
247
248#endif // QSCOPEDPOINTER_H