qt6-bb10/tests/auto/gui
Giuseppe D'Angelo 3fb3d95c33 Add support for CMYK file I/O in JPEG
JPEG part 6 defines CMYK support. This commit adds such support to the
JPEG plugin.

A *very* interesting discovery is the fact that Photoshop inverts the
meaning of the CMYK color channels when saving into JPEG: 0 means "full
ink", and 255 means "no ink". Most other image viewers/editors follow
the same interpretation, I imagine for compatibility.

But others, like Adobe Reader, don't (???) -- a PDF expects a DCT
encoding with 0 meaning "no ink". I am adding a SubType to the image I/O
handler to let the user choose what they want, defaulting to Photoshop
behavior.

Also, turns out that Qt was already loading CMYK files and converting
them to RGB. I don't think we should do automatic, lossy conversions (we
were not taking into account an eventual colorspace...), so I'm changing
that loading to yield a CMYK QImage.

Finally: save the colorspace, even if it's a CMYK image.

QColorSpace doesn't support anything but RGB matrix-based colorspaces.
Yet, it can load an arbitrary ICC profile, and will store it even if
it's unable to use it. We can use this fact to preserve the colorspace
embedded in CMYK images, or let users set an arbitrary ICC profile on
them through Qt APIs, and then saving the result in JPEG.
[ChangeLog][QtGui][JPEG] Added support for loading and saving of JPEG
files in 8-bit CMYK format. When loading a CMYK JPEG file, Qt used to
convert it automatically to a RGB image; now instead it's kept as-is.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ibdbfa16aa35814f5dba28c2df89577175162b731
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-03 22:15:42 +01:00
..
image Add support for CMYK file I/O in JPEG 2024-04-03 22:15:42 +01:00
itemmodels Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
kernel Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
math3d Change license for tests files 2024-02-04 09:56:42 +01:00
painting GUI: add CMYK painting support 2024-04-03 18:31:36 +01:00
platform Change license for tests files 2024-02-04 09:56:42 +01:00
qopengl Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglconfig Change license for tests files 2024-02-04 09:56:42 +01:00
qvulkan Change license for tests files 2024-02-04 09:56:42 +01:00
rhi rhi: Add support for resolving depth-stencil 2024-04-03 22:14:21 +02:00
text Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
util Improve KTX file reading memory safety 2024-02-09 13:08:44 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00