|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
QwtColorMap is used to map values into colors. More...
#include <qwt_colormap.h>
Public Types | |
| enum | Format { RGB , Indexed } |
| Format for color mapping. More... | |
Public Member Functions | |
| QwtColorMap (Format=QwtColorMap::RGB) | |
| Constructor. | |
| virtual | ~QwtColorMap () |
| Destructor. | |
| void | setFormat (Format) |
| Set the format of the color map. | |
| Format | format () const |
| virtual QRgb | rgb (double vMin, double vMax, double value) const =0 |
| Map a value of a given interval into a RGB value. | |
| virtual uint | colorIndex (int numColors, double vMin, double vMax, double value) const |
| Map a value of a given interval into a color index. | |
| QColor | color (double vMin, double vMax, double value) const |
| virtual QVector< QRgb > | colorTable (int numColors) const |
| Build and return a color map of arbitrary number of colors. | |
| virtual QVector< QRgb > | colorTable256 () const |
| Build and return a color map of 256 colors. | |
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:
| enum QwtColorMap::Format |
Format for color mapping.
| 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.
|
|
explicit |
Constructor.
| [in] | format | Format of the color map. |
|
virtual |
Map a value of a given interval into a color index.
| [in] | numColors | Number of colors. |
| [in] | vMin | Minimum of the value interval. |
| [in] | vMax | Maximum of the value interval. |
| [in] | value | Value to map into a color index. |
Reimplemented in QwtLinearColorMap.
|
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().
| [in] | numColors | Number of colors. |
|
virtual |
Build and return a color map of 256 colors.
The color table is needed for rendering indexed images in combination with using colorIndex().
|
pure virtual |
Map a value of a given interval into a RGB value.
Implemented in QwtLinearColorMap, QwtAlphaColorMap, QwtHueColorMap, and QwtSaturationValueColorMap.
| void QwtColorMap::setFormat | ( | Format | format | ) |
Set the format of the color map.
| [in] | format | Format of the color map. |