QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 所有成员列表
QwtColorMap类 参考abstract

QwtColorMap is used to map values into colors. 更多...

#include <qwt_colormap.h>

类 QwtColorMap 继承关系图:
QwtAlphaColorMap QwtHueColorMap QwtLinearColorMap QwtSaturationValueColorMap

Public 类型

enum  Format { RGB , Indexed }
 Format for color mapping 更多...
 

Public 成员函数

 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()

QwtColorMap::QwtColorMap ( Format  format = QwtColorMap::RGB)
explicit

Constructor.

参数
[in]formatFormat 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]numColorsNumber of colors.
[in]vMinMinimum of the value interval.
[in]vMaxMaximum of the value interval.
[in]valueValue 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]numColorsNumber 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

Map a value of a given interval into a RGB value.

QwtLinearColorMap, QwtAlphaColorMap, QwtHueColorMap , 以及 QwtSaturationValueColorMap 内被实现.

◆ setFormat()

void QwtColorMap::setFormat ( Format  format)

Set the format of the color map.

参数
[in]formatFormat of the color map.

该类的文档由以下文件生成: