1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>cairo_pattern_t</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
<link rel="up" href="Drawing.html" title="Drawing">
9
<link rel="prev" href="cairo-Paths.html" title="Paths">
10
<link rel="next" href="cairo-Transformations.html" title="Transformations">
11
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="Drawing.html" title="Drawing">
14
<link rel="chapter" href="Fonts.html" title="Fonts">
15
<link rel="chapter" href="Surfaces.html" title="Surfaces">
16
<link rel="chapter" href="Support.html" title="Utilities">
17
<link rel="index" href="ix01.html" title="Index">
18
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
<link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="cairo-Paths.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="Drawing.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
31
<td><a accesskey="n" href="cairo-Transformations.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cairo-Patterns.synopsis" class="shortcut">Top</a>
35
<a href="#cairo-Patterns.description" class="shortcut">Description</a></nobr></td></tr>
37
<div class="refentry" lang="en">
38
<a name="cairo-Patterns"></a><div class="titlepage"></div>
39
<div class="refnamediv"><table width="100%"><tr>
41
<h2><span class="refentrytitle"><a name="cairo-Patterns.top_of_page"></a>cairo_pattern_t</span></h2>
42
<p>cairo_pattern_t — Sources for drawing</p>
44
<td valign="top" align="right"></td>
46
<div class="refsynopsisdiv">
47
<a name="cairo-Patterns.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
typedef <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>;
50
void <a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgb" title="cairo_pattern_add_color_stop_rgb ()">cairo_pattern_add_color_stop_rgb</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
55
void <a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgba" title="cairo_pattern_add_color_stop_rgba ()">cairo_pattern_add_color_stop_rgba</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
61
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-color-stop-count" title="cairo_pattern_get_color_stop_count ()">cairo_pattern_get_color_stop_count</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
63
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-color-stop-rgba" title="cairo_pattern_get_color_stop_rgba ()">cairo_pattern_get_color_stop_rgba</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
70
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-create-rgb" title="cairo_pattern_create_rgb ()">cairo_pattern_create_rgb</a> (double red,
73
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-create-rgba" title="cairo_pattern_create_rgba ()">cairo_pattern_create_rgba</a> (double red,
77
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-rgba" title="cairo_pattern_get_rgba ()">cairo_pattern_get_rgba</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
82
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-create-for-surface" title="cairo_pattern_create_for_surface ()">cairo_pattern_create_for_surface</a> (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t">cairo_surface_t</a> *surface);
83
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-surface" title="cairo_pattern_get_surface ()">cairo_pattern_get_surface</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
84
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t">cairo_surface_t</a> **surface);
85
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-create-linear" title="cairo_pattern_create_linear ()">cairo_pattern_create_linear</a> (double x0,
89
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-linear-points" title="cairo_pattern_get_linear_points ()">cairo_pattern_get_linear_points</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
94
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-create-radial" title="cairo_pattern_create_radial ()">cairo_pattern_create_radial</a> (double cx0,
100
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-radial-circles" title="cairo_pattern_get_radial_circles ()">cairo_pattern_get_radial_circles</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
107
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* <a class="link" href="cairo-Patterns.html#cairo-pattern-reference" title="cairo_pattern_reference ()">cairo_pattern_reference</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
108
void <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()">cairo_pattern_destroy</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
109
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()">cairo_pattern_status</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
110
enum <a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t">cairo_extend_t</a>;
111
void <a class="link" href="cairo-Patterns.html#cairo-pattern-set-extend" title="cairo_pattern_set_extend ()">cairo_pattern_set_extend</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
112
<a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t">cairo_extend_t</a> extend);
113
<a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t">cairo_extend_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-extend" title="cairo_pattern_get_extend ()">cairo_pattern_get_extend</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
114
enum <a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t">cairo_filter_t</a>;
115
void <a class="link" href="cairo-Patterns.html#cairo-pattern-set-filter" title="cairo_pattern_set_filter ()">cairo_pattern_set_filter</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
116
<a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t">cairo_filter_t</a> filter);
117
<a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t">cairo_filter_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-filter" title="cairo_pattern_get_filter ()">cairo_pattern_get_filter</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
118
void <a class="link" href="cairo-Patterns.html#cairo-pattern-set-matrix" title="cairo_pattern_set_matrix ()">cairo_pattern_set_matrix</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
119
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
120
void <a class="link" href="cairo-Patterns.html#cairo-pattern-get-matrix" title="cairo_pattern_get_matrix ()">cairo_pattern_get_matrix</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
121
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
122
enum <a class="link" href="cairo-Patterns.html#cairo-pattern-type-t" title="enum cairo_pattern_type_t">cairo_pattern_type_t</a>;
123
<a class="link" href="cairo-Patterns.html#cairo-pattern-type-t" title="enum cairo_pattern_type_t">cairo_pattern_type_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-get-type" title="cairo_pattern_get_type ()">cairo_pattern_get_type</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
124
unsigned int <a class="link" href="cairo-Patterns.html#cairo-pattern-get-reference-count" title="cairo_pattern_get_reference_count ()">cairo_pattern_get_reference_count</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);
125
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-Patterns.html#cairo-pattern-set-user-data" title="cairo_pattern_set_user_data ()">cairo_pattern_set_user_data</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
126
const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t">cairo_user_data_key_t</a> *key,
128
<a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()">cairo_destroy_func_t</a> destroy);
129
void* <a class="link" href="cairo-Patterns.html#cairo-pattern-get-user-data" title="cairo_pattern_get_user_data ()">cairo_pattern_get_user_data</a> (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
130
const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t">cairo_user_data_key_t</a> *key);
133
<div class="refsect1" lang="en">
134
<a name="cairo-Patterns.description"></a><h2>Description</h2>
136
<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> is the paint with which cairo draws.
137
The primary use of patterns is as the source for all cairo drawing operations,
138
although they can also be used as masks, that is, as the brush too.
141
A cairo pattern is created by using one of the many constructors,
142
of the form cairo_pattern_create_<span class="emphasis"><em>type</em></span>()
143
or implicitly through
144
cairo_set_source_<span class="emphasis"><em>type</em></span>() functions.
147
<div class="refsect1" lang="en">
148
<a name="cairo-Patterns.details"></a><h2>Details</h2>
149
<div class="refsect2" lang="en">
150
<a name="cairo-pattern-t"></a><h3>cairo_pattern_t</h3>
151
<pre class="programlisting">typedef struct _cairo_pattern cairo_pattern_t;
154
A <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> represents a source when drawing onto a
155
surface. There are different subtypes of <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>,
156
for different types of sources; for example,
157
<a class="link" href="cairo-Patterns.html#cairo-pattern-create-rgb" title="cairo_pattern_create_rgb ()"><code class="function">cairo_pattern_create_rgb()</code></a> creates a pattern for a solid
161
Other than various cairo_pattern_create_<span class="emphasis"><em>type</em></span>()
162
functions, some of the pattern types can be implicitly created
163
using various cairo_set_source_<span class="emphasis"><em>type</em></span>() functions;
164
for example <a class="link" href="cairo-cairo-t.html#cairo-set-source-rgb" title="cairo_set_source_rgb ()"><code class="function">cairo_set_source_rgb()</code></a>.
167
The type of a pattern can be queried with <a class="link" href="cairo-Patterns.html#cairo-pattern-get-type" title="cairo_pattern_get_type ()"><code class="function">cairo_pattern_get_type()</code></a>.
170
Memory management of <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> is done with
171
<a class="link" href="cairo-Patterns.html#cairo-pattern-reference" title="cairo_pattern_reference ()"><code class="function">cairo_pattern_reference()</code></a> and <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a>.</p>
177
<div class="refsect2" lang="en">
178
<a name="cairo-pattern-add-color-stop-rgb"></a><h3>cairo_pattern_add_color_stop_rgb ()</h3>
179
<pre class="programlisting">void cairo_pattern_add_color_stop_rgb (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
185
Adds an opaque color stop to a gradient pattern. The offset
186
specifies the location along the gradient's control vector. For
187
example, a linear gradient's control vector is from (x0,y0) to
188
(x1,y1) while a radial gradient's control vector is from any point
189
on the start circle to the corresponding point on the end circle.
192
The color is specified in the same way as in <a class="link" href="cairo-cairo-t.html#cairo-set-source-rgb" title="cairo_set_source_rgb ()"><code class="function">cairo_set_source_rgb()</code></a>.
195
If two (or more) stops are specified with identical offset values,
196
they will be sorted according to the order in which the stops are
197
added, (stops added earlier will compare less than stops added
198
later). This can be useful for reliably making sharp color
199
transitions instead of the typical blend.
202
Note: If the pattern is not a gradient pattern, (eg. a linear or
203
radial pattern), then the pattern will be put into an error status
204
with a status of <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a>.</p>
208
<div class="variablelist"><table border="0">
209
<col align="left" valign="top">
212
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
213
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
217
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
218
<td> an offset in the range [0.0 .. 1.0]
222
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
223
<td> red component of color
227
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
228
<td> green component of color
232
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
233
<td> blue component of color
240
<div class="refsect2" lang="en">
241
<a name="cairo-pattern-add-color-stop-rgba"></a><h3>cairo_pattern_add_color_stop_rgba ()</h3>
242
<pre class="programlisting">void cairo_pattern_add_color_stop_rgba (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
249
Adds a translucent color stop to a gradient pattern. The offset
250
specifies the location along the gradient's control vector. For
251
example, a linear gradient's control vector is from (x0,y0) to
252
(x1,y1) while a radial gradient's control vector is from any point
253
on the start circle to the corresponding point on the end circle.
256
The color is specified in the same way as in <a class="link" href="cairo-cairo-t.html#cairo-set-source-rgba" title="cairo_set_source_rgba ()"><code class="function">cairo_set_source_rgba()</code></a>.
259
If two (or more) stops are specified with identical offset values,
260
they will be sorted according to the order in which the stops are
261
added, (stops added earlier will compare less than stops added
262
later). This can be useful for reliably making sharp color
263
transitions instead of the typical blend.
266
Note: If the pattern is not a gradient pattern, (eg. a linear or
267
radial pattern), then the pattern will be put into an error status
268
with a status of <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a>.</p>
272
<div class="variablelist"><table border="0">
273
<col align="left" valign="top">
276
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
277
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
281
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
282
<td> an offset in the range [0.0 .. 1.0]
286
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
287
<td> red component of color
291
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
292
<td> green component of color
296
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
297
<td> blue component of color
301
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
302
<td> alpha component of color
309
<div class="refsect2" lang="en">
310
<a name="cairo-pattern-get-color-stop-count"></a><h3>cairo_pattern_get_color_stop_count ()</h3>
311
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_color_stop_count (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
314
Gets the number of color stops specified in the given gradient
319
<div class="variablelist"><table border="0">
320
<col align="left" valign="top">
323
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
324
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
328
<td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
329
<td> return value for the number of color stops, or <a
330
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
331
><code class="literal">NULL</code></a>
335
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
336
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or
337
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> if <em class="parameter"><code>pattern</code></em> is not a gradient
344
<p class="since">Since 1.4
348
<div class="refsect2" lang="en">
349
<a name="cairo-pattern-get-color-stop-rgba"></a><h3>cairo_pattern_get_color_stop_rgba ()</h3>
350
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_color_stop_rgba (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
356
double *alpha);</pre>
358
Gets the color and offset information at the given <em class="parameter"><code>index</code></em> for a
359
gradient pattern. Values of <em class="parameter"><code>index</code></em> are 0 to 1 less than the number
360
returned by <a class="link" href="cairo-Patterns.html#cairo-pattern-get-color-stop-count" title="cairo_pattern_get_color_stop_count ()"><code class="function">cairo_pattern_get_color_stop_count()</code></a>.</p>
364
<div class="variablelist"><table border="0">
365
<col align="left" valign="top">
368
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
369
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
373
<td><p><span class="term"><em class="parameter"><code>index</code></em> :</span></p></td>
374
<td> index of the stop to return data for
378
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
379
<td> return value for the offset of the stop, or <a
380
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
381
><code class="literal">NULL</code></a>
385
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
386
<td> return value for red component of color, or <a
387
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
388
><code class="literal">NULL</code></a>
392
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
393
<td> return value for green component of color, or <a
394
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
395
><code class="literal">NULL</code></a>
399
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
400
<td> return value for blue component of color, or <a
401
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
402
><code class="literal">NULL</code></a>
406
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
407
<td> return value for alpha component of color, or <a
408
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
409
><code class="literal">NULL</code></a>
413
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
414
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-INVALID-INDEX:CAPS"><code class="literal">CAIRO_STATUS_INVALID_INDEX</code></a>
415
if <em class="parameter"><code>index</code></em> is not valid for the given pattern. If the pattern is
416
not a gradient pattern, <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> is
423
<p class="since">Since 1.4
427
<div class="refsect2" lang="en">
428
<a name="cairo-pattern-create-rgb"></a><h3>cairo_pattern_create_rgb ()</h3>
429
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_create_rgb (double red,
433
Creates a new <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> corresponding to an opaque color. The
434
color components are floating point numbers in the range 0 to 1.
435
If the values passed in are outside that range, they will be
440
<div class="variablelist"><table border="0">
441
<col align="left" valign="top">
444
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
445
<td> red component of the color
449
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
450
<td> green component of the color
454
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
455
<td> blue component of the color
459
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
460
<td> the newly created <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> if successful, or
461
an error pattern in case of no memory. The caller owns the
462
returned object and should call <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when
465
This function will always return a valid pointer, but if an error
466
occurred the pattern status will be set to an error. To inspect
467
the status of a pattern use <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()"><code class="function">cairo_pattern_status()</code></a>.
474
<div class="refsect2" lang="en">
475
<a name="cairo-pattern-create-rgba"></a><h3>cairo_pattern_create_rgba ()</h3>
476
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_create_rgba (double red,
481
Creates a new <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> corresponding to a translucent color.
482
The color components are floating point numbers in the range 0 to
483
1. If the values passed in are outside that range, they will be
488
<div class="variablelist"><table border="0">
489
<col align="left" valign="top">
492
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
493
<td> red component of the color
497
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
498
<td> green component of the color
502
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
503
<td> blue component of the color
507
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
508
<td> alpha component of the color
512
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
513
<td> the newly created <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> if successful, or
514
an error pattern in case of no memory. The caller owns the
515
returned object and should call <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when
518
This function will always return a valid pointer, but if an error
519
occurred the pattern status will be set to an error. To inspect
520
the status of a pattern use <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()"><code class="function">cairo_pattern_status()</code></a>.
527
<div class="refsect2" lang="en">
528
<a name="cairo-pattern-get-rgba"></a><h3>cairo_pattern_get_rgba ()</h3>
529
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_rgba (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
533
double *alpha);</pre>
535
Gets the solid color for a solid color pattern.</p>
539
<div class="variablelist"><table border="0">
540
<col align="left" valign="top">
543
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
544
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
548
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
549
<td> return value for red component of color, or <a
550
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
551
><code class="literal">NULL</code></a>
555
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
556
<td> return value for green component of color, or <a
557
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
558
><code class="literal">NULL</code></a>
562
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
563
<td> return value for blue component of color, or <a
564
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
565
><code class="literal">NULL</code></a>
569
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
570
<td> return value for alpha component of color, or <a
571
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
572
><code class="literal">NULL</code></a>
576
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
577
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or
578
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> if the pattern is not a solid
585
<p class="since">Since 1.4
589
<div class="refsect2" lang="en">
590
<a name="cairo-pattern-create-for-surface"></a><h3>cairo_pattern_create_for_surface ()</h3>
591
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_create_for_surface (<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t">cairo_surface_t</a> *surface);</pre>
593
Create a new <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> for the given surface.</p>
597
<div class="variablelist"><table border="0">
598
<col align="left" valign="top">
601
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
606
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
607
<td> the newly created <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> if successful, or
608
an error pattern in case of no memory. The caller owns the
609
returned object and should call <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when
612
This function will always return a valid pointer, but if an error
613
occurred the pattern status will be set to an error. To inspect
614
the status of a pattern use <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()"><code class="function">cairo_pattern_status()</code></a>.
621
<div class="refsect2" lang="en">
622
<a name="cairo-pattern-get-surface"></a><h3>cairo_pattern_get_surface ()</h3>
623
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_surface (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
624
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t">cairo_surface_t</a> **surface);</pre>
626
Gets the surface of a surface pattern. The reference returned in
627
<em class="parameter"><code>surface</code></em> is owned by the pattern; the caller should call
628
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-reference" title="cairo_surface_reference ()"><code class="function">cairo_surface_reference()</code></a> if the surface is to be retained.</p>
632
<div class="variablelist"><table border="0">
633
<col align="left" valign="top">
636
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
637
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
641
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
642
<td> return value for surface of pattern, or <a
643
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
644
><code class="literal">NULL</code></a>
648
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
649
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or
650
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> if the pattern is not a surface
657
<p class="since">Since 1.4
661
<div class="refsect2" lang="en">
662
<a name="cairo-pattern-create-linear"></a><h3>cairo_pattern_create_linear ()</h3>
663
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_create_linear (double x0,
668
Create a new linear gradient <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> along the line defined
669
by (x0, y0) and (x1, y1). Before using the gradient pattern, a
670
number of color stops should be defined using
671
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgb" title="cairo_pattern_add_color_stop_rgb ()"><code class="function">cairo_pattern_add_color_stop_rgb()</code></a> or
672
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgba" title="cairo_pattern_add_color_stop_rgba ()"><code class="function">cairo_pattern_add_color_stop_rgba()</code></a>.
675
Note: The coordinates here are in pattern space. For a new pattern,
676
pattern space is identical to user space, but the relationship
677
between the spaces can be changed with <a class="link" href="cairo-Patterns.html#cairo-pattern-set-matrix" title="cairo_pattern_set_matrix ()"><code class="function">cairo_pattern_set_matrix()</code></a>.</p>
681
<div class="variablelist"><table border="0">
682
<col align="left" valign="top">
685
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
686
<td> x coordinate of the start point
690
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
691
<td> y coordinate of the start point
695
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
696
<td> x coordinate of the end point
700
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
701
<td> y coordinate of the end point
705
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
706
<td> the newly created <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> if successful, or
707
an error pattern in case of no memory. The caller owns the
708
returned object and should call <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when
711
This function will always return a valid pointer, but if an error
712
occurred the pattern status will be set to an error. To inspect
713
the status of a pattern use <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()"><code class="function">cairo_pattern_status()</code></a>.
720
<div class="refsect2" lang="en">
721
<a name="cairo-pattern-get-linear-points"></a><h3>cairo_pattern_get_linear_points ()</h3>
722
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_linear_points (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
728
Gets the gradient endpoints for a linear gradient.</p>
732
<div class="variablelist"><table border="0">
733
<col align="left" valign="top">
736
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
737
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
741
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
742
<td> return value for the x coordinate of the first point, or <a
743
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
744
><code class="literal">NULL</code></a>
748
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
749
<td> return value for the y coordinate of the first point, or <a
750
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
751
><code class="literal">NULL</code></a>
755
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
756
<td> return value for the x coordinate of the second point, or <a
757
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
758
><code class="literal">NULL</code></a>
762
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
763
<td> return value for the y coordinate of the second point, or <a
764
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
765
><code class="literal">NULL</code></a>
769
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
770
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or
771
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> if <em class="parameter"><code>pattern</code></em> is not a linear
778
<p class="since">Since 1.4
782
<div class="refsect2" lang="en">
783
<a name="cairo-pattern-create-radial"></a><h3>cairo_pattern_create_radial ()</h3>
784
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_create_radial (double cx0,
789
double radius1);</pre>
791
Creates a new radial gradient <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> between the two
792
circles defined by (cx0, cy0, radius0) and (cx1, cy1, radius1). Before using the
793
gradient pattern, a number of color stops should be defined using
794
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgb" title="cairo_pattern_add_color_stop_rgb ()"><code class="function">cairo_pattern_add_color_stop_rgb()</code></a> or
795
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgba" title="cairo_pattern_add_color_stop_rgba ()"><code class="function">cairo_pattern_add_color_stop_rgba()</code></a>.
798
Note: The coordinates here are in pattern space. For a new pattern,
799
pattern space is identical to user space, but the relationship
800
between the spaces can be changed with <a class="link" href="cairo-Patterns.html#cairo-pattern-set-matrix" title="cairo_pattern_set_matrix ()"><code class="function">cairo_pattern_set_matrix()</code></a>.</p>
804
<div class="variablelist"><table border="0">
805
<col align="left" valign="top">
808
<td><p><span class="term"><em class="parameter"><code>cx0</code></em> :</span></p></td>
809
<td> x coordinate for the center of the start circle
813
<td><p><span class="term"><em class="parameter"><code>cy0</code></em> :</span></p></td>
814
<td> y coordinate for the center of the start circle
818
<td><p><span class="term"><em class="parameter"><code>radius0</code></em> :</span></p></td>
819
<td> radius of the start circle
823
<td><p><span class="term"><em class="parameter"><code>cx1</code></em> :</span></p></td>
824
<td> x coordinate for the center of the end circle
828
<td><p><span class="term"><em class="parameter"><code>cy1</code></em> :</span></p></td>
829
<td> y coordinate for the center of the end circle
833
<td><p><span class="term"><em class="parameter"><code>radius1</code></em> :</span></p></td>
834
<td> radius of the end circle
838
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
839
<td> the newly created <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> if successful, or
840
an error pattern in case of no memory. The caller owns the
841
returned object and should call <a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when
844
This function will always return a valid pointer, but if an error
845
occurred the pattern status will be set to an error. To inspect
846
the status of a pattern use <a class="link" href="cairo-Patterns.html#cairo-pattern-status" title="cairo_pattern_status ()"><code class="function">cairo_pattern_status()</code></a>.
853
<div class="refsect2" lang="en">
854
<a name="cairo-pattern-get-radial-circles"></a><h3>cairo_pattern_get_radial_circles ()</h3>
855
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_get_radial_circles (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
863
Gets the gradient endpoint circles for a radial gradient, each
864
specified as a center coordinate and a radius.</p>
868
<div class="variablelist"><table border="0">
869
<col align="left" valign="top">
872
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
873
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
877
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
878
<td> return value for the x coordinate of the center of the first circle, or <a
879
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
880
><code class="literal">NULL</code></a>
884
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
885
<td> return value for the y coordinate of the center of the first circle, or <a
886
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
887
><code class="literal">NULL</code></a>
891
<td><p><span class="term"><em class="parameter"><code>r0</code></em> :</span></p></td>
892
<td> return value for the radius of the first circle, or <a
893
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
894
><code class="literal">NULL</code></a>
898
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
899
<td> return value for the x coordinate of the center of the second circle, or <a
900
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
901
><code class="literal">NULL</code></a>
905
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
906
<td> return value for the y coordinate of the center of the second circle, or <a
907
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
908
><code class="literal">NULL</code></a>
912
<td><p><span class="term"><em class="parameter"><code>r1</code></em> :</span></p></td>
913
<td> return value for the radius of the second circle, or <a
914
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
915
><code class="literal">NULL</code></a>
919
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
920
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, or
921
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a> if <em class="parameter"><code>pattern</code></em> is not a radial
928
<p class="since">Since 1.4
932
<div class="refsect2" lang="en">
933
<a name="cairo-pattern-reference"></a><h3>cairo_pattern_reference ()</h3>
934
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a>* cairo_pattern_reference (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
936
Increases the reference count on <em class="parameter"><code>pattern</code></em> by one. This prevents
937
<em class="parameter"><code>pattern</code></em> from being destroyed until a matching call to
938
<a class="link" href="cairo-Patterns.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> is made.
941
The number of references to a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> can be get using
942
<a class="link" href="cairo-Patterns.html#cairo-pattern-get-reference-count" title="cairo_pattern_get_reference_count ()"><code class="function">cairo_pattern_get_reference_count()</code></a>.</p>
946
<div class="variablelist"><table border="0">
947
<col align="left" valign="top">
950
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
951
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
955
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
956
<td> the referenced <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>.
963
<div class="refsect2" lang="en">
964
<a name="cairo-pattern-destroy"></a><h3>cairo_pattern_destroy ()</h3>
965
<pre class="programlisting">void cairo_pattern_destroy (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
967
Decreases the reference count on <em class="parameter"><code>pattern</code></em> by one. If the result is
968
zero, then <em class="parameter"><code>pattern</code></em> and all associated resources are freed. See
969
<a class="link" href="cairo-Patterns.html#cairo-pattern-reference" title="cairo_pattern_reference ()"><code class="function">cairo_pattern_reference()</code></a>.</p>
973
<div class="variablelist"><table border="0">
974
<col align="left" valign="top">
976
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
977
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
983
<div class="refsect2" lang="en">
984
<a name="cairo-pattern-status"></a><h3>cairo_pattern_status ()</h3>
985
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_status (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
987
Checks whether an error has previously occurred for this
992
<div class="variablelist"><table border="0">
993
<col align="left" valign="top">
996
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
997
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1001
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1002
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>, <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>, or
1003
<a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-PATTERN-TYPE-MISMATCH:CAPS"><code class="literal">CAIRO_STATUS_PATTERN_TYPE_MISMATCH</code></a>.
1010
<div class="refsect2" lang="en">
1011
<a name="cairo-extend-t"></a><h3>enum cairo_extend_t</h3>
1012
<pre class="programlisting">typedef enum _cairo_extend {
1014
CAIRO_EXTEND_REPEAT,
1015
CAIRO_EXTEND_REFLECT,
1020
<a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t"><span class="type">cairo_extend_t</span></a> is used to describe how pattern color/alpha will be
1021
determined for areas "outside" the pattern's natural area, (for
1022
example, outside the surface bounds or outside the gradient
1026
The default extend mode is <a class="link" href="cairo-Patterns.html#CAIRO-EXTEND-NONE:CAPS"><code class="literal">CAIRO_EXTEND_NONE</code></a> for surface patterns
1027
and <a class="link" href="cairo-Patterns.html#CAIRO-EXTEND-PAD:CAPS"><code class="literal">CAIRO_EXTEND_PAD</code></a> for gradient patterns.
1030
New entries may be added in future versions.</p>
1034
<div class="variablelist"><table border="0">
1035
<col align="left" valign="top">
1038
<td><p><a name="CAIRO-EXTEND-NONE:CAPS"></a><span class="term"><code class="literal">CAIRO_EXTEND_NONE</code></span></p></td>
1039
<td> pixels outside of the source pattern
1040
are fully transparent
1044
<td><p><a name="CAIRO-EXTEND-REPEAT:CAPS"></a><span class="term"><code class="literal">CAIRO_EXTEND_REPEAT</code></span></p></td>
1045
<td> the pattern is tiled by repeating
1049
<td><p><a name="CAIRO-EXTEND-REFLECT:CAPS"></a><span class="term"><code class="literal">CAIRO_EXTEND_REFLECT</code></span></p></td>
1050
<td> the pattern is tiled by reflecting
1051
at the edges (Implemented for surface patterns since 1.6)
1055
<td><p><a name="CAIRO-EXTEND-PAD:CAPS"></a><span class="term"><code class="literal">CAIRO_EXTEND_PAD</code></span></p></td>
1056
<td> pixels outside of the pattern copy
1057
the closest pixel from the source (Since 1.2; but only
1058
implemented for surface patterns since 1.6)
1065
<div class="refsect2" lang="en">
1066
<a name="cairo-pattern-set-extend"></a><h3>cairo_pattern_set_extend ()</h3>
1067
<pre class="programlisting">void cairo_pattern_set_extend (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1068
<a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t">cairo_extend_t</a> extend);</pre>
1070
Sets the mode to be used for drawing outside the area of a pattern.
1071
See <a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t"><span class="type">cairo_extend_t</span></a> for details on the semantics of each extend
1075
The default extend mode is <a class="link" href="cairo-Patterns.html#CAIRO-EXTEND-NONE:CAPS"><code class="literal">CAIRO_EXTEND_NONE</code></a> for surface patterns
1076
and <a class="link" href="cairo-Patterns.html#CAIRO-EXTEND-PAD:CAPS"><code class="literal">CAIRO_EXTEND_PAD</code></a> for gradient patterns.</p>
1080
<div class="variablelist"><table border="0">
1081
<col align="left" valign="top">
1084
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1085
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1089
<td><p><span class="term"><em class="parameter"><code>extend</code></em> :</span></p></td>
1090
<td> a <a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t"><span class="type">cairo_extend_t</span></a> describing how the area outside of the
1091
pattern will be drawn
1098
<div class="refsect2" lang="en">
1099
<a name="cairo-pattern-get-extend"></a><h3>cairo_pattern_get_extend ()</h3>
1100
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t">cairo_extend_t</a> cairo_pattern_get_extend (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
1102
Gets the current extend mode for a pattern. See <a class="link" href="cairo-Patterns.html#cairo-extend-t" title="enum cairo_extend_t"><span class="type">cairo_extend_t</span></a>
1103
for details on the semantics of each extend strategy.</p>
1107
<div class="variablelist"><table border="0">
1108
<col align="left" valign="top">
1111
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1112
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1116
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1117
<td> the current extend strategy used for drawing the
1125
<div class="refsect2" lang="en">
1126
<a name="cairo-filter-t"></a><h3>enum cairo_filter_t</h3>
1127
<pre class="programlisting">typedef enum _cairo_filter {
1131
CAIRO_FILTER_NEAREST,
1132
CAIRO_FILTER_BILINEAR,
1133
CAIRO_FILTER_GAUSSIAN
1137
<a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t"><span class="type">cairo_filter_t</span></a> is used to indicate what filtering should be
1138
applied when reading pixel values from patterns. See
1139
<code class="function">cairo_pattern_set_source()</code> for indicating the desired filter to be
1140
used with a particular pattern.</p>
1144
<div class="variablelist"><table border="0">
1145
<col align="left" valign="top">
1148
<td><p><a name="CAIRO-FILTER-FAST:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_FAST</code></span></p></td>
1149
<td> A high-performance filter, with quality similar
1150
to <a class="link" href="cairo-Patterns.html#CAIRO-FILTER-NEAREST:CAPS"><code class="literal">CAIRO_FILTER_NEAREST</code></a>
1154
<td><p><a name="CAIRO-FILTER-GOOD:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_GOOD</code></span></p></td>
1155
<td> A reasonable-performance filter, with quality
1156
similar to <a class="link" href="cairo-Patterns.html#CAIRO-FILTER-BILINEAR:CAPS"><code class="literal">CAIRO_FILTER_BILINEAR</code></a>
1160
<td><p><a name="CAIRO-FILTER-BEST:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_BEST</code></span></p></td>
1161
<td> The highest-quality available, performance may
1162
not be suitable for interactive use.
1166
<td><p><a name="CAIRO-FILTER-NEAREST:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_NEAREST</code></span></p></td>
1167
<td> Nearest-neighbor filtering
1171
<td><p><a name="CAIRO-FILTER-BILINEAR:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_BILINEAR</code></span></p></td>
1172
<td> Linear interpolation in two dimensions
1176
<td><p><a name="CAIRO-FILTER-GAUSSIAN:CAPS"></a><span class="term"><code class="literal">CAIRO_FILTER_GAUSSIAN</code></span></p></td>
1177
<td> This filter value is currently
1178
unimplemented, and should not be used in current code.
1185
<div class="refsect2" lang="en">
1186
<a name="cairo-pattern-set-filter"></a><h3>cairo_pattern_set_filter ()</h3>
1187
<pre class="programlisting">void cairo_pattern_set_filter (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1188
<a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t">cairo_filter_t</a> filter);</pre>
1190
Sets the filter to be used for resizing when using this pattern.
1191
See <a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t"><span class="type">cairo_filter_t</span></a> for details on each filter.
1194
* Note that you might want to control filtering even when you do not
1195
have an explicit <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> object, (for example when using
1196
<a class="link" href="cairo-cairo-t.html#cairo-set-source-surface" title="cairo_set_source_surface ()"><code class="function">cairo_set_source_surface()</code></a>). In these cases, it is convenient to
1197
use <a class="link" href="cairo-cairo-t.html#cairo-get-source" title="cairo_get_source ()"><code class="function">cairo_get_source()</code></a> to get access to the pattern that cairo
1198
creates implicitly. For example:
1202
<div class="informalexample"><pre class="programlisting">
1203
cairo_set_source_surface (cr, image, x, y);
1204
cairo_pattern_set_filter (cairo_get_source (cr), %CAIRO_FILTER_NEAREST);
1209
<div class="variablelist"><table border="0">
1210
<col align="left" valign="top">
1213
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1214
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1218
<td><p><span class="term"><em class="parameter"><code>filter</code></em> :</span></p></td>
1219
<td> a <a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t"><span class="type">cairo_filter_t</span></a> describing the filter to use for resizing
1227
<div class="refsect2" lang="en">
1228
<a name="cairo-pattern-get-filter"></a><h3>cairo_pattern_get_filter ()</h3>
1229
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t">cairo_filter_t</a> cairo_pattern_get_filter (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
1231
Gets the current filter for a pattern. See <a class="link" href="cairo-Patterns.html#cairo-filter-t" title="enum cairo_filter_t"><span class="type">cairo_filter_t</span></a>
1232
for details on each filter.</p>
1236
<div class="variablelist"><table border="0">
1237
<col align="left" valign="top">
1240
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1241
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1245
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1246
<td> the current filter used for resizing the pattern.
1253
<div class="refsect2" lang="en">
1254
<a name="cairo-pattern-set-matrix"></a><h3>cairo_pattern_set_matrix ()</h3>
1255
<pre class="programlisting">void cairo_pattern_set_matrix (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1256
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
1258
Sets the pattern's transformation matrix to <em class="parameter"><code>matrix</code></em>. This matrix is
1259
a transformation from user space to pattern space.
1262
When a pattern is first created it always has the identity matrix
1263
for its transformation matrix, which means that pattern space is
1264
initially identical to user space.
1267
Important: Please note that the direction of this transformation
1268
matrix is from user space to pattern space. This means that if you
1269
imagine the flow from a pattern to user space (and on to device
1270
space), then coordinates in that flow will be transformed by the
1271
inverse of the pattern matrix.
1274
For example, if you want to make a pattern appear twice as large as
1275
it does by default the correct code to use is:
1279
<div class="informalexample"><pre class="programlisting">
1280
cairo_matrix_init_scale (&matrix, 0.5, 0.5);
1281
cairo_pattern_set_matrix (pattern, &matrix);
1286
Meanwhile, using values of 2.0 rather than 0.5 in the code above
1287
would cause the pattern to appear at half of its default size.
1290
Also, please note the discussion of the user-space locking
1291
semantics of <a class="link" href="cairo-cairo-t.html#cairo-set-source" title="cairo_set_source ()"><code class="function">cairo_set_source()</code></a>.</p>
1295
<div class="variablelist"><table border="0">
1296
<col align="left" valign="top">
1299
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1300
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1304
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
1305
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
1312
<div class="refsect2" lang="en">
1313
<a name="cairo-pattern-get-matrix"></a><h3>cairo_pattern_get_matrix ()</h3>
1314
<pre class="programlisting">void cairo_pattern_get_matrix (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1315
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
1317
Stores the pattern's transformation matrix into <em class="parameter"><code>matrix</code></em>.</p>
1321
<div class="variablelist"><table border="0">
1322
<col align="left" valign="top">
1325
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1326
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1330
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
1331
<td> return value for the matrix
1338
<div class="refsect2" lang="en">
1339
<a name="cairo-pattern-type-t"></a><h3>enum cairo_pattern_type_t</h3>
1340
<pre class="programlisting">typedef enum _cairo_pattern_type {
1341
CAIRO_PATTERN_TYPE_SOLID,
1342
CAIRO_PATTERN_TYPE_SURFACE,
1343
CAIRO_PATTERN_TYPE_LINEAR,
1344
CAIRO_PATTERN_TYPE_RADIAL
1345
} cairo_pattern_type_t;
1348
<a class="link" href="cairo-Patterns.html#cairo-pattern-type-t" title="enum cairo_pattern_type_t"><span class="type">cairo_pattern_type_t</span></a> is used to describe the type of a given pattern.
1351
The type of a pattern is determined by the function used to create
1352
it. The <a class="link" href="cairo-Patterns.html#cairo-pattern-create-rgb" title="cairo_pattern_create_rgb ()"><code class="function">cairo_pattern_create_rgb()</code></a> and <a class="link" href="cairo-Patterns.html#cairo-pattern-create-rgba" title="cairo_pattern_create_rgba ()"><code class="function">cairo_pattern_create_rgba()</code></a>
1353
functions create SOLID patterns. The remaining
1354
cairo_pattern_create functions map to pattern types in obvious
1358
The pattern type can be queried with <a class="link" href="cairo-Patterns.html#cairo-pattern-get-type" title="cairo_pattern_get_type ()"><code class="function">cairo_pattern_get_type()</code></a>
1361
Most <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> functions can be called with a pattern of any
1362
type, (though trying to change the extend or filter for a solid
1363
pattern will have no effect). A notable exception is
1364
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgb" title="cairo_pattern_add_color_stop_rgb ()"><code class="function">cairo_pattern_add_color_stop_rgb()</code></a> and
1365
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgba" title="cairo_pattern_add_color_stop_rgba ()"><code class="function">cairo_pattern_add_color_stop_rgba()</code></a> which must only be called with
1366
gradient patterns (either LINEAR or RADIAL). Otherwise the pattern
1367
will be shutdown and put into an error state.
1370
New entries may be added in future versions.</p>
1374
<div class="variablelist"><table border="0">
1375
<col align="left" valign="top">
1378
<td><p><a name="CAIRO-PATTERN-TYPE-SOLID:CAPS"></a><span class="term"><code class="literal">CAIRO_PATTERN_TYPE_SOLID</code></span></p></td>
1379
<td> The pattern is a solid (uniform)
1380
color. It may be opaque or translucent.
1384
<td><p><a name="CAIRO-PATTERN-TYPE-SURFACE:CAPS"></a><span class="term"><code class="literal">CAIRO_PATTERN_TYPE_SURFACE</code></span></p></td>
1385
<td> The pattern is a based on a surface (an image).
1389
<td><p><a name="CAIRO-PATTERN-TYPE-LINEAR:CAPS"></a><span class="term"><code class="literal">CAIRO_PATTERN_TYPE_LINEAR</code></span></p></td>
1390
<td> The pattern is a linear gradient.
1394
<td><p><a name="CAIRO-PATTERN-TYPE-RADIAL:CAPS"></a><span class="term"><code class="literal">CAIRO_PATTERN_TYPE_RADIAL</code></span></p></td>
1395
<td> The pattern is a radial gradient.
1400
<p class="since">Since 1.2
1404
<div class="refsect2" lang="en">
1405
<a name="cairo-pattern-get-type"></a><h3>cairo_pattern_get_type ()</h3>
1406
<pre class="programlisting"><a class="link" href="cairo-Patterns.html#cairo-pattern-type-t" title="enum cairo_pattern_type_t">cairo_pattern_type_t</a> cairo_pattern_get_type (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
1408
This function returns the type a pattern.
1409
See <a class="link" href="cairo-Patterns.html#cairo-pattern-type-t" title="enum cairo_pattern_type_t"><span class="type">cairo_pattern_type_t</span></a> for available types.</p>
1413
<div class="variablelist"><table border="0">
1414
<col align="left" valign="top">
1417
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1418
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1422
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1423
<td> The type of <em class="parameter"><code>pattern</code></em>.
1429
<p class="since">Since 1.2
1433
<div class="refsect2" lang="en">
1434
<a name="cairo-pattern-get-reference-count"></a><h3>cairo_pattern_get_reference_count ()</h3>
1435
<pre class="programlisting">unsigned int cairo_pattern_get_reference_count (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern);</pre>
1437
Returns the current reference count of <em class="parameter"><code>pattern</code></em>.</p>
1441
<div class="variablelist"><table border="0">
1442
<col align="left" valign="top">
1445
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1446
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1450
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1451
<td> the current reference count of <em class="parameter"><code>pattern</code></em>. If the
1452
object is a nil object, 0 will be returned.
1458
<p class="since">Since 1.4
1462
<div class="refsect2" lang="en">
1463
<a name="cairo-pattern-set-user-data"></a><h3>cairo_pattern_set_user_data ()</h3>
1464
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_pattern_set_user_data (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1465
const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t">cairo_user_data_key_t</a> *key,
1467
<a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()">cairo_destroy_func_t</a> destroy);</pre>
1469
Attach user data to <em class="parameter"><code>pattern</code></em>. To remove user data from a surface,
1470
call this function with the key that was used to set it and <a
1471
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
1472
><code class="literal">NULL</code></a>
1473
for <em class="parameter"><code>data</code></em>.</p>
1477
<div class="variablelist"><table border="0">
1478
<col align="left" valign="top">
1481
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1482
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1486
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
1487
<td> the address of a <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> to attach the user data to
1491
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1492
<td> the user data to attach to the <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1496
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
1497
<td> a <a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()"><span class="type">cairo_destroy_func_t</span></a> which will be called when the
1498
<a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> is destroyed or when new user data is attached using the
1503
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1504
<td> <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> or <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a> if a
1505
slot could not be allocated for the user data.
1511
<p class="since">Since 1.4
1515
<div class="refsect2" lang="en">
1516
<a name="cairo-pattern-get-user-data"></a><h3>cairo_pattern_get_user_data ()</h3>
1517
<pre class="programlisting">void* cairo_pattern_get_user_data (<a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t">cairo_pattern_t</a> *pattern,
1518
const <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t">cairo_user_data_key_t</a> *key);</pre>
1520
Return user data previously attached to <em class="parameter"><code>pattern</code></em> using the
1521
specified key. If no user data has been attached with the given
1522
key this function returns <a
1523
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
1524
><code class="literal">NULL</code></a>.</p>
1528
<div class="variablelist"><table border="0">
1529
<col align="left" valign="top">
1532
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
1533
<td> a <a class="link" href="cairo-Patterns.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
1537
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
1538
<td> the address of the <a class="link" href="cairo-Types.html#cairo-user-data-key-t" title="cairo_user_data_key_t"><span class="type">cairo_user_data_key_t</span></a> the user data was
1543
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1544
<td> the user data previously attached or <a
1545
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
1546
><code class="literal">NULL</code></a>.
1552
<p class="since">Since 1.4
1556
<div class="refsect1" lang="en">
1557
<a name="cairo-Patterns.see-also"></a><h2>See Also</h2>
1560
<div class="itemizedlist"><ul type="disc">
1561
<li><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a></li>
1562
<li><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a></li>
1568
<div class="footer">
1570
Generated by GTK-Doc V1.10</div>