34
31
<p>inplace — in-place paintbox operations: flood, paste, line,
37
<td valign="top" align="right"></td>
34
<td class="gallery_image" valign="top" align="right"></td>
38
35
</tr></table></div>
39
36
<div class="refsect1">
40
37
<a name="libvips-inplace.stability-level"></a><h2>Stability Level</h2>
41
38
Stable, unless otherwise indicated
43
<div class="refsynopsisdiv">
44
<a name="libvips-inplace.synopsis"></a><h2>Synopsis</h2>
45
<pre class="synopsis">
46
#include <vips/vips.h>
48
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-rect" title="im_draw_rect ()">im_draw_rect</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
49
<em class="parameter"><code><span class="type">int</span> left</code></em>,
50
<em class="parameter"><code><span class="type">int</span> top</code></em>,
51
<em class="parameter"><code><span class="type">int</span> width</code></em>,
52
<em class="parameter"><code><span class="type">int</span> height</code></em>,
53
<em class="parameter"><code><span class="type">int</span> fill</code></em>,
54
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
55
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()">im_draw_circle</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
56
<em class="parameter"><code><span class="type">int</span> x</code></em>,
57
<em class="parameter"><code><span class="type">int</span> y</code></em>,
58
<em class="parameter"><code><span class="type">int</span> radius</code></em>,
59
<em class="parameter"><code><span class="type">gboolean</span> fill</code></em>,
60
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
61
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-image" title="im_draw_image ()">im_draw_image</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
62
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *sub</code></em>,
63
<em class="parameter"><code><span class="type">int</span> x</code></em>,
64
<em class="parameter"><code><span class="type">int</span> y</code></em>);
65
<span class="returnvalue">int</span> (<a class="link" href="libvips-inplace.html#VipsPlotFn" title="VipsPlotFn ()">*VipsPlotFn</a>) (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
66
<em class="parameter"><code><span class="type">int</span> x</code></em>,
67
<em class="parameter"><code><span class="type">int</span> y</code></em>,
68
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
69
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
70
<em class="parameter"><code><span class="type">void</span> *c</code></em>);
71
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()">im_draw_line_user</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
72
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
73
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
74
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
75
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
76
<em class="parameter"><code><a class="link" href="libvips-inplace.html#VipsPlotFn" title="VipsPlotFn ()"><span class="type">VipsPlotFn</span></a> plot</code></em>,
77
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
78
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
79
<em class="parameter"><code><span class="type">void</span> *c</code></em>);
80
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()">im_draw_line</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
81
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
82
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
83
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
84
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
85
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
86
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-lineset" title="im_lineset ()">im_lineset</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
87
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *out</code></em>,
88
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
89
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *ink</code></em>,
90
<em class="parameter"><code><span class="type">int</span> n</code></em>,
91
<em class="parameter"><code><span class="type">int</span> *x1v</code></em>,
92
<em class="parameter"><code><span class="type">int</span> *y1v</code></em>,
93
<em class="parameter"><code><span class="type">int</span> *x2v</code></em>,
94
<em class="parameter"><code><span class="type">int</span> *y2v</code></em>);
95
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()">im_draw_flood</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
96
<em class="parameter"><code><span class="type">int</span> x</code></em>,
97
<em class="parameter"><code><span class="type">int</span> y</code></em>,
98
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
99
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);
100
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()">im_draw_flood_blob</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
101
<em class="parameter"><code><span class="type">int</span> x</code></em>,
102
<em class="parameter"><code><span class="type">int</span> y</code></em>,
103
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
104
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);
105
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()">im_draw_flood_other</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
106
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *test</code></em>,
107
<em class="parameter"><code><span class="type">int</span> x</code></em>,
108
<em class="parameter"><code><span class="type">int</span> y</code></em>,
109
<em class="parameter"><code><span class="type">int</span> serial</code></em>,
110
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);
111
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()">im_draw_mask</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
112
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask_im</code></em>,
113
<em class="parameter"><code><span class="type">int</span> x</code></em>,
114
<em class="parameter"><code><span class="type">int</span> y</code></em>,
115
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
116
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-point" title="im_draw_point ()">im_draw_point</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
117
<em class="parameter"><code><span class="type">int</span> x</code></em>,
118
<em class="parameter"><code><span class="type">int</span> y</code></em>,
119
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
120
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-read-point" title="im_read_point ()">im_read_point</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
121
<em class="parameter"><code><span class="type">int</span> x</code></em>,
122
<em class="parameter"><code><span class="type">int</span> y</code></em>,
123
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);
124
<span class="returnvalue">int</span> <a class="link" href="libvips-inplace.html#im-draw-smudge" title="im_draw_smudge ()">im_draw_smudge</a> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
125
<em class="parameter"><code><span class="type">int</span> left</code></em>,
126
<em class="parameter"><code><span class="type">int</span> top</code></em>,
127
<em class="parameter"><code><span class="type">int</span> width</code></em>,
128
<em class="parameter"><code><span class="type">int</span> height</code></em>);
40
<div class="refsect1">
41
<a name="libvips-inplace.functions"></a><h2>Functions</h2>
42
<div class="informaltable"><table width="100%" border="0">
44
<col width="150px" class="functions_return">
45
<col class="functions_name">
49
<td class="function_type">
50
<span class="returnvalue">int</span>
52
<td class="function_name">
53
<a class="link" href="libvips-inplace.html#im-draw-rect" title="im_draw_rect ()">im_draw_rect</a> <span class="c_punctuation">()</span>
57
<td class="function_type">
58
<span class="returnvalue">int</span>
60
<td class="function_name">
61
<a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()">im_draw_circle</a> <span class="c_punctuation">()</span>
65
<td class="function_type">
66
<span class="returnvalue">int</span>
68
<td class="function_name">
69
<a class="link" href="libvips-inplace.html#im-draw-image" title="im_draw_image ()">im_draw_image</a> <span class="c_punctuation">()</span>
73
<td class="function_type">
74
<span class="returnvalue">int</span>
76
<td class="function_name">
77
<span class="c_punctuation">(</span><a class="link" href="libvips-inplace.html#VipsPlotFn" title="VipsPlotFn ()">*VipsPlotFn</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
81
<td class="function_type">
82
<span class="returnvalue">int</span>
84
<td class="function_name">
85
<a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()">im_draw_line_user</a> <span class="c_punctuation">()</span>
89
<td class="function_type">
90
<span class="returnvalue">int</span>
92
<td class="function_name">
93
<a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()">im_draw_line</a> <span class="c_punctuation">()</span>
97
<td class="function_type">
98
<span class="returnvalue">int</span>
100
<td class="function_name">
101
<a class="link" href="libvips-inplace.html#im-lineset" title="im_lineset ()">im_lineset</a> <span class="c_punctuation">()</span>
105
<td class="function_type">
106
<span class="returnvalue">int</span>
108
<td class="function_name">
109
<a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()">im_draw_flood</a> <span class="c_punctuation">()</span>
113
<td class="function_type">
114
<span class="returnvalue">int</span>
116
<td class="function_name">
117
<a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()">im_draw_flood_blob</a> <span class="c_punctuation">()</span>
121
<td class="function_type">
122
<span class="returnvalue">int</span>
124
<td class="function_name">
125
<a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()">im_draw_flood_other</a> <span class="c_punctuation">()</span>
129
<td class="function_type">
130
<span class="returnvalue">int</span>
132
<td class="function_name">
133
<a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()">im_draw_mask</a> <span class="c_punctuation">()</span>
137
<td class="function_type">
138
<span class="returnvalue">int</span>
140
<td class="function_name">
141
<a class="link" href="libvips-inplace.html#im-draw-point" title="im_draw_point ()">im_draw_point</a> <span class="c_punctuation">()</span>
145
<td class="function_type">
146
<span class="returnvalue">int</span>
148
<td class="function_name">
149
<a class="link" href="libvips-inplace.html#im-read-point" title="im_read_point ()">im_read_point</a> <span class="c_punctuation">()</span>
153
<td class="function_type">
154
<span class="returnvalue">int</span>
156
<td class="function_name">
157
<a class="link" href="libvips-inplace.html#im-draw-smudge" title="im_draw_smudge ()">im_draw_smudge</a> <span class="c_punctuation">()</span>
163
<div class="refsect1">
164
<a name="libvips-inplace.object-hierarchy"></a><h2>Object Hierarchy</h2>
168
<div class="refsect1">
169
<a name="libvips-inplace.includes"></a><h2>Includes</h2>
170
<pre class="synopsis">#include <vips/vips.h>
131
173
<div class="refsect1">
132
174
<a name="libvips-inplace.description"></a><h2>Description</h2>
134
These operations directly modify the image. They do not thread, on 32-bit
175
<p>These operations directly modify the image. They do not thread, on 32-bit
135
176
machines they will be limited to 2GB images, and a little care needs to be
136
taken if you use them as part of an image pipeline.
139
They are mostly supposed to be useful
140
for paintbox-style programs.
177
taken if you use them as part of an image pipeline. </p>
178
<p>They are mostly supposed to be useful
179
for paintbox-style programs.</p>
143
181
<div class="refsect1">
144
<a name="libvips-inplace.details"></a><h2>Details</h2>
145
<div class="refsect2">
146
<a name="im-draw-rect"></a><h3>im_draw_rect ()</h3>
147
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_rect (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
148
<em class="parameter"><code><span class="type">int</span> left</code></em>,
149
<em class="parameter"><code><span class="type">int</span> top</code></em>,
150
<em class="parameter"><code><span class="type">int</span> width</code></em>,
151
<em class="parameter"><code><span class="type">int</span> height</code></em>,
152
<em class="parameter"><code><span class="type">int</span> fill</code></em>,
153
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
155
Paint pixels within <em class="parameter"><code>left</code></em>, <em class="parameter"><code>top</code></em>, <em class="parameter"><code>width</code></em>, <em class="parameter"><code>height</code></em> in <em class="parameter"><code>image</code></em> with <em class="parameter"><code>ink</code></em>. If
156
<em class="parameter"><code>fill</code></em> is zero, just paint a 1-pixel-wide outline.
159
See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.
161
<div class="variablelist"><table border="0" class="variablelist">
163
<col align="left" valign="top">
168
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
169
<td>image to draw on</td>
172
<td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
173
<td>area to paint</td>
176
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
177
<td>area to paint</td>
180
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
181
<td>area to paint</td>
184
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
185
<td>area to paint</td>
188
<td><p><span class="term"><em class="parameter"><code>fill</code></em> :</span></p></td>
189
<td>fill the rect</td>
192
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
193
<td>paint with this colour</td>
196
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
197
<td>0 on success, or -1 on error.</td>
203
<div class="refsect2">
204
<a name="im-draw-circle"></a><h3>im_draw_circle ()</h3>
205
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_circle (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
206
<em class="parameter"><code><span class="type">int</span> x</code></em>,
207
<em class="parameter"><code><span class="type">int</span> y</code></em>,
208
<em class="parameter"><code><span class="type">int</span> radius</code></em>,
209
<em class="parameter"><code><span class="type">gboolean</span> fill</code></em>,
210
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
212
Draws a circle on <em class="parameter"><code>image</code></em>. If <em class="parameter"><code>fill</code></em> is <code class="literal">TRUE</code> then the circle is filled,
213
otherwise a 1-pixel-wide perimeter is drawn.
216
<em class="parameter"><code>ink</code></em> is an array of bytes containing a valid pixel for the image's format.
217
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em> ) bytes.
220
See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.
222
<div class="variablelist"><table border="0" class="variablelist">
224
<col align="left" valign="top">
229
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
230
<td>image to draw on</td>
233
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
234
<td>centre of circle</td>
237
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
238
<td>centre of circle</td>
241
<td><p><span class="term"><em class="parameter"><code>radius</code></em> :</span></p></td>
242
<td>circle radius</td>
245
<td><p><span class="term"><em class="parameter"><code>fill</code></em> :</span></p></td>
246
<td>fill the circle</td>
249
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
250
<td>value to draw</td>
253
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
254
<td>0 on success, or -1 on error.</td>
260
<div class="refsect2">
261
<a name="im-draw-image"></a><h3>im_draw_image ()</h3>
262
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_image (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
263
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *sub</code></em>,
264
<em class="parameter"><code><span class="type">int</span> x</code></em>,
265
<em class="parameter"><code><span class="type">int</span> y</code></em>);</pre>
267
Draw <em class="parameter"><code>sub</code></em> on top of <em class="parameter"><code>image</code></em> at position <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>. The two images must have the
182
<a name="libvips-inplace.functions_details"></a><h2>Functions</h2>
183
<div class="refsect2">
184
<a name="im-draw-rect"></a><h3>im_draw_rect ()</h3>
185
<pre class="programlisting"><span class="returnvalue">int</span>
186
im_draw_rect (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
187
<em class="parameter"><code><span class="type">int</span> left</code></em>,
188
<em class="parameter"><code><span class="type">int</span> top</code></em>,
189
<em class="parameter"><code><span class="type">int</span> width</code></em>,
190
<em class="parameter"><code><span class="type">int</span> height</code></em>,
191
<em class="parameter"><code><span class="type">int</span> fill</code></em>,
192
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
193
<p>Paint pixels within <em class="parameter"><code>left</code></em>
194
, <em class="parameter"><code>top</code></em>
195
, <em class="parameter"><code>width</code></em>
196
, <em class="parameter"><code>height</code></em>
197
in <em class="parameter"><code>image</code></em>
198
with <em class="parameter"><code>ink</code></em>
200
<em class="parameter"><code>fill</code></em>
201
is zero, just paint a 1-pixel-wide outline.</p>
202
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.</p>
203
<div class="refsect3">
204
<a name="id-1.3.9.8.2.6"></a><h4>Parameters</h4>
205
<div class="informaltable"><table width="100%" border="0">
207
<col width="150px" class="parameters_name">
208
<col class="parameters_description">
209
<col width="200px" class="parameters_annotations">
213
<td class="parameter_name"><p>image</p></td>
214
<td class="parameter_description"><p>image to draw on</p></td>
215
<td class="parameter_annotations"> </td>
218
<td class="parameter_name"><p>left</p></td>
219
<td class="parameter_description"><p>area to paint</p></td>
220
<td class="parameter_annotations"> </td>
223
<td class="parameter_name"><p>top</p></td>
224
<td class="parameter_description"><p>area to paint</p></td>
225
<td class="parameter_annotations"> </td>
228
<td class="parameter_name"><p>width</p></td>
229
<td class="parameter_description"><p>area to paint</p></td>
230
<td class="parameter_annotations"> </td>
233
<td class="parameter_name"><p>height</p></td>
234
<td class="parameter_description"><p>area to paint</p></td>
235
<td class="parameter_annotations"> </td>
238
<td class="parameter_name"><p>fill</p></td>
239
<td class="parameter_description"><p>fill the rect</p></td>
240
<td class="parameter_annotations"> </td>
243
<td class="parameter_name"><p>ink</p></td>
244
<td class="parameter_description"><p>paint with this colour</p></td>
245
<td class="parameter_annotations"> </td>
250
<div class="refsect3">
251
<a name="id-1.3.9.8.2.7"></a><h4>Returns</h4>
252
<p> 0 on success, or -1 on error.</p>
257
<div class="refsect2">
258
<a name="im-draw-circle"></a><h3>im_draw_circle ()</h3>
259
<pre class="programlisting"><span class="returnvalue">int</span>
260
im_draw_circle (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
261
<em class="parameter"><code><span class="type">int</span> x</code></em>,
262
<em class="parameter"><code><span class="type">int</span> y</code></em>,
263
<em class="parameter"><code><span class="type">int</span> radius</code></em>,
264
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> fill</code></em>,
265
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
266
<p>Draws a circle on <em class="parameter"><code>image</code></em>
267
. If <em class="parameter"><code>fill</code></em>
268
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the circle is filled,
269
otherwise a 1-pixel-wide perimeter is drawn.</p>
270
<p><em class="parameter"><code>ink</code></em>
271
is an array of bytes containing a valid pixel for the image's format.
272
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em>
274
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.</p>
275
<div class="refsect3">
276
<a name="id-1.3.9.8.3.7"></a><h4>Parameters</h4>
277
<div class="informaltable"><table width="100%" border="0">
279
<col width="150px" class="parameters_name">
280
<col class="parameters_description">
281
<col width="200px" class="parameters_annotations">
285
<td class="parameter_name"><p>image</p></td>
286
<td class="parameter_description"><p>image to draw on</p></td>
287
<td class="parameter_annotations"> </td>
290
<td class="parameter_name"><p>x</p></td>
291
<td class="parameter_description"><p>centre of circle</p></td>
292
<td class="parameter_annotations"> </td>
295
<td class="parameter_name"><p>y</p></td>
296
<td class="parameter_description"><p>centre of circle</p></td>
297
<td class="parameter_annotations"> </td>
300
<td class="parameter_name"><p>radius</p></td>
301
<td class="parameter_description"><p>circle radius</p></td>
302
<td class="parameter_annotations"> </td>
305
<td class="parameter_name"><p>fill</p></td>
306
<td class="parameter_description"><p>fill the circle</p></td>
307
<td class="parameter_annotations"> </td>
310
<td class="parameter_name"><p>ink</p></td>
311
<td class="parameter_description"><p>value to draw</p></td>
312
<td class="parameter_annotations"> </td>
317
<div class="refsect3">
318
<a name="id-1.3.9.8.3.8"></a><h4>Returns</h4>
319
<p> 0 on success, or -1 on error.</p>
324
<div class="refsect2">
325
<a name="im-draw-image"></a><h3>im_draw_image ()</h3>
326
<pre class="programlisting"><span class="returnvalue">int</span>
327
im_draw_image (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
328
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *sub</code></em>,
329
<em class="parameter"><code><span class="type">int</span> x</code></em>,
330
<em class="parameter"><code><span class="type">int</span> y</code></em>);</pre>
331
<p>Draw <em class="parameter"><code>sub</code></em>
332
on top of <em class="parameter"><code>image</code></em>
333
at position <em class="parameter"><code>x</code></em>
334
, <em class="parameter"><code>y</code></em>
335
. The two images must have the
269
Coding. If <em class="parameter"><code>sub</code></em> has 1 band, the bands will be duplicated to match the
270
number of bands in <em class="parameter"><code>image</code></em>. <em class="parameter"><code>sub</code></em> will be converted to <em class="parameter"><code>image</code></em>'s format, see
271
<code class="function">im_clip2fmt()</code>.
274
See also: <code class="function">im_insert()</code>.
276
<div class="variablelist"><table border="0" class="variablelist">
278
<col align="left" valign="top">
283
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
284
<td>image to draw on</td>
287
<td><p><span class="term"><em class="parameter"><code>sub</code></em> :</span></p></td>
288
<td>image to draw</td>
291
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
292
<td>position to insert</td>
295
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
296
<td>position to insert</td>
299
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
300
<td>0 on success, or -1 on error.</td>
306
<div class="refsect2">
307
<a name="VipsPlotFn"></a><h3>VipsPlotFn ()</h3>
308
<pre class="programlisting"><span class="returnvalue">int</span> (*VipsPlotFn) (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
309
<em class="parameter"><code><span class="type">int</span> x</code></em>,
310
<em class="parameter"><code><span class="type">int</span> y</code></em>,
311
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
312
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
313
<em class="parameter"><code><span class="type">void</span> *c</code></em>);</pre>
315
A plot function, as used by <a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()"><code class="function">im_draw_line_user()</code></a> to draw on an image.
317
<div class="variablelist"><table border="0" class="variablelist">
319
<col align="left" valign="top">
324
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
325
<td>image to draw on</td>
328
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
329
<td>position to draw at</td>
332
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
333
<td>position to draw at</td>
336
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
340
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
344
<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
351
<div class="refsect2">
352
<a name="im-draw-line-user"></a><h3>im_draw_line_user ()</h3>
353
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_line_user (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
354
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
355
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
356
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
357
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
358
<em class="parameter"><code><a class="link" href="libvips-inplace.html#VipsPlotFn" title="VipsPlotFn ()"><span class="type">VipsPlotFn</span></a> plot</code></em>,
359
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
360
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
361
<em class="parameter"><code><span class="type">void</span> *c</code></em>);</pre>
363
Calls <em class="parameter"><code>plot</code></em> for every point on the line connecting <em class="parameter"><code>x1</code></em>, <em class="parameter"><code>y1</code></em> and <em class="parameter"><code>x2</code></em>, <em class="parameter"><code>y2</code></em>.
364
If you pass <a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()"><code class="function">im_draw_mask()</code></a> as the plot operation, you can draw wide lines
365
or lines with various brushes.
368
See also: <a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()"><code class="function">im_draw_mask()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.
370
<div class="variablelist"><table border="0" class="variablelist">
372
<col align="left" valign="top">
377
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
378
<td>image to draw on</td>
381
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
385
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
389
<td><p><span class="term"><em class="parameter"><code>x2</code></em> :</span></p></td>
393
<td><p><span class="term"><em class="parameter"><code>y2</code></em> :</span></p></td>
397
<td><p><span class="term"><em class="parameter"><code>plot</code></em> :</span></p></td>
398
<td>draw operation</td>
401
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
402
<td>draw operation parameter</td>
405
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
406
<td>draw operation parameter</td>
409
<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
410
<td>draw operation parameter</td>
413
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
414
<td>0 on success, or -1 on error.</td>
420
<div class="refsect2">
421
<a name="im-draw-line"></a><h3>im_draw_line ()</h3>
422
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_line (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
423
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
424
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
425
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
426
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
427
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
429
Draws a 1-pixel-wide line on an image.
432
<em class="parameter"><code>ink</code></em> is an array of bytes
337
Coding. If <em class="parameter"><code>sub</code></em>
338
has 1 band, the bands will be duplicated to match the
339
number of bands in <em class="parameter"><code>image</code></em>
340
. <em class="parameter"><code>sub</code></em>
341
will be converted to <em class="parameter"><code>image</code></em>
343
<code class="function">im_clip2fmt()</code>.</p>
344
<p>See also: <code class="function">im_insert()</code>.</p>
345
<div class="refsect3">
346
<a name="id-1.3.9.8.4.6"></a><h4>Parameters</h4>
347
<div class="informaltable"><table width="100%" border="0">
349
<col width="150px" class="parameters_name">
350
<col class="parameters_description">
351
<col width="200px" class="parameters_annotations">
355
<td class="parameter_name"><p>image</p></td>
356
<td class="parameter_description"><p>image to draw on</p></td>
357
<td class="parameter_annotations"> </td>
360
<td class="parameter_name"><p>sub</p></td>
361
<td class="parameter_description"><p>image to draw</p></td>
362
<td class="parameter_annotations"> </td>
365
<td class="parameter_name"><p>x</p></td>
366
<td class="parameter_description"><p>position to insert</p></td>
367
<td class="parameter_annotations"> </td>
370
<td class="parameter_name"><p>y</p></td>
371
<td class="parameter_description"><p>position to insert</p></td>
372
<td class="parameter_annotations"> </td>
377
<div class="refsect3">
378
<a name="id-1.3.9.8.4.7"></a><h4>Returns</h4>
379
<p> 0 on success, or -1 on error.</p>
384
<div class="refsect2">
385
<a name="VipsPlotFn"></a><h3>VipsPlotFn ()</h3>
386
<pre class="programlisting"><span class="returnvalue">int</span>
387
<span class="c_punctuation">(</span>*VipsPlotFn<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
388
<em class="parameter"><code><span class="type">int</span> x</code></em>,
389
<em class="parameter"><code><span class="type">int</span> y</code></em>,
390
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
391
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
392
<em class="parameter"><code><span class="type">void</span> *c</code></em>);</pre>
393
<p>A plot function, as used by <a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()"><code class="function">im_draw_line_user()</code></a> to draw on an image.</p>
394
<div class="refsect3">
395
<a name="id-1.3.9.8.5.5"></a><h4>Parameters</h4>
396
<div class="informaltable"><table width="100%" border="0">
398
<col width="150px" class="parameters_name">
399
<col class="parameters_description">
400
<col width="200px" class="parameters_annotations">
404
<td class="parameter_name"><p>image</p></td>
405
<td class="parameter_description"><p>image to draw on</p></td>
406
<td class="parameter_annotations"> </td>
409
<td class="parameter_name"><p>x</p></td>
410
<td class="parameter_description"><p>position to draw at</p></td>
411
<td class="parameter_annotations"> </td>
414
<td class="parameter_name"><p>y</p></td>
415
<td class="parameter_description"><p>position to draw at</p></td>
416
<td class="parameter_annotations"> </td>
419
<td class="parameter_name"><p>a</p></td>
420
<td class="parameter_description"><p>user data</p></td>
421
<td class="parameter_annotations"> </td>
424
<td class="parameter_name"><p>b</p></td>
425
<td class="parameter_description"><p>user data</p></td>
426
<td class="parameter_annotations"> </td>
429
<td class="parameter_name"><p>c</p></td>
430
<td class="parameter_description"><p>user data</p></td>
431
<td class="parameter_annotations"> </td>
436
<div class="refsect3">
437
<a name="id-1.3.9.8.5.6"></a><h4>Returns</h4>
442
<div class="refsect2">
443
<a name="im-draw-line-user"></a><h3>im_draw_line_user ()</h3>
444
<pre class="programlisting"><span class="returnvalue">int</span>
445
im_draw_line_user (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
446
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
447
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
448
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
449
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
450
<em class="parameter"><code><a class="link" href="libvips-inplace.html#VipsPlotFn" title="VipsPlotFn ()"><span class="type">VipsPlotFn</span></a> plot</code></em>,
451
<em class="parameter"><code><span class="type">void</span> *a</code></em>,
452
<em class="parameter"><code><span class="type">void</span> *b</code></em>,
453
<em class="parameter"><code><span class="type">void</span> *c</code></em>);</pre>
454
<p>Calls <em class="parameter"><code>plot</code></em>
455
for every point on the line connecting <em class="parameter"><code>x1</code></em>
456
, <em class="parameter"><code>y1</code></em>
457
and <em class="parameter"><code>x2</code></em>
458
, <em class="parameter"><code>y2</code></em>
460
If you pass <a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()"><code class="function">im_draw_mask()</code></a> as the plot operation, you can draw wide lines
461
or lines with various brushes.</p>
462
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-mask" title="im_draw_mask ()"><code class="function">im_draw_mask()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.</p>
463
<div class="refsect3">
464
<a name="id-1.3.9.8.6.6"></a><h4>Parameters</h4>
465
<div class="informaltable"><table width="100%" border="0">
467
<col width="150px" class="parameters_name">
468
<col class="parameters_description">
469
<col width="200px" class="parameters_annotations">
473
<td class="parameter_name"><p>image</p></td>
474
<td class="parameter_description"><p>image to draw on</p></td>
475
<td class="parameter_annotations"> </td>
478
<td class="parameter_name"><p>x1</p></td>
479
<td class="parameter_description"><p>start point</p></td>
480
<td class="parameter_annotations"> </td>
483
<td class="parameter_name"><p>y1</p></td>
484
<td class="parameter_description"><p>start point</p></td>
485
<td class="parameter_annotations"> </td>
488
<td class="parameter_name"><p>x2</p></td>
489
<td class="parameter_description"><p>end point</p></td>
490
<td class="parameter_annotations"> </td>
493
<td class="parameter_name"><p>y2</p></td>
494
<td class="parameter_description"><p>end point</p></td>
495
<td class="parameter_annotations"> </td>
498
<td class="parameter_name"><p>plot</p></td>
499
<td class="parameter_description"><p>draw operation</p></td>
500
<td class="parameter_annotations"> </td>
503
<td class="parameter_name"><p>a</p></td>
504
<td class="parameter_description"><p>draw operation parameter</p></td>
505
<td class="parameter_annotations"> </td>
508
<td class="parameter_name"><p>b</p></td>
509
<td class="parameter_description"><p>draw operation parameter</p></td>
510
<td class="parameter_annotations"> </td>
513
<td class="parameter_name"><p>c</p></td>
514
<td class="parameter_description"><p>draw operation parameter</p></td>
515
<td class="parameter_annotations"> </td>
520
<div class="refsect3">
521
<a name="id-1.3.9.8.6.7"></a><h4>Returns</h4>
522
<p> 0 on success, or -1 on error.</p>
527
<div class="refsect2">
528
<a name="im-draw-line"></a><h3>im_draw_line ()</h3>
529
<pre class="programlisting"><span class="returnvalue">int</span>
530
im_draw_line (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
531
<em class="parameter"><code><span class="type">int</span> x1</code></em>,
532
<em class="parameter"><code><span class="type">int</span> y1</code></em>,
533
<em class="parameter"><code><span class="type">int</span> x2</code></em>,
534
<em class="parameter"><code><span class="type">int</span> y2</code></em>,
535
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
536
<p>Draws a 1-pixel-wide line on an image. </p>
537
<p><em class="parameter"><code>ink</code></em>
433
539
containing a valid pixel for the image's format.
434
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em> ) bytes.
437
See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.
439
<div class="variablelist"><table border="0" class="variablelist">
540
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em>
542
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>.</p>
543
<div class="refsect3">
544
<a name="id-1.3.9.8.7.7"></a><h4>Parameters</h4>
545
<div class="informaltable"><table width="100%" border="0">
441
<col align="left" valign="top">
547
<col width="150px" class="parameters_name">
548
<col class="parameters_description">
549
<col width="200px" class="parameters_annotations">
446
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
447
<td>image to draw on</td>
450
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
454
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
458
<td><p><span class="term"><em class="parameter"><code>x2</code></em> :</span></p></td>
462
<td><p><span class="term"><em class="parameter"><code>y2</code></em> :</span></p></td>
466
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
467
<td>value to draw</td>
470
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
471
<td>0 on success, or -1 on error.</td>
553
<td class="parameter_name"><p>image</p></td>
554
<td class="parameter_description"><p>image to draw on</p></td>
555
<td class="parameter_annotations"> </td>
558
<td class="parameter_name"><p>x1</p></td>
559
<td class="parameter_description"><p>start point</p></td>
560
<td class="parameter_annotations"> </td>
563
<td class="parameter_name"><p>y1</p></td>
564
<td class="parameter_description"><p>start point</p></td>
565
<td class="parameter_annotations"> </td>
568
<td class="parameter_name"><p>x2</p></td>
569
<td class="parameter_description"><p>end point</p></td>
570
<td class="parameter_annotations"> </td>
573
<td class="parameter_name"><p>y2</p></td>
574
<td class="parameter_description"><p>end point</p></td>
575
<td class="parameter_annotations"> </td>
578
<td class="parameter_name"><p>ink</p></td>
579
<td class="parameter_description"><p>value to draw</p></td>
580
<td class="parameter_annotations"> </td>
585
<div class="refsect3">
586
<a name="id-1.3.9.8.7.8"></a><h4>Returns</h4>
587
<p> 0 on success, or -1 on error.</p>
477
592
<div class="refsect2">
478
<a name="im-lineset"></a><h3>im_lineset ()</h3>
479
<pre class="programlisting"><span class="returnvalue">int</span> im_lineset (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
480
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *out</code></em>,
481
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
482
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *ink</code></em>,
483
<em class="parameter"><code><span class="type">int</span> n</code></em>,
484
<em class="parameter"><code><span class="type">int</span> *x1v</code></em>,
485
<em class="parameter"><code><span class="type">int</span> *y1v</code></em>,
486
<em class="parameter"><code><span class="type">int</span> *x2v</code></em>,
487
<em class="parameter"><code><span class="type">int</span> *y2v</code></em>);</pre>
593
<a name="im-lineset"></a><h3>im_lineset ()</h3>
594
<pre class="programlisting"><span class="returnvalue">int</span>
595
im_lineset (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *in</code></em>,
596
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *out</code></em>,
597
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask</code></em>,
598
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *ink</code></em>,
599
<em class="parameter"><code><span class="type">int</span> n</code></em>,
600
<em class="parameter"><code><span class="type">int</span> *x1v</code></em>,
601
<em class="parameter"><code><span class="type">int</span> *y1v</code></em>,
602
<em class="parameter"><code><span class="type">int</span> *x2v</code></em>,
603
<em class="parameter"><code><span class="type">int</span> *y2v</code></em>);</pre>
606
<div class="refsect3">
607
<a name="id-1.3.9.8.8.5"></a><h4>Returns</h4>
492
612
<div class="refsect2">
493
<a name="im-draw-flood"></a><h3>im_draw_flood ()</h3>
494
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_flood (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
495
<em class="parameter"><code><span class="type">int</span> x</code></em>,
496
<em class="parameter"><code><span class="type">int</span> y</code></em>,
497
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
498
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
500
Flood-fill <em class="parameter"><code>image</code></em> with <em class="parameter"><code>ink</code></em>, starting at position <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>. The filled area is
613
<a name="im-draw-flood"></a><h3>im_draw_flood ()</h3>
614
<pre class="programlisting"><span class="returnvalue">int</span>
615
im_draw_flood (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
616
<em class="parameter"><code><span class="type">int</span> x</code></em>,
617
<em class="parameter"><code><span class="type">int</span> y</code></em>,
618
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
619
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
620
<p>Flood-fill <em class="parameter"><code>image</code></em>
621
with <em class="parameter"><code>ink</code></em>
622
, starting at position <em class="parameter"><code>x</code></em>
623
, <em class="parameter"><code>y</code></em>
501
625
bounded by pixels that are equal to the ink colour, in other words, it
502
searches for pixels enclosed by a line of <em class="parameter"><code>ink</code></em>.
505
The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>. <em class="parameter"><code>dout</code></em> may be
509
See also: <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()"><code class="function">im_draw_flood_other()</code></a>.
511
<div class="variablelist"><table border="0" class="variablelist">
626
searches for pixels enclosed by a line of <em class="parameter"><code>ink</code></em>
628
<p>The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>
629
. <em class="parameter"><code>dout</code></em>
632
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()"><code class="function">im_draw_flood_other()</code></a>.</p>
633
<div class="refsect3">
634
<a name="id-1.3.9.8.9.7"></a><h4>Parameters</h4>
635
<div class="informaltable"><table width="100%" border="0">
513
<col align="left" valign="top">
637
<col width="150px" class="parameters_name">
638
<col class="parameters_description">
639
<col width="200px" class="parameters_annotations">
518
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
519
<td>image to fill</td>
522
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
523
<td>position to start fill</td>
526
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
527
<td>position to start fill</td>
530
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
531
<td>colour to fill with</td>
534
<td><p><span class="term"><em class="parameter"><code>dout</code></em> :</span></p></td>
535
<td>output the bounding box of the filled area</td>
538
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
539
<td>0 on success, or -1 on error.</td>
643
<td class="parameter_name"><p>image</p></td>
644
<td class="parameter_description"><p>image to fill</p></td>
645
<td class="parameter_annotations"> </td>
648
<td class="parameter_name"><p>x</p></td>
649
<td class="parameter_description"><p>position to start fill</p></td>
650
<td class="parameter_annotations"> </td>
653
<td class="parameter_name"><p>y</p></td>
654
<td class="parameter_description"><p>position to start fill</p></td>
655
<td class="parameter_annotations"> </td>
658
<td class="parameter_name"><p>ink</p></td>
659
<td class="parameter_description"><p>colour to fill with</p></td>
660
<td class="parameter_annotations"> </td>
663
<td class="parameter_name"><p>dout</p></td>
664
<td class="parameter_description"><p>output the bounding box of the filled area </p></td>
665
<td class="parameter_annotations"> </td>
670
<div class="refsect3">
671
<a name="id-1.3.9.8.9.8"></a><h4>Returns</h4>
672
<p> 0 on success, or -1 on error.</p>
545
677
<div class="refsect2">
546
<a name="im-draw-flood-blob"></a><h3>im_draw_flood_blob ()</h3>
547
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_flood_blob (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
548
<em class="parameter"><code><span class="type">int</span> x</code></em>,
549
<em class="parameter"><code><span class="type">int</span> y</code></em>,
550
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
551
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
553
Flood-fill <em class="parameter"><code>image</code></em> with <em class="parameter"><code>ink</code></em>, starting at position <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>. The filled area is
678
<a name="im-draw-flood-blob"></a><h3>im_draw_flood_blob ()</h3>
679
<pre class="programlisting"><span class="returnvalue">int</span>
680
im_draw_flood_blob (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
681
<em class="parameter"><code><span class="type">int</span> x</code></em>,
682
<em class="parameter"><code><span class="type">int</span> y</code></em>,
683
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>,
684
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
685
<p>Flood-fill <em class="parameter"><code>image</code></em>
686
with <em class="parameter"><code>ink</code></em>
687
, starting at position <em class="parameter"><code>x</code></em>
688
, <em class="parameter"><code>y</code></em>
554
690
bounded by pixels that are equal to the start pixel, in other words, it
555
searches for a blob of same-coloured pixels.
558
The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>. <em class="parameter"><code>dout</code></em> may be
562
See also: <a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()"><code class="function">im_draw_flood()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()"><code class="function">im_draw_flood_other()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>.
564
<div class="variablelist"><table border="0" class="variablelist">
566
<col align="left" valign="top">
571
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
572
<td>image to fill</td>
575
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
576
<td>position to start fill</td>
579
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
580
<td>position to start fill</td>
583
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
584
<td>colour to fill with</td>
587
<td><p><span class="term"><em class="parameter"><code>dout</code></em> :</span></p></td>
588
<td>output the bounding box of the filled area</td>
591
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
592
<td>0 on success, or -1 on error.</td>
598
<div class="refsect2">
599
<a name="im-draw-flood-other"></a><h3>im_draw_flood_other ()</h3>
600
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_flood_other (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
601
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *test</code></em>,
602
<em class="parameter"><code><span class="type">int</span> x</code></em>,
603
<em class="parameter"><code><span class="type">int</span> y</code></em>,
604
<em class="parameter"><code><span class="type">int</span> serial</code></em>,
605
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
607
Flood-fill <em class="parameter"><code>image</code></em> with <em class="parameter"><code>serial</code></em>, starting at position <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>. The filled
608
area is bounded by pixels in <em class="parameter"><code>test</code></em> that are equal to the start pixel, in
609
other words, it searches <em class="parameter"><code>test</code></em> for a blob of same-coloured pixels, marking
610
those pixels in <em class="parameter"><code>image</code></em> with <em class="parameter"><code>serial</code></em>.
613
The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>. <em class="parameter"><code>dout</code></em> may be
617
See also: <a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()"><code class="function">im_draw_flood()</code></a>, <a class="link" href="libvips-morphology.html#im-label-regions" title="im_label_regions ()"><code class="function">im_label_regions()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>.
619
<div class="variablelist"><table border="0" class="variablelist">
621
<col align="left" valign="top">
626
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
627
<td>image to mark</td>
630
<td><p><span class="term"><em class="parameter"><code>test</code></em> :</span></p></td>
631
<td>image to test</td>
634
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
635
<td>position to start fill</td>
638
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
639
<td>position to start fill</td>
642
<td><p><span class="term"><em class="parameter"><code>serial</code></em> :</span></p></td>
643
<td>mark pixels with this number</td>
646
<td><p><span class="term"><em class="parameter"><code>dout</code></em> :</span></p></td>
647
<td>output the bounding box of the filled area</td>
650
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
651
<td>0 on success, or -1 on error.</td>
657
<div class="refsect2">
658
<a name="im-draw-mask"></a><h3>im_draw_mask ()</h3>
659
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_mask (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
660
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask_im</code></em>,
661
<em class="parameter"><code><span class="type">int</span> x</code></em>,
662
<em class="parameter"><code><span class="type">int</span> y</code></em>,
663
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
665
Draw a mask on the image. <em class="parameter"><code>mask_im</code></em> is a monochrome 8-bit image with 0/255
666
for transparent or <em class="parameter"><code>ink</code></em> coloured points. Intermediate values blend the ink
667
with the pixel. Use with <a href="http://http://www.vips.ecs.soton.ac.uk/libvips-conversion.html#im-text"><code class="function">im_text()</code></a> to draw text on an image.
670
<em class="parameter"><code>ink</code></em> is an array of bytes
691
searches for a blob of same-coloured pixels.</p>
692
<p>The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>
693
. <em class="parameter"><code>dout</code></em>
696
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()"><code class="function">im_draw_flood()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-other" title="im_draw_flood_other ()"><code class="function">im_draw_flood_other()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>.</p>
697
<div class="refsect3">
698
<a name="id-1.3.9.8.10.7"></a><h4>Parameters</h4>
699
<div class="informaltable"><table width="100%" border="0">
701
<col width="150px" class="parameters_name">
702
<col class="parameters_description">
703
<col width="200px" class="parameters_annotations">
707
<td class="parameter_name"><p>image</p></td>
708
<td class="parameter_description"><p>image to fill</p></td>
709
<td class="parameter_annotations"> </td>
712
<td class="parameter_name"><p>x</p></td>
713
<td class="parameter_description"><p>position to start fill</p></td>
714
<td class="parameter_annotations"> </td>
717
<td class="parameter_name"><p>y</p></td>
718
<td class="parameter_description"><p>position to start fill</p></td>
719
<td class="parameter_annotations"> </td>
722
<td class="parameter_name"><p>ink</p></td>
723
<td class="parameter_description"><p>colour to fill with</p></td>
724
<td class="parameter_annotations"> </td>
727
<td class="parameter_name"><p>dout</p></td>
728
<td class="parameter_description"><p>output the bounding box of the filled area </p></td>
729
<td class="parameter_annotations"> </td>
734
<div class="refsect3">
735
<a name="id-1.3.9.8.10.8"></a><h4>Returns</h4>
736
<p> 0 on success, or -1 on error.</p>
741
<div class="refsect2">
742
<a name="im-draw-flood-other"></a><h3>im_draw_flood_other ()</h3>
743
<pre class="programlisting"><span class="returnvalue">int</span>
744
im_draw_flood_other (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
745
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *test</code></em>,
746
<em class="parameter"><code><span class="type">int</span> x</code></em>,
747
<em class="parameter"><code><span class="type">int</span> y</code></em>,
748
<em class="parameter"><code><span class="type">int</span> serial</code></em>,
749
<em class="parameter"><code><a class="link" href="libvips-rect.html#VipsRect" title="VipsRect"><span class="type">VipsRect</span></a> *dout</code></em>);</pre>
750
<p>Flood-fill <em class="parameter"><code>image</code></em>
751
with <em class="parameter"><code>serial</code></em>
752
, starting at position <em class="parameter"><code>x</code></em>
753
, <em class="parameter"><code>y</code></em>
755
area is bounded by pixels in <em class="parameter"><code>test</code></em>
756
that are equal to the start pixel, in
757
other words, it searches <em class="parameter"><code>test</code></em>
758
for a blob of same-coloured pixels, marking
759
those pixels in <em class="parameter"><code>image</code></em>
760
with <em class="parameter"><code>serial</code></em>
762
<p>The bounding box of the modified pixels is returned in <em class="parameter"><code>dout</code></em>
763
. <em class="parameter"><code>dout</code></em>
766
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-flood" title="im_draw_flood ()"><code class="function">im_draw_flood()</code></a>, <a class="link" href="libvips-morphology.html#im-label-regions" title="im_label_regions ()"><code class="function">im_label_regions()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-flood-blob" title="im_draw_flood_blob ()"><code class="function">im_draw_flood_blob()</code></a>.</p>
767
<div class="refsect3">
768
<a name="id-1.3.9.8.11.7"></a><h4>Parameters</h4>
769
<div class="informaltable"><table width="100%" border="0">
771
<col width="150px" class="parameters_name">
772
<col class="parameters_description">
773
<col width="200px" class="parameters_annotations">
777
<td class="parameter_name"><p>image</p></td>
778
<td class="parameter_description"><p>image to mark</p></td>
779
<td class="parameter_annotations"> </td>
782
<td class="parameter_name"><p>test</p></td>
783
<td class="parameter_description"><p>image to test</p></td>
784
<td class="parameter_annotations"> </td>
787
<td class="parameter_name"><p>x</p></td>
788
<td class="parameter_description"><p>position to start fill</p></td>
789
<td class="parameter_annotations"> </td>
792
<td class="parameter_name"><p>y</p></td>
793
<td class="parameter_description"><p>position to start fill</p></td>
794
<td class="parameter_annotations"> </td>
797
<td class="parameter_name"><p>serial</p></td>
798
<td class="parameter_description"><p>mark pixels with this number</p></td>
799
<td class="parameter_annotations"> </td>
802
<td class="parameter_name"><p>dout</p></td>
803
<td class="parameter_description"><p>output the bounding box of the filled area </p></td>
804
<td class="parameter_annotations"> </td>
809
<div class="refsect3">
810
<a name="id-1.3.9.8.11.8"></a><h4>Returns</h4>
811
<p> 0 on success, or -1 on error.</p>
816
<div class="refsect2">
817
<a name="im-draw-mask"></a><h3>im_draw_mask ()</h3>
818
<pre class="programlisting"><span class="returnvalue">int</span>
819
im_draw_mask (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
820
<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *mask_im</code></em>,
821
<em class="parameter"><code><span class="type">int</span> x</code></em>,
822
<em class="parameter"><code><span class="type">int</span> y</code></em>,
823
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
824
<p>Draw a mask on the image. <em class="parameter"><code>mask_im</code></em>
825
is a monochrome 8-bit image with 0/255
826
for transparent or <em class="parameter"><code>ink</code></em>
827
coloured points. Intermediate values blend the ink
828
with the pixel. Use with <code class="function">im_text()</code> to draw text on an image.</p>
829
<p><em class="parameter"><code>ink</code></em>
671
831
containing a valid pixel for the image's format.
672
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em> ) bytes.
675
See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>, <a href="http://http://www.vips.ecs.soton.ac.uk/libvips-conversion.html#im-text"><code class="function">im_text()</code></a>, <a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()"><code class="function">im_draw_line_user()</code></a>.
677
<div class="variablelist"><table border="0" class="variablelist">
679
<col align="left" valign="top">
684
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
685
<td>image to draw on</td>
688
<td><p><span class="term"><em class="parameter"><code>mask_im</code></em> :</span></p></td>
689
<td>mask of 0/255 values showing where to plot</td>
692
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
693
<td>draw mask here</td>
696
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
697
<td>draw mask here</td>
700
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
701
<td>value to draw</td>
704
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
705
<td>0 on success, or -1 on error.</td>
711
<div class="refsect2">
712
<a name="im-draw-point"></a><h3>im_draw_point ()</h3>
713
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_point (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
714
<em class="parameter"><code><span class="type">int</span> x</code></em>,
715
<em class="parameter"><code><span class="type">int</span> y</code></em>,
716
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
718
Draws a single point on an image.
721
<em class="parameter"><code>ink</code></em> is an array of bytes containing a valid pixel for the image's format.
722
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>im</code></em> ) bytes.
725
See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.
727
<div class="variablelist"><table border="0" class="variablelist">
729
<col align="left" valign="top">
734
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
735
<td>image to draw on</td>
738
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
739
<td>position to draw</td>
742
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
743
<td>position to draw</td>
746
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
747
<td>value to draw</td>
750
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
751
<td>0 on success, or -1 on error.</td>
757
<div class="refsect2">
758
<a name="im-read-point"></a><h3>im_read_point ()</h3>
759
<pre class="programlisting"><span class="returnvalue">int</span> im_read_point (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
760
<em class="parameter"><code><span class="type">int</span> x</code></em>,
761
<em class="parameter"><code><span class="type">int</span> y</code></em>,
762
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
764
Reads a single point on an image.
767
<em class="parameter"><code>ink</code></em> is an array of bytes to contain a valid pixel for the image's format.
768
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>im</code></em> ) bytes.
771
See also: <a class="link" href="libvips-inplace.html#im-draw-point" title="im_draw_point ()"><code class="function">im_draw_point()</code></a>.
773
<div class="variablelist"><table border="0" class="variablelist">
775
<col align="left" valign="top">
780
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
781
<td>image to read from</td>
784
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
785
<td>position to read</td>
788
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
789
<td>position to read</td>
792
<td><p><span class="term"><em class="parameter"><code>ink</code></em> :</span></p></td>
793
<td>read value here</td>
796
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
797
<td>0 on success, or -1 on error.</td>
803
<div class="refsect2">
804
<a name="im-draw-smudge"></a><h3>im_draw_smudge ()</h3>
805
<pre class="programlisting"><span class="returnvalue">int</span> im_draw_smudge (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
806
<em class="parameter"><code><span class="type">int</span> left</code></em>,
807
<em class="parameter"><code><span class="type">int</span> top</code></em>,
808
<em class="parameter"><code><span class="type">int</span> width</code></em>,
809
<em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
811
Smudge a section of <em class="parameter"><code>image</code></em>. Each pixel in the area <em class="parameter"><code>left</code></em>, <em class="parameter"><code>top</code></em>, <em class="parameter"><code>width</code></em>,
812
<em class="parameter"><code>height</code></em> is replaced by the average of the surrounding 3x3 pixels.
815
This an inplace operation, so <em class="parameter"><code>image</code></em> is changed. It does not thread and will
832
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>image</code></em>
834
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-circle" title="im_draw_circle ()"><code class="function">im_draw_circle()</code></a>, <code class="function">im_text()</code>, <a class="link" href="libvips-inplace.html#im-draw-line-user" title="im_draw_line_user ()"><code class="function">im_draw_line_user()</code></a>.</p>
835
<div class="refsect3">
836
<a name="id-1.3.9.8.12.7"></a><h4>Parameters</h4>
837
<div class="informaltable"><table width="100%" border="0">
839
<col width="150px" class="parameters_name">
840
<col class="parameters_description">
841
<col width="200px" class="parameters_annotations">
845
<td class="parameter_name"><p>image</p></td>
846
<td class="parameter_description"><p>image to draw on</p></td>
847
<td class="parameter_annotations"> </td>
850
<td class="parameter_name"><p>mask_im</p></td>
851
<td class="parameter_description"><p>mask of 0/255 values showing where to plot</p></td>
852
<td class="parameter_annotations"> </td>
855
<td class="parameter_name"><p>x</p></td>
856
<td class="parameter_description"><p>draw mask here</p></td>
857
<td class="parameter_annotations"> </td>
860
<td class="parameter_name"><p>y</p></td>
861
<td class="parameter_description"><p>draw mask here</p></td>
862
<td class="parameter_annotations"> </td>
865
<td class="parameter_name"><p>ink</p></td>
866
<td class="parameter_description"><p>value to draw</p></td>
867
<td class="parameter_annotations"> </td>
872
<div class="refsect3">
873
<a name="id-1.3.9.8.12.8"></a><h4>Returns</h4>
874
<p> 0 on success, or -1 on error.</p>
879
<div class="refsect2">
880
<a name="im-draw-point"></a><h3>im_draw_point ()</h3>
881
<pre class="programlisting"><span class="returnvalue">int</span>
882
im_draw_point (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
883
<em class="parameter"><code><span class="type">int</span> x</code></em>,
884
<em class="parameter"><code><span class="type">int</span> y</code></em>,
885
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
886
<p>Draws a single point on an image. </p>
887
<p><em class="parameter"><code>ink</code></em>
888
is an array of bytes containing a valid pixel for the image's format.
889
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>im</code></em>
891
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.</p>
892
<div class="refsect3">
893
<a name="id-1.3.9.8.13.7"></a><h4>Parameters</h4>
894
<div class="informaltable"><table width="100%" border="0">
896
<col width="150px" class="parameters_name">
897
<col class="parameters_description">
898
<col width="200px" class="parameters_annotations">
902
<td class="parameter_name"><p>image</p></td>
903
<td class="parameter_description"><p>image to draw on</p></td>
904
<td class="parameter_annotations"> </td>
907
<td class="parameter_name"><p>x</p></td>
908
<td class="parameter_description"><p>position to draw</p></td>
909
<td class="parameter_annotations"> </td>
912
<td class="parameter_name"><p>y</p></td>
913
<td class="parameter_description"><p>position to draw</p></td>
914
<td class="parameter_annotations"> </td>
917
<td class="parameter_name"><p>ink</p></td>
918
<td class="parameter_description"><p>value to draw</p></td>
919
<td class="parameter_annotations"> </td>
924
<div class="refsect3">
925
<a name="id-1.3.9.8.13.8"></a><h4>Returns</h4>
926
<p> 0 on success, or -1 on error.</p>
931
<div class="refsect2">
932
<a name="im-read-point"></a><h3>im_read_point ()</h3>
933
<pre class="programlisting"><span class="returnvalue">int</span>
934
im_read_point (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
935
<em class="parameter"><code><span class="type">int</span> x</code></em>,
936
<em class="parameter"><code><span class="type">int</span> y</code></em>,
937
<em class="parameter"><code><span class="type">VipsPel</span> *ink</code></em>);</pre>
938
<p>Reads a single point on an image. </p>
939
<p><em class="parameter"><code>ink</code></em>
940
is an array of bytes to contain a valid pixel for the image's format.
941
It must have at least IM_IMAGE_SIZEOF_PEL( <em class="parameter"><code>im</code></em>
943
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-point" title="im_draw_point ()"><code class="function">im_draw_point()</code></a>.</p>
944
<div class="refsect3">
945
<a name="id-1.3.9.8.14.7"></a><h4>Parameters</h4>
946
<div class="informaltable"><table width="100%" border="0">
948
<col width="150px" class="parameters_name">
949
<col class="parameters_description">
950
<col width="200px" class="parameters_annotations">
954
<td class="parameter_name"><p>image</p></td>
955
<td class="parameter_description"><p>image to read from</p></td>
956
<td class="parameter_annotations"> </td>
959
<td class="parameter_name"><p>x</p></td>
960
<td class="parameter_description"><p>position to read</p></td>
961
<td class="parameter_annotations"> </td>
964
<td class="parameter_name"><p>y</p></td>
965
<td class="parameter_description"><p>position to read</p></td>
966
<td class="parameter_annotations"> </td>
969
<td class="parameter_name"><p>ink</p></td>
970
<td class="parameter_description"><p>read value here</p></td>
971
<td class="parameter_annotations"> </td>
976
<div class="refsect3">
977
<a name="id-1.3.9.8.14.8"></a><h4>Returns</h4>
978
<p> 0 on success, or -1 on error.</p>
983
<div class="refsect2">
984
<a name="im-draw-smudge"></a><h3>im_draw_smudge ()</h3>
985
<pre class="programlisting"><span class="returnvalue">int</span>
986
im_draw_smudge (<em class="parameter"><code><a class="link" href="VipsImage.html" title="VipsImage"><span class="type">VipsImage</span></a> *image</code></em>,
987
<em class="parameter"><code><span class="type">int</span> left</code></em>,
988
<em class="parameter"><code><span class="type">int</span> top</code></em>,
989
<em class="parameter"><code><span class="type">int</span> width</code></em>,
990
<em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
991
<p>Smudge a section of <em class="parameter"><code>image</code></em>
992
. Each pixel in the area <em class="parameter"><code>left</code></em>
993
, <em class="parameter"><code>top</code></em>
994
, <em class="parameter"><code>width</code></em>
996
<em class="parameter"><code>height</code></em>
997
is replaced by the average of the surrounding 3x3 pixels. </p>
998
<p>This an inplace operation, so <em class="parameter"><code>image</code></em>
999
is changed. It does not thread and will
816
1000
not work well as part of a pipeline. On 32-bit machines it will be limited
820
See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.
822
<div class="variablelist"><table border="0" class="variablelist">
1002
<p>See also: <a class="link" href="libvips-inplace.html#im-draw-line" title="im_draw_line ()"><code class="function">im_draw_line()</code></a>.</p>
1003
<div class="refsect3">
1004
<a name="id-1.3.9.8.15.7"></a><h4>Parameters</h4>
1005
<div class="informaltable"><table width="100%" border="0">
824
<col align="left" valign="top">
1007
<col width="150px" class="parameters_name">
1008
<col class="parameters_description">
1009
<col width="200px" class="parameters_annotations">
829
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
830
<td>image to smudge</td>
833
<td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
834
<td>area to smudge</td>
837
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
838
<td>area to smudge</td>
841
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
842
<td>area to smudge</td>
845
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
846
<td>area to smudge</td>
849
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
850
<td>0 on success, or -1 on error.</td>
1013
<td class="parameter_name"><p>image</p></td>
1014
<td class="parameter_description"><p>image to smudge</p></td>
1015
<td class="parameter_annotations"> </td>
1018
<td class="parameter_name"><p>left</p></td>
1019
<td class="parameter_description"><p>area to smudge</p></td>
1020
<td class="parameter_annotations"> </td>
1023
<td class="parameter_name"><p>top</p></td>
1024
<td class="parameter_description"><p>area to smudge</p></td>
1025
<td class="parameter_annotations"> </td>
1028
<td class="parameter_name"><p>width</p></td>
1029
<td class="parameter_description"><p>area to smudge</p></td>
1030
<td class="parameter_annotations"> </td>
1033
<td class="parameter_name"><p>height</p></td>
1034
<td class="parameter_description"><p>area to smudge</p></td>
1035
<td class="parameter_annotations"> </td>
1040
<div class="refsect3">
1041
<a name="id-1.3.9.8.15.8"></a><h4>Returns</h4>
1042
<p> 0 on success, or -1 on error.</p>
1047
<div class="refsect1">
1048
<a name="libvips-inplace.other_details"></a><h2>Types and Values</h2>
857
1051
<div class="footer">
859
Generated by GTK-Doc V1.19</div>
1053
Generated by GTK-Doc V1.20</div>
b'\\ No newline at end of file'