QColormap Class

Die Klasse QColormap bildet geräteunabhängige QColors auf geräteabhängige Pixelwerte ab. Mehr...

Kopfzeile: #include <QColormap>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets

Öffentliche Typen

enum Mode { Direct, Indexed, Gray }

Öffentliche Funktionen

QColormap(const QColormap &colormap)
~QColormap()
const QColor colorAt(uint pixel) const
const QList<QColor> colormap() const
int depth() const
QColormap::Mode mode() const
uint pixel(const QColor &color) const
int size() const
QColormap &operator=(const QColormap &colormap)

Statische öffentliche Mitglieder

QColormap instance(int screen = -1)

Detaillierte Beschreibung

Dokumentation der Mitgliedstypen

enum QColormap::Mode

Diese Aufzählung beschreibt, wie QColormap geräteunabhängige RGB-Werte auf geräteabhängige Pixelwerte abbildet.

KonstanteWertBeschreibung
QColormap::Direct0Pixelwerte werden direkt von den RGB-Werten abgeleitet, die auch als "True Color" bekannt sind.
QColormap::Indexed1Pixelwerte stellen Indizes in einer Liste verfügbarer Farben dar, d.h. QColormap verwendet den Index der Farbe, die einem RGB-Wert am ehesten entspricht.
QColormap::Gray2Ähnlich wie bei Indexed stellen Pixelwerte eine Liste verfügbarer Grautöne dar. QColormap verwendet den Index des Grautons, der dem berechneten Grauton eines RGB-Werts am ehesten entspricht.

Dokumentation der Mitgliedsfunktionen

QColormap::QColormap(const QColormap &colormap)

Konstruiert eine Kopie eines anderen colormap.

[noexcept] QColormap::~QColormap()

Zerstört die Farbkarte.

const QColor QColormap::colorAt(uint pixel) const

Gibt eine QColor für die pixel zurück.

Siehe auch pixel().

const QList<QColor> QColormap::colormap() const

Gibt eine Liste von Farben zurück, die die Gerätefarbkarte für die Modi Indexed und Gray darstellt. Diese Funktion gibt eine leere Liste für den Modus Direct zurück.

Siehe auch size().

int QColormap::depth() const

Gibt die Tiefe des Geräts zurück.

Siehe auch size().

[static] QColormap QColormap::instance(int screen = -1)

Gibt die Farbkarte für den angegebenen screen zurück. Wenn screen -1 ist, gibt diese Funktion die Farbkarte für den Standardbildschirm zurück.

QColormap::Mode QColormap::mode() const

Gibt den Modus dieser Farbkarte zurück.

Siehe auch QColormap::Mode.

uint QColormap::pixel(const QColor &color) const

Liefert einen geräteabhängigen Pixelwert für die color.

Siehe auch colorAt().

int QColormap::size() const

Gibt die Größe der Farbkarte für die Modi Indexed und Gray zurück; gibt -1 für den Modus Direct zurück.

Siehe auch colormap().

QColormap &QColormap::operator=(const QColormap &colormap)

Weist die angegebene colormap dieser Farbkarte zu und gibt einen Verweis auf diese Farbkarte zurück.

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