This file is indexed.

/usr/share/gtk-doc/html/libgwydraw/GwyGradient.html is in libgwyddion20-doc 2.34-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gwyddion Drawing Library Reference Manual: GwyGradient</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Gwyddion Drawing Library Reference Manual">
<link rel="up" href="index.html" title="Gwyddion Drawing Library Reference Manual">
<link rel="prev" href="libgwydraw-GwyRGBA.html" title="GwyRGBA">
<link rel="next" href="GwyGLMaterial.html" title="GwyGLMaterial">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left">
<a href="#" class="shortcut">Top</a>
                   | 
                  <a href="#GwyGradient.description" class="shortcut">Description</a>
                   | 
                  <a href="#GwyGradient.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="libgwydraw-GwyRGBA.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GwyGLMaterial.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GwyGradient"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GwyGradient.top_of_page"></a>GwyGradient</span></h2>
<p>GwyGradient — A map from numbers to RGBA colors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GwyGradient.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libdraw/gwydraw.h&gt;

struct              <a class="link" href="GwyGradient.html#GwyGradient-struct" title="struct GwyGradient">GwyGradient</a>;
struct              <a class="link" href="GwyGradient.html#GwyGradientClass" title="struct GwyGradientClass">GwyGradientClass</a>;
#define             <a class="link" href="GwyGradient.html#GWY-GRADIENT-DEFAULT:CAPS" title="GWY_GRADIENT_DEFAULT">GWY_GRADIENT_DEFAULT</a>
                    <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint">GwyGradientPoint</a>;
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-get-color" title="gwy_gradient_get_color ()">gwy_gradient_get_color</a>              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgwydraw-GwyRGBA.html#GwyRGBA" title="GwyRGBA"><span class="type">GwyRGBA</span></a> *color</code></em>);
const <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#guchar"><span class="returnvalue">guchar</span></a> *      <a class="link" href="GwyGradient.html#gwy-gradient-get-samples" title="gwy_gradient_get_samples ()">gwy_gradient_get_samples</a>            (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *nsamples</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#guchar"><span class="returnvalue">guchar</span></a> *            <a class="link" href="GwyGradient.html#gwy-gradient-sample" title="gwy_gradient_sample ()">gwy_gradient_sample</a>                 (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nsamples</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *samples</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-sample-to-pixbuf" title="gwy_gradient_sample_to_pixbuf ()">gwy_gradient_sample_to_pixbuf</a>       (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GwyGradient.html#gwy-gradient-get-npoints" title="gwy_gradient_get_npoints ()">gwy_gradient_get_npoints</a>            (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>);
<a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="returnvalue">GwyGradientPoint</span></a>    <a class="link" href="GwyGradient.html#gwy-gradient-get-point" title="gwy_gradient_get_point ()">gwy_gradient_get_point</a>              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-set-point" title="gwy_gradient_set_point ()">gwy_gradient_set_point</a>              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-set-point-color" title="gwy_gradient_set_point_color ()">gwy_gradient_set_point_color</a>        (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="libgwydraw-GwyRGBA.html#GwyRGBA" title="GwyRGBA"><span class="type">GwyRGBA</span></a> *color</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-insert-point" title="gwy_gradient_insert_point ()">gwy_gradient_insert_point</a>           (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GwyGradient.html#gwy-gradient-insert-point-sorted" title="gwy_gradient_insert_point_sorted ()">gwy_gradient_insert_point_sorted</a>    (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-delete-point" title="gwy_gradient_delete_point ()">gwy_gradient_delete_point</a>           (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-reset" title="gwy_gradient_reset ()">gwy_gradient_reset</a>                  (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>);
const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="returnvalue">GwyGradientPoint</span></a> * <a class="link" href="GwyGradient.html#gwy-gradient-get-points" title="gwy_gradient_get_points ()">gwy_gradient_get_points</a>        (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *npoints</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-set-points" title="gwy_gradient_set_points ()">gwy_gradient_set_points</a>             (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> npoints</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *points</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GwyGradient.html#gwy-gradient-set-from-samples" title="gwy_gradient_set_from_samples ()">gwy_gradient_set_from_samples</a>       (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nsamples</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *samples</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> threshold</code></em>);
<a href="../libgwyddion/GwyInventory.html"><span class="returnvalue">GwyInventory</span></a> *      <a class="link" href="GwyGradient.html#gwy-gradients" title="gwy_gradients ()">gwy_gradients</a>                       (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="GwyGradient.html" title="GwyGradient"><span class="returnvalue">GwyGradient</span></a> *       <a class="link" href="GwyGradient.html#gwy-gradients-get-gradient" title="gwy_gradients_get_gradient ()">gwy_gradients_get_gradient</a>          (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GwyGradient.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----<a href="../libgwyddion/GwyResource.html">GwyResource</a>
         +----GwyGradient
</pre>
</div>
<div class="refsect1">
<a name="GwyGradient.description"></a><h2>Description</h2>
<p>
Gradient is a map from interval [0,1] to RGB(A) color space. Each gradient
is defined by an ordered set of color points, the first of them is always at
0.0, the last at 1.0 (thus each gradient must consist of at least two
points).  Between them, the color is interpolated.  Color points of
modifiable gradients (see <a href="../libgwyddion/GwyResource.html"><span class="type">GwyResource</span></a>) can be edited with functions like
<a class="link" href="GwyGradient.html#gwy-gradient-insert-point" title="gwy_gradient_insert_point ()"><code class="function">gwy_gradient_insert_point()</code></a>, <a class="link" href="GwyGradient.html#gwy-gradient-set-point-color" title="gwy_gradient_set_point_color ()"><code class="function">gwy_gradient_set_point_color()</code></a>, or
<a class="link" href="GwyGradient.html#gwy-gradient-set-points" title="gwy_gradient_set_points ()"><code class="function">gwy_gradient_set_points()</code></a>.
</p>
<p>
Gradient objects can be obtained from <a class="link" href="GwyGradient.html#gwy-gradients-get-gradient" title="gwy_gradients_get_gradient ()"><code class="function">gwy_gradients_get_gradient()</code></a>. New
gradients can be created with <a href="../libgwyddion/GwyInventory.html#gwy-inventory-new-item"><code class="function">gwy_inventory_new_item()</code></a> on the <a href="../libgwyddion/GwyInventory.html"><span class="type">GwyInventory</span></a>
returned by <a class="link" href="GwyGradient.html#gwy-gradients" title="gwy_gradients ()"><code class="function">gwy_gradients()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="GwyGradient.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GwyGradient-struct"></a><h3>struct GwyGradient</h3>
<pre class="programlisting">struct GwyGradient;</pre>
<p>
<a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> struct contains private data only and should be accessed
using the functions below.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GwyGradientClass"></a><h3>struct GwyGradientClass</h3>
<pre class="programlisting">struct GwyGradientClass;</pre>
<p>
<a class="link" href="GwyGradient.html#GwyGradientClass" title="struct GwyGradientClass"><span class="type">GwyGradientClass</span></a> does not contain any public members.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GWY-GRADIENT-DEFAULT:CAPS"></a><h3>GWY_GRADIENT_DEFAULT</h3>
<pre class="programlisting">#define GWY_GRADIENT_DEFAULT "Gray"
</pre>
<p>
The name of the default gray color gradient.
</p>
<p>
It is guaranteed to always exist.
</p>
<p>
Note this is not the same as user's default gradient which corresponds to
the default item in <a class="link" href="GwyGradient.html#gwy-gradients" title="gwy_gradients ()"><code class="function">gwy_gradients()</code></a> inventory and it changes over time.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GwyGradientPoint"></a><h3>GwyGradientPoint</h3>
<pre class="programlisting">typedef struct {
    gdouble x;
    GwyRGBA color;
} GwyGradientPoint;
</pre>
<p>
Gradient color point struct.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> <em class="structfield"><code><a name="GwyGradientPoint.x"></a>x</code></em>;</span></p></td>
<td>Color point position (in interval [0,1]).</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libgwydraw-GwyRGBA.html#GwyRGBA" title="GwyRGBA"><span class="type">GwyRGBA</span></a> <em class="structfield"><code><a name="GwyGradientPoint.color"></a>color</code></em>;</span></p></td>
<td>The color at position <em class="parameter"><code>x</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-get-color"></a><h3>gwy_gradient_get_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_get_color              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgwydraw-GwyRGBA.html#GwyRGBA" title="GwyRGBA"><span class="type">GwyRGBA</span></a> *color</code></em>);</pre>
<p>
Computes the color at a given position of a color gradient.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>Position in gradient, in range 0..1.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>Color to fill with interpolated color at position <em class="parameter"><code>x</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-get-samples"></a><h3>gwy_gradient_get_samples ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="returnvalue">guchar</span></a> *      gwy_gradient_get_samples            (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *nsamples</code></em>);</pre>
<p>
Returns color gradient sampled to integers in <span class="type">GdkPixbuf-like</span> scheme.
</p>
<p>
The returned samples are owned by <em class="parameter"><code>gradient</code></em> and must not be modified or
freed.  They are automatically updated when the gradient changes, although
their number never changes.  The returned pointer is valid only as long
as the gradient used, indicated by <a href="../libgwyddion/GwyResource.html#gwy-resource-use"><code class="function">gwy_resource_use()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient to get samples of.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nsamples</code></em> :</span></p></td>
<td>A location to store the number of samples (or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Sampled <em class="parameter"><code>gradient</code></em> as a sequence of <span class="type">GdkPixbuf-like</span> RRGGBBAA
quadruplets.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-sample"></a><h3>gwy_gradient_sample ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="returnvalue">guchar</span></a> *            gwy_gradient_sample                 (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nsamples</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *samples</code></em>);</pre>
<p>
Samples a gradient to an array <span class="type">GdkPixbuf-like</span> samples.
</p>
<p>
If <em class="parameter"><code>samples</code></em> is not <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, it's resized to 4*<em class="parameter"><code>nsamples</code></em> bytes, otherwise a
new buffer is allocated.
</p>
<p>
If you don't have a reason for specific sample size (and are not going
to modify the samples or otherwise dislike the automatic resampling on
gradient definition change), use <a class="link" href="GwyGradient.html#gwy-gradient-get-samples" title="gwy_gradient_get_samples ()"><code class="function">gwy_gradient_get_samples()</code></a> instead.
This function does not need the gradient to be in use, though.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient to sample.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nsamples</code></em> :</span></p></td>
<td>Required number of samples.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>samples</code></em> :</span></p></td>
<td>Pointer to array to be filled.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Sampled <em class="parameter"><code>gradient</code></em> as a sequence of <span class="type">GdkPixbuf-like</span> RRGGBBAA
quadruplets.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-sample-to-pixbuf"></a><h3>gwy_gradient_sample_to_pixbuf ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_sample_to_pixbuf       (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>);</pre>
<p>
Samples a color gradient to a provided pixbuf.
</p>
<p>
Unlike <a class="link" href="GwyGradient.html#gwy-gradient-sample" title="gwy_gradient_sample ()"><code class="function">gwy_gradient_sample()</code></a> which simply takes samples at equidistant
points this method uses supersampling and thus it gives a bit better
looking gradient presentation.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient to sample.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td>A pixbuf to sample gradient to (in horizontal direction).</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-get-npoints"></a><h3>gwy_gradient_get_npoints ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gwy_gradient_get_npoints            (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>);</pre>
<p>
Returns the number of points in a color gradient.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The number of points in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-get-point"></a><h3>gwy_gradient_get_point ()</h3>
<pre class="programlisting"><a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="returnvalue">GwyGradientPoint</span></a>    gwy_gradient_get_point              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>);</pre>
<p>
Returns the point at given index of a color gradient.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
<td>Color point index in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Color point at <em class="parameter"><code>index_</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-set-point"></a><h3>gwy_gradient_set_point ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_set_point              (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);</pre>
<p>
Sets a single color point in a color gradient.
</p>
<p>
It is an error to try to move points beyond its neighbours, or to move first
(or last) point from 0 (or 1).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
<td>Color point index in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>point</code></em> :</span></p></td>
<td>Color point to replace current point at <em class="parameter"><code>index_</code></em> with.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-set-point-color"></a><h3>gwy_gradient_set_point_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_set_point_color        (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="libgwydraw-GwyRGBA.html#GwyRGBA" title="GwyRGBA"><span class="type">GwyRGBA</span></a> *color</code></em>);</pre>
<p>
Sets the color of a color gradient point without moving it.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
<td>Color point index in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>Color to set the point to.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-insert-point"></a><h3>gwy_gradient_insert_point ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_insert_point           (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);</pre>
<p>
Inserts a point to a color gradient.
</p>
<p>
It is an error to try to position a outside its future neighbours, or to
move the first (or last) point from 0 (or 1).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
<td>Color point index in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>point</code></em> :</span></p></td>
<td>Color point to insert at <em class="parameter"><code>index_</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-insert-point-sorted"></a><h3>gwy_gradient_insert_point_sorted ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gwy_gradient_insert_point_sorted    (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *point</code></em>);</pre>
<p>
Inserts a point into a color gradient based on its x position.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>point</code></em> :</span></p></td>
<td>Color point to insert.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The index <em class="parameter"><code>point</code></em> was inserted at.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-delete-point"></a><h3>gwy_gradient_delete_point ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_delete_point           (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> index_</code></em>);</pre>
<p>
Deletes a point at given index in a color gradient.
</p>
<p>
It is not possible to delete points in gradients with less than 3 points.
First and last points should not be deleted unless there's another point
with <em class="parameter"><code>x</code></em> = 0 or <em class="parameter"><code>x</code></em> = 1 present.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
<td>Color point index in <em class="parameter"><code>gradient</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-reset"></a><h3>gwy_gradient_reset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_reset                  (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>);</pre>
<p>
Resets a gradient to the default two-point gray scale state.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-get-points"></a><h3>gwy_gradient_get_points ()</h3>
<pre class="programlisting">const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="returnvalue">GwyGradientPoint</span></a> * gwy_gradient_get_points        (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *npoints</code></em>);</pre>
<p>
Returns the complete set of color points of a gradient.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>npoints</code></em> :</span></p></td>
<td>A location to store the number of color points (or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Complete set <em class="parameter"><code>gradient</code></em>'s color points.  The returned array is
owned by <em class="parameter"><code>gradient</code></em> and must not be modified or freed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-set-points"></a><h3>gwy_gradient_set_points ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_set_points             (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> npoints</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GwyGradient.html#GwyGradientPoint" title="GwyGradientPoint"><span class="type">GwyGradientPoint</span></a> *points</code></em>);</pre>
<p>
Sets the complete color gradient definition to a given set of points.
</p>
<p>
The point positions should be ordered, and first point should start at 0.0,
last end at 1.0.  There should be no redundant points.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>npoints</code></em> :</span></p></td>
<td>The length of <em class="parameter"><code>points</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>Color points to set as new gradient definition.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradient-set-from-samples"></a><h3>gwy_gradient_set_from_samples ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gwy_gradient_set_from_samples       (<em class="parameter"><code><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="type">GwyGradient</span></a> *gradient</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> nsamples</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *samples</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> threshold</code></em>);</pre>
<p>
Reconstructs a color gradient definition from sampled colors.
</p>
<p>
The result is usually approximate.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gradient</code></em> :</span></p></td>
<td>A color gradient.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nsamples</code></em> :</span></p></td>
<td>Number of samples, it must be at least one.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>samples</code></em> :</span></p></td>
<td>Sampled color gradient in <span class="type">GdkPixbuf-like</span> RRGGBBAA form.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>threshold</code></em> :</span></p></td>
<td>Maximum allowed difference (for color components in range 0..1).
When negative, default value 1/80 suitable for most purposes
is used.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradients"></a><h3>gwy_gradients ()</h3>
<pre class="programlisting"><a href="../libgwyddion/GwyInventory.html"><span class="returnvalue">GwyInventory</span></a> *      gwy_gradients                       (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Gets inventory with all the gradients.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Gradient inventory.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-gradients-get-gradient"></a><h3>gwy_gradients_get_gradient ()</h3>
<pre class="programlisting"><a class="link" href="GwyGradient.html" title="GwyGradient"><span class="returnvalue">GwyGradient</span></a> *       gwy_gradients_get_gradient          (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>
Convenience function to get a gradient from <a class="link" href="GwyGradient.html#gwy-gradients" title="gwy_gradients ()"><code class="function">gwy_gradients()</code></a> by name.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>Gradient name.  May be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to get the default gradient.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Gradient identified by <em class="parameter"><code>name</code></em> or the default gradient if <em class="parameter"><code>name</code></em> does
not exist.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="GwyGradient.see-also"></a><h2>See Also</h2>
<a class="link" href="libgwydraw-gwypixfield.html" title="gwypixfield">gwypixfield</a> --
           Drawing data with gradients,
           <a href="../libgwyddion/GwyInventory.html"><span class="type">GwyInventory</span></a> -- the container holding all gradients,
           <a href="../libgwydgets/GwyDataView.html"><span class="type">GwyDataView</span></a> -- 2D data display widget,
           <a href="../libgwydgets/GwyColorAxis.html"><span class="type">GwyColorAxis</span></a> -- false color axis widget
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.19</div>
</body>
</html>