~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to doc/public/html/cairo-Patterns.html

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
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">
23
 
</head>
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">
26
 
<tr valign="middle">
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>
32
 
</tr>
33
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cairo-Patterns.synopsis" class="shortcut">Top</a>
34
 
                   | 
35
 
                  <a href="#cairo-Patterns.description" class="shortcut">Description</a></nobr></td></tr>
36
 
</table>
37
 
<div class="refentry" lang="en">
38
 
<a name="cairo-Patterns"></a><div class="titlepage"></div>
39
 
<div class="refnamediv"><table width="100%"><tr>
40
 
<td valign="top">
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>
43
 
</td>
44
 
<td valign="top" align="right"></td>
45
 
</tr></table></div>
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,
51
 
                                                         double offset,
52
 
                                                         double red,
53
 
                                                         double green,
54
 
                                                         double blue);
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,
56
 
                                                         double offset,
57
 
                                                         double red,
58
 
                                                         double green,
59
 
                                                         double blue,
60
 
                                                         double alpha);
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,
62
 
                                                         int *count);
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,
64
 
                                                         int index,
65
 
                                                         double *offset,
66
 
                                                         double *red,
67
 
                                                         double *green,
68
 
                                                         double *blue,
69
 
                                                         double *alpha);
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,
71
 
                                                         double green,
72
 
                                                         double blue);
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,
74
 
                                                         double green,
75
 
                                                         double blue,
76
 
                                                         double alpha);
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,
78
 
                                                         double *red,
79
 
                                                         double *green,
80
 
                                                         double *blue,
81
 
                                                         double *alpha);
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,
86
 
                                                         double y0,
87
 
                                                         double x1,
88
 
                                                         double y1);
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,
90
 
                                                         double *x0,
91
 
                                                         double *y0,
92
 
                                                         double *x1,
93
 
                                                         double *y1);
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,
95
 
                                                         double cy0,
96
 
                                                         double radius0,
97
 
                                                         double cx1,
98
 
                                                         double cy1,
99
 
                                                         double radius1);
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,
101
 
                                                         double *x0,
102
 
                                                         double *y0,
103
 
                                                         double *r0,
104
 
                                                         double *x1,
105
 
                                                         double *y1,
106
 
                                                         double *r1);
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,
127
 
                                                         void *user_data,
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);
131
 
</pre>
132
 
</div>
133
 
<div class="refsect1" lang="en">
134
 
<a name="cairo-Patterns.description"></a><h2>Description</h2>
135
 
<p>
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.
139
 
</p>
140
 
<p>
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.
145
 
</p>
146
 
</div>
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;
152
 
</pre>
153
 
<p>
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
158
 
opaque color.
159
 
</p>
160
 
<p>
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>.
165
 
</p>
166
 
<p>
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>.
168
 
</p>
169
 
<p>
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>
172
 
<p>
173
 
 
174
 
</p>
175
 
</div>
176
 
<hr>
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,
180
 
                                                         double offset,
181
 
                                                         double red,
182
 
                                                         double green,
183
 
                                                         double blue);</pre>
184
 
<p>
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.
190
 
</p>
191
 
<p>
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>.
193
 
</p>
194
 
<p>
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.
200
 
</p>
201
 
<p>
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>
205
 
<p>
206
 
 
207
 
</p>
208
 
<div class="variablelist"><table border="0">
209
 
<col align="left" valign="top">
210
 
<tbody>
211
 
<tr>
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>
214
 
</td>
215
 
</tr>
216
 
<tr>
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]
219
 
</td>
220
 
</tr>
221
 
<tr>
222
 
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
223
 
<td> red component of color
224
 
</td>
225
 
</tr>
226
 
<tr>
227
 
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
228
 
<td> green component of color
229
 
</td>
230
 
</tr>
231
 
<tr>
232
 
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
233
 
<td> blue component of color
234
 
</td>
235
 
</tr>
236
 
</tbody>
237
 
</table></div>
238
 
</div>
239
 
<hr>
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,
243
 
                                                         double offset,
244
 
                                                         double red,
245
 
                                                         double green,
246
 
                                                         double blue,
247
 
                                                         double alpha);</pre>
248
 
<p>
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.
254
 
</p>
255
 
<p>
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>.
257
 
</p>
258
 
<p>
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.
264
 
</p>
265
 
<p>
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>
269
 
<p>
270
 
 
271
 
</p>
272
 
<div class="variablelist"><table border="0">
273
 
<col align="left" valign="top">
274
 
<tbody>
275
 
<tr>
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>
278
 
</td>
279
 
</tr>
280
 
<tr>
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]
283
 
</td>
284
 
</tr>
285
 
<tr>
286
 
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
287
 
<td> red component of color
288
 
</td>
289
 
</tr>
290
 
<tr>
291
 
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
292
 
<td> green component of color
293
 
</td>
294
 
</tr>
295
 
<tr>
296
 
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
297
 
<td> blue component of color
298
 
</td>
299
 
</tr>
300
 
<tr>
301
 
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
302
 
<td> alpha component of color
303
 
</td>
304
 
</tr>
305
 
</tbody>
306
 
</table></div>
307
 
</div>
308
 
<hr>
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,
312
 
                                                         int *count);</pre>
313
 
<p>
314
 
Gets the number of color stops specified in the given gradient
315
 
pattern.</p>
316
 
<p>
317
 
 
318
 
</p>
319
 
<div class="variablelist"><table border="0">
320
 
<col align="left" valign="top">
321
 
<tbody>
322
 
<tr>
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>
325
 
</td>
326
 
</tr>
327
 
<tr>
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>
332
 
</td>
333
 
</tr>
334
 
<tr>
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
338
 
pattern.
339
 
 
340
 
</td>
341
 
</tr>
342
 
</tbody>
343
 
</table></div>
344
 
<p class="since">Since  1.4
345
 
</p>
346
 
</div>
347
 
<hr>
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,
351
 
                                                         int index,
352
 
                                                         double *offset,
353
 
                                                         double *red,
354
 
                                                         double *green,
355
 
                                                         double *blue,
356
 
                                                         double *alpha);</pre>
357
 
<p>
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>
361
 
<p>
362
 
 
363
 
</p>
364
 
<div class="variablelist"><table border="0">
365
 
<col align="left" valign="top">
366
 
<tbody>
367
 
<tr>
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>
370
 
</td>
371
 
</tr>
372
 
<tr>
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
375
 
</td>
376
 
</tr>
377
 
<tr>
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>
382
 
</td>
383
 
</tr>
384
 
<tr>
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>
389
 
</td>
390
 
</tr>
391
 
<tr>
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>
396
 
</td>
397
 
</tr>
398
 
<tr>
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>
403
 
</td>
404
 
</tr>
405
 
<tr>
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>
410
 
</td>
411
 
</tr>
412
 
<tr>
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
417
 
returned.
418
 
 
419
 
</td>
420
 
</tr>
421
 
</tbody>
422
 
</table></div>
423
 
<p class="since">Since  1.4
424
 
</p>
425
 
</div>
426
 
<hr>
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,
430
 
                                                         double green,
431
 
                                                         double blue);</pre>
432
 
<p>
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
436
 
clamped.</p>
437
 
<p>
438
 
 
439
 
</p>
440
 
<div class="variablelist"><table border="0">
441
 
<col align="left" valign="top">
442
 
<tbody>
443
 
<tr>
444
 
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
445
 
<td> red component of the color
446
 
</td>
447
 
</tr>
448
 
<tr>
449
 
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
450
 
<td> green component of the color
451
 
</td>
452
 
</tr>
453
 
<tr>
454
 
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
455
 
<td> blue component of the color
456
 
</td>
457
 
</tr>
458
 
<tr>
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
463
 
finished with it.
464
 
 
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>.
468
 
</td>
469
 
</tr>
470
 
</tbody>
471
 
</table></div>
472
 
</div>
473
 
<hr>
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,
477
 
                                                         double green,
478
 
                                                         double blue,
479
 
                                                         double alpha);</pre>
480
 
<p>
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
484
 
clamped.</p>
485
 
<p>
486
 
 
487
 
</p>
488
 
<div class="variablelist"><table border="0">
489
 
<col align="left" valign="top">
490
 
<tbody>
491
 
<tr>
492
 
<td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
493
 
<td> red component of the color
494
 
</td>
495
 
</tr>
496
 
<tr>
497
 
<td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
498
 
<td> green component of the color
499
 
</td>
500
 
</tr>
501
 
<tr>
502
 
<td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
503
 
<td> blue component of the color
504
 
</td>
505
 
</tr>
506
 
<tr>
507
 
<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
508
 
<td> alpha component of the color
509
 
</td>
510
 
</tr>
511
 
<tr>
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
516
 
finished with it.
517
 
 
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>.
521
 
</td>
522
 
</tr>
523
 
</tbody>
524
 
</table></div>
525
 
</div>
526
 
<hr>
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,
530
 
                                                         double *red,
531
 
                                                         double *green,
532
 
                                                         double *blue,
533
 
                                                         double *alpha);</pre>
534
 
<p>
535
 
Gets the solid color for a solid color pattern.</p>
536
 
<p>
537
 
 
538
 
</p>
539
 
<div class="variablelist"><table border="0">
540
 
<col align="left" valign="top">
541
 
<tbody>
542
 
<tr>
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>
545
 
</td>
546
 
</tr>
547
 
<tr>
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>
552
 
</td>
553
 
</tr>
554
 
<tr>
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>
559
 
</td>
560
 
</tr>
561
 
<tr>
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>
566
 
</td>
567
 
</tr>
568
 
<tr>
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>
573
 
</td>
574
 
</tr>
575
 
<tr>
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
579
 
color pattern.
580
 
 
581
 
</td>
582
 
</tr>
583
 
</tbody>
584
 
</table></div>
585
 
<p class="since">Since  1.4
586
 
</p>
587
 
</div>
588
 
<hr>
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>
592
 
<p>
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>
594
 
<p>
595
 
 
596
 
</p>
597
 
<div class="variablelist"><table border="0">
598
 
<col align="left" valign="top">
599
 
<tbody>
600
 
<tr>
601
 
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
602
 
<td> the surface
603
 
</td>
604
 
</tr>
605
 
<tr>
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
610
 
finished with it.
611
 
 
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>.
615
 
</td>
616
 
</tr>
617
 
</tbody>
618
 
</table></div>
619
 
</div>
620
 
<hr>
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>
625
 
<p>
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>
629
 
<p>
630
 
 
631
 
</p>
632
 
<div class="variablelist"><table border="0">
633
 
<col align="left" valign="top">
634
 
<tbody>
635
 
<tr>
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>
638
 
</td>
639
 
</tr>
640
 
<tr>
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>
645
 
</td>
646
 
</tr>
647
 
<tr>
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
651
 
pattern.
652
 
 
653
 
</td>
654
 
</tr>
655
 
</tbody>
656
 
</table></div>
657
 
<p class="since">Since  1.4
658
 
</p>
659
 
</div>
660
 
<hr>
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,
664
 
                                                         double y0,
665
 
                                                         double x1,
666
 
                                                         double y1);</pre>
667
 
<p>
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>.
673
 
</p>
674
 
<p>
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>
678
 
<p>
679
 
 
680
 
</p>
681
 
<div class="variablelist"><table border="0">
682
 
<col align="left" valign="top">
683
 
<tbody>
684
 
<tr>
685
 
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
686
 
<td> x coordinate of the start point
687
 
</td>
688
 
</tr>
689
 
<tr>
690
 
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
691
 
<td> y coordinate of the start point
692
 
</td>
693
 
</tr>
694
 
<tr>
695
 
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
696
 
<td> x coordinate of the end point
697
 
</td>
698
 
</tr>
699
 
<tr>
700
 
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
701
 
<td> y coordinate of the end point
702
 
</td>
703
 
</tr>
704
 
<tr>
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
709
 
finished with it.
710
 
 
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>.
714
 
</td>
715
 
</tr>
716
 
</tbody>
717
 
</table></div>
718
 
</div>
719
 
<hr>
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,
723
 
                                                         double *x0,
724
 
                                                         double *y0,
725
 
                                                         double *x1,
726
 
                                                         double *y1);</pre>
727
 
<p>
728
 
Gets the gradient endpoints for a linear gradient.</p>
729
 
<p>
730
 
 
731
 
</p>
732
 
<div class="variablelist"><table border="0">
733
 
<col align="left" valign="top">
734
 
<tbody>
735
 
<tr>
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>
738
 
</td>
739
 
</tr>
740
 
<tr>
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>
745
 
</td>
746
 
</tr>
747
 
<tr>
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>
752
 
</td>
753
 
</tr>
754
 
<tr>
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>
759
 
</td>
760
 
</tr>
761
 
<tr>
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>
766
 
</td>
767
 
</tr>
768
 
<tr>
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
772
 
gradient pattern.
773
 
 
774
 
</td>
775
 
</tr>
776
 
</tbody>
777
 
</table></div>
778
 
<p class="since">Since  1.4
779
 
</p>
780
 
</div>
781
 
<hr>
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,
785
 
                                                         double cy0,
786
 
                                                         double radius0,
787
 
                                                         double cx1,
788
 
                                                         double cy1,
789
 
                                                         double radius1);</pre>
790
 
<p>
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>.
796
 
</p>
797
 
<p>
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>
801
 
<p>
802
 
 
803
 
</p>
804
 
<div class="variablelist"><table border="0">
805
 
<col align="left" valign="top">
806
 
<tbody>
807
 
<tr>
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
810
 
</td>
811
 
</tr>
812
 
<tr>
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
815
 
</td>
816
 
</tr>
817
 
<tr>
818
 
<td><p><span class="term"><em class="parameter"><code>radius0</code></em> :</span></p></td>
819
 
<td> radius of the start circle
820
 
</td>
821
 
</tr>
822
 
<tr>
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
825
 
</td>
826
 
</tr>
827
 
<tr>
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
830
 
</td>
831
 
</tr>
832
 
<tr>
833
 
<td><p><span class="term"><em class="parameter"><code>radius1</code></em> :</span></p></td>
834
 
<td> radius of the end circle
835
 
</td>
836
 
</tr>
837
 
<tr>
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
842
 
finished with it.
843
 
 
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>.
847
 
</td>
848
 
</tr>
849
 
</tbody>
850
 
</table></div>
851
 
</div>
852
 
<hr>
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,
856
 
                                                         double *x0,
857
 
                                                         double *y0,
858
 
                                                         double *r0,
859
 
                                                         double *x1,
860
 
                                                         double *y1,
861
 
                                                         double *r1);</pre>
862
 
<p>
863
 
Gets the gradient endpoint circles for a radial gradient, each
864
 
specified as a center coordinate and a radius.</p>
865
 
<p>
866
 
 
867
 
</p>
868
 
<div class="variablelist"><table border="0">
869
 
<col align="left" valign="top">
870
 
<tbody>
871
 
<tr>
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>
874
 
</td>
875
 
</tr>
876
 
<tr>
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>
881
 
</td>
882
 
</tr>
883
 
<tr>
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>
888
 
</td>
889
 
</tr>
890
 
<tr>
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>
895
 
</td>
896
 
</tr>
897
 
<tr>
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>
902
 
</td>
903
 
</tr>
904
 
<tr>
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>
909
 
</td>
910
 
</tr>
911
 
<tr>
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>
916
 
</td>
917
 
</tr>
918
 
<tr>
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
922
 
gradient pattern.
923
 
 
924
 
</td>
925
 
</tr>
926
 
</tbody>
927
 
</table></div>
928
 
<p class="since">Since  1.4
929
 
</p>
930
 
</div>
931
 
<hr>
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>
935
 
<p>
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.
939
 
</p>
940
 
<p>
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>
943
 
<p>
944
 
 
945
 
</p>
946
 
<div class="variablelist"><table border="0">
947
 
<col align="left" valign="top">
948
 
<tbody>
949
 
<tr>
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>
952
 
</td>
953
 
</tr>
954
 
<tr>
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>.
957
 
</td>
958
 
</tr>
959
 
</tbody>
960
 
</table></div>
961
 
</div>
962
 
<hr>
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>
966
 
<p>
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>
970
 
<p>
971
 
 
972
 
</p>
973
 
<div class="variablelist"><table border="0">
974
 
<col align="left" valign="top">
975
 
<tbody><tr>
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>
978
 
</td>
979
 
</tr></tbody>
980
 
</table></div>
981
 
</div>
982
 
<hr>
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>
986
 
<p>
987
 
Checks whether an error has previously occurred for this
988
 
pattern.</p>
989
 
<p>
990
 
 
991
 
</p>
992
 
<div class="variablelist"><table border="0">
993
 
<col align="left" valign="top">
994
 
<tbody>
995
 
<tr>
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>
998
 
</td>
999
 
</tr>
1000
 
<tr>
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>.
1004
 
</td>
1005
 
</tr>
1006
 
</tbody>
1007
 
</table></div>
1008
 
</div>
1009
 
<hr>
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 {
1013
 
    CAIRO_EXTEND_NONE,
1014
 
    CAIRO_EXTEND_REPEAT,
1015
 
    CAIRO_EXTEND_REFLECT,
1016
 
    CAIRO_EXTEND_PAD
1017
 
} cairo_extend_t;
1018
 
</pre>
1019
 
<p>
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
1023
 
geometry).
1024
 
</p>
1025
 
<p>
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.
1028
 
</p>
1029
 
<p>
1030
 
New entries may be added in future versions.</p>
1031
 
<p>
1032
 
 
1033
 
</p>
1034
 
<div class="variablelist"><table border="0">
1035
 
<col align="left" valign="top">
1036
 
<tbody>
1037
 
<tr>
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
1041
 
</td>
1042
 
</tr>
1043
 
<tr>
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
1046
 
</td>
1047
 
</tr>
1048
 
<tr>
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)
1052
 
</td>
1053
 
</tr>
1054
 
<tr>
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)
1059
 
</td>
1060
 
</tr>
1061
 
</tbody>
1062
 
</table></div>
1063
 
</div>
1064
 
<hr>
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>
1069
 
<p>
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
1072
 
strategy.
1073
 
</p>
1074
 
<p>
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>
1077
 
<p>
1078
 
 
1079
 
</p>
1080
 
<div class="variablelist"><table border="0">
1081
 
<col align="left" valign="top">
1082
 
<tbody>
1083
 
<tr>
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>
1086
 
</td>
1087
 
</tr>
1088
 
<tr>
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
1092
 
</td>
1093
 
</tr>
1094
 
</tbody>
1095
 
</table></div>
1096
 
</div>
1097
 
<hr>
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>
1101
 
<p>
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>
1104
 
<p>
1105
 
 
1106
 
</p>
1107
 
<div class="variablelist"><table border="0">
1108
 
<col align="left" valign="top">
1109
 
<tbody>
1110
 
<tr>
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>
1113
 
</td>
1114
 
</tr>
1115
 
<tr>
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
1118
 
pattern.
1119
 
</td>
1120
 
</tr>
1121
 
</tbody>
1122
 
</table></div>
1123
 
</div>
1124
 
<hr>
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 {
1128
 
    CAIRO_FILTER_FAST,
1129
 
    CAIRO_FILTER_GOOD,
1130
 
    CAIRO_FILTER_BEST,
1131
 
    CAIRO_FILTER_NEAREST,
1132
 
    CAIRO_FILTER_BILINEAR,
1133
 
    CAIRO_FILTER_GAUSSIAN
1134
 
} cairo_filter_t;
1135
 
</pre>
1136
 
<p>
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>
1141
 
<p>
1142
 
 
1143
 
</p>
1144
 
<div class="variablelist"><table border="0">
1145
 
<col align="left" valign="top">
1146
 
<tbody>
1147
 
<tr>
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>
1151
 
</td>
1152
 
</tr>
1153
 
<tr>
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>
1157
 
</td>
1158
 
</tr>
1159
 
<tr>
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.
1163
 
</td>
1164
 
</tr>
1165
 
<tr>
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
1168
 
</td>
1169
 
</tr>
1170
 
<tr>
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
1173
 
</td>
1174
 
</tr>
1175
 
<tr>
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.
1179
 
</td>
1180
 
</tr>
1181
 
</tbody>
1182
 
</table></div>
1183
 
</div>
1184
 
<hr>
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>
1189
 
<p>
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.
1192
 
</p>
1193
 
<p>
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:
1199
 
</p>
1200
 
<p>
1201
 
</p>
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);
1205
 
</pre></div>
1206
 
<p>
1207
 
 
1208
 
</p>
1209
 
<div class="variablelist"><table border="0">
1210
 
<col align="left" valign="top">
1211
 
<tbody>
1212
 
<tr>
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>
1215
 
</td>
1216
 
</tr>
1217
 
<tr>
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
1220
 
the pattern
1221
 
</td>
1222
 
</tr>
1223
 
</tbody>
1224
 
</table></div>
1225
 
</div>
1226
 
<hr>
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>
1230
 
<p>
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>
1233
 
<p>
1234
 
 
1235
 
</p>
1236
 
<div class="variablelist"><table border="0">
1237
 
<col align="left" valign="top">
1238
 
<tbody>
1239
 
<tr>
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>
1242
 
</td>
1243
 
</tr>
1244
 
<tr>
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.
1247
 
</td>
1248
 
</tr>
1249
 
</tbody>
1250
 
</table></div>
1251
 
</div>
1252
 
<hr>
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>
1257
 
<p>
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.
1260
 
</p>
1261
 
<p>
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.
1265
 
</p>
1266
 
<p>
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.
1272
 
</p>
1273
 
<p>
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:
1276
 
</p>
1277
 
<p>
1278
 
</p>
1279
 
<div class="informalexample"><pre class="programlisting">
1280
 
cairo_matrix_init_scale (&amp;matrix, 0.5, 0.5);
1281
 
cairo_pattern_set_matrix (pattern, &amp;matrix);
1282
 
</pre></div>
1283
 
<p>
1284
 
</p>
1285
 
<p>
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.
1288
 
</p>
1289
 
<p>
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>
1292
 
<p>
1293
 
 
1294
 
</p>
1295
 
<div class="variablelist"><table border="0">
1296
 
<col align="left" valign="top">
1297
 
<tbody>
1298
 
<tr>
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>
1301
 
</td>
1302
 
</tr>
1303
 
<tr>
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>
1306
 
</td>
1307
 
</tr>
1308
 
</tbody>
1309
 
</table></div>
1310
 
</div>
1311
 
<hr>
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>
1316
 
<p>
1317
 
Stores the pattern's transformation matrix into <em class="parameter"><code>matrix</code></em>.</p>
1318
 
<p>
1319
 
 
1320
 
</p>
1321
 
<div class="variablelist"><table border="0">
1322
 
<col align="left" valign="top">
1323
 
<tbody>
1324
 
<tr>
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>
1327
 
</td>
1328
 
</tr>
1329
 
<tr>
1330
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
1331
 
<td> return value for the matrix
1332
 
</td>
1333
 
</tr>
1334
 
</tbody>
1335
 
</table></div>
1336
 
</div>
1337
 
<hr>
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;
1346
 
</pre>
1347
 
<p>
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.
1349
 
</p>
1350
 
<p>
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
1355
 
ways.
1356
 
</p>
1357
 
<p>
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>
1359
 
</p>
1360
 
<p>
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.
1368
 
</p>
1369
 
<p>
1370
 
New entries may be added in future versions.</p>
1371
 
<p>
1372
 
 
1373
 
</p>
1374
 
<div class="variablelist"><table border="0">
1375
 
<col align="left" valign="top">
1376
 
<tbody>
1377
 
<tr>
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.
1381
 
</td>
1382
 
</tr>
1383
 
<tr>
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).
1386
 
</td>
1387
 
</tr>
1388
 
<tr>
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.
1391
 
</td>
1392
 
</tr>
1393
 
<tr>
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.
1396
 
</td>
1397
 
</tr>
1398
 
</tbody>
1399
 
</table></div>
1400
 
<p class="since">Since  1.2
1401
 
</p>
1402
 
</div>
1403
 
<hr>
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>
1407
 
<p>
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>
1410
 
<p>
1411
 
 
1412
 
</p>
1413
 
<div class="variablelist"><table border="0">
1414
 
<col align="left" valign="top">
1415
 
<tbody>
1416
 
<tr>
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>
1419
 
</td>
1420
 
</tr>
1421
 
<tr>
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>.
1424
 
 
1425
 
</td>
1426
 
</tr>
1427
 
</tbody>
1428
 
</table></div>
1429
 
<p class="since">Since  1.2
1430
 
</p>
1431
 
</div>
1432
 
<hr>
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>
1436
 
<p>
1437
 
Returns the current reference count of <em class="parameter"><code>pattern</code></em>.</p>
1438
 
<p>
1439
 
 
1440
 
</p>
1441
 
<div class="variablelist"><table border="0">
1442
 
<col align="left" valign="top">
1443
 
<tbody>
1444
 
<tr>
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>
1447
 
</td>
1448
 
</tr>
1449
 
<tr>
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.
1453
 
 
1454
 
</td>
1455
 
</tr>
1456
 
</tbody>
1457
 
</table></div>
1458
 
<p class="since">Since  1.4
1459
 
</p>
1460
 
</div>
1461
 
<hr>
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,
1466
 
                                                         void *user_data,
1467
 
                                                         <a class="link" href="cairo-Types.html#cairo-destroy-func-t" title="cairo_destroy_func_t ()">cairo_destroy_func_t</a> destroy);</pre>
1468
 
<p>
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>
1474
 
<p>
1475
 
 
1476
 
</p>
1477
 
<div class="variablelist"><table border="0">
1478
 
<col align="left" valign="top">
1479
 
<tbody>
1480
 
<tr>
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>
1483
 
</td>
1484
 
</tr>
1485
 
<tr>
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
1488
 
</td>
1489
 
</tr>
1490
 
<tr>
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>
1493
 
</td>
1494
 
</tr>
1495
 
<tr>
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
1499
 
same key.
1500
 
</td>
1501
 
</tr>
1502
 
<tr>
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.
1506
 
 
1507
 
</td>
1508
 
</tr>
1509
 
</tbody>
1510
 
</table></div>
1511
 
<p class="since">Since  1.4
1512
 
</p>
1513
 
</div>
1514
 
<hr>
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>
1519
 
<p>
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>
1525
 
<p>
1526
 
 
1527
 
</p>
1528
 
<div class="variablelist"><table border="0">
1529
 
<col align="left" valign="top">
1530
 
<tbody>
1531
 
<tr>
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>
1534
 
</td>
1535
 
</tr>
1536
 
<tr>
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
1539
 
attached to
1540
 
</td>
1541
 
</tr>
1542
 
<tr>
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>.
1547
 
 
1548
 
</td>
1549
 
</tr>
1550
 
</tbody>
1551
 
</table></div>
1552
 
<p class="since">Since  1.4
1553
 
</p>
1554
 
</div>
1555
 
</div>
1556
 
<div class="refsect1" lang="en">
1557
 
<a name="cairo-Patterns.see-also"></a><h2>See Also</h2>
1558
 
<p>
1559
 
</p>
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>
1563
 
</ul></div>
1564
 
<p>
1565
 
</p>
1566
 
</div>
1567
 
</div>
1568
 
<div class="footer">
1569
 
<hr>
1570
 
          Generated by GTK-Doc V1.10</div>
1571
 
</body>
1572
 
</html>