File: gimppixelrgn.xml

package info (click to toggle)
gimp 2.2.13-1etch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 94,832 kB
  • ctags: 47,113
  • sloc: ansic: 524,858; xml: 36,798; lisp: 9,870; sh: 9,409; makefile: 7,923; python: 2,674; perl: 2,589; yacc: 520; lex: 334
file content (546 lines) | stat: -rw-r--r-- 35,555 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="libgimp-gimppixelrgn">
<refmeta>
<refentrytitle role="top_of_page">gimppixelrgn</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMP Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>gimppixelrgn</refname>
<refpurpose>Functions for operating on pixel regions.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



            <link linkend="GimpPixelRgn">GimpPixelRgn</link>;
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-init">gimp_pixel_rgn_init</link>             (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="GimpDrawable">GimpDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height,
                                             <link linkend="gint">gint</link> dirty,
                                             <link linkend="gint">gint</link> shadow);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-resize">gimp_pixel_rgn_resize</link>           (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-get-pixel">gimp_pixel_rgn_get_pixel</link>        (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-get-row">gimp_pixel_rgn_get_row</link>          (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-get-col">gimp_pixel_rgn_get_col</link>          (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> height);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-get-rect">gimp_pixel_rgn_get_rect</link>         (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-set-pixel">gimp_pixel_rgn_set_pixel</link>        (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-set-row">gimp_pixel_rgn_set_row</link>          (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-set-col">gimp_pixel_rgn_set_col</link>          (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> height);
<link linkend="void">void</link>        <link linkend="gimp-pixel-rgn-set-rect">gimp_pixel_rgn_set_rect</link>         (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
<link linkend="gpointer">gpointer</link>    <link linkend="gimp-pixel-rgns-register">gimp_pixel_rgns_register</link>        (<link linkend="gint">gint</link> nrgns,
                                             ...);
<link linkend="gpointer">gpointer</link>    <link linkend="gimp-pixel-rgns-register2">gimp_pixel_rgns_register2</link>       (<link linkend="gint">gint</link> nrgns,
                                             <link linkend="GimpPixelRgn">GimpPixelRgn</link> **prs);
<link linkend="gpointer">gpointer</link>    <link linkend="gimp-pixel-rgns-process">gimp_pixel_rgns_process</link>         (<link linkend="gpointer">gpointer</link> pri_ptr);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
Functions for operating on pixel regions.  These functions provide
fast ways of accessing and modifying portions of a drawable.

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="GimpPixelRgn" role="struct"/>GimpPixelRgn</title>
<indexterm><primary>GimpPixelRgn</primary></indexterm><programlisting>typedef struct {
  guchar       *data;          /* pointer to region data */
  GimpDrawable *drawable;      /* pointer to drawable */
  guint         bpp;           /* bytes per pixel */
  guint         rowstride;     /* bytes per pixel row */
  guint         x, y;          /* origin */
  guint         w, h;          /* width and height of region */
  guint         dirty : 1;     /* will this region be dirtied? */
  guint         shadow : 1;    /* will this region use the shadow or normal tiles */
  guint         process_count; /* used internally */
} GimpPixelRgn;
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-init" role="function"/>gimp_pixel_rgn_init ()</title>
<indexterm><primary>gimp_pixel_rgn_init</primary></indexterm><programlisting><link linkend="void">void</link>        gimp_pixel_rgn_init             (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="GimpDrawable">GimpDrawable</link> *drawable,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height,
                                             <link linkend="gint">gint</link> dirty,
                                             <link linkend="gint">gint</link> shadow);</programlisting>
<para>
Initialize the pixel region pointed by <parameter>pr</parameter> with the specified parameters.
</para>
<para>
The <parameter>dirty</parameter> and <parameter>shadow</parameter> flags can be used as follows:
</para>
<para>
- <parameter>dirty</parameter> = FALSE, <parameter>shadow</parameter> = FALSE: the region will be used to read
                                   the actual drawable datas.  This
                                   is useful for save plug-ins or for
                                   filters.
</para>
<para>
- <parameter>dirty</parameter> = FALSE, <parameter>shadow</parameter> = TRUE:  the region will be used to read the
                                   shadow tiles.  This is used in
                                   some filter plug-ins which operate
                                   in two passes such as gaussian
                                   blur.  The first pass reads the
                                   actual drawable data and writes to
                                   the shadow tiles, and the second
                                   one reads from and writes to the
                                   shadow tiles.
</para>
<para>
- <parameter>dirty</parameter> = TRUE, <parameter>shadow</parameter> = TRUE:   the region will be used to write to
                                   the shadow tiles. It is common
                                   practice to write to the shadow
                                   tiles and then use
                                   #<link linkend="gimp-drawable-merge-shadow"><function>gimp_drawable_merge_shadow()</function></link> to
                                   merge the changes from the shadow
                                   tiles using the current selection
                                   as a mask.
</para>
<para>
- <parameter>dirty</parameter> = TRUE, <parameter>shadow</parameter> = FALSE:  the region will be used to directly
                                   change the drawable content. Don't
                                   do this, since this could prevent
                                   the Undo-System from working as
                                   expected.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>        a pointer to a <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link> variable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable</parameter>&nbsp;:</term>
<listitem><simpara>  the <link linkend="GimpDrawable"><type>GimpDrawable</type></link> the new region will be attached to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>         the x coordinate of the top-left pixel of the region in the
            <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>         the y coordinate of the top-left pixel of the region in the
            <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>     the width of the region.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara>    the height of the region.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dirty</parameter>&nbsp;:</term>
<listitem><simpara>     a <link linkend="gboolean"><type>gboolean</type></link> indicating whether the <parameter>drawable</parameter> should be marked
            as "dirty".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>shadow</parameter>&nbsp;:</term>
<listitem><simpara>    a <link linkend="gboolean"><type>gboolean</type></link> indicating whether the region is attached to the
            shadow tiles or the real <parameter>drawable</parameter> tiles.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-resize" role="function"/>gimp_pixel_rgn_resize ()</title>
<indexterm><primary>gimp_pixel_rgn_resize</primary></indexterm><programlisting><link linkend="void">void</link>        gimp_pixel_rgn_resize           (<link linkend="GimpPixelRgn">GimpPixelRgn</link> *pr,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Change the position and size of a previously initialized pixel region.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>      a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>       the x coordinate of the new position of the region's
          top-left corner.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>       the y coordinate of the new position of the region's
          top-left corner.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>   the new width of the region.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara>  the new height of the region.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-get-pixel" role="function"/>gimp_pixel_rgn_get_pixel ()</title>
<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,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);</programlisting>
<para>
Fill the buffer pointed by <parameter>buf</parameter> with the value of the pixel at (<parameter>x</parameter>, <parameter>y</parameter>)
in the region <parameter>pr</parameter>. <parameter>buf</parameter> should be large enough to hold the pixel value
(1 <link linkend="guchar"><type>guchar</type></link> for an indexed or grayscale drawable, 2 <link linkend="guchar"><type>guchar</type></link> for
indexed with alpha or grayscale with alpha drawable, 3 <link linkend="guchar"><type>guchar</type></link> for
rgb drawable and 4 <link linkend="guchar"><type>guchar</type></link> for rgb with alpha drawable.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>   a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>     the x coordinate of the wanted pixel (relative to the drawable)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>     the y coordinate of the wanted pixel (relative to the drawable)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-get-row" role="function"/>gimp_pixel_rgn_get_row ()</title>
<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,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width);</programlisting>
<para>
Get several pixels of a region in a row. This function fills the buffer
<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>).
<parameter>buf</parameter> should be large enough to hold all these values.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>  the number of pixels to get.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-get-col" role="function"/>gimp_pixel_rgn_get_col ()</title>
<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,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Get several pixels of a region's column. This function fills the buffer
<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).
<parameter>buf</parameter> should be large enough to hold all these values.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> the number of pixels to get.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-get-rect" role="function"/>gimp_pixel_rgn_get_rect ()</title>
<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,
                                             <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Get all the pixel values from the rectangle defined by <parameter>x</parameter>, <parameter>y</parameter>, <parameter>width</parameter> and
<parameter>height</parameter>. This function fills the buffer <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>+<parameter>height</parameter>-1).
<parameter>buf</parameter> should be large enough to hold all these values (<parameter>width</parameter>*<parameter>height</parameter>*bpp).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>  the width of the rectangle.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> the height of the rectangle.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-set-pixel" role="function"/>gimp_pixel_rgn_set_pixel ()</title>
<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,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y);</programlisting>
<para>
Set the pixel at (<parameter>x</parameter>, <parameter>y</parameter>) to the values from <parameter>buf</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>   a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>  a pointer to an array of <link linkend="guchar"><type>guchar</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>    the x coordinate of the pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>    the y coordinate of the pixel (relative to the drawable).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-set-row" role="function"/>gimp_pixel_rgn_set_row ()</title>
<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,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width);</programlisting>
<para>
Set several pixels of a region in a row. This function draws the pixels
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>.
<parameter>buf</parameter> should be large enough to hold all these values.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>  the number of pixels to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-set-col" role="function"/>gimp_pixel_rgn_set_col ()</title>
<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,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Set several pixels of a region's column. This function draws the pixels
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>.
<parameter>buf</parameter> should be large enough to hold all these values.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> the number of pixels to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgn-set-rect" role="function"/>gimp_pixel_rgn_set_rect ()</title>
<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,
                                             const <link linkend="guchar">guchar</link> *buf,
                                             <link linkend="gint">gint</link> x,
                                             <link linkend="gint">gint</link> y,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Set all the pixel of the rectangle defined by <parameter>x</parameter>, <parameter>y</parameter>, <parameter>width</parameter> and
<parameter>height</parameter>. This function draws the rectangle from (<parameter>x</parameter>, <parameter>y</parameter>) to
(<parameter>x</parameter>+<parameter>width</parameter>-1, <parameter>y</parameter>+<parameter>height</parameter>-1), using the pixel values from the buffer <parameter>buf</parameter>.
<parameter>buf</parameter> should be large enough to hold all these values (<parameter>width</parameter>*<parameter>height</parameter>*bpp).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pr</parameter>&nbsp;:</term>
<listitem><simpara>     a pointer to a previously initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&nbsp;:</term>
<listitem><simpara>    a pointer to an array of <link linkend="guchar"><type>guchar</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>      the x coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>      the y coordinate of the first pixel (relative to the drawable).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara>  the width of the rectangle.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> the height of the rectangle.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgns-register" role="function"/>gimp_pixel_rgns_register ()</title>
<indexterm><primary>gimp_pixel_rgns_register</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>    gimp_pixel_rgns_register        (<link linkend="gint">gint</link> nrgns,
                                             ...);</programlisting>
<para>
This is the varargs version of <link linkend="gimp-pixel-rgns-register2"><type>gimp_pixel_rgns_register2</type></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>nrgns</parameter>&nbsp;:</term>
<listitem><simpara>   the number of regions to register.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
<listitem><simpara> <parameter>nrgns</parameter> pointers to <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> to a regions iterator.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgns-register2" role="function"/>gimp_pixel_rgns_register2 ()</title>
<indexterm><primary>gimp_pixel_rgns_register2</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>    gimp_pixel_rgns_register2       (<link linkend="gint">gint</link> nrgns,
                                             <link linkend="GimpPixelRgn">GimpPixelRgn</link> **prs);</programlisting>
<para>
It takes a number of initialized regions of the same size and provides a
pixel region iterator the iterator can be used to iterate over the
registered pixel regions.  While iterating the registered pixel regions will
cover subsets of the original pixel regions, chosen for optimized access to
the image data.
</para>
<para>
Note that the given regions themselves are changed by this function, so
they are resized to the first subsets.
</para>
<para>
This function has to be used together with gimp_pixel_rgns_process in a loop.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>nrgns</parameter>&nbsp;:</term>
<listitem><simpara> the number of regions to register.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prs</parameter>&nbsp;:</term>
<listitem><simpara>   an array of <parameter>nrgns</parameter> pointers to initialized <link linkend="GimpPixelRgn"><type>GimpPixelRgn</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> to a regions iterator.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-pixel-rgns-process" role="function"/>gimp_pixel_rgns_process ()</title>
<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>
<para>
This function update the regions registered previously with one of the
<link linkend="gimp-pixel-rgns-register"><type>gimp_pixel_rgns_register</type></link>* functions to their next tile.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>pri_ptr</parameter>&nbsp;:</term>
<listitem><simpara> a regions iterator returned by <link linkend="gimp-pixel-rgns-register"><type>gimp_pixel_rgns_register</type></link>,
          <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>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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
any tiles left.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>