QColorTransform Class

Die Klasse QColorTransform ist eine Transformation zwischen Farbräumen. Mehr...

Kopfzeile: #include <QColorTransform>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

Öffentliche Funktionen

(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)

Detaillierte Beschreibung

QColorTransform ist eine Instanziierung einer Transformation zwischen Farbräumen. Sie kann auf Farben und Pixel angewendet werden, um sie von einem Farbraum in einen anderen zu konvertieren.

Um eine QColorTransform zu erstellen, verwenden Sie QColorSpace::transformationToColorSpace():

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

Das Einrichten einer QColorTransform erfordert eine gewisse Vorverarbeitung, so dass es empfehlenswert ist, QColorTransforms, die Sie häufig benötigen, in der Nähe zu behalten, anstatt sie spontan zu erzeugen.

Dokumentation der Mitgliedsfunktionen

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

Gibt true zurück, wenn die Farbtransformation die Identitätstransformation ist.

Diese Funktion wurde in Qt 6.4 eingeführt.

QRgb QColorTransform::map(QRgb argb) const

Wendet die Farbtransformation auf den Wert QRgb argb an.

Die Eingabe sollte undurchsichtig oder unvermultipliziert sein.

QRgba64 QColorTransform::map(QRgba64 rgba64) const

Wendet die Farbtransformation auf den Wert QRgba64 rgba64 an.

Die Eingabe sollte undurchsichtig oder unvermultipliziert sein.

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

Wendet die Farbtransformation auf den Wert QRgbaFloat16 rgbafp16 an.

Die Eingabe sollte undurchsichtig oder nicht vormultipliziert sein.

Diese Funktion wurde in Qt 6.4 eingeführt.

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

Wendet die Farbtransformation auf den Wert QRgbaFloat32 rgbafp32 an.

Die Eingabe sollte undurchsichtig oder nicht vormultipliziert sein.

Diese Funktion wurde in Qt 6.4 eingeführt.

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

Wendet die Farbtransformation auf den Wert QColor color an.

Verwandte Nicht-Mitglieder

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

Gibt true zurück, wenn ct1 nicht die gleiche Transformation wie ct2 definiert.

Diese Funktion wurde in Qt 6.4 eingeführt.

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

Gibt true zurück, wenn ct1 die gleiche Farbtransformation wie ct2 definiert.

Diese Funktion wurde in Qt 6.4 eingeführt.

© 2025 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.