summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qimage
Commit message (Collapse)AuthorAgeFilesLines
* Add CMYK support to QColorSpaceAllan Sandfeld Jensen11 days2-0/+65
| | | | | | | | [ChangeLog][QtGui][QColorSpace] Support for CMYK color spaces has been added. Change-Id: I2c684dbeee8b97fc90ca4e2a892349a7fa465d06 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add color space model, making gray color spaces explicitAllan Sandfeld Jensen2024-04-051-0/+78
| | | | | | | | | This also adds image conversion of both format and color space, which will also be required later for conversions to CMYK formats and color spaces. Change-Id: I578c0a010ffcdb4df4cf9080c0621fac8bc342bf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port QImage::Format_CMYK32 to CMYK8888Giuseppe D'Angelo2024-04-041-7/+7
| | | | | | | | | | | | Follow the established convention that byte-oriented image formats have the "8888" suffix, not "32". The old enum name is temporarily left to help port other submodules. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* GUI: add CMYK painting supportGiuseppe D'Angelo2024-04-031-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a CMYK 8bpp format to QImage. The idea is to enable the transport of CMYK images inside Qt, for instance to be loaded/saved from files or painted on CMYK capable paint devices (e.g. PDF). Also, rasterization support *from* a CMYK image is added (on top of a RGB surface), as well as CMYK image scaling/conversion. Conversion and rasterization between CMYK and RGB isn't particularly optimized nor it honors any colorspaces yet. The overall idea is to match 1:1 the existing behavior of CMYK QColor (which get naively changed to RGB; there isn't colorspace support in QPainter yet). There are no plans to add rasterization *towards* CMYK. Image save/load in native CMYK formats will be added in future commits. This work has been kindly sponsored by the QGIS project (https://qgis.org/). [ChangeLog][QtGui] Support for 8-bit CMYK images has been added. Change-Id: I4b024cd4c15119c669b6ddd450418a9e425587f8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Copy color table in QImage::transform paint pathAllan Sandfeld Jensen2023-12-141-0/+11
| | | | | | | | | A copy without pixel ratio was made, but color table not set. Pick-to: 6.7 6.6 6.5 6.2 Fixes: QTBUG-119902 Change-Id: I328f3faa70d7a1263061cbe51921999393e30801 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Centralize conversion from unpremultiplied to premultiplied image formatAllan Sandfeld Jensen2023-12-121-0/+25
| | | | | | | Makes it possible to add new unpremultiplied formats later. Change-Id: Id998a2674ca9067a0e2a5f85c7baf04bcd9a9912 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix smooth scaling of Format_Mono and Format_MonoLSBJoni Poikelin2023-10-261-0/+20
| | | | | | | Fixes: QTBUG-117713 Pick-to: 6.6 6.5 6.2 Change-Id: I2fb071a4d2229da50dfacb0a92c51c3e4ea57a74 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* tst_QImage: replace QList with constexpr arrayMarc Mutz2023-08-081-3/+2
| | | | | | | | | | | | "Never use a dynamically-sized container for statically-sized data." Port the loop from Q_FOREACH (which can't deal with arrays) to ranged for (which can). Pick-to: 6.6 6.5 Task-number: QTBUG-115839 Change-Id: I40773a0397b83cce0c803967ee3fd7ae274933d3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* CMake: Make gui tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I2ef59684cf297a0222a136ce7b5630037294d000 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-2/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tst_QImage::reinterpretAsFormat(): deduplicate a data tagEdward Welbourne2022-10-181-1/+1
| | | | | | | | Two rows shared a data tag. Prefixed one of them with the color of the half-transparent image it involves (the other's is fully transparent). Change-Id: I1bd174008ed29bcf2f460e683fdf6d1f12ba19d0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QImage::mirrored(): deduplicate some data row namesEdward Welbourne2022-10-181-6/+6
| | | | | Change-Id: Ia10c72c450eed12d29c9608c6a6270dd4dc4ef7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Allow specify distance to plane for QTransformJiDe Zhang2022-08-181-0/+19
| | | | | | | | | | | | | | | | | The default camera to plane distance is 1024, when rotating a big image along the x or y axis, some areas of the screen may move above the camera, causing the rotation to fail. A new rotation interface has been added to allow users to specify the distance from the camera to the plane themselves when rotating the QImage. Also, this support has been added to QMatrix4x4::projectedRotate. [ChangeLog][QtGui][QTransform] Added overloads to rotate() and rotateRadians() that allow specifying of the distance to the rotation plane. Fixes: QTBUG-105088 Change-Id: I81f629916ddd9b6ab84e0282191e4284a88a85f5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* tst_qimage: skip exifReadComments when the feature is not activeJanne Juntunen2022-08-081-0/+3
| | | | | | | | | | We need to skip the exifReadComments test case if reading text from image has been configured off, like in webOS's Yocto recipe for QtBase. Fixes: QTBUG-105393 Pick-to: 6.4 Change-Id: If45872ca7ed26620fa38bc6b47132363d661acdc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-3/+3
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Do metadata detach simpler than full detachAllan Sandfeld Jensen2022-06-011-0/+20
| | | | | | | | | Avoid a full data detach when only metadata changes. This paradigm was already used one place, and made generic. Fixes: QTBUG-81674 Change-Id: I605253babc6ad9fc130e19e8cef3812690933ac5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Tests: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Check if platform has enough RAM for hugeQImage testPasi Petäjäjärvi2022-02-171-1/+4
| | | | | | | | | | | The hugeQImage test loads, as its name suggests, a huge image. At 2.5 GiB it's too big for the hard-coded 1 GiB limit on RAM that the QNX toolchain hard-codes when it's started in QEMU. Pick-to: 6.2 6.3 Task-number: QTBUG-100929 Change-Id: I8e8caaff7fd1dd0e648ada5df613c793f72bcf5d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Cleanup tests that add test data to resources explicitlyAlexey Edelev2022-02-111-34/+0
| | | | | | | | | | | | Remove Integrity and Android specific code that explicitly adds test data to the resource files. qt_internal_add_test functions implicitly adds test data to resources for Android and Integrity platforms by default. Change-Id: Ia1d58755b47442e1953462e38606f70fec262368 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove unused .qrc filesJoerg Bornemann2022-01-171-22/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Preserve QImage metadata when converting format with color tableEirik Aavitsland2021-09-281-0/+7
| | | | | | | | | | Unlike the other conversion functions, convertWithPalette() did not call copyMetadata(). Fixes: QTBUG-96926 Pick-to: 6.2 5.15 Change-Id: I2b171cec16bc5a90d33e80d6fe178c650ed3fe36 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-1/+1
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add load/fromdata() overloads taking QByteArrayView to QImageEirik Aavitsland2021-06-021-6/+27
| | | | | | | | | | | | | | Handy when one has the data buffer to be read in a QBAV. This also fixes an issue and compiler warning about passing a qsizetype data length value as an int, and makes it possible to pass a qsizetype-size length without going through QByteArray. Makes the QByteArray overload redundant. Change-Id: Iba8825cf0fd8003fb2eac5b1d30a61ec91b85ceb Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Introduce float QImage formats and renderingAllan Sandfeld Jensen2021-05-261-8/+32
| | | | | | | | | Useful for some HDR representations and HDR rendering. Change-Id: If6e8a661faa3d2afdf17b6ed4d8ff5c5b2aeb30e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Correct RGB to Grayscale conversionAllan Sandfeld Jensen2021-05-211-11/+18
| | | | | | | | | | | The existing conversions weren't handling gamma correctly and used an ad-hoc definition of gray instead of based on true luminance. [ChangeLog][QtGui] RGB conversions to grayscale formats are now gamma-corrected and produce color-space luminance values Change-Id: I88ab870c8f5e502ddb053e6a14a75102239a26f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix alpha handling of QImage::setPixelAllan Sandfeld Jensen2021-03-221-11/+61
| | | | | | | | | | It was treated differently depending on format, made it consistently behave the same for all formats (following the behavior of the primary formats). Pick-to: 6.1 6.0 5.15 Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add deviceIndependentSize() to QPixmap and QImageMorten Johan Sørvig2021-03-081-0/+10
| | | | | | | | | | This function returns the size in device independent pixels, and should be used when calculating user interface sizes. Change-Id: I528123f962595a3da42438ca560289a29aca4917 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* And fix handling and test of QImage::fill(uint) as wellAllan Sandfeld Jensen2021-02-251-2/+8
| | | | | | | | | Only RGB444 and RGB666 were treated slighlty different from the rest, but the test had a few additional mistakes. Pick-to: 6.1 6.0 5.15 Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-7/+31
| | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Pick-to: 6.1 6.0 5.15 Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-13/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+2
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Tests: Fix building with qmake on WindowsFriedemann Kleint2020-12-171-1/+1
| | | | | | | | Apparently some library definitions went overboard, link them directly. Pick-to: 6.0 Change-Id: I009737f7e3edff5619241b700a627dc4e25e6018 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix QImage::setPixelColor on RGBA64_PremultipliedAllan Sandfeld Jensen2020-12-041-0/+8
| | | | | | | | QColors were not premultiplied before being set. Pick-to: 6.0 5.15 5.12 Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warning about discarded return valueVolker Hilsheimer2020-11-231-1/+1
| | | | | | | | | Not testing the result of the copying, just verifying that it doesn't assert. Pick-to: 6.0 Change-Id: Ib51129134b74c17eada7e3819ccfff10bb9affbf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Allow painting above INT16_MAX on 64-bit architecturesAllan Sandfeld Jensen2020-11-091-0/+64
| | | | | | | | | | | The logic in qgrayraster was ready for it except for an intermediate format. qrasterizer.cpp and qcosmeticstroker.cpp uses a dot-16 fixed point format, and had to be changed to handle higher coordinates on 64-bit architectures. Fixes: QTBUG-84428 Change-Id: I85ab7a04e38bd0dbcefa9f16c16ccc84785a33cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Test QImage move semanticsAllan Sandfeld Jensen2020-10-161-2/+33
| | | | | | | Tests the move semantics of QImage in Qt6. Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Preserve formats in QImage::scaled()Allan Sandfeld Jensen2020-09-261-0/+30
| | | | | | | | | Do not always use the smoothScaled routine, the normal routines are also optimized, and do not convert to alpha formats when not necessary. Task-number: QTBUG-49719 Change-Id: I6ee9b620cc259472c419e7363357f41ce29b594a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-4/+4
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Create consistent sets of QImage methodsAllan Sandfeld Jensen2020-09-091-7/+7
| | | | | | | Adds consistently named inplace and imperative methods. Change-Id: I8739c1c4585d2ba4aa181bb9a681255d76c120d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QtGui: Add Windows conversion functions for to QImageFriedemann Kleint2020-07-241-7/+3
| | | | | | | | | Add conversions from/to HBITMAP, HICON to QImage. Split the pixmap conversion functions apart to use them. Task-number: QTBUG-81876 Change-Id: Ic0c41a402a1f6e9bec572fc4d691357bd48e6423 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-4/+4
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in gui testsJarek Kobus2020-06-251-8/+8
| | | | | | Task-number: QTBUG-84469 Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QByteArray's methods taking QString and their usesSona Kurazyan2020-06-251-1/+1
| | | | | | | | | | [ChangeLog][QtCore][QByteArray] Remove method overloads taking QString as argument, all of which were equivalent to passing the toUtf8() of the string instead. Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove winrtOliver Wolff2020-06-063-7/+7
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated members from QtGui/image classesVolker Hilsheimer2020-04-291-28/+0
| | | | | | | | Cleaning up those that are trivial to remove because they have direct replacements. Change-Id: I4f5c25884a01474fa2db8b369f0d883bd21edd5b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-5/+126
|\ | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a