Loading...
Searching...
No Matches
qwt_color_map.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_color_map.h"
#include "qwt_interval.h"
#include <qvector.h>
static inline QRgb qwtHsvToRgb( int h, int s, int v, int a )
{
#if 0
return QColor::fromHsv( h, s, v, a ).rgb();
#else
const double vs = v * s / 255.0;
const int p = v - qRound( vs );
switch( h / 60 )
{
case 0:
{
const double r = ( 60 - h ) / 60.0;
return qRgba( v, v - qRound( r * vs ), p, a );
}
case 1:
{
const double r = ( h - 60 ) / 60.0;
return qRgba( v - qRound( r * vs ), v, p, a );
}
case 2:
{
const double r = ( 180 - h ) / 60.0;
return qRgba( p, v, v - qRound( r * vs ), a );
}
case 3:
{
const double r = ( h - 180 ) / 60.0;
return qRgba( p, v - qRound( r * vs ), v, a );
}
case 4:
{
const double r = ( 300 - h ) / 60.0;
return qRgba( v - qRound( r * vs ), p, v, a );
}
case 5:
default:
{
const double r = ( h - 300 ) / 60.0;
return qRgba( v, p, v - qRound( r * vs ), a );
}
}
#endif
}
class QwtLinearColorMap::ColorStops
{
public:
ColorStops():
m_doAlpha( false )
{
m_stops.reserve( 256 );
}
void insert( double pos, const QColor& color );
QRgb rgb( QwtLinearColorMap::Mode, double pos ) const;
QVector< double > stops() const;
private:
class ColorStop
{
public:
ColorStop():
pos( 0.0 ),
rgb( 0 )
{
};
ColorStop( double p, const QColor& c ):
pos( p ),
rgb( c.rgba() )
{
r = qRed( rgb );
g = qGreen( rgb );
b = qBlue( rgb );
a = qAlpha( rgb );
/*
when mapping a value to rgb we will have to calculate:
- const int v = int( ( s1.v0 + ratio * s1.vStep ) + 0.5 );
Thus adding 0.5 ( for rounding ) can be done in advance
*/
r0 = r + 0.5;
g0 = g + 0.5;
b0 = b + 0.5;
a0 = a + 0.5;
rStep = gStep = bStep = aStep = 0.0;
posStep = 0.0;
}
void updateSteps( const ColorStop& nextStop )
{
rStep = nextStop.r - r;
gStep = nextStop.g - g;
bStep = nextStop.b - b;
aStep = nextStop.a - a;
posStep = nextStop.pos - pos;
}
double pos;
QRgb rgb;
int r, g, b, a;
// precalculated values
double rStep, gStep, bStep, aStep;
double r0, g0, b0, a0;
double posStep;
};
inline int findUpper( double pos ) const;
QVector< ColorStop > m_stops;
bool m_doAlpha;
};
void QwtLinearColorMap::ColorStops::insert( double pos, const QColor& color )
{
// Lookups need to be very fast, insertions are not so important.
// Anyway, a balanced tree is what we need here. TODO ...
if ( pos < 0.0 || pos > 1.0 )
return;
int index;
if ( m_stops.size() == 0 )
{
index = 0;
m_stops.resize( 1 );
}
else
{
index = findUpper( pos );
if ( index == m_stops.size() ||
qAbs( m_stops[index].pos - pos ) >= 0.001 )
{
m_stops.resize( m_stops.size() + 1 );
for ( int i = m_stops.size() - 1; i > index; i-- )
m_stops[i] = m_stops[i - 1];
}
}
m_stops[index] = ColorStop( pos, color );
if ( color.alpha() != 255 )
m_doAlpha = true;
if ( index > 0 )
m_stops[index - 1].updateSteps( m_stops[index] );
if ( index < m_stops.size() - 1 )
m_stops[index].updateSteps( m_stops[index + 1] );
}
inline QVector< double > QwtLinearColorMap::ColorStops::stops() const
{
QVector< double > positions( m_stops.size() );
for ( int i = 0; i < m_stops.size(); i++ )
positions[i] = m_stops[i].pos;
return positions;
}
inline int QwtLinearColorMap::ColorStops::findUpper( double pos ) const
{
int index = 0;
int n = m_stops.size();
const ColorStop* stops = m_stops.data();
while ( n > 0 )
{
const int half = n >> 1;
const int middle = index + half;
if ( stops[middle].pos <= pos )
{
index = middle + 1;
n -= half + 1;
}
else
n = half;
}
return index;
}
inline QRgb QwtLinearColorMap::ColorStops::rgb(
QwtLinearColorMap::Mode mode, double pos ) const
{
if ( pos <= 0.0 )
return m_stops[0].rgb;
if ( pos >= 1.0 )
return m_stops[ m_stops.size() - 1 ].rgb;
const int index = findUpper( pos );
if ( mode == FixedColors )
{
return m_stops[index - 1].rgb;
}
else
{
const ColorStop& s1 = m_stops[index - 1];
const double ratio = ( pos - s1.pos ) / ( s1.posStep );
const int r = int( s1.r0 + ratio * s1.rStep );
const int g = int( s1.g0 + ratio * s1.gStep );
const int b = int( s1.b0 + ratio * s1.bStep );
if ( m_doAlpha )
{
if ( s1.aStep )
{
const int a = int( s1.a0 + ratio * s1.aStep );
return qRgba( r, g, b, a );
}
else
{
return qRgba( r, g, b, s1.a );
}
}
else
{
return qRgb( r, g, b );
}
}
}
QwtColorMap::QwtColorMap( Format format )
: m_format( format )
{
}
QwtColorMap::~QwtColorMap()
{
}
void QwtColorMap::setFormat( Format format )
{
m_format = format;
}
uint QwtColorMap::colorIndex( int numColors,
const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0.0 )
return 0;
if ( value <= interval.minValue() )
return 0;
const int maxIndex = numColors - 1;
if ( value >= interval.maxValue() )
return maxIndex;
const double v = maxIndex * ( ( value - interval.minValue() ) / width );
return static_cast< unsigned int >( v + 0.5 );
}
QVector< QRgb > QwtColorMap::colorTable256() const
{
QVector< QRgb > table( 256 );
const QwtInterval interval( 0, 256 );
for ( int i = 0; i < 256; i++ )
table[i] = rgb( interval, i );
return table;
}
QVector< QRgb > QwtColorMap::colorTable( int numColors ) const
{
QVector< QRgb > table( numColors );
const QwtInterval interval( 0.0, 1.0 );
const double step = 1.0 / ( numColors - 1 );
for ( int i = 0; i < numColors; i++ )
table[i] = rgb( interval, step * i );
return table;
}
class QwtLinearColorMap::PrivateData
{
public:
ColorStops colorStops;
QwtLinearColorMap::Mode mode;
};
QwtLinearColorMap::QwtLinearColorMap( QwtColorMap::Format format ):
QwtColorMap( format )
{
m_data = new PrivateData;
m_data->mode = ScaledColors;
setColorInterval( Qt::blue, Qt::yellow );
}
QwtLinearColorMap::QwtLinearColorMap( const QColor& color1,
const QColor& color2, QwtColorMap::Format format )
: QwtColorMap( format )
{
m_data = new PrivateData;
m_data->mode = ScaledColors;
setColorInterval( color1, color2 );
}
QwtLinearColorMap::~QwtLinearColorMap()
{
delete m_data;
}
void QwtLinearColorMap::setMode( Mode mode )
{
m_data->mode = mode;
}
QwtLinearColorMap::Mode QwtLinearColorMap::mode() const
{
return m_data->mode;
}
void QwtLinearColorMap::setColorInterval(
const QColor& color1, const QColor& color2 )
{
m_data->colorStops = ColorStops();
m_data->colorStops.insert( 0.0, color1 );
m_data->colorStops.insert( 1.0, color2 );
}
void QwtLinearColorMap::addColorStop( double value, const QColor& color )
{
if ( value >= 0.0 && value <= 1.0 )
m_data->colorStops.insert( value, color );
}
QVector< double > QwtLinearColorMap::colorStops() const
{
return m_data->colorStops.stops();
}
QColor QwtLinearColorMap::color1() const
{
return QColor::fromRgba( m_data->colorStops.rgb( m_data->mode, 0.0 ) );
}
QColor QwtLinearColorMap::color2() const
{
return QColor::fromRgba( m_data->colorStops.rgb( m_data->mode, 1.0 ) );
}
QRgb QwtLinearColorMap::rgb(
const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0.0 )
return 0u;
const double ratio = ( value - interval.minValue() ) / width;
return m_data->colorStops.rgb( m_data->mode, ratio );
}
uint QwtLinearColorMap::colorIndex( int numColors,
const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0.0 )
return 0;
if ( value <= interval.minValue() )
return 0;
if ( value >= interval.maxValue() )
return numColors - 1;
const double v = ( numColors - 1 ) * ( value - interval.minValue() ) / width;
return static_cast< unsigned int >( ( m_data->mode == FixedColors ) ? v : v + 0.5 );
}
class QwtAlphaColorMap::PrivateData
{
public:
PrivateData()
: alpha1(0)
, alpha2(255)
{
}
int alpha1, alpha2;
QColor color;
QRgb rgb;
QRgb rgbMin;
QRgb rgbMax;
};
QwtAlphaColorMap::QwtAlphaColorMap( const QColor& color )
: QwtColorMap( QwtColorMap::RGB )
{
m_data = new PrivateData;
setColor( color );
}
QwtAlphaColorMap::~QwtAlphaColorMap()
{
delete m_data;
}
void QwtAlphaColorMap::setColor( const QColor& color )
{
m_data->color = color;
m_data->rgb = color.rgb() & qRgba( 255, 255, 255, 0 );
m_data->rgbMin = m_data->rgb | ( m_data->alpha1 << 24 );
m_data->rgbMax = m_data->rgb | ( m_data->alpha2 << 24 );
}
QColor QwtAlphaColorMap::color() const
{
return m_data->color;
}
void QwtAlphaColorMap::setAlphaInterval( int alpha1, int alpha2 )
{
m_data->alpha1 = qBound( 0, alpha1, 255 );
m_data->alpha2 = qBound( 0, alpha2, 255 );
m_data->rgbMin = m_data->rgb | ( alpha1 << 24 );
m_data->rgbMax = m_data->rgb | ( alpha2 << 24 );
}
int QwtAlphaColorMap::alpha1() const
{
return m_data->alpha1;
}
int QwtAlphaColorMap::alpha2() const
{
return m_data->alpha2;
}
QRgb QwtAlphaColorMap::rgb( const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0.0 )
return 0u;
if ( value <= interval.minValue() )
return m_data->rgb;
if ( value >= interval.maxValue() )
return m_data->rgbMax;
const double ratio = ( value - interval.minValue() ) / width;
const int alpha = m_data->alpha1 + qRound( ratio * ( m_data->alpha2 - m_data->alpha1 ) );
return m_data->rgb | ( alpha << 24 );
}
class QwtHueColorMap::PrivateData
{
public:
PrivateData();
void updateTable();
int hue1, hue2;
int saturation;
int value;
int alpha;
QRgb rgbMin;
QRgb rgbMax;
QRgb rgbTable[360];
};
QwtHueColorMap::PrivateData::PrivateData()
: hue1(0)
, hue2(359)
, saturation(255)
, value(255)
, alpha(255)
{
updateTable();
}
void QwtHueColorMap::PrivateData::updateTable()
{
const int p = qRound( value * ( 255 - saturation ) / 255.0 );
const double vs = value * saturation / 255.0;
for ( int i = 0; i < 60; i++ )
{
const double r = ( 60 - i ) / 60.0;
rgbTable[i] = qRgba( value, qRound( value - r * vs ), p, alpha );
}
for ( int i = 60; i < 120; i++ )
{
const double r = ( i - 60 ) / 60.0;
rgbTable[i] = qRgba( qRound( value - r * vs ), value, p, alpha );
}
for ( int i = 120; i < 180; i++ )
{
const double r = ( 180 - i ) / 60.0;
rgbTable[i] = qRgba( p, value, qRound( value - r * vs ), alpha );
}
for ( int i = 180; i < 240; i++ )
{
const double r = ( i - 180 ) / 60.0;
rgbTable[i] = qRgba( p, qRound( value - r * vs ), value, alpha );
}
for ( int i = 240; i < 300; i++ )
{
const double r = ( 300 - i ) / 60.0;
rgbTable[i] = qRgba( qRound( value - r * vs ), p, value, alpha );
}
for ( int i = 300; i < 360; i++ )
{
const double r = ( i - 300 ) / 60.0;
rgbTable[i] = qRgba( value, p, qRound( value - r * vs ), alpha );
}
rgbMin = rgbTable[ hue1 % 360 ];
rgbMax = rgbTable[ hue2 % 360 ];
}
QwtHueColorMap::QwtHueColorMap( QwtColorMap::Format format )
: QwtColorMap( format )
{
m_data = new PrivateData;
}
QwtHueColorMap::~QwtHueColorMap()
{
delete m_data;
}
void QwtHueColorMap::setHueInterval( int hue1, int hue2 )
{
m_data->hue1 = qMax( hue1, 0 );
m_data->hue2 = qMax( hue2, 0 );
m_data->rgbMin = m_data->rgbTable[ hue1 % 360 ];
m_data->rgbMax = m_data->rgbTable[ hue2 % 360 ];
}
void QwtHueColorMap::setSaturation( int saturation )
{
saturation = qBound( 0, saturation, 255 );
if ( saturation != m_data->saturation )
{
m_data->saturation = saturation;
m_data->updateTable();
}
}
void QwtHueColorMap::setValue( int value )
{
value = qBound( 0, value, 255 );
if ( value != m_data->value )
{
m_data->value = value;
m_data->updateTable();
}
}
void QwtHueColorMap::setAlpha( int alpha )
{
alpha = qBound( 0, alpha, 255 );
if ( alpha != m_data->alpha )
{
m_data->alpha = alpha;
m_data->updateTable();
}
}
int QwtHueColorMap::hue1() const
{
return m_data->hue1;
}
int QwtHueColorMap::hue2() const
{
return m_data->hue2;
}
int QwtHueColorMap::saturation() const
{
return m_data->saturation;
}
int QwtHueColorMap::value() const
{
return m_data->value;
}
int QwtHueColorMap::alpha() const
{
return m_data->alpha;
}
QRgb QwtHueColorMap::rgb( const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0 )
return 0u;
if ( value <= interval.minValue() )
return m_data->rgbMin;
if ( value >= interval.maxValue() )
return m_data->rgbMax;
const double ratio = ( value - interval.minValue() ) / width;
int hue = m_data->hue1 + qRound( ratio * ( m_data->hue2 - m_data->hue1 ) );
if ( hue >= 360 )
{
hue -= 360;
if ( hue >= 360 )
hue = hue % 360;
}
return m_data->rgbTable[hue];
}
class QwtSaturationValueColorMap::PrivateData
{
public:
PrivateData()
: hue(0)
, sat1(255)
, sat2(255)
, value1(0)
, value2(255)
, alpha(255)
, tableType(Invalid)
{
updateTable();
}
void updateTable()
{
tableType = Invalid;
if ( ( value1 == value2 ) && ( sat1 != sat2 ) )
{
rgbTable.resize( 256 );
for ( int i = 0; i < 256; i++ )
rgbTable[i] = qwtHsvToRgb( hue, i, value1, alpha );
tableType = Saturation;
}
else if ( ( value1 != value2 ) && ( sat1 == sat2 ) )
{
rgbTable.resize( 256 );
for ( int i = 0; i < 256; i++ )
rgbTable[i] = qwtHsvToRgb( hue, sat1, i, alpha );
tableType = Value;
}
else
{
rgbTable.resize( 256 * 256 );
for ( int s = 0; s < 256; s++ )
{
const int v0 = s * 256;
for ( int v = 0; v < 256; v++ )
rgbTable[v0 + v] = qwtHsvToRgb( hue, s, v, alpha );
}
}
}
int hue;
int sat1, sat2;
int value1, value2;
int alpha;
enum
{
Invalid,
Value,
Saturation
} tableType;
QVector< QRgb > rgbTable;
};
QwtSaturationValueColorMap::QwtSaturationValueColorMap()
{
m_data = new PrivateData;
}
QwtSaturationValueColorMap::~QwtSaturationValueColorMap()
{
delete m_data;
}
void QwtSaturationValueColorMap::setHue( int hue )
{
hue = hue % 360;
if ( hue != m_data->hue )
{
m_data->hue = hue;
m_data->updateTable();
}
}
void QwtSaturationValueColorMap::setSaturationInterval(
int saturation1, int saturation2 )
{
saturation1 = qBound( 0, saturation1, 255 );
saturation2 = qBound( 0, saturation2, 255 );
if ( ( saturation1 != m_data->sat1 ) || ( saturation2 != m_data->sat2 ) )
{
m_data->sat1 = saturation1;
m_data->sat2 = saturation2;
m_data->updateTable();
}
}
void QwtSaturationValueColorMap::setValueInterval( int value1, int value2 )
{
value1 = qBound( 0, value1, 255 );
value2 = qBound( 0, value2, 255 );
if ( ( value1 != m_data->value1 ) || ( value2 != m_data->value2 ) )
{
m_data->value1 = value1;
m_data->value2 = value2;
m_data->updateTable();
}
}
void QwtSaturationValueColorMap::setAlpha( int alpha )
{
alpha = qBound( 0, alpha, 255 );
if ( alpha != m_data->alpha )
{
m_data->alpha = alpha;
m_data->updateTable();
}
}
int QwtSaturationValueColorMap::hue() const
{
return m_data->hue;
}
int QwtSaturationValueColorMap::saturation1() const
{
return m_data->sat1;
}
int QwtSaturationValueColorMap::saturation2() const
{
return m_data->sat2;
}
int QwtSaturationValueColorMap::value1() const
{
return m_data->value1;
}
int QwtSaturationValueColorMap::value2() const
{
return m_data->value2;
}
int QwtSaturationValueColorMap::alpha() const
{
return m_data->alpha;
}
QRgb QwtSaturationValueColorMap::rgb(
const QwtInterval& interval, double value ) const
{
const double width = interval.width();
if ( width <= 0 )
return 0u;
const QRgb* rgbTable = m_data->rgbTable.constData();
switch( m_data->tableType )
{
case PrivateData::Saturation:
{
if ( value <= interval.minValue() )
return m_data->rgbTable[m_data->sat1];
if ( value >= interval.maxValue() )
return m_data->rgbTable[m_data->sat2];
const double ratio = ( value - interval.minValue() ) / width;
const int sat = m_data->sat1
+ qRound( ratio * ( m_data->sat2 - m_data->sat1 ) );
return rgbTable[sat];
}
case PrivateData::Value:
{
if ( value <= interval.minValue() )
return m_data->rgbTable[m_data->value1];
if ( value >= interval.maxValue() )
return m_data->rgbTable[m_data->value2];
const double ratio = ( value - interval.minValue() ) / width;
const int v = m_data->value1 +
qRound( ratio * ( m_data->value2 - m_data->value1 ) );
return rgbTable[ v ];
}
default:
{
int s, v;
if ( value <= interval.minValue() )
{
s = m_data->sat1;
v = m_data->value1;
}
else if ( value >= interval.maxValue() )
{
s = m_data->sat2;
v = m_data->value2;
}
else
{
const double ratio = ( value - interval.minValue() ) / width;
v = m_data->value1 + qRound( ratio * ( m_data->value2 - m_data->value1 ) );
s = m_data->sat1 + qRound( ratio * ( m_data->sat2 - m_data->sat1 ) );
}
return rgbTable[ 256 * s + v ];
}
}
}
QVector< double >
QwtAlphaColorMap::alpha2
int alpha2() const
Definition qwt_color_map.cpp:609
QwtAlphaColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const override
Map a value of a given interval into a alpha value.
Definition qwt_color_map.cpp:622
QwtAlphaColorMap::setColor
void setColor(const QColor &)
Definition qwt_color_map.cpp:558
QwtAlphaColorMap::setAlphaInterval
void setAlphaInterval(int alpha1, int alpha2)
Definition qwt_color_map.cpp:587
QwtAlphaColorMap::color
QColor color() const
Definition qwt_color_map.cpp:571
QwtAlphaColorMap::~QwtAlphaColorMap
virtual ~QwtAlphaColorMap()
Destructor.
Definition qwt_color_map.cpp:547
QwtAlphaColorMap::QwtAlphaColorMap
QwtAlphaColorMap(const QColor &=QColor(Qt::gray))
Constructor.
Definition qwt_color_map.cpp:539
QwtAlphaColorMap::alpha1
int alpha1() const
Definition qwt_color_map.cpp:600
QwtColorMap
QwtColorMap is used to map values into colors.
Definition qwt_color_map.h:38
QwtColorMap::colorIndex
virtual uint colorIndex(int numColors, const QwtInterval &interval, double value) const
Map a value of a given interval into a color index.
Definition qwt_color_map.cpp:278
QwtColorMap::QwtColorMap
QwtColorMap(Format=QwtColorMap::RGB)
Definition qwt_color_map.cpp:249
QwtColorMap::color
QColor color(const QwtInterval &, double value) const
Definition qwt_color_map.h:248
QwtColorMap::Format
Format
Definition qwt_color_map.h:46
QwtColorMap::colorTable
virtual QVector< QRgb > colorTable(int numColors) const
Definition qwt_color_map.cpp:325
QwtColorMap::colorTable256
virtual QVector< QRgb > colorTable256() const
Definition qwt_color_map.cpp:304
QwtColorMap::rgb
virtual QRgb rgb(const QwtInterval &interval, double value) const =0
QwtColorMap::setFormat
void setFormat(Format)
Definition qwt_color_map.cpp:264
QwtColorMap::~QwtColorMap
virtual ~QwtColorMap()
Destructor.
Definition qwt_color_map.cpp:255
QwtHueColorMap::QwtHueColorMap
QwtHueColorMap(QwtColorMap::Format=QwtColorMap::RGB)
Constructor.
Definition qwt_color_map.cpp:723
QwtHueColorMap::hue2
int hue2() const
Definition qwt_color_map.cpp:829
QwtHueColorMap::alpha
int alpha() const
Definition qwt_color_map.cpp:856
QwtHueColorMap::setSaturation
void setSaturation(int saturation)
Set the the saturation coordinate.
Definition qwt_color_map.cpp:764
QwtHueColorMap::value
int value() const
Definition qwt_color_map.cpp:847
QwtHueColorMap::setHueInterval
void setHueInterval(int hue1, int hue2)
Definition qwt_color_map.cpp:746
QwtHueColorMap::setAlpha
void setAlpha(int alpha)
Set the the alpha coordinate.
Definition qwt_color_map.cpp:805
QwtHueColorMap::~QwtHueColorMap
virtual ~QwtHueColorMap()
Destructor.
Definition qwt_color_map.cpp:730
QwtHueColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const override
Definition qwt_color_map.cpp:869
QwtHueColorMap::hue1
int hue1() const
Definition qwt_color_map.cpp:820
QwtHueColorMap::saturation
int saturation() const
Definition qwt_color_map.cpp:838
QwtHueColorMap::setValue
void setValue(int value)
Set the the value coordinate.
Definition qwt_color_map.cpp:784
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtInterval::minValue
double minValue() const
Definition qwt_interval.h:192
QwtInterval::width
double width() const
Return the width of an interval.
Definition qwt_interval.h:227
QwtInterval::maxValue
double maxValue() const
Definition qwt_interval.h:198
QwtLinearColorMap::QwtLinearColorMap
QwtLinearColorMap(QwtColorMap::Format=QwtColorMap::RGB)
Definition qwt_color_map.cpp:351
QwtLinearColorMap::mode
Mode mode() const
Definition qwt_color_map.cpp:400
QwtLinearColorMap::colorStops
QVector< double > colorStops() const
Definition qwt_color_map.cpp:442
QwtLinearColorMap::colorIndex
virtual uint colorIndex(int numColors, const QwtInterval &, double value) const override
Map a value of a given interval into a color index.
Definition qwt_color_map.cpp:494
QwtLinearColorMap::~QwtLinearColorMap
virtual ~QwtLinearColorMap()
Destructor.
Definition qwt_color_map.cpp:377
QwtLinearColorMap::addColorStop
void addColorStop(double value, const QColor &)
Definition qwt_color_map.cpp:433
QwtLinearColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const override
Definition qwt_color_map.cpp:473
QwtLinearColorMap::setColorInterval
void setColorInterval(const QColor &color1, const QColor &color2)
Definition qwt_color_map.cpp:415
QwtLinearColorMap::Mode
Mode
Definition qwt_color_map.h:106
QwtLinearColorMap::ScaledColors
@ ScaledColors
Interpolating the colors of the adjacent stops.
Definition qwt_color_map.h:111
QwtLinearColorMap::FixedColors
@ FixedColors
Return the color from the next lower color stop.
Definition qwt_color_map.h:108
QwtLinearColorMap::color2
QColor color2() const
Definition qwt_color_map.cpp:460
QwtLinearColorMap::color1
QColor color1() const
Definition qwt_color_map.cpp:451
QwtLinearColorMap::setMode
void setMode(Mode)
Set the mode of the color map.
Definition qwt_color_map.cpp:391
QwtSaturationValueColorMap::setSaturationInterval
void setSaturationInterval(int sat1, int sat2)
Set the interval for the saturation coordinate.
Definition qwt_color_map.cpp:1016
QwtSaturationValueColorMap::setAlpha
void setAlpha(int alpha)
Set the the alpha coordinate.
Definition qwt_color_map.cpp:1067
QwtSaturationValueColorMap::hue
int hue() const
Definition qwt_color_map.cpp:1082
QwtSaturationValueColorMap::saturation2
int saturation2() const
Definition qwt_color_map.cpp:1100
QwtSaturationValueColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const override
Definition qwt_color_map.cpp:1140
QwtSaturationValueColorMap::value1
int value1() const
Definition qwt_color_map.cpp:1109
QwtSaturationValueColorMap::alpha
int alpha() const
Definition qwt_color_map.cpp:1127
QwtSaturationValueColorMap::QwtSaturationValueColorMap
QwtSaturationValueColorMap()
Constructor.
Definition qwt_color_map.cpp:972
QwtSaturationValueColorMap::value2
int value2() const
Definition qwt_color_map.cpp:1118
QwtSaturationValueColorMap::~QwtSaturationValueColorMap
virtual ~QwtSaturationValueColorMap()
Destructor.
Definition qwt_color_map.cpp:978
QwtSaturationValueColorMap::saturation1
int saturation1() const
Definition qwt_color_map.cpp:1091
QwtSaturationValueColorMap::setValueInterval
void setValueInterval(int value1, int value2)
Set the interval for the value coordinate.
Definition qwt_color_map.cpp:1043
QwtSaturationValueColorMap::setHue
void setHue(int hue)
Set the the hue coordinate.
Definition qwt_color_map.cpp:992