Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
QwtAlphaColorMap Class Reference

QwtAlphaColorMap varies the alpha value of a color. More...

#include <qwt_color_map.h>

Inheritance diagram for QwtAlphaColorMap:

Public Member Functions

 QwtAlphaColorMap (const QColor &=QColor(Qt::gray))
 Constructor.
 
virtual ~QwtAlphaColorMap ()
 Destructor.
 
void setAlphaInterval (int alpha1, int alpha2)
 
int alpha1 () const
 
int alpha2 () const
 
void setColor (const QColor &)
 
QColor color () const
 
virtual QRgb rgb (const QwtInterval &, double value) const override
 Map a value of a given interval into a alpha value.
 
- Public Member Functions inherited from QwtColorMap
 QwtColorMap (Format=QwtColorMap::RGB)
 
virtual ~QwtColorMap ()
 Destructor.
 
void setFormat (Format)
 
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
 
virtual QVector< QRgb > colorTable256 () const
 

Additional Inherited Members

- Public Types inherited from QwtColorMap
enum  Format { RGB , Indexed }
 
- Public Attributes inherited from QwtColorMap
Format const
 

Detailed Description

QwtAlphaColorMap varies the alpha value of a color.

Definition at line 147 of file qwt_color_map.h.

Constructor & Destructor Documentation

◆ QwtAlphaColorMap()

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

Constructor.

The alpha interval is initialized by 0 to 255.

Parameters
colorColor of the map
See also
setColor(), setAlphaInterval()

Definition at line 539 of file qwt_color_map.cpp.

◆ ~QwtAlphaColorMap()

QwtAlphaColorMap::~QwtAlphaColorMap ( )
virtual

Destructor.

Definition at line 547 of file qwt_color_map.cpp.

Member Function Documentation

◆ alpha1()

int QwtAlphaColorMap::alpha1 ( ) const
Returns
First alpha coordinate
See also
setAlphaInterval()

Definition at line 600 of file qwt_color_map.cpp.

◆ alpha2()

int QwtAlphaColorMap::alpha2 ( ) const
Returns
Second alpha coordinate
See also
setAlphaInterval()

Definition at line 609 of file qwt_color_map.cpp.

◆ color()

QColor QwtAlphaColorMap::color ( ) const
Returns
the color
See also
setColor()

Definition at line 571 of file qwt_color_map.cpp.

◆ rgb()

QRgb QwtAlphaColorMap::rgb ( const QwtInterval & interval,
double value ) const
overridevirtual

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

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

Implements QwtColorMap.

Definition at line 622 of file qwt_color_map.cpp.

◆ setAlphaInterval()

void QwtAlphaColorMap::setAlphaInterval ( int alpha1,
int alpha2 )

Set the interval for the alpha coordinate

alpha1/alpha2 need to be in the range 0 to 255, where 255 means opaque and 0 means transparent.

Parameters
alpha1First alpha coordinate
alpha2Second alpha coordinate
See also
alpha1(), alpha2()

Definition at line 587 of file qwt_color_map.cpp.

◆ setColor()

void QwtAlphaColorMap::setColor ( const QColor & color)

Set the color

Parameters
colorColor
See also
color()

Definition at line 558 of file qwt_color_map.cpp.