QwtColorMap is used to map values into colors.
更多...
#include <qwt_colormap.h>
|
| | 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:
◆ Format
Format for color mapping
- 参见
- rgb(), colorIndex(), colorTable()
| 枚举值 |
|---|
| 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.
- 参见
- colorIndex(), colorTable()
|
◆ QwtColorMap()
Constructor.
- 参数
-
| [in] | format | Format of the color map. |
◆ colorIndex()
| uint QwtColorMap::colorIndex |
( |
int |
numColors, |
|
|
double |
vMin, |
|
|
double |
vMax, |
|
|
double |
value |
|
) |
| const |
|
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. |
- 返回
- Index, between 0 and numColors - 1, or -1 for an invalid value.
被 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().
- 参数
-
| [in] | numColors | Number of colors. |
- 返回
- 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().
- 返回
- A color table, that can be used for a QImage.
◆ rgb()
| virtual QRgb QwtColorMap::rgb |
( |
double |
vMin, |
|
|
double |
vMax, |
|
|
double |
value |
|
) |
| const |
|
pure virtual |
◆ setFormat()
| void QwtColorMap::setFormat |
( |
Format |
format | ) |
|
Set the format of the color map.
- 参数
-
| [in] | format | Format of the color map. |
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/core/qwt_colormap.h
- /home/runner/work/QWT/QWT/src/core/qwt_colormap.cpp