1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
5
<refentry id="libgimp-gimppixelrgn">
7
<refentrytitle>gimppixelrgn</refentrytitle>
8
<manvolnum>3</manvolnum>
9
<refmiscinfo>LIBGIMP Library</refmiscinfo>
13
<refname>gimppixelrgn</refname><refpurpose>Functions for operating on pixel regions.</refpurpose>
16
<refsynopsisdiv><title>Synopsis</title>
22
<link linkend="GimpPixelRgn">GimpPixelRgn</link>;
23
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-init">gimp_pixel_rgn_init</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
24
<link linkend="GimpDrawable">GimpDrawable</link> *drawable,
25
<link linkend="gint">gint</link> x,
26
<link linkend="gint">gint</link> y,
27
<link linkend="gint">gint</link> width,
28
<link linkend="gint">gint</link> height,
29
<link linkend="gint">gint</link> dirty,
30
<link linkend="gint">gint</link> shadow);
31
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-resize">gimp_pixel_rgn_resize</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
32
<link linkend="gint">gint</link> x,
33
<link linkend="gint">gint</link> y,
34
<link linkend="gint">gint</link> width,
35
<link linkend="gint">gint</link> height);
36
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-get-pixel">gimp_pixel_rgn_get_pixel</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
37
<link linkend="guchar">guchar</link> *buf,
38
<link linkend="gint">gint</link> x,
39
<link linkend="gint">gint</link> y);
40
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-get-row">gimp_pixel_rgn_get_row</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
41
<link linkend="guchar">guchar</link> *buf,
42
<link linkend="gint">gint</link> x,
43
<link linkend="gint">gint</link> y,
44
<link linkend="gint">gint</link> width);
45
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-get-col">gimp_pixel_rgn_get_col</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
46
<link linkend="guchar">guchar</link> *buf,
47
<link linkend="gint">gint</link> x,
48
<link linkend="gint">gint</link> y,
49
<link linkend="gint">gint</link> height);
50
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-get-rect">gimp_pixel_rgn_get_rect</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
51
<link linkend="guchar">guchar</link> *buf,
52
<link linkend="gint">gint</link> x,
53
<link linkend="gint">gint</link> y,
54
<link linkend="gint">gint</link> width,
55
<link linkend="gint">gint</link> height);
56
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-set-pixel">gimp_pixel_rgn_set_pixel</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
57
const <link linkend="guchar">guchar</link> *buf,
58
<link linkend="gint">gint</link> x,
59
<link linkend="gint">gint</link> y);
60
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-set-row">gimp_pixel_rgn_set_row</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
61
const <link linkend="guchar">guchar</link> *buf,
62
<link linkend="gint">gint</link> x,
63
<link linkend="gint">gint</link> y,
64
<link linkend="gint">gint</link> width);
65
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-set-col">gimp_pixel_rgn_set_col</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
66
const <link linkend="guchar">guchar</link> *buf,
67
<link linkend="gint">gint</link> x,
68
<link linkend="gint">gint</link> y,
69
<link linkend="gint">gint</link> height);
70
<link linkend="void">void</link> <link linkend="gimp-pixel-rgn-set-rect">gimp_pixel_rgn_set_rect</link> (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
71
const <link linkend="guchar">guchar</link> *buf,
72
<link linkend="gint">gint</link> x,
73
<link linkend="gint">gint</link> y,
74
<link linkend="gint">gint</link> width,
75
<link linkend="gint">gint</link> height);
76
<link linkend="gpointer">gpointer</link> <link linkend="gimp-pixel-rgns-register">gimp_pixel_rgns_register</link> (<link linkend="gint">gint</link> nrgns,
78
<link linkend="gpointer">gpointer</link> <link linkend="gimp-pixel-rgns-register2">gimp_pixel_rgns_register2</link> (<link linkend="gint">gint</link> nrgns,
79
<link linkend="GimpPixelRgn">GimpPixelRgn</link> **prs);
80
<link linkend="gpointer">gpointer</link> <link linkend="gimp-pixel-rgns-process">gimp_pixel_rgns_process</link> (<link linkend="gpointer">gpointer</link> pri_ptr);
93
<title>Description</title>
95
Functions for operating on pixel regions. These functions provide
96
fast ways of accessing and modifying portions of a drawable.
102
<title>Details</title>
104
<title><anchor id="GimpPixelRgn"/>GimpPixelRgn</title>
105
<indexterm><primary>GimpPixelRgn</primary></indexterm><programlisting>typedef struct {
106
guchar *data; /* pointer to region data */
107
GimpDrawable *drawable; /* pointer to drawable */
108
guint bpp; /* bytes per pixel */
109
guint rowstride; /* bytes per pixel row */
110
guint x, y; /* origin */
111
guint w, h; /* width and height of region */
112
guint dirty : 1; /* will this region be dirtied? */
113
guint shadow : 1; /* will this region use the shadow or normal tiles */
114
guint process_count; /* used internally */
121
<title><anchor id="gimp-pixel-rgn-init"/>gimp_pixel_rgn_init ()</title>
122
<indexterm><primary>gimp_pixel_rgn_init</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_init (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
123
<link linkend="GimpDrawable">GimpDrawable</link> *drawable,
124
<link linkend="gint">gint</link> x,
125
<link linkend="gint">gint</link> y,
126
<link linkend="gint">gint</link> width,
127
<link linkend="gint">gint</link> height,
128
<link linkend="gint">gint</link> dirty,
129
<link linkend="gint">gint</link> shadow);</programlisting>
131
Initialize the pixel region pointed by <parameter>pr</parameter> with the specified parameters.
134
The <parameter>dirty</parameter> and <parameter>shadow</parameter> flags can be used as follows:
137
- <parameter>dirty</parameter> = FALSE, <parameter>shadow</parameter> = FALSE: the region will be used to read
138
the actual drawable datas. This
139
is useful for save plug-ins or for
143
- <parameter>dirty</parameter> = FALSE, <parameter>shadow</parameter> = TRUE: the region will be used to read the
144
shadow tiles. This is used in
145
some filter plug-ins which operate
146
in two passes such as gaussian
147
blur. The first pass reads the
148
actual drawable data and writes to
149
the shadow tiles, and the second
150
one reads from and writes to the
154
- <parameter>dirty</parameter> = TRUE, <parameter>shadow</parameter> = TRUE: the region will be used to write to
155
the shadow tiles. It is common
156
practice to write to the shadow
158
#<link linkend="gimp-drawable-merge-shadow"><function>gimp_drawable_merge_shadow()</function></link> to
159
merge the changes from the shadow
160
tiles using the current selection
164
- <parameter>dirty</parameter> = TRUE, <parameter>shadow</parameter> = FALSE: the region will be used to directly
165
change the drawable content. Don't
166
do this, since this could prevent
167
the Undo-System from working as
171
</para><variablelist role="params">
172
<varlistentry><term><parameter>pr</parameter> :</term>
173
<listitem><simpara> a pointer to a <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link> variable.
174
</simpara></listitem></varlistentry>
175
<varlistentry><term><parameter>drawable</parameter> :</term>
176
<listitem><simpara> the <link linkend="GimpDrawable"><type>GimpDrawable</type></link> the new region will be attached to.
177
</simpara></listitem></varlistentry>
178
<varlistentry><term><parameter>x</parameter> :</term>
179
<listitem><simpara> the x coordinate of the top-left pixel of the region in the
180
<parameter>drawable</parameter>.
181
</simpara></listitem></varlistentry>
182
<varlistentry><term><parameter>y</parameter> :</term>
183
<listitem><simpara> the y coordinate of the top-left pixel of the region in the
184
<parameter>drawable</parameter>.
185
</simpara></listitem></varlistentry>
186
<varlistentry><term><parameter>width</parameter> :</term>
187
<listitem><simpara> the width of the region.
188
</simpara></listitem></varlistentry>
189
<varlistentry><term><parameter>height</parameter> :</term>
190
<listitem><simpara> the height of the region.
191
</simpara></listitem></varlistentry>
192
<varlistentry><term><parameter>dirty</parameter> :</term>
193
<listitem><simpara> a <link linkend="gboolean"><type>gboolean</type></link> indicating whether the <parameter>drawable</parameter> should be marked
195
</simpara></listitem></varlistentry>
196
<varlistentry><term><parameter>shadow</parameter> :</term>
197
<listitem><simpara> a <link linkend="gboolean"><type>gboolean</type></link> indicating whether the region is attached to the
198
shadow tiles or the real <parameter>drawable</parameter> tiles.
199
</simpara></listitem></varlistentry>
200
</variablelist></refsect2>
202
<title><anchor id="gimp-pixel-rgn-resize"/>gimp_pixel_rgn_resize ()</title>
203
<indexterm><primary>gimp_pixel_rgn_resize</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_resize (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
204
<link linkend="gint">gint</link> x,
205
<link linkend="gint">gint</link> y,
206
<link linkend="gint">gint</link> width,
207
<link linkend="gint">gint</link> height);</programlisting>
209
Change the position and size of a previously initialized pixel region.</para>
212
</para><variablelist role="params">
213
<varlistentry><term><parameter>pr</parameter> :</term>
214
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
215
</simpara></listitem></varlistentry>
216
<varlistentry><term><parameter>x</parameter> :</term>
217
<listitem><simpara> the x coordinate of the new position of the region's
219
</simpara></listitem></varlistentry>
220
<varlistentry><term><parameter>y</parameter> :</term>
221
<listitem><simpara> the y coordinate of the new position of the region's
223
</simpara></listitem></varlistentry>
224
<varlistentry><term><parameter>width</parameter> :</term>
225
<listitem><simpara> the new width of the region.
226
</simpara></listitem></varlistentry>
227
<varlistentry><term><parameter>height</parameter> :</term>
228
<listitem><simpara> the new height of the region.
229
</simpara></listitem></varlistentry>
230
</variablelist></refsect2>
232
<title><anchor id="gimp-pixel-rgn-get-pixel"/>gimp_pixel_rgn_get_pixel ()</title>
233
<indexterm><primary>gimp_pixel_rgn_get_pixel</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_get_pixel (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
234
<link linkend="guchar">guchar</link> *buf,
235
<link linkend="gint">gint</link> x,
236
<link linkend="gint">gint</link> y);</programlisting>
238
Fill the buffer pointed by <parameter>buf</parameter> with the value of the pixel at (<parameter>x</parameter>, <parameter>y</parameter>)
239
in the region <parameter>pr</parameter>. <parameter>buf</parameter> should be large enough to hold the pixel value
240
(1 <link linkend="guchar"><type>guchar</type></link> for an indexed or grayscale drawable, 2 <link linkend="guchar"><type>guchar</type></link> for
241
indexed with alpha or grayscale with alpha drawable, 3 <link linkend="guchar"><type>guchar</type></link> for
242
rgb drawable and 4 <link linkend="guchar"><type>guchar</type></link> for rgb with alpha drawable.</para>
245
</para><variablelist role="params">
246
<varlistentry><term><parameter>pr</parameter> :</term>
247
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
248
</simpara></listitem></varlistentry>
249
<varlistentry><term><parameter>buf</parameter> :</term>
250
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
251
</simpara></listitem></varlistentry>
252
<varlistentry><term><parameter>x</parameter> :</term>
253
<listitem><simpara> the x coordinate of the wanted pixel (relative to the drawable)
254
</simpara></listitem></varlistentry>
255
<varlistentry><term><parameter>y</parameter> :</term>
256
<listitem><simpara> the y coordinate of the wanted pixel (relative to the drawable)
257
</simpara></listitem></varlistentry>
258
</variablelist></refsect2>
260
<title><anchor id="gimp-pixel-rgn-get-row"/>gimp_pixel_rgn_get_row ()</title>
261
<indexterm><primary>gimp_pixel_rgn_get_row</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_get_row (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
262
<link linkend="guchar">guchar</link> *buf,
263
<link linkend="gint">gint</link> x,
264
<link linkend="gint">gint</link> y,
265
<link linkend="gint">gint</link> width);</programlisting>
267
Get several pixels of a region in a row. This function fills the buffer
268
<parameter>buf</parameter> with the values of the pixels from (<parameter>x</parameter>, <parameter>y</parameter>) to (<parameter>x</parameter>+<parameter>width</parameter>-1, <parameter>y</parameter>).
269
<parameter>buf</parameter> should be large enough to hold all these values.</para>
272
</para><variablelist role="params">
273
<varlistentry><term><parameter>pr</parameter> :</term>
274
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
275
</simpara></listitem></varlistentry>
276
<varlistentry><term><parameter>buf</parameter> :</term>
277
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
278
</simpara></listitem></varlistentry>
279
<varlistentry><term><parameter>x</parameter> :</term>
280
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
281
</simpara></listitem></varlistentry>
282
<varlistentry><term><parameter>y</parameter> :</term>
283
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
284
</simpara></listitem></varlistentry>
285
<varlistentry><term><parameter>width</parameter> :</term>
286
<listitem><simpara> the number of pixels to get.
287
</simpara></listitem></varlistentry>
288
</variablelist></refsect2>
290
<title><anchor id="gimp-pixel-rgn-get-col"/>gimp_pixel_rgn_get_col ()</title>
291
<indexterm><primary>gimp_pixel_rgn_get_col</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_get_col (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
292
<link linkend="guchar">guchar</link> *buf,
293
<link linkend="gint">gint</link> x,
294
<link linkend="gint">gint</link> y,
295
<link linkend="gint">gint</link> height);</programlisting>
297
Get several pixels of a region's column. This function fills the buffer
298
<parameter>buf</parameter> with the values of the pixels from (<parameter>x</parameter>, <parameter>y</parameter>) to (<parameter>x</parameter>, <parameter>y</parameter>+<parameter>height</parameter>-1).
299
<parameter>buf</parameter> should be large enough to hold all these values.</para>
302
</para><variablelist role="params">
303
<varlistentry><term><parameter>pr</parameter> :</term>
304
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
305
</simpara></listitem></varlistentry>
306
<varlistentry><term><parameter>buf</parameter> :</term>
307
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
308
</simpara></listitem></varlistentry>
309
<varlistentry><term><parameter>x</parameter> :</term>
310
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
311
</simpara></listitem></varlistentry>
312
<varlistentry><term><parameter>y</parameter> :</term>
313
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
314
</simpara></listitem></varlistentry>
315
<varlistentry><term><parameter>height</parameter> :</term>
316
<listitem><simpara> the number of pixels to get.
317
</simpara></listitem></varlistentry>
318
</variablelist></refsect2>
320
<title><anchor id="gimp-pixel-rgn-get-rect"/>gimp_pixel_rgn_get_rect ()</title>
321
<indexterm><primary>gimp_pixel_rgn_get_rect</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_get_rect (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
322
<link linkend="guchar">guchar</link> *buf,
323
<link linkend="gint">gint</link> x,
324
<link linkend="gint">gint</link> y,
325
<link linkend="gint">gint</link> width,
326
<link linkend="gint">gint</link> height);</programlisting>
328
Get all the pixel values from the rectangle defined by <parameter>x</parameter>, <parameter>y</parameter>, <parameter>width</parameter> and
329
<parameter>height</parameter>. This function fills the buffer <parameter>buf</parameter> with the values of the pixels
330
from (<parameter>x</parameter>, <parameter>y</parameter>) to (<parameter>x</parameter>+<parameter>width</parameter>-1, <parameter>y</parameter>+<parameter>height</parameter>-1).
331
<parameter>buf</parameter> should be large enough to hold all these values (<parameter>width</parameter>*<parameter>height</parameter>*bpp).</para>
334
</para><variablelist role="params">
335
<varlistentry><term><parameter>pr</parameter> :</term>
336
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
337
</simpara></listitem></varlistentry>
338
<varlistentry><term><parameter>buf</parameter> :</term>
339
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
340
</simpara></listitem></varlistentry>
341
<varlistentry><term><parameter>x</parameter> :</term>
342
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
343
</simpara></listitem></varlistentry>
344
<varlistentry><term><parameter>y</parameter> :</term>
345
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
346
</simpara></listitem></varlistentry>
347
<varlistentry><term><parameter>width</parameter> :</term>
348
<listitem><simpara> the width of the rectangle.
349
</simpara></listitem></varlistentry>
350
<varlistentry><term><parameter>height</parameter> :</term>
351
<listitem><simpara> the height of the rectangle.
352
</simpara></listitem></varlistentry>
353
</variablelist></refsect2>
355
<title><anchor id="gimp-pixel-rgn-set-pixel"/>gimp_pixel_rgn_set_pixel ()</title>
356
<indexterm><primary>gimp_pixel_rgn_set_pixel</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_set_pixel (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
357
const <link linkend="guchar">guchar</link> *buf,
358
<link linkend="gint">gint</link> x,
359
<link linkend="gint">gint</link> y);</programlisting>
361
Set the pixel at (<parameter>x</parameter>, <parameter>y</parameter>) to the values from <parameter>buf</parameter>.</para>
364
</para><variablelist role="params">
365
<varlistentry><term><parameter>pr</parameter> :</term>
366
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
367
</simpara></listitem></varlistentry>
368
<varlistentry><term><parameter>buf</parameter> :</term>
369
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>.
370
</simpara></listitem></varlistentry>
371
<varlistentry><term><parameter>x</parameter> :</term>
372
<listitem><simpara> the x coordinate of the pixel (relative to the drawable).
373
</simpara></listitem></varlistentry>
374
<varlistentry><term><parameter>y</parameter> :</term>
375
<listitem><simpara> the y coordinate of the pixel (relative to the drawable).
376
</simpara></listitem></varlistentry>
377
</variablelist></refsect2>
379
<title><anchor id="gimp-pixel-rgn-set-row"/>gimp_pixel_rgn_set_row ()</title>
380
<indexterm><primary>gimp_pixel_rgn_set_row</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_set_row (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
381
const <link linkend="guchar">guchar</link> *buf,
382
<link linkend="gint">gint</link> x,
383
<link linkend="gint">gint</link> y,
384
<link linkend="gint">gint</link> width);</programlisting>
386
Set several pixels of a region in a row. This function draws the pixels
387
from (<parameter>x</parameter>, <parameter>y</parameter>) to (<parameter>x</parameter>+<parameter>width</parameter>-1, <parameter>y</parameter>) using the values of the buffer <parameter>buf</parameter>.
388
<parameter>buf</parameter> should be large enough to hold all these values.</para>
391
</para><variablelist role="params">
392
<varlistentry><term><parameter>pr</parameter> :</term>
393
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
394
</simpara></listitem></varlistentry>
395
<varlistentry><term><parameter>buf</parameter> :</term>
396
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
397
</simpara></listitem></varlistentry>
398
<varlistentry><term><parameter>x</parameter> :</term>
399
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
400
</simpara></listitem></varlistentry>
401
<varlistentry><term><parameter>y</parameter> :</term>
402
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
403
</simpara></listitem></varlistentry>
404
<varlistentry><term><parameter>width</parameter> :</term>
405
<listitem><simpara> the number of pixels to set.
406
</simpara></listitem></varlistentry>
407
</variablelist></refsect2>
409
<title><anchor id="gimp-pixel-rgn-set-col"/>gimp_pixel_rgn_set_col ()</title>
410
<indexterm><primary>gimp_pixel_rgn_set_col</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_set_col (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
411
const <link linkend="guchar">guchar</link> *buf,
412
<link linkend="gint">gint</link> x,
413
<link linkend="gint">gint</link> y,
414
<link linkend="gint">gint</link> height);</programlisting>
416
Set several pixels of a region's column. This function draws the pixels
417
from (<parameter>x</parameter>, <parameter>y</parameter>) to (<parameter>x</parameter>, <parameter>y</parameter>+<parameter>height</parameter>-1) using the values from the buffer <parameter>buf</parameter>.
418
<parameter>buf</parameter> should be large enough to hold all these values.</para>
421
</para><variablelist role="params">
422
<varlistentry><term><parameter>pr</parameter> :</term>
423
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
424
</simpara></listitem></varlistentry>
425
<varlistentry><term><parameter>buf</parameter> :</term>
426
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
427
</simpara></listitem></varlistentry>
428
<varlistentry><term><parameter>x</parameter> :</term>
429
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
430
</simpara></listitem></varlistentry>
431
<varlistentry><term><parameter>y</parameter> :</term>
432
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
433
</simpara></listitem></varlistentry>
434
<varlistentry><term><parameter>height</parameter> :</term>
435
<listitem><simpara> the number of pixels to set.
436
</simpara></listitem></varlistentry>
437
</variablelist></refsect2>
439
<title><anchor id="gimp-pixel-rgn-set-rect"/>gimp_pixel_rgn_set_rect ()</title>
440
<indexterm><primary>gimp_pixel_rgn_set_rect</primary></indexterm><programlisting><link linkend="void">void</link> gimp_pixel_rgn_set_rect (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
441
const <link linkend="guchar">guchar</link> *buf,
442
<link linkend="gint">gint</link> x,
443
<link linkend="gint">gint</link> y,
444
<link linkend="gint">gint</link> width,
445
<link linkend="gint">gint</link> height);</programlisting>
447
Set all the pixel of the rectangle defined by <parameter>x</parameter>, <parameter>y</parameter>, <parameter>width</parameter> and
448
<parameter>height</parameter>. This function draws the rectangle from (<parameter>x</parameter>, <parameter>y</parameter>) to
449
(<parameter>x</parameter>+<parameter>width</parameter>-1, <parameter>y</parameter>+<parameter>height</parameter>-1), using the pixel values from the buffer <parameter>buf</parameter>.
450
<parameter>buf</parameter> should be large enough to hold all these values (<parameter>width</parameter>*<parameter>height</parameter>*bpp).</para>
453
</para><variablelist role="params">
454
<varlistentry><term><parameter>pr</parameter> :</term>
455
<listitem><simpara> a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
456
</simpara></listitem></varlistentry>
457
<varlistentry><term><parameter>buf</parameter> :</term>
458
<listitem><simpara> a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
459
</simpara></listitem></varlistentry>
460
<varlistentry><term><parameter>x</parameter> :</term>
461
<listitem><simpara> the x coordinate of the first pixel (relative to the drawable).
462
</simpara></listitem></varlistentry>
463
<varlistentry><term><parameter>y</parameter> :</term>
464
<listitem><simpara> the y coordinate of the first pixel (relative to the drawable).
465
</simpara></listitem></varlistentry>
466
<varlistentry><term><parameter>width</parameter> :</term>
467
<listitem><simpara> the width of the rectangle.
468
</simpara></listitem></varlistentry>
469
<varlistentry><term><parameter>height</parameter> :</term>
470
<listitem><simpara> the height of the rectangle.
471
</simpara></listitem></varlistentry>
472
</variablelist></refsect2>
474
<title><anchor id="gimp-pixel-rgns-register"/>gimp_pixel_rgns_register ()</title>
475
<indexterm><primary>gimp_pixel_rgns_register</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> gimp_pixel_rgns_register (<link linkend="gint">gint</link> nrgns,
476
...);</programlisting>
478
This is the varargs version of <link linkend="gimp-pixel-rgns-register2"><type>gimp_pixel_rgns_register2</type></link>.</para>
481
</para><variablelist role="params">
482
<varlistentry><term><parameter>nrgns</parameter> :</term>
483
<listitem><simpara> the number of regions to register.
484
</simpara></listitem></varlistentry>
485
<varlistentry><term><parameter>...</parameter> :</term>
486
<listitem><simpara> <parameter>nrgns</parameter> pointers to <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
487
</simpara></listitem></varlistentry>
488
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> to a regions iterator.
489
</simpara></listitem></varlistentry>
490
</variablelist></refsect2>
492
<title><anchor id="gimp-pixel-rgns-register2"/>gimp_pixel_rgns_register2 ()</title>
493
<indexterm><primary>gimp_pixel_rgns_register2</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> gimp_pixel_rgns_register2 (<link linkend="gint">gint</link> nrgns,
494
<link linkend="GimpPixelRgn">GimpPixelRgn</link> **prs);</programlisting>
496
It takes a number of initialized regions of the same size and provides a
497
pixel region iterator the iterator can be used to iterate over the
498
registered pixel regions. While iterating the registered pixel regions will
499
cover subsets of the original pixel regions, chosen for optimized access to
503
Note that the given regions themselves are changed by this function, so
504
they are resized to the first subsets.
507
This function has to be used together with gimp_pixel_rgns_process in a loop.</para>
510
</para><variablelist role="params">
511
<varlistentry><term><parameter>nrgns</parameter> :</term>
512
<listitem><simpara> the number of regions to register.
513
</simpara></listitem></varlistentry>
514
<varlistentry><term><parameter>prs</parameter> :</term>
515
<listitem><simpara> an array of <parameter>nrgns</parameter> pointers to initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
516
</simpara></listitem></varlistentry>
517
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> to a regions iterator.
518
</simpara></listitem></varlistentry>
519
</variablelist></refsect2>
521
<title><anchor id="gimp-pixel-rgns-process"/>gimp_pixel_rgns_process ()</title>
522
<indexterm><primary>gimp_pixel_rgns_process</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> gimp_pixel_rgns_process (<link linkend="gpointer">gpointer</link> pri_ptr);</programlisting>
524
This function update the regions registered previously with one of the
525
<link linkend="gimp-pixel-rgns-register"><type>gimp_pixel_rgns_register</type></link>* functions to their next tile.</para>
528
</para><variablelist role="params">
529
<varlistentry><term><parameter>pri_ptr</parameter> :</term>
530
<listitem><simpara> a regions iterator returned by <link linkend="gimp-pixel-rgns-register"><type>gimp_pixel_rgns_register</type></link>,
531
<link linkend="gimp-pixel-rgns-register2"><type>gimp_pixel_rgns_register2</type></link> or <link linkend="gimp-pixel-rgns-process"><type>gimp_pixel_rgns_process</type></link>.
532
</simpara></listitem></varlistentry>
533
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> to a new regions iterator or <link linkend="NULL:CAPS"><type>NULL</type></link> if there isn't
535
</simpara></listitem></varlistentry>
536
</variablelist></refsect2>