QwtColorMap - QwtColorMap is used to map values into colors.
Contents
Detailed Description
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:
• QImage::Format_Indexed8
• QImage::Format_ARGB32
Seealso:QwtPlotSpectrogram, QwtScaleWidgetMember Enumeration Documentation
enumQwtColorMap::Format
Format for color mapping
Seealso:rgb(), colorIndex(), colorTable()EnumeratorRGB The map is intended to map into RGB values.
Indexed
The map is intended to map into 8 bit values, that are indices into the color table.
Member Function Documentation
QColorQwtColorMap::color(constQwtInterval&interval,doublevalue)const[inline]
Map a value into a color
Parameters:interval Valid interval for values
value Value
Returns:
Color corresponding to value
Warning:
This method is slow for Indexed color maps. If it is necessary to map many values, its better to get
the color table once and find the color using colorIndex().
virtualunsignedcharQwtColorMap::colorIndex(constQwtInterval&interval,doublevalue)const[purevirtual]
Map a value of a given interval into a color index
Parameters:interval Range for the values
value Value
Returns:
color index, corresponding to value
Implemented in QwtLinearColorMap.
QVector<QRgb>QwtColorMap::colorTable(constQwtInterval&interval)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().
Parameters:interval Range for the values
Returns:
A color table, that can be used for a QImage
QwtColorMap::FormatQwtColorMap::format()const[inline]Returns:
Intended format of the color map
Seealso:FormatvirtualQRgbQwtColorMap::rgb(constQwtInterval&interval,doublevalue)const[purevirtual]
Map a value of a given interval into a RGB value.
Parameters:interval Range for the values
value Value
Returns:
RGB value, corresponding to value
Implemented in QwtAlphaColorMap, and QwtLinearColorMap.
Name
QwtColorMap - QwtColorMap is used to map values into colors.
Synopsis
#include <qwt_color_map.h>
Inherited by QwtAlphaColorMap, and QwtLinearColorMap.
PublicTypes
enum Format { RGB, Indexed }
PublicMemberFunctionsQwtColorMap (Format=QwtColorMap::RGB)
Constructor.
virtual ~QwtColorMap ()
Destructor.
Formatformat () const
virtual QRgb rgb (const QwtInterval &interval, double value) const =0
virtual unsigned char colorIndex (const QwtInterval &interval, double value) const =0
QColor color (const QwtInterval &, double value) const
virtual QVector< QRgb > colorTable (const QwtInterval &) const
