File: classQCPColorGradient.html

package info (click to toggle)
qcustomplot 2.0.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,376 kB
  • sloc: cpp: 21,746; sh: 180; makefile: 2
file content (597 lines) | stat: -rw-r--r-- 40,767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="author" content="Emanuel Eichhammer" />
<meta name="copyright" content="(C) 2011-2016 Emanuel Eichhammer" />
<title>QCPColorGradient Class Reference</title>
<link href="qcp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<a class="headerLink"  href="index.html">Main Page</a> &middot;
<a class="headerLink"  href="classoverview.html">Class Overview</a> &middot;
<a class="headerLink"  href="hierarchy.html">Hierarchy</a> &middot;
<a class="headerLink"  href="annotated.html">All Classes</a> &middot;
<a class="headerLink"  href="pages.html">Special Pages</a>
<!-- Generated by Doxygen 1.8.12 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Functions</a> &#124;
<a href="#pro-methods">Protected Functions</a>  </div>
  <div class="headertitle">
<div class="title">QCPColorGradient Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Defines a color gradient for use with e.g. <a class="el" href="classQCPColorMap.html">QCPColorMap</a>.  
 <a href="classQCPColorGradient.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac5dca17cc24336e6ca176610e7f77fc1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a> </td></tr>
<tr class="separator:ac5dca17cc24336e6ca176610e7f77fc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed6569828fee337023670272910c9072"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> </td></tr>
<tr class="separator:aed6569828fee337023670272910c9072"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Functions</h2></td></tr>
<tr class="memitem:a96bcc490ff9dc32b22941ce00800bce0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a96bcc490ff9dc32b22941ce00800bce0">QCPColorGradient</a> ()</td></tr>
<tr class="separator:a96bcc490ff9dc32b22941ce00800bce0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e570b4004fd60bd135e52d685ed2b66"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a4e570b4004fd60bd135e52d685ed2b66">QCPColorGradient</a> (<a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> preset)</td></tr>
<tr class="separator:a4e570b4004fd60bd135e52d685ed2b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f3478c33c59aa3c03b9ea1f809877fa"><td class="memItemLeft" align="right" valign="top"><a id="a7f3478c33c59aa3c03b9ea1f809877fa"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (const <a class="el" href="classQCPColorGradient.html">QCPColorGradient</a> &amp;other) const</td></tr>
<tr class="separator:a7f3478c33c59aa3c03b9ea1f809877fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad26a10e3beaef4fc6f2553d1a9756087"><td class="memItemLeft" align="right" valign="top"><a id="ad26a10e3beaef4fc6f2553d1a9756087"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="classQCPColorGradient.html">QCPColorGradient</a> &amp;other) const</td></tr>
<tr class="separator:ad26a10e3beaef4fc6f2553d1a9756087"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4b9d7034fc3b6c76318b05075367090"><td class="memItemLeft" align="right" valign="top"><a id="ac4b9d7034fc3b6c76318b05075367090"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>levelCount</b> () const</td></tr>
<tr class="separator:ac4b9d7034fc3b6c76318b05075367090"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaab19729e921682401044ac8e518ff02"><td class="memItemLeft" align="right" valign="top"><a id="aaab19729e921682401044ac8e518ff02"></a>
QMap&lt; double, QColor &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>colorStops</b> () const</td></tr>
<tr class="separator:aaab19729e921682401044ac8e518ff02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abad5002858db8cf75ecb045200881de6"><td class="memItemLeft" align="right" valign="top"><a id="abad5002858db8cf75ecb045200881de6"></a>
<a class="el" href="classQCPColorGradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a>&#160;</td><td class="memItemRight" valign="bottom"><b>colorInterpolation</b> () const</td></tr>
<tr class="separator:abad5002858db8cf75ecb045200881de6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22a1d2b17f203caf0dcec833507fb9e0"><td class="memItemLeft" align="right" valign="top"><a id="a22a1d2b17f203caf0dcec833507fb9e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>periodic</b> () const</td></tr>
<tr class="separator:a22a1d2b17f203caf0dcec833507fb9e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18da587eb4f7fc788ea28ba15b6a12de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a18da587eb4f7fc788ea28ba15b6a12de">setLevelCount</a> (int n)</td></tr>
<tr class="separator:a18da587eb4f7fc788ea28ba15b6a12de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a724e828aa6f0ba5011a9392477c35d3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a> (const QMap&lt; double, QColor &gt; &amp;colorStops)</td></tr>
<tr class="separator:a724e828aa6f0ba5011a9392477c35d3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b48be5e78079db1bb2a1188a4c3390e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> (double position, const QColor &amp;<a class="el" href="classQCPColorGradient.html#a0599545c859268b025d2060dea741cea">color</a>)</td></tr>
<tr class="separator:a3b48be5e78079db1bb2a1188a4c3390e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa13fda86406e1d896a465a409ae63b38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a> (<a class="el" href="classQCPColorGradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a> interpolation)</td></tr>
<tr class="separator:aa13fda86406e1d896a465a409ae63b38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39d6448155fc00a219f239220d14bb39"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a> (bool enabled)</td></tr>
<tr class="separator:a39d6448155fc00a219f239220d14bb39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf423ceb943e177b0ed2c48c811d83dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#aaf423ceb943e177b0ed2c48c811d83dc">colorize</a> (const double *data, const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)</td></tr>
<tr class="separator:aaf423ceb943e177b0ed2c48c811d83dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf0cc7fba83ef21f7b8d5d5258519db3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#acf0cc7fba83ef21f7b8d5d5258519db3">colorize</a> (const double *data, const unsigned char *alpha, const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)</td></tr>
<tr class="separator:acf0cc7fba83ef21f7b8d5d5258519db3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0599545c859268b025d2060dea741cea"><td class="memItemLeft" align="right" valign="top">QRgb&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a0599545c859268b025d2060dea741cea">color</a> (double position, const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;range, bool logarithmic=false)</td></tr>
<tr class="separator:a0599545c859268b025d2060dea741cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0aeec1528241728b9671bf8e60b1622"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a> (<a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> preset)</td></tr>
<tr class="separator:aa0aeec1528241728b9671bf8e60b1622"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a939213e85f0d1279519d555c5fcfb6ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> ()</td></tr>
<tr class="separator:a939213e85f0d1279519d555c5fcfb6ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f72f501de429829ec446333316decda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classQCPColorGradient.html">QCPColorGradient</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a9f72f501de429829ec446333316decda">inverted</a> () const</td></tr>
<tr class="separator:a9f72f501de429829ec446333316decda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Functions</h2></td></tr>
<tr class="memitem:a137b368ea8829a871974add6e4883c71"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a137b368ea8829a871974add6e4883c71">stopsUseAlpha</a> () const</td></tr>
<tr class="separator:a137b368ea8829a871974add6e4883c71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a353f15ab3ab586eebf1f6b58c3e2707b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPColorGradient.html#a353f15ab3ab586eebf1f6b58c3e2707b">updateColorBuffer</a> ()</td></tr>
<tr class="separator:a353f15ab3ab586eebf1f6b58c3e2707b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines a color gradient for use with e.g. <a class="el" href="classQCPColorMap.html">QCPColorMap</a>. </p>
<p>This class describes a color gradient which can be used to encode data with color. For example, <a class="el" href="classQCPColorMap.html" title="A plottable representing a two-dimensional color map in a plot. ">QCPColorMap</a> and <a class="el" href="classQCPColorScale.html" title="A color scale for use with color coding data such as QCPColorMap. ">QCPColorScale</a> have <a class="el" href="classQCPColorMap.html#a7313c78360471cead3576341a2c50377">setGradient</a> methods which take an instance of this class. Colors are set with <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt(double position, const QColor &amp;color)</a> with a <em>position</em> from 0 to 1. In between these defined color positions, the color will be interpolated linearly either in RGB or HSV space, see <a class="el" href="classQCPColorGradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<p>Alternatively, load one of the preset color gradients shown in the image below, with <a class="el" href="classQCPColorGradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a>, or by directly specifying the preset in the constructor.</p>
<p>Apart from red, green and blue components, the gradient also interpolates the alpha values of the configured color stops. This allows to display some portions of the data range as transparent in the plot.</p>
<div class="image">
<img src="QCPColorGradient.png" alt="QCPColorGradient.png"/>
</div>
<p>The <a class="el" href="classQCPColorGradient.html">ructor</a> allows directly converting a <a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> to a <a class="el" href="classQCPColorGradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a>. This means that you can directly pass <a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> to all the <em>setGradient</em> methods, e.g.: </p><div class="fragment"><div class="line">  colorMap-&gt;setGradient(<a class="code" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5">QCPColorGradient::gpHot</a>);</div></div><!-- fragment --><p> The total number of levels used in the gradient can be set with <a class="el" href="classQCPColorGradient.html#a18da587eb4f7fc788ea28ba15b6a12de">setLevelCount</a>. Whether the color gradient shall be applied periodically (wrapping around) to data values that lie outside the data range specified on the plottable instance can be controlled with <a class="el" href="classQCPColorGradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a>. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ac5dca17cc24336e6ca176610e7f77fc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5dca17cc24336e6ca176610e7f77fc1">&sect;&nbsp;</a></span>ColorInterpolation</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classQCPColorGradient.html#ac5dca17cc24336e6ca176610e7f77fc1">QCPColorGradient::ColorInterpolation</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Defines the color spaces in which color interpolation between gradient stops can be performed.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPColorGradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7"></a>ciRGB&#160;</td><td class="fielddoc"><p>Color channels red, green and blue are linearly interpolated. </p>
</td></tr>
<tr><td class="fieldname"><a id="ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb"></a>ciHSV&#160;</td><td class="fielddoc"><p>Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the shortest angle distance) </p>
</td></tr>
</table>

</div>
</div>
<a id="aed6569828fee337023670272910c9072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed6569828fee337023670272910c9072">&sect;&nbsp;</a></span>GradientPreset</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">QCPColorGradient::GradientPreset</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Defines the available presets that can be loaded with <a class="el" href="classQCPColorGradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a>. See the documentation there for an image of the presets. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb"></a>gpGrayscale&#160;</td><td class="fielddoc"><p>Continuous lightness from black to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5"></a>gpHot&#160;</td><td class="fielddoc"><p>Continuous lightness from black over firey colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557"></a>gpCold&#160;</td><td class="fielddoc"><p>Continuous lightness from black over icey colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62"></a>gpNight&#160;</td><td class="fielddoc"><p>Continuous lightness from black over weak blueish colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721"></a>gpCandy&#160;</td><td class="fielddoc"><p>Blue over pink to white. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2"></a>gpGeography&#160;</td><td class="fielddoc"><p>Colors suitable to represent different elevations on geographical maps. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b"></a>gpIon&#160;</td><td class="fielddoc"><p>Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7"></a>gpThermal&#160;</td><td class="fielddoc"><p>Colors suitable for thermal imaging, ranging from dark blue over purple to orange, yellow and white. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52"></a>gpPolar&#160;</td><td class="fielddoc"><p>Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle and red for positive values. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f"></a>gpSpectrum&#160;</td><td class="fielddoc"><p>An approximation of the visible light spectrum (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02"></a>gpJet&#160;</td><td class="fielddoc"><p>Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130"></a>gpHues&#160;</td><td class="fielddoc"><p>Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and phases, see <a class="el" href="classQCPColorGradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a>) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a96bcc490ff9dc32b22941ce00800bce0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96bcc490ff9dc32b22941ce00800bce0">&sect;&nbsp;</a></span>QCPColorGradient() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPColorGradient::QCPColorGradient </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructs a new, empty <a class="el" href="classQCPColorGradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a> with no predefined color stops. You can add own color stops with <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a>.</p>
<p>The color level count is initialized to 350. </p>

</div>
</div>
<a id="a4e570b4004fd60bd135e52d685ed2b66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e570b4004fd60bd135e52d685ed2b66">&sect;&nbsp;</a></span>QCPColorGradient() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPColorGradient::QCPColorGradient </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a>&#160;</td>
          <td class="paramname"><em>preset</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructs a new <a class="el" href="classQCPColorGradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a> initialized with the colors and color interpolation according to <em>preset</em>.</p>
<p>The color level count is initialized to 350. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a18da587eb4f7fc788ea28ba15b6a12de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18da587eb4f7fc788ea28ba15b6a12de">&sect;&nbsp;</a></span>setLevelCount()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setLevelCount </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the number of discretization levels of the color gradient to <em>n</em>. The default is 350 which is typically enough to create a smooth appearance. The minimum number of levels is 2.</p>
<div class="image">
<img src="QCPColorGradient-levelcount.png" alt="QCPColorGradient-levelcount.png"/>
</div>
 
</div>
</div>
<a id="a724e828aa6f0ba5011a9392477c35d3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a724e828aa6f0ba5011a9392477c35d3a">&sect;&nbsp;</a></span>setColorStops()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorStops </td>
          <td>(</td>
          <td class="paramtype">const QMap&lt; double, QColor &gt; &amp;&#160;</td>
          <td class="paramname"><em>colorStops</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets at which positions from 0 to 1 which color shall occur. The positions are the keys, the colors are the values of the passed QMap <em>colorStops</em>. In between these color stops, the color is interpolated according to <a class="el" href="classQCPColorGradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<p>A more convenient way to create a custom gradient may be to clear all color stops with <a class="el" href="classQCPColorGradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> (or creating a new, empty <a class="el" href="classQCPColorGradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a>) and then adding them one by one with <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPColorGradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> </dd></dl>

</div>
</div>
<a id="a3b48be5e78079db1bb2a1188a4c3390e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b48be5e78079db1bb2a1188a4c3390e">&sect;&nbsp;</a></span>setColorStopAt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorStopAt </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QColor &amp;&#160;</td>
          <td class="paramname"><em>color</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the <em>color</em> the gradient will have at the specified <em>position</em> (from 0 to 1). In between these color stops, the color is interpolated according to <a class="el" href="classQCPColorGradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPColorGradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="classQCPColorGradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> </dd></dl>

</div>
</div>
<a id="aa13fda86406e1d896a465a409ae63b38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa13fda86406e1d896a465a409ae63b38">&sect;&nbsp;</a></span>setColorInterpolation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorInterpolation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPColorGradient.html#ac5dca17cc24336e6ca176610e7f77fc1">QCPColorGradient::ColorInterpolation</a>&#160;</td>
          <td class="paramname"><em>interpolation</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether the colors in between the configured color stops (see <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a>) shall be interpolated linearly in RGB or in HSV color space.</p>
<p>For example, a sweep in RGB space from red to green will have a muddy brown intermediate color, whereas in HSV space the intermediate color is yellow. </p>

</div>
</div>
<a id="a39d6448155fc00a219f239220d14bb39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39d6448155fc00a219f239220d14bb39">&sect;&nbsp;</a></span>setPeriodic()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setPeriodic </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether data points that are outside the configured data range (e.g. <a class="el" href="classQCPColorMap.html#a980b42837821159786a85b4b7dcb8774">QCPColorMap::setDataRange</a>) are colored by periodically repeating the color gradient or whether they all have the same color, corresponding to the respective gradient boundary color.</p>
<div class="image">
<img src="QCPColorGradient-periodic.png" alt="QCPColorGradient-periodic.png"/>
</div>
<p>As shown in the image above, gradients that have the same start and end color are especially suitable for a periodic gradient mapping, since they produce smooth color transitions throughout the color map. A preset that has this property is <a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130">gpHues</a>.</p>
<p>In practice, using periodic color gradients makes sense when the data corresponds to a periodic dimension, such as an angle or a phase. If this is not the case, the color encoding might become ambiguous, because multiple different data values are shown as the same color. </p>

</div>
</div>
<a id="aaf423ceb943e177b0ed2c48c811d83dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf423ceb943e177b0ed2c48c811d83dc">&sect;&nbsp;</a></span>colorize() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::colorize </td>
          <td>(</td>
          <td class="paramtype">const double *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;&#160;</td>
          <td class="paramname"><em>range</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRgb *&#160;</td>
          <td class="paramname"><em>scanLine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dataIndexFactor</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>logarithmic</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is an overloaded function.</p>
<p>This method is used to quickly convert a <em>data</em> array to colors. The colors will be output in the array <em>scanLine</em>. Both <em>data</em> and <em>scanLine</em> must have the length <em>n</em> when passed to this function. The data range that shall be used for mapping the data value to the gradient is passed in <em>range</em>. <em>logarithmic</em> indicates whether the data values shall be mapped to colors logarithmically.</p>
<p>if <em>data</em> actually contains 2D-data linearized via <code>[row*columnCount + column]</code>, you can set <em>dataIndexFactor</em> to <code>columnCount</code> to convert a column instead of a row of the data array, in <em>scanLine</em>. <em>scanLine</em> will remain a regular (1D) array. This works because <em>data</em> is addressed <code>data[i*dataIndexFactor]</code>.</p>
<p>Use the overloaded method to additionally provide alpha map data.</p>
<p>The QRgb values that are placed in <em>scanLine</em> have their r, g and b components premultiplied with alpha (see QImage::Format_ARGB32_Premultiplied). </p>

</div>
</div>
<a id="acf0cc7fba83ef21f7b8d5d5258519db3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf0cc7fba83ef21f7b8d5d5258519db3">&sect;&nbsp;</a></span>colorize() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::colorize </td>
          <td>(</td>
          <td class="paramtype">const double *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>alpha</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;&#160;</td>
          <td class="paramname"><em>range</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRgb *&#160;</td>
          <td class="paramname"><em>scanLine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dataIndexFactor</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>logarithmic</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is an overloaded function.</p>
<p>Additionally to the other overload of <a class="el" href="classQCPColorGradient.html#aaf423ceb943e177b0ed2c48c811d83dc">colorize</a>, this method takes the array <em>alpha</em>, which has the same size and structure as <em>data</em> and encodes the alpha information per data point.</p>
<p>The QRgb values that are placed in <em>scanLine</em> have their r, g and b components premultiplied with alpha (see QImage::Format_ARGB32_Premultiplied). </p>

</div>
</div>
<a id="a0599545c859268b025d2060dea741cea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0599545c859268b025d2060dea741cea">&sect;&nbsp;</a></span>color()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QRgb QCPColorGradient::color </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classQCPRange.html">QCPRange</a> &amp;&#160;</td>
          <td class="paramname"><em>range</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>logarithmic</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This method is used to colorize a single data value given in <em>position</em>, to colors. The data range that shall be used for mapping the data value to the gradient is passed in <em>range</em>. <em>logarithmic</em> indicates whether the data value shall be mapped to a color logarithmically.</p>
<p>If an entire array of data values shall be converted, rather use <a class="el" href="classQCPColorGradient.html#aaf423ceb943e177b0ed2c48c811d83dc">colorize</a>, for better performance.</p>
<p>The returned QRgb has its r, g and b components premultiplied with alpha (see QImage::Format_ARGB32_Premultiplied). </p>

</div>
</div>
<a id="aa0aeec1528241728b9671bf8e60b1622"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0aeec1528241728b9671bf8e60b1622">&sect;&nbsp;</a></span>loadPreset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::loadPreset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPColorGradient.html#aed6569828fee337023670272910c9072">GradientPreset</a>&#160;</td>
          <td class="paramname"><em>preset</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears the current color stops and loads the specified <em>preset</em>. A preset consists of predefined color stops and the corresponding color interpolation method.</p>
<p>The available presets are: </p><div class="image">
<img src="QCPColorGradient.png" alt="QCPColorGradient.png"/>
</div>
 
</div>
</div>
<a id="a939213e85f0d1279519d555c5fcfb6ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a939213e85f0d1279519d555c5fcfb6ad">&sect;&nbsp;</a></span>clearColorStops()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::clearColorStops </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears all color stops.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPColorGradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> </dd></dl>

</div>
</div>
<a id="a9f72f501de429829ec446333316decda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f72f501de429829ec446333316decda">&sect;&nbsp;</a></span>inverted()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classQCPColorGradient.html">QCPColorGradient</a> QCPColorGradient::inverted </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns an inverted gradient. The inverted gradient has all properties as this <a class="el" href="classQCPColorGradient.html">QCPColorGradient</a>, but the order of the color stops is inverted.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classQCPColorGradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="classQCPColorGradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> </dd></dl>

</div>
</div>
<a id="a137b368ea8829a871974add6e4883c71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a137b368ea8829a871974add6e4883c71">&sect;&nbsp;</a></span>stopsUseAlpha()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool QCPColorGradient::stopsUseAlpha </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns true if the color gradient uses transparency, i.e. if any of the configured color stops has an alpha value below 255. </p>

</div>
</div>
<a id="a353f15ab3ab586eebf1f6b58c3e2707b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a353f15ab3ab586eebf1f6b58c3e2707b">&sect;&nbsp;</a></span>updateColorBuffer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::updateColorBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Updates the internal color buffer which will be used by <a class="el" href="classQCPColorGradient.html#aaf423ceb943e177b0ed2c48c811d83dc">colorize</a> and <a class="el" href="classQCPColorGradient.html#a0599545c859268b025d2060dea741cea">color</a>, to quickly convert positions to colors. This is where the interpolation between color stops is calculated. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/colorgradient.h</li>
<li>src/colorgradient.cpp</li>
</ul>
</div><!-- contents -->
</body>
</html>