The QColormap class maps device independent QColors to device dependent pixel values. More...
Header: | #include <QColormap> |
CMake: | find_package(Qt6 COMPONENTS Widgets REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
enum | Mode { Direct, Indexed, Gray } |
QColormap(const QColormap &colormap) | |
QColormap & | operator=(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 | instance(int screen = -1) |
This enum describes how QColormap maps device independent RGB values to device dependent pixel values.
Constant | Value | Description |
---|---|---|
QColormap::Direct |
0 |
Pixel values are derived directly from the RGB values, also known as "True Color." |
QColormap::Indexed |
1 |
Pixel values represent indexes into a list of available colors, i.e. QColormap uses the index of the color that most closely matches an RGB value. |
QColormap::Gray |
2 |
Similar to Indexed , pixel values represent a list of available gray tones. QColormap uses the index of the gray tone that most closely matches the computed gray tone of an RGB value. |
Constructs a copy of another colormap.
Assigns the given colormap to this color map and returns a reference to this color map.
Destroys the colormap.
Returns a QColor for the pixel.
See also pixel().
Returns a list of colors which represents the devices colormap for Indexed
and Gray
modes. This function returns an empty list for Direct
mode.
See also size().
Returns the depth of the device.
See also size().
[static]
QColormap QColormap::instance(int screen = -1)
Returns the colormap for the specified screen. If screen is -1, this function returns the colormap for the default screen.
Returns the mode of this colormap.
See also QColormap::Mode.
Returns a device dependent pixel value for the color.
See also colorAt().
Returns the size of the colormap for Indexed
and Gray
modes; Returns -1 for Direct
mode.
See also colormap().
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qcolormap.html