Qwt User's Guide svn
Public Types | Public Member Functions
QwtAlphaColorMap Class Reference

#include <qwt_color_map.h>

Inherits QwtColorMap.

List of all members.

Public Types

enum  Format {
  RGB,
  Indexed
}

Public Member Functions

QColor color (const QwtInterval &, double value) const
QColor color () const
virtual QVector< QRgb > colorTable (const QwtInterval &) const
Format format () const
 QwtAlphaColorMap (const QColor &=QColor(Qt::gray))
virtual QRgb rgb (const QwtInterval &, double value) const
void setColor (const QColor &)
virtual ~QwtAlphaColorMap ()

Detailed Description

QwtAlphaColorMap variies the alpha value of a color.


Member Enumeration Documentation

enum QwtColorMap::Format [inherited]

Format for color mapping

See also:
rgb(), colorIndex(), colorTable()
Enumerator:
RGB 

The map is intended to map into QRgb values.

Indexed 

The map is intended to map into 8 bit values, that are indices into the color table.


Constructor & Destructor Documentation

QwtAlphaColorMap::QwtAlphaColorMap ( const QColor &  color = QColor( Qt::gray ))

Constructor

Parameters:
colorColor of the map
QwtAlphaColorMap::~QwtAlphaColorMap ( ) [virtual]

Destructor.


Member Function Documentation

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

Map a value into a color

Parameters:
intervalValid interval for values
valueValue
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().
QColor QwtAlphaColorMap::color ( ) const
Returns:
the color
See also:
setColor()
QVector< QRgb > QwtColorMap::colorTable ( const QwtInterval interval) const [virtual, inherited]

Build and return a color map of 256 colors

The color table is needed for rendering indexed images in combination with using colorIndex().

Parameters:
intervalRange for the values
Returns:
A color table, that can be used for a QImage
QwtColorMap::Format QwtColorMap::format ( ) const [inline, inherited]
Returns:
Intended format of the color map
See also:
Format
QRgb QwtAlphaColorMap::rgb ( const QwtInterval interval,
double  value 
) const [virtual]

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

alpha := (value - interval.minValue()) / interval.width();

Parameters:
intervalRange for all values
valueValue to map into a rgb value
Returns:
rgb value, with an alpha value

Implements QwtColorMap.

void QwtAlphaColorMap::setColor ( const QColor &  color)

Set the color

Parameters:
colorColor
See also:
color()
qmi style