summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2024-03-14 10:05:31 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2024-04-05 18:40:47 +0200
commit05b84673045a5f4432a6caa9bea08d8fba1e1a03 (patch)
tree68ecd72c6448dffe970f079120e5c6a14e4c4c63 /tests/libfuzzer
parenta786404036990c595e25122fae5f710f12bc397b (diff)
Add color space model, making gray color spaces explicit
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>
Diffstat (limited to 'tests/libfuzzer')
-rw-r--r--tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp
index 3bd94785ef..5055b57229 100644
--- a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp
+++ b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp
@@ -5,6 +5,7 @@
#include <QGuiApplication>
#include <QColorSpace>
+#include <QImage>
extern "C" int LLVMFuzzerTestOneInput(const char *data, size_t size) {
// to reduce noise and increase speed
@@ -28,7 +29,12 @@ extern "C" int LLVMFuzzerTestOneInput(const char *data, size_t size) {
Q_UNUSED(b);
QRgb color = 0xfaf8fa00;
color = trans1.map(color);
+ QImage img(16, 2, cs.colorModel() == QColorSpace::ColorModel::Rgb ? QImage::Format_RGB32 : QImage::Format_Grayscale8);
+ img.setColorSpace(cs);
+ QImage img2 = img.convertedToColorSpace(QColorSpace::SRgb);
if (cs.isValidTarget()) {
+ QImage img3 = img2.convertedToColorSpace(cs);
+
QColorTransform trans2 = QColorSpace(QColorSpace::SRgb).transformationToColorSpace(cs);
bool a = (trans1 == trans2);
Q_UNUSED(a);