Sur cette page

QColorTransform Class

La classe QColorTransform est une transformation entre les espaces couleurs. Plus d'informations...

En-tête : #include <QColorTransform>
CMake : find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake : QT += gui

Fonctions publiques

(since 6.4) bool isIdentity() const
QRgb map(QRgb argb) const
QRgba64 map(QRgba64 rgba64) const
(since 6.4) QRgbaFloat16 map(QRgbaFloat16 rgbafp16) const
(since 6.4) QRgbaFloat32 map(QRgbaFloat32 rgbafp32) const
QColor map(const QColor &color) const
(since 6.4) bool operator!=(const QColorTransform &ct1, const QColorTransform &ct2)
(since 6.4) bool operator==(const QColorTransform &ct1, const QColorTransform &ct2)

Description détaillée

QColorTransform est une instanciation d'une transformation entre espaces colorimétriques. Elle peut être appliquée à la couleur et aux pixels pour les convertir d'un espace couleur à un autre.

Pour créer une QColorTransform, utilisez QColorSpace::transformationToColorSpace() :

QColorSpace sourceColorSpace(QColorSpace::SRgb);
QColorSpace targetColorSpace(QColorSpace::DisplayP3);
QColorTransform srgbToP3Transform = sourceColorSpace.transformationToColorSpace(targetColorSpace);

La mise en place d'une QColorTransform nécessite un certain prétraitement, il est donc recommandé de conserver les QColorTransforms dont vous avez souvent besoin, plutôt que de les générer à la volée.

Documentation des fonctions membres

[noexcept, since 6.4] bool QColorTransform::isIdentity() const

Retourne vrai si la transformée de couleur est la transformée d'identité.

Cette fonction a été introduite dans Qt 6.4.

QRgb QColorTransform::map(QRgb argb) const

Applique la transformation des couleurs à la valeur QRgb argb .

L'entrée doit être opaque ou non multipliée.

QRgba64 QColorTransform::map(QRgba64 rgba64) const

Applique la transformation des couleurs à la valeur QRgba64 rgba64 .

L'entrée doit être opaque ou non multipliée.

[since 6.4] QRgbaFloat16 QColorTransform::map(QRgbaFloat16 rgbafp16) const

Applique la transformation des couleurs à la valeur QRgbaFloat16 rgbafp16 .

L'entrée doit être opaque ou non multipliée.

Cette fonction a été introduite dans Qt 6.4.

[since 6.4] QRgbaFloat32 QColorTransform::map(QRgbaFloat32 rgbafp32) const

Applique la transformation des couleurs à la valeur QRgbaFloat32 rgbafp32 .

L'entrée doit être opaque ou non multipliée.

Cette fonction a été introduite dans Qt 6.4.

QColor QColorTransform::map(const QColor &color) const

Applique la transformation des couleurs à la valeur QColor color .

Non-membres associés

[since 6.4] bool operator!=(const QColorTransform &ct1, const QColorTransform &ct2)

Retourne vrai si ct1 ne définit pas la même transformation que ct2.

Cette fonction a été introduite dans Qt 6.4.

[since 6.4] bool operator==(const QColorTransform &ct1, const QColorTransform &ct2)

Retourne vrai si ct1 définit la même transformation de couleur que ct2.

Cette fonction a été introduite dans Qt 6.4.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.