QwtColorMap is used to map values into colors.
More...
#include <qwt_color_map.h>
QwtColorMap is used to map values into colors.
For displaying 3D data on a 2D plane the 3rd dimension is often displayed using colors, like f.e in a spectrogram.
Each color map is optimized to return colors for only one of the following image formats:
◆ Format
Format for color mapping.
- See also
- rgb(), colorIndex(), colorTable()
| Enumerator |
|---|
| RGB | The map is intended to map into RGB values.
|
| Indexed | Map values into 8 bit values, that are used as indexes into the color table.
Indexed color maps are used to generate QImage::Format_Indexed8 images. The calculation of the color index is usually faster and the resulting image has a lower memory footprint.
- See also
- colorIndex(), colorTable()
|
◆ QwtColorMap()
Constructor.
- Parameters
-
| format | Format of the color map |
◆ color()
| QColor QwtColorMap::color |
( |
const QwtInterval & |
interval, |
|
|
double |
value |
|
) |
| const |
|
inline |
Map a value into a color.
- Parameters
-
| interval | Valid interval for values |
| value | Value |
- Returns
- Color corresponding to value
◆ colorIndex()
| uint QwtColorMap::colorIndex |
( |
int |
numColors, |
|
|
const QwtInterval & |
interval, |
|
|
double |
value |
|
) |
| const |
|
virtual |
Map a value of a given interval into a color index.
- Parameters
-
| numColors | Number of colors |
| interval | Range for all values |
| value | Value to map into a color index |
- Returns
- Index, between 0 and numColors - 1, or -1 for an invalid value
Reimplemented in QwtLinearColorMap.
◆ colorTable()
| QVector< QRgb > QwtColorMap::colorTable |
( |
int |
numColors | ) |
const |
|
virtual |
Build and return a color map of arbitrary number of colors.
The color table is needed for rendering indexed images in combination with using colorIndex().
- Parameters
-
| numColors | Number of colors |
- Returns
- A color table
◆ colorTable256()
| QVector< QRgb > QwtColorMap::colorTable256 |
( |
| ) |
const |
|
virtual |
Build and return a color map of 256 colors.
The color table is needed for rendering indexed images in combination with using colorIndex().
- Returns
- A color table, that can be used for a QImage
◆ format()
- Returns
- Intended format of the color map
- See also
- Format
◆ rgb()
| virtual QRgb QwtColorMap::rgb |
( |
const QwtInterval & |
interval, |
|
|
double |
value |
|
) |
| const |
|
pure virtual |
◆ setFormat()
| void QwtColorMap::setFormat |
( |
Format |
format | ) |
|
Set the format of the color map.
- Parameters
-
| format | Format of the color map |
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/qwt_color_map.h
- /home/runner/work/QWT/QWT/src/qwt_color_map.cpp