QwtColorMap is used to map values into colors. More...
#include <qwt_color_map.h>
Public Types | |
enum | Format { RGB, Indexed } |
Public Member Functions | |
QColor | color (const QwtInterval &, double value) const |
virtual uint | colorIndex (int numColors, const QwtInterval &interval, double value) const |
Map a value of a given interval into a color index. More... | |
virtual QVector< QRgb > | colorTable (int numColors) const |
virtual QVector< QRgb > | colorTable256 () const |
Format | format () const |
QwtColorMap (Format=QwtColorMap::RGB) | |
virtual QRgb | rgb (const QwtInterval &interval, double value) const =0 |
void | setFormat (Format) |
virtual | ~QwtColorMap () |
Destructor. More... | |
Private Attributes | |
Format | d_format |
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:
Definition at line 33 of file qwt_color_map.h.
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.
|
Definition at line 41 of file qwt_color_map.h.
|
explicit |
Constructor
format | Format of the color map |
Definition at line 263 of file qwt_color_map.cpp.
|
virtual |
Destructor.
Definition at line 269 of file qwt_color_map.cpp.
|
inline |
Map a value into a color
interval | Valid interval for values |
value | Value |
Definition at line 239 of file qwt_color_map.h.
|
virtual |
Map a value of a given interval into a color index.
numColors | Number of colors |
interval | Range for all values |
value | Value to map into a color index |
Reimplemented in QwtLinearColorMap.
Definition at line 297 of file qwt_color_map.cpp.
|
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().
numColors | Number of colors |
Definition at line 355 of file qwt_color_map.cpp.
|
virtual |
Build and return a color map of 256 colors
The color table is needed for rendering indexed images in combination with using colorIndex().
Definition at line 334 of file qwt_color_map.cpp.
|
inline |
Definition at line 249 of file qwt_color_map.h.
|
pure virtual |
Map a value of a given interval into a RGB value.
interval | Range for the values |
value | Value |
Implemented in QwtSaturationValueColorMap, QwtHueColorMap, QwtAlphaColorMap, and QwtLinearColorMap.
void QwtColorMap::setFormat | ( | Format | format | ) |
Set the format of the color map
format | Format of the color map |
Definition at line 278 of file qwt_color_map.cpp.
|
private |
Definition at line 85 of file qwt_color_map.h.