QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QwtColorMap Class Referenceabstract

QwtColorMap is used to map values into colors. More...

#include <qwt_color_map.h>

Inheritance diagram for QwtColorMap:
QwtAlphaColorMap QwtHueColorMap QwtLinearColorMap QwtSaturationValueColorMap

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 (const QwtInterval &interval, double value) const =0
 Map a value of a given interval into a RGB value.
 
virtual uint colorIndex (int numColors, const QwtInterval &interval, double value) const
 Map a value of a given interval into a color index.
 
QColor color (const QwtInterval &, 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.
 

Detailed Description

QwtColorMap is used to map values into colors.

Member Enumeration Documentation

◆ Format

Format for color mapping.

See also
rgb(), colorIndex(), colorTable()
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.

See also
colorIndex(), colorTable()

Constructor & Destructor Documentation

◆ QwtColorMap()

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

Constructor.

Member Function Documentation

◆ colorIndex()

uint QwtColorMap::colorIndex ( int  numColors,
const QwtInterval interval,
double  value 
) const
virtual

Map a value of a given interval into a color index.

Reimplemented in QwtLinearColorMap.

◆ colorTable()

QVector< QRgb > QwtColorMap::colorTable ( int  numColors) const
virtual

Build and return a color map of arbitrary number of colors.

◆ colorTable256()

QVector< QRgb > QwtColorMap::colorTable256 ( ) const
virtual

Build and return a color map of 256 colors.

◆ rgb()

virtual QRgb QwtColorMap::rgb ( const QwtInterval interval,
double  value 
) const
pure virtual

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

Implemented in QwtLinearColorMap, QwtAlphaColorMap, QwtHueColorMap, and QwtSaturationValueColorMap.

◆ setFormat()

void QwtColorMap::setFormat ( Format  format)

Set the format of the color map.


The documentation for this class was generated from the following files: