Document how to create a QColorTransform via QColorSpace

Change-Id: If651a4f17f52ff784bc0832440f41fb30cd29371
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5effd7ad53997a5a1edcba09457036971cbdcd54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2024-10-04 09:56:32 +02:00 committed by Qt Cherry-pick Bot
parent f6fa4c4145
commit bc83fb11a1

View File

@ -84,6 +84,14 @@ void QColorTransformPrivate::updateLutsOut() const
It can be applied on color and pixels to convert them from one color space to It can be applied on color and pixels to convert them from one color space to
another. another.
To create a QColorTransform, use QColorSpace::transformationToColorSpace():
\code
QColorSpace sourceColorSpace(QColorSpace::SRgb);
QColorSpace targetColorSpace(QColorSpace::DisplayP3);
QColorTransform srgbToP3Transform = sourceColorSpace.transformationToColorSpace(targetColorSpace);
\endcode
Setting up a QColorTransform takes some preprocessing, so keeping around Setting up a QColorTransform takes some preprocessing, so keeping around
QColorTransforms that you need often is recommended, instead of generating QColorTransforms that you need often is recommended, instead of generating
them on the fly. them on the fly.