qwt_color_map.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #include "qwt_color_map.h"
11 #include "qwt_interval.h"
12 
13 #include <qvector.h>
14 
15 static inline QRgb qwtHsvToRgb( int h, int s, int v, int a )
16 {
17 #if 0
18  return QColor::fromHsv( h, s, v, a ).rgb();
19 #else
20 
21  const double vs = v * s / 255.0;
22  const int p = v - qRound( vs );
23 
24  switch( h / 60 )
25  {
26  case 0:
27  {
28  const double r = ( 60 - h ) / 60.0;
29  return qRgba( v, v - qRound( r * vs ), p, a );
30  }
31  case 1:
32  {
33  const double r = ( h - 60 ) / 60.0;
34  return qRgba( v - qRound( r * vs ), v, p, a );
35  }
36  case 2:
37  {
38  const double r = ( 180 - h ) / 60.0;
39  return qRgba( p, v, v - qRound( r * vs ), a );
40  }
41  case 3:
42  {
43  const double r = ( h - 180 ) / 60.0;
44  return qRgba( p, v - qRound( r * vs ), v, a );
45  }
46  case 4:
47  {
48  const double r = ( 300 - h ) / 60.0;
49  return qRgba( v - qRound( r * vs ), p, v, a );
50  }
51  case 5:
52  default:
53  {
54  const double r = ( h - 300 ) / 60.0;
55  return qRgba( v, p, v - qRound( r * vs ), a );
56  }
57  }
58 #endif
59 }
60 
62 {
63  public:
65  m_doAlpha( false )
66  {
67  m_stops.reserve( 256 );
68  }
69 
70  void insert( double pos, const QColor& color );
71  QRgb rgb( QwtLinearColorMap::Mode, double pos ) const;
72 
73  QVector< double > stops() const;
74 
75  private:
76 
77  class ColorStop
78  {
79  public:
81  pos( 0.0 ),
82  rgb( 0 )
83  {
84  };
85 
86  ColorStop( double p, const QColor& c ):
87  pos( p ),
88  rgb( c.rgba() )
89  {
90  r = qRed( rgb );
91  g = qGreen( rgb );
92  b = qBlue( rgb );
93  a = qAlpha( rgb );
94 
95  /*
96  when mapping a value to rgb we will have to calculate:
97  - const int v = int( ( s1.v0 + ratio * s1.vStep ) + 0.5 );
98 
99  Thus adding 0.5 ( for rounding ) can be done in advance
100  */
101  r0 = r + 0.5;
102  g0 = g + 0.5;
103  b0 = b + 0.5;
104  a0 = a + 0.5;
105 
106  rStep = gStep = bStep = aStep = 0.0;
107  posStep = 0.0;
108  }
109 
110  void updateSteps( const ColorStop& nextStop )
111  {
112  rStep = nextStop.r - r;
113  gStep = nextStop.g - g;
114  bStep = nextStop.b - b;
115  aStep = nextStop.a - a;
116  posStep = nextStop.pos - pos;
117  }
118 
119  double pos;
120  QRgb rgb;
121  int r, g, b, a;
122 
123  // precalculated values
124  double rStep, gStep, bStep, aStep;
125  double r0, g0, b0, a0;
126  double posStep;
127  };
128 
129  inline int findUpper( double pos ) const;
131  bool m_doAlpha;
132 };
133 
134 void QwtLinearColorMap::ColorStops::insert( double pos, const QColor& color )
135 {
136  // Lookups need to be very fast, insertions are not so important.
137  // Anyway, a balanced tree is what we need here. TODO ...
138 
139  if ( pos < 0.0 || pos > 1.0 )
140  return;
141 
142  int index;
143  if ( m_stops.size() == 0 )
144  {
145  index = 0;
146  m_stops.resize( 1 );
147  }
148  else
149  {
150  index = findUpper( pos );
151  if ( index == m_stops.size() ||
152  qAbs( m_stops[index].pos - pos ) >= 0.001 )
153  {
154  m_stops.resize( m_stops.size() + 1 );
155  for ( int i = m_stops.size() - 1; i > index; i-- )
156  m_stops[i] = m_stops[i - 1];
157  }
158  }
159 
160  m_stops[index] = ColorStop( pos, color );
161  if ( color.alpha() != 255 )
162  m_doAlpha = true;
163 
164  if ( index > 0 )
165  m_stops[index - 1].updateSteps( m_stops[index] );
166 
167  if ( index < m_stops.size() - 1 )
168  m_stops[index].updateSteps( m_stops[index + 1] );
169 }
170 
172 {
173  QVector< double > positions( m_stops.size() );
174  for ( int i = 0; i < m_stops.size(); i++ )
175  positions[i] = m_stops[i].pos;
176  return positions;
177 }
178 
179 inline int QwtLinearColorMap::ColorStops::findUpper( double pos ) const
180 {
181  int index = 0;
182  int n = m_stops.size();
183 
184  const ColorStop* stops = m_stops.data();
185 
186  while ( n > 0 )
187  {
188  const int half = n >> 1;
189  const int middle = index + half;
190 
191  if ( stops[middle].pos <= pos )
192  {
193  index = middle + 1;
194  n -= half + 1;
195  }
196  else
197  n = half;
198  }
199 
200  return index;
201 }
202 
204  QwtLinearColorMap::Mode mode, double pos ) const
205 {
206  if ( pos <= 0.0 )
207  return m_stops[0].rgb;
208  if ( pos >= 1.0 )
209  return m_stops[ m_stops.size() - 1 ].rgb;
210 
211  const int index = findUpper( pos );
212  if ( mode == FixedColors )
213  {
214  return m_stops[index - 1].rgb;
215  }
216  else
217  {
218  const ColorStop& s1 = m_stops[index - 1];
219 
220  const double ratio = ( pos - s1.pos ) / ( s1.posStep );
221 
222  const int r = int( s1.r0 + ratio * s1.rStep );
223  const int g = int( s1.g0 + ratio * s1.gStep );
224  const int b = int( s1.b0 + ratio * s1.bStep );
225 
226  if ( m_doAlpha )
227  {
228  if ( s1.aStep )
229  {
230  const int a = int( s1.a0 + ratio * s1.aStep );
231  return qRgba( r, g, b, a );
232  }
233  else
234  {
235  return qRgba( r, g, b, s1.a );
236  }
237  }
238  else
239  {
240  return qRgb( r, g, b );
241  }
242  }
243 }
244 
250  : m_format( format )
251 {
252 }
253 
256 {
257 }
258 
265 {
266  m_format = format;
267 }
268 
278 uint QwtColorMap::colorIndex( int numColors,
279  const QwtInterval& interval, double value ) const
280 {
281  const double width = interval.width();
282  if ( width <= 0.0 )
283  return 0;
284 
285  if ( value <= interval.minValue() )
286  return 0;
287 
288  const int maxIndex = numColors - 1;
289  if ( value >= interval.maxValue() )
290  return maxIndex;
291 
292  const double v = maxIndex * ( ( value - interval.minValue() ) / width );
293  return static_cast< unsigned int >( v + 0.5 );
294 }
295 
305 {
306  QVector< QRgb > table( 256 );
307 
308  const QwtInterval interval( 0, 256 );
309 
310  for ( int i = 0; i < 256; i++ )
311  table[i] = rgb( interval, i );
312 
313  return table;
314 }
315 
326 {
327  QVector< QRgb > table( numColors );
328 
329  const QwtInterval interval( 0.0, 1.0 );
330 
331  const double step = 1.0 / ( numColors - 1 );
332  for ( int i = 0; i < numColors; i++ )
333  table[i] = rgb( interval, step * i );
334 
335  return table;
336 }
337 
339 {
340  public:
343 };
344 
353 {
354  m_data = new PrivateData;
356 
357  setColorInterval( Qt::blue, Qt::yellow );
358 }
359 
368  const QColor& color2, QwtColorMap::Format format )
369  : QwtColorMap( format )
370 {
371  m_data = new PrivateData;
374 }
375 
378 {
379  delete m_data;
380 }
381 
392 {
393  m_data->mode = mode;
394 }
395 
401 {
402  return m_data->mode;
403 }
404 
416  const QColor& color1, const QColor& color2 )
417 {
419  m_data->colorStops.insert( 0.0, color1 );
420  m_data->colorStops.insert( 1.0, color2 );
421 }
422 
433 void QwtLinearColorMap::addColorStop( double value, const QColor& color )
434 {
435  if ( value >= 0.0 && value <= 1.0 )
436  m_data->colorStops.insert( value, color );
437 }
438 
443 {
444  return m_data->colorStops.stops();
445 }
446 
452 {
453  return QColor::fromRgba( m_data->colorStops.rgb( m_data->mode, 0.0 ) );
454 }
455 
461 {
462  return QColor::fromRgba( m_data->colorStops.rgb( m_data->mode, 1.0 ) );
463 }
464 
474  const QwtInterval& interval, double value ) const
475 {
476  const double width = interval.width();
477  if ( width <= 0.0 )
478  return 0u;
479 
480  const double ratio = ( value - interval.minValue() ) / width;
481  return m_data->colorStops.rgb( m_data->mode, ratio );
482 }
483 
494 uint QwtLinearColorMap::colorIndex( int numColors,
495  const QwtInterval& interval, double value ) const
496 {
497  const double width = interval.width();
498  if ( width <= 0.0 )
499  return 0;
500 
501  if ( value <= interval.minValue() )
502  return 0;
503 
504  if ( value >= interval.maxValue() )
505  return numColors - 1;
506 
507  const double v = ( numColors - 1 ) * ( value - interval.minValue() ) / width;
508  return static_cast< unsigned int >( ( m_data->mode == FixedColors ) ? v : v + 0.5 );
509 }
510 
512 {
513  public:
515  : alpha1(0)
516  , alpha2(255)
517  {
518  }
519 
521 
522  QColor color;
523  QRgb rgb;
524 
525  QRgb rgbMin;
526  QRgb rgbMax;
527 };
528 
529 
540  : QwtColorMap( QwtColorMap::RGB )
541 {
542  m_data = new PrivateData;
543  setColor( color );
544 }
545 
548 {
549  delete m_data;
550 }
551 
558 void QwtAlphaColorMap::setColor( const QColor& color )
559 {
560  m_data->color = color;
561  m_data->rgb = color.rgb() & qRgba( 255, 255, 255, 0 );
562 
563  m_data->rgbMin = m_data->rgb | ( m_data->alpha1 << 24 );
564  m_data->rgbMax = m_data->rgb | ( m_data->alpha2 << 24 );
565 }
566 
572 {
573  return m_data->color;
574 }
575 
587 void QwtAlphaColorMap::setAlphaInterval( int alpha1, int alpha2 )
588 {
589  m_data->alpha1 = qBound( 0, alpha1, 255 );
590  m_data->alpha2 = qBound( 0, alpha2, 255 );
591 
592  m_data->rgbMin = m_data->rgb | ( alpha1 << 24 );
593  m_data->rgbMax = m_data->rgb | ( alpha2 << 24 );
594 }
595 
601 {
602  return m_data->alpha1;
603 }
604 
610 {
611  return m_data->alpha2;
612 }
613 
622 QRgb QwtAlphaColorMap::rgb( const QwtInterval& interval, double value ) const
623 {
624  const double width = interval.width();
625  if ( width <= 0.0 )
626  return 0u;
627 
628  if ( value <= interval.minValue() )
629  return m_data->rgb;
630 
631  if ( value >= interval.maxValue() )
632  return m_data->rgbMax;
633 
634  const double ratio = ( value - interval.minValue() ) / width;
635  const int alpha = m_data->alpha1 + qRound( ratio * ( m_data->alpha2 - m_data->alpha1 ) );
636 
637  return m_data->rgb | ( alpha << 24 );
638 }
639 
641 {
642  public:
643  PrivateData();
644 
645  void updateTable();
646 
647  int hue1, hue2;
649  int value;
650  int alpha;
651 
652  QRgb rgbMin;
653  QRgb rgbMax;
654 
655  QRgb rgbTable[360];
656 };
657 
659  : hue1(0)
660  , hue2(359)
661  , saturation(255)
662  , value(255)
663  , alpha(255)
664 {
665  updateTable();
666 }
667 
669 {
670  const int p = qRound( value * ( 255 - saturation ) / 255.0 );
671  const double vs = value * saturation / 255.0;
672 
673  for ( int i = 0; i < 60; i++ )
674  {
675  const double r = ( 60 - i ) / 60.0;
676  rgbTable[i] = qRgba( value, qRound( value - r * vs ), p, alpha );
677  }
678 
679  for ( int i = 60; i < 120; i++ )
680  {
681  const double r = ( i - 60 ) / 60.0;
682  rgbTable[i] = qRgba( qRound( value - r * vs ), value, p, alpha );
683  }
684 
685  for ( int i = 120; i < 180; i++ )
686  {
687  const double r = ( 180 - i ) / 60.0;
688  rgbTable[i] = qRgba( p, value, qRound( value - r * vs ), alpha );
689  }
690 
691  for ( int i = 180; i < 240; i++ )
692  {
693  const double r = ( i - 180 ) / 60.0;
694  rgbTable[i] = qRgba( p, qRound( value - r * vs ), value, alpha );
695  }
696 
697  for ( int i = 240; i < 300; i++ )
698  {
699  const double r = ( 300 - i ) / 60.0;
700  rgbTable[i] = qRgba( qRound( value - r * vs ), p, value, alpha );
701  }
702 
703  for ( int i = 300; i < 360; i++ )
704  {
705  const double r = ( i - 300 ) / 60.0;
706  rgbTable[i] = qRgba( value, p, qRound( value - r * vs ), alpha );
707  }
708 
709  rgbMin = rgbTable[ hue1 % 360 ];
710  rgbMax = rgbTable[ hue2 % 360 ];
711 }
712 
724  : QwtColorMap( format )
725 {
726  m_data = new PrivateData;
727 }
728 
731 {
732  delete m_data;
733 }
734 
746 void QwtHueColorMap::setHueInterval( int hue1, int hue2 )
747 {
748  m_data->hue1 = qMax( hue1, 0 );
749  m_data->hue2 = qMax( hue2, 0 );
750 
751  m_data->rgbMin = m_data->rgbTable[ hue1 % 360 ];
752  m_data->rgbMax = m_data->rgbTable[ hue2 % 360 ];
753 }
754 
764 void QwtHueColorMap::setSaturation( int saturation )
765 {
766  saturation = qBound( 0, saturation, 255 );
767 
768  if ( saturation != m_data->saturation )
769  {
771  m_data->updateTable();
772  }
773 }
774 
784 void QwtHueColorMap::setValue( int value )
785 {
786  value = qBound( 0, value, 255 );
787 
788  if ( value != m_data->value )
789  {
790  m_data->value = value;
791  m_data->updateTable();
792  }
793 }
794 
805 void QwtHueColorMap::setAlpha( int alpha )
806 {
807  alpha = qBound( 0, alpha, 255 );
808 
809  if ( alpha != m_data->alpha )
810  {
811  m_data->alpha = alpha;
812  m_data->updateTable();
813  }
814 }
815 
821 {
822  return m_data->hue1;
823 }
824 
830 {
831  return m_data->hue2;
832 }
833 
839 {
840  return m_data->saturation;
841 }
842 
848 {
849  return m_data->value;
850 }
851 
857 {
858  return m_data->alpha;
859 }
860 
869 QRgb QwtHueColorMap::rgb( const QwtInterval& interval, double value ) const
870 {
871  const double width = interval.width();
872  if ( width <= 0 )
873  return 0u;
874 
875  if ( value <= interval.minValue() )
876  return m_data->rgbMin;
877 
878  if ( value >= interval.maxValue() )
879  return m_data->rgbMax;
880 
881  const double ratio = ( value - interval.minValue() ) / width;
882 
883  int hue = m_data->hue1 + qRound( ratio * ( m_data->hue2 - m_data->hue1 ) );
884  if ( hue >= 360 )
885  {
886  hue -= 360;
887 
888  if ( hue >= 360 )
889  hue = hue % 360;
890  }
891 
892  return m_data->rgbTable[hue];
893 }
894 
896 {
897  public:
899  : hue(0)
900  , sat1(255)
901  , sat2(255)
902  , value1(0)
903  , value2(255)
904  , alpha(255)
905  , tableType(Invalid)
906  {
907  updateTable();
908  }
909 
910  void updateTable()
911  {
912  tableType = Invalid;
913 
914  if ( ( value1 == value2 ) && ( sat1 != sat2 ) )
915  {
916  rgbTable.resize( 256 );
917 
918  for ( int i = 0; i < 256; i++ )
919  rgbTable[i] = qwtHsvToRgb( hue, i, value1, alpha );
920 
922  }
923  else if ( ( value1 != value2 ) && ( sat1 == sat2 ) )
924  {
925  rgbTable.resize( 256 );
926 
927  for ( int i = 0; i < 256; i++ )
928  rgbTable[i] = qwtHsvToRgb( hue, sat1, i, alpha );
929 
930  tableType = Value;
931  }
932  else
933  {
934  rgbTable.resize( 256 * 256 );
935 
936  for ( int s = 0; s < 256; s++ )
937  {
938  const int v0 = s * 256;
939 
940  for ( int v = 0; v < 256; v++ )
941  rgbTable[v0 + v] = qwtHsvToRgb( hue, s, v, alpha );
942  }
943  }
944  }
945 
946  int hue;
947  int sat1, sat2;
949  int alpha;
950 
951  enum
952  {
956 
957  } tableType;
958 
960 };
961 
973 {
974  m_data = new PrivateData;
975 }
976 
979 {
980  delete m_data;
981 }
982 
993 {
994  hue = hue % 360;
995 
996  if ( hue != m_data->hue )
997  {
998  m_data->hue = hue;
999  m_data->updateTable();
1000  }
1001 }
1002 
1017  int saturation1, int saturation2 )
1018 {
1019  saturation1 = qBound( 0, saturation1, 255 );
1020  saturation2 = qBound( 0, saturation2, 255 );
1021 
1022  if ( ( saturation1 != m_data->sat1 ) || ( saturation2 != m_data->sat2 ) )
1023  {
1024  m_data->sat1 = saturation1;
1025  m_data->sat2 = saturation2;
1026 
1027  m_data->updateTable();
1028  }
1029 }
1030 
1043 void QwtSaturationValueColorMap::setValueInterval( int value1, int value2 )
1044 {
1045  value1 = qBound( 0, value1, 255 );
1046  value2 = qBound( 0, value2, 255 );
1047 
1048  if ( ( value1 != m_data->value1 ) || ( value2 != m_data->value2 ) )
1049  {
1050  m_data->value1 = value1;
1051  m_data->value2 = value2;
1052 
1053  m_data->updateTable();
1054  }
1055 }
1056 
1068 {
1069  alpha = qBound( 0, alpha, 255 );
1070 
1071  if ( alpha != m_data->alpha )
1072  {
1073  m_data->alpha = alpha;
1074  m_data->updateTable();
1075  }
1076 }
1077 
1083 {
1084  return m_data->hue;
1085 }
1086 
1092 {
1093  return m_data->sat1;
1094 }
1095 
1101 {
1102  return m_data->sat2;
1103 }
1104 
1110 {
1111  return m_data->value1;
1112 }
1113 
1119 {
1120  return m_data->value2;
1121 }
1122 
1128 {
1129  return m_data->alpha;
1130 }
1131 
1141  const QwtInterval& interval, double value ) const
1142 {
1143  const double width = interval.width();
1144  if ( width <= 0 )
1145  return 0u;
1146 
1147  const QRgb* rgbTable = m_data->rgbTable.constData();
1148 
1149  switch( m_data->tableType )
1150  {
1152  {
1153  if ( value <= interval.minValue() )
1154  return m_data->rgbTable[m_data->sat1];
1155 
1156  if ( value >= interval.maxValue() )
1157  return m_data->rgbTable[m_data->sat2];
1158 
1159  const double ratio = ( value - interval.minValue() ) / width;
1160  const int sat = m_data->sat1
1161  + qRound( ratio * ( m_data->sat2 - m_data->sat1 ) );
1162 
1163  return rgbTable[sat];
1164  }
1165  case PrivateData::Value:
1166  {
1167  if ( value <= interval.minValue() )
1168  return m_data->rgbTable[m_data->value1];
1169 
1170  if ( value >= interval.maxValue() )
1171  return m_data->rgbTable[m_data->value2];
1172 
1173  const double ratio = ( value - interval.minValue() ) / width;
1174  const int v = m_data->value1 +
1175  qRound( ratio * ( m_data->value2 - m_data->value1 ) );
1176 
1177  return rgbTable[ v ];
1178  }
1179  default:
1180  {
1181  int s, v;
1182  if ( value <= interval.minValue() )
1183  {
1184  s = m_data->sat1;
1185  v = m_data->value1;
1186  }
1187  else if ( value >= interval.maxValue() )
1188  {
1189  s = m_data->sat2;
1190  v = m_data->value2;
1191  }
1192  else
1193  {
1194  const double ratio = ( value - interval.minValue() ) / width;
1195 
1196  v = m_data->value1 + qRound( ratio * ( m_data->value2 - m_data->value1 ) );
1197  s = m_data->sat1 + qRound( ratio * ( m_data->sat2 - m_data->sat1 ) );
1198  }
1199 
1200  return rgbTable[ 256 * s + v ];
1201  }
1202  }
1203 }
QwtSaturationValueColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const QWT_OVERRIDE
Definition: qwt_color_map.cpp:1140
QwtLinearColorMap::ColorStops::ColorStop::gStep
double gStep
Definition: qwt_color_map.cpp:124
QwtLinearColorMap::ColorStops::ColorStop::pos
double pos
Definition: qwt_color_map.cpp:119
color
color
Definition: color.h:16
QwtSaturationValueColorMap::PrivateData::Value
@ Value
Definition: qwt_color_map.cpp:954
QwtAlphaColorMap::~QwtAlphaColorMap
virtual ~QwtAlphaColorMap()
Destructor.
Definition: qwt_color_map.cpp:547
QwtColorMap::Format
Format
Definition: qwt_color_map.h:45
QwtLinearColorMap::ColorStops::rgb
QRgb rgb(QwtLinearColorMap::Mode, double pos) const
Definition: qwt_color_map.cpp:203
QwtLinearColorMap::mode
Mode mode() const
Definition: qwt_color_map.cpp:400
QwtLinearColorMap::ColorStops::ColorStop::bStep
double bStep
Definition: qwt_color_map.cpp:124
QwtLinearColorMap::FixedColors
@ FixedColors
Return the color from the next lower color stop.
Definition: qwt_color_map.h:108
QwtLinearColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const QWT_OVERRIDE
Definition: qwt_color_map.cpp:473
QwtAlphaColorMap::PrivateData::alpha2
int alpha2
Definition: qwt_color_map.cpp:520
QwtHueColorMap::PrivateData::saturation
int saturation
Definition: qwt_color_map.cpp:648
QwtSaturationValueColorMap::PrivateData::tableType
enum QwtSaturationValueColorMap::PrivateData::@23 tableType
QwtAlphaColorMap::PrivateData::rgb
QRgb rgb
Definition: qwt_color_map.cpp:523
QwtSaturationValueColorMap::setSaturationInterval
void setSaturationInterval(int sat1, int sat2)
Set the interval for the saturation coordinate.
Definition: qwt_color_map.cpp:1016
QwtAlphaColorMap::PrivateData::rgbMax
QRgb rgbMax
Definition: qwt_color_map.cpp:526
s
XmlRpcServer s
QwtLinearColorMap::ColorStops::ColorStop::g
int g
Definition: qwt_color_map.cpp:121
QwtLinearColorMap::ColorStops::ColorStop::b
int b
Definition: qwt_color_map.cpp:121
QwtLinearColorMap::~QwtLinearColorMap
virtual ~QwtLinearColorMap()
Destructor.
Definition: qwt_color_map.cpp:377
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::QwtColorMap
QwtColorMap(Format=QwtColorMap::RGB)
Definition: qwt_color_map.cpp:249
QwtAlphaColorMap::color
QColor color() const
Definition: qwt_color_map.cpp:571
QwtHueColorMap::setHueInterval
void setHueInterval(int hue1, int hue2)
Definition: qwt_color_map.cpp:746
QVector< double >
QwtLinearColorMap::setColorInterval
void setColorInterval(const QColor &color1, const QColor &color2)
Definition: qwt_color_map.cpp:415
QwtInterval::minValue
double minValue() const
Definition: qwt_interval.h:192
QwtSaturationValueColorMap::alpha
int alpha() const
Definition: qwt_color_map.cpp:1127
QwtSaturationValueColorMap::setHue
void setHue(int hue)
Set the the hue coordinate.
Definition: qwt_color_map.cpp:992
QwtAlphaColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const QWT_OVERRIDE
Map a value of a given interval into a alpha value.
Definition: qwt_color_map.cpp:622
rgb
Definition: color.h:192
QwtSaturationValueColorMap::value1
int value1() const
Definition: qwt_color_map.cpp:1109
QwtLinearColorMap::ColorStops::ColorStop::g0
double g0
Definition: qwt_color_map.cpp:125
QwtAlphaColorMap::m_data
PrivateData * m_data
Definition: qwt_color_map.h:165
QwtHueColorMap::hue1
int hue1() const
Definition: qwt_color_map.cpp:820
qwt_interval.h
QwtSaturationValueColorMap::PrivateData::Invalid
@ Invalid
Definition: qwt_color_map.cpp:953
QwtLinearColorMap::color2
QColor color2() const
Definition: qwt_color_map.cpp:460
QwtSaturationValueColorMap::PrivateData::sat1
int sat1
Definition: qwt_color_map.cpp:947
QwtSaturationValueColorMap::~QwtSaturationValueColorMap
virtual ~QwtSaturationValueColorMap()
Destructor.
Definition: qwt_color_map.cpp:978
QwtHueColorMap::~QwtHueColorMap
virtual ~QwtHueColorMap()
Destructor.
Definition: qwt_color_map.cpp:730
qwtHsvToRgb
static QRgb qwtHsvToRgb(int h, int s, int v, int a)
Definition: qwt_color_map.cpp:15
QwtAlphaColorMap::QwtAlphaColorMap
QwtAlphaColorMap(const QColor &=QColor(Qt::gray))
Constructor.
Definition: qwt_color_map.cpp:539
QwtLinearColorMap::ColorStops::ColorStop
Definition: qwt_color_map.cpp:77
QwtLinearColorMap::ColorStops::m_stops
QVector< ColorStop > m_stops
Definition: qwt_color_map.cpp:130
QwtLinearColorMap::ColorStops::ColorStops
ColorStops()
Definition: qwt_color_map.cpp:64
QwtLinearColorMap::PrivateData::colorStops
ColorStops colorStops
Definition: qwt_color_map.cpp:341
QwtLinearColorMap::Mode
Mode
Definition: qwt_color_map.h:105
QwtSaturationValueColorMap::hue
int hue() const
Definition: qwt_color_map.cpp:1082
QwtHueColorMap::PrivateData::updateTable
void updateTable()
Definition: qwt_color_map.cpp:668
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
QwtSaturationValueColorMap::saturation1
int saturation1() const
Definition: qwt_color_map.cpp:1091
QwtSaturationValueColorMap::value2
int value2() const
Definition: qwt_color_map.cpp:1118
QwtHueColorMap::hue2
int hue2() const
Definition: qwt_color_map.cpp:829
QwtHueColorMap::PrivateData::hue2
int hue2
Definition: qwt_color_map.cpp:647
QwtHueColorMap::PrivateData::value
int value
Definition: qwt_color_map.cpp:649
QwtHueColorMap::PrivateData::rgbMin
QRgb rgbMin
Definition: qwt_color_map.cpp:652
QwtLinearColorMap::PrivateData
Definition: qwt_color_map.cpp:338
QwtLinearColorMap::ColorStops::ColorStop::a0
double a0
Definition: qwt_color_map.cpp:125
QwtSaturationValueColorMap::PrivateData::alpha
int alpha
Definition: qwt_color_map.cpp:949
QwtHueColorMap::PrivateData::alpha
int alpha
Definition: qwt_color_map.cpp:650
QwtHueColorMap::PrivateData::rgbTable
QRgb rgbTable[360]
Definition: qwt_color_map.cpp:655
QwtAlphaColorMap::PrivateData::alpha1
int alpha1
Definition: qwt_color_map.cpp:520
QwtAlphaColorMap::alpha2
int alpha2() const
Definition: qwt_color_map.cpp:609
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
QwtLinearColorMap::ColorStops::ColorStop::rStep
double rStep
Definition: qwt_color_map.cpp:124
QwtHueColorMap::setValue
void setValue(int value)
Set the the value coordinate.
Definition: qwt_color_map.cpp:784
QwtInterval::width
double width() const
Return the width of an interval.
Definition: qwt_interval.h:227
QwtHueColorMap::rgb
virtual QRgb rgb(const QwtInterval &, double value) const QWT_OVERRIDE
Definition: qwt_color_map.cpp:869
QwtSaturationValueColorMap::saturation2
int saturation2() const
Definition: qwt_color_map.cpp:1100
QwtLinearColorMap::color1
QColor color1() const
Definition: qwt_color_map.cpp:451
QwtSaturationValueColorMap::PrivateData::value1
int value1
Definition: qwt_color_map.cpp:948
qwt_color_map.h
QwtLinearColorMap::ColorStops::ColorStop::rgb
QRgb rgb
Definition: qwt_color_map.cpp:120
QwtHueColorMap::PrivateData
Definition: qwt_color_map.cpp:640
QwtHueColorMap::PrivateData::rgbMax
QRgb rgbMax
Definition: qwt_color_map.cpp:653
QwtLinearColorMap::ColorStops::ColorStop::r
int r
Definition: qwt_color_map.cpp:121
QwtLinearColorMap::ColorStops
Definition: qwt_color_map.cpp:61
QwtSaturationValueColorMap::setValueInterval
void setValueInterval(int value1, int value2)
Set the interval for the value coordinate.
Definition: qwt_color_map.cpp:1043
QwtLinearColorMap::setMode
void setMode(Mode)
Set the mode of the color map.
Definition: qwt_color_map.cpp:391
QwtColorMap::setFormat
void setFormat(Format)
Definition: qwt_color_map.cpp:264
QwtLinearColorMap::ColorStops::insert
void insert(double pos, const QColor &color)
Definition: qwt_color_map.cpp:134
QwtAlphaColorMap::PrivateData::rgbMin
QRgb rgbMin
Definition: qwt_color_map.cpp:525
QwtHueColorMap::QwtHueColorMap
QwtHueColorMap(QwtColorMap::Format=QwtColorMap::RGB)
Constructor.
Definition: qwt_color_map.cpp:723
QwtAlphaColorMap::alpha1
int alpha1() const
Definition: qwt_color_map.cpp:600
QwtSaturationValueColorMap::PrivateData::sat2
int sat2
Definition: qwt_color_map.cpp:947
QwtLinearColorMap::ColorStops::m_doAlpha
bool m_doAlpha
Definition: qwt_color_map.cpp:131
QwtColorMap::format
Format format() const
Definition: qwt_color_map.h:257
QwtLinearColorMap::ColorStops::ColorStop::ColorStop
ColorStop(double p, const QColor &c)
Definition: qwt_color_map.cpp:86
format
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
Definition: color.h:543
QwtLinearColorMap::colorIndex
virtual uint colorIndex(int numColors, const QwtInterval &, double value) const QWT_OVERRIDE
Map a value of a given interval into a color index.
Definition: qwt_color_map.cpp:494
QwtAlphaColorMap::PrivateData
Definition: qwt_color_map.cpp:511
QwtLinearColorMap::ColorStops::ColorStop::ColorStop
ColorStop()
Definition: qwt_color_map.cpp:80
backward::Color::yellow
@ yellow
Definition: backward.hpp:3678
QwtSaturationValueColorMap::m_data
PrivateData * m_data
Definition: qwt_color_map.h:236
udp_client.int
int
Definition: udp_client.py:11
QwtSaturationValueColorMap::QwtSaturationValueColorMap
QwtSaturationValueColorMap()
Constructor.
Definition: qwt_color_map.cpp:972
QwtHueColorMap::setAlpha
void setAlpha(int alpha)
Set the the alpha coordinate.
Definition: qwt_color_map.cpp:805
QwtSaturationValueColorMap::PrivateData::Saturation
@ Saturation
Definition: qwt_color_map.cpp:955
QwtAlphaColorMap::setAlphaInterval
void setAlphaInterval(int alpha1, int alpha2)
Definition: qwt_color_map.cpp:587
QwtHueColorMap::setSaturation
void setSaturation(int saturation)
Set the the saturation coordinate.
Definition: qwt_color_map.cpp:764
QwtLinearColorMap::ColorStops::ColorStop::r0
double r0
Definition: qwt_color_map.cpp:125
QwtLinearColorMap::ScaledColors
@ ScaledColors
Interpolating the colors of the adjacent stops.
Definition: qwt_color_map.h:111
QwtColorMap::rgb
virtual QRgb rgb(const QwtInterval &interval, double value) const =0
QwtLinearColorMap::PrivateData::mode
QwtLinearColorMap::Mode mode
Definition: qwt_color_map.cpp:342
QwtAlphaColorMap::PrivateData::PrivateData
PrivateData()
Definition: qwt_color_map.cpp:514
QwtHueColorMap::m_data
PrivateData * m_data
Definition: qwt_color_map.h:201
QwtSaturationValueColorMap::PrivateData::PrivateData
PrivateData()
Definition: qwt_color_map.cpp:898
QwtColorMap::~QwtColorMap
virtual ~QwtColorMap()
Destructor.
Definition: qwt_color_map.cpp:255
QwtSaturationValueColorMap::PrivateData::updateTable
void updateTable()
Definition: qwt_color_map.cpp:910
QwtHueColorMap::PrivateData::hue1
int hue1
Definition: qwt_color_map.cpp:647
QwtAlphaColorMap::setColor
void setColor(const QColor &)
Definition: qwt_color_map.cpp:558
QwtLinearColorMap::QwtLinearColorMap
QwtLinearColorMap(QwtColorMap::Format=QwtColorMap::RGB)
Definition: qwt_color_map.cpp:351
QwtLinearColorMap::ColorStops::ColorStop::updateSteps
void updateSteps(const ColorStop &nextStop)
Definition: qwt_color_map.cpp:110
QwtHueColorMap::value
int value() const
Definition: qwt_color_map.cpp:847
QwtInterval::maxValue
double maxValue() const
Definition: qwt_interval.h:198
QwtAlphaColorMap::PrivateData::color
QColor color
Definition: qwt_color_map.cpp:522
QwtSaturationValueColorMap::PrivateData::value2
int value2
Definition: qwt_color_map.cpp:948
QwtColorMap
QwtColorMap is used to map values into colors.
Definition: qwt_color_map.h:37
QwtHueColorMap::alpha
int alpha() const
Definition: qwt_color_map.cpp:856
QwtHueColorMap::PrivateData::PrivateData
PrivateData()
Definition: qwt_color_map.cpp:658
QwtLinearColorMap::colorStops
QVector< double > colorStops() const
Definition: qwt_color_map.cpp:442
QwtLinearColorMap::ColorStops::ColorStop::aStep
double aStep
Definition: qwt_color_map.cpp:124
QwtLinearColorMap::ColorStops::ColorStop::posStep
double posStep
Definition: qwt_color_map.cpp:126
QwtSaturationValueColorMap::setAlpha
void setAlpha(int alpha)
Set the the alpha coordinate.
Definition: qwt_color_map.cpp:1067
QwtLinearColorMap::ColorStops::ColorStop::a
int a
Definition: qwt_color_map.cpp:121
QwtLinearColorMap::addColorStop
void addColorStop(double value, const QColor &)
Definition: qwt_color_map.cpp:433
QwtLinearColorMap::ColorStops::ColorStop::b0
double b0
Definition: qwt_color_map.cpp:125
sol::table
table_core< false > table
Definition: forward.hpp:1126
QwtSaturationValueColorMap::PrivateData::rgbTable
QVector< QRgb > rgbTable
Definition: qwt_color_map.cpp:959
QwtLinearColorMap::ColorStops::stops
QVector< double > stops() const
Definition: qwt_color_map.cpp:171
QwtSaturationValueColorMap::PrivateData
Definition: qwt_color_map.cpp:895
QwtLinearColorMap::ColorStops::findUpper
int findUpper(double pos) const
Definition: qwt_color_map.cpp:179
QwtLinearColorMap::m_data
PrivateData * m_data
Definition: qwt_color_map.h:140
QwtSaturationValueColorMap::PrivateData::hue
int hue
Definition: qwt_color_map.cpp:946
QwtColorMap::m_format
Format m_format
Definition: qwt_color_map.h:88
QwtHueColorMap::saturation
int saturation() const
Definition: qwt_color_map.cpp:838


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