Public Types | Public Member Functions | Private Attributes | 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:
Inheritance graph
[legend]

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 m_format
 

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:

Definition at line 37 of file qwt_color_map.h.

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

Definition at line 45 of file qwt_color_map.h.

Constructor & Destructor Documentation

◆ QwtColorMap()

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

Constructor

Parameters
formatFormat of the color map

Definition at line 249 of file qwt_color_map.cpp.

◆ ~QwtColorMap()

QwtColorMap::~QwtColorMap ( )
virtual

Destructor.

Definition at line 255 of file qwt_color_map.cpp.

Member Function Documentation

◆ color()

QColor QwtColorMap::color ( const QwtInterval interval,
double  value 
) const
inline

Map a value into a color

Parameters
intervalValid interval for values
valueValue
Returns
Color corresponding to value

Definition at line 248 of file qwt_color_map.h.

◆ colorIndex()

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

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

Parameters
numColorsNumber of colors
intervalRange for all values
valueValue to map into a color index
Returns
Index, between 0 and numColors - 1, or -1 for an invalid value

Reimplemented in QwtLinearColorMap.

Definition at line 278 of file qwt_color_map.cpp.

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

Parameters
numColorsNumber of colors
Returns
A color table

Definition at line 325 of file qwt_color_map.cpp.

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

Returns
A color table, that can be used for a QImage

Definition at line 304 of file qwt_color_map.cpp.

◆ format()

QwtColorMap::Format QwtColorMap::format ( ) const
inline
Returns
Intended format of the color map
See also
Format

Definition at line 257 of file qwt_color_map.h.

◆ rgb()

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

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

Parameters
intervalRange for the values
valueValue
Returns
RGB value, corresponding to value

Implemented in QwtSaturationValueColorMap, QwtHueColorMap, QwtAlphaColorMap, and QwtLinearColorMap.

◆ setFormat()

void QwtColorMap::setFormat ( Format  format)

Set the format of the color map

Parameters
formatFormat of the color map

Definition at line 264 of file qwt_color_map.cpp.

Member Data Documentation

◆ m_format

Format QwtColorMap::m_format
private

Definition at line 88 of file qwt_color_map.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:50