782 lines
38 KiB
HTML
782 lines
38 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>gimppixelrgn</title>
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
|
|
<link rel="start" href="index.html" title="GIMP Library Reference Manual">
|
|
<link rel="up" href="libgimp-image.html" title="Manupulating Images and their Properties">
|
|
<link rel="prev" href="libgimp-gimppixelfetcher.html" title="gimppixelfetcher">
|
|
<link rel="next" href="libgimp-gimpregioniterator.html" title="gimpregioniterator">
|
|
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
<link rel="part" href="libgimp.html" title="Part I. GIMP Library">
|
|
<link rel="chapter" href="libgimp-general.html" title="Functions not Related to Specific Images">
|
|
<link rel="chapter" href="libgimp-image.html" title="Manupulating Images and their Properties">
|
|
<link rel="chapter" href="libgimp-data.html" title="Data Objects">
|
|
<link rel="chapter" href="libgimp-selectors.html" title="Controlling the Core's Selection Dialogs">
|
|
<link rel="part" href="libgimpui.html" title="Part II. GIMP User Interface Library">
|
|
<link rel="chapter" href="libgimpui-hierarchy.html" title="Object Hierarchy">
|
|
<link rel="index" href="libgimp-index.html" title="Index">
|
|
<link rel="index" href="libgimp-index-new-in-2-2.html" title="Index of new symbols in GIMP 2.2">
|
|
<link rel="index" href="libgimp-index-new-in-2-4.html" title="Index of new symbols in GIMP 2.4">
|
|
<link rel="index" href="libgimp-index-deprecated.html" title="Index of deprecated symbols">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
|
<tr valign="middle">
|
|
<td><a accesskey="p" href="libgimp-gimppixelfetcher.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
|
<td><a accesskey="u" href="libgimp-image.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
|
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
|
<th width="100%" align="center">GIMP Library Reference Manual</th>
|
|
<td><a accesskey="n" href="libgimp-gimpregioniterator.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
|
</tr>
|
|
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2573942" class="shortcut">Top</a>
|
|
 | 
|
|
<a href="#id2650378" class="shortcut">Description</a></nobr></td></tr>
|
|
</table>
|
|
<div class="refentry" lang="en">
|
|
<a name="libgimp-gimppixelrgn"></a><div class="titlepage"></div>
|
|
<div class="refnamediv"><table width="100%"><tr>
|
|
<td valign="top">
|
|
<h2>
|
|
<a name="id2573942"></a><span class="refentrytitle">gimppixelrgn</span>
|
|
</h2>
|
|
<p>gimppixelrgn — Functions for operating on pixel regions.</p>
|
|
</td>
|
|
<td valign="top" align="right"></td>
|
|
</tr></table></div>
|
|
<div class="refsynopsisdiv">
|
|
<h2>Synopsis</h2>
|
|
<pre class="synopsis">
|
|
|
|
|
|
|
|
<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a>;
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-init">gimp_pixel_rgn_init</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
<a href="libgimp-gimpdrawable.html#GimpDrawable">GimpDrawable</a> *drawable,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height,
|
|
gint dirty,
|
|
gint shadow);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-resize">gimp_pixel_rgn_resize</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-get-pixel">gimp_pixel_rgn_get_pixel</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-get-row">gimp_pixel_rgn_get_row</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-get-col">gimp_pixel_rgn_get_col</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint height);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-get-rect">gimp_pixel_rgn_get_rect</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-set-pixel">gimp_pixel_rgn_set_pixel</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-set-row">gimp_pixel_rgn_set_row</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-set-col">gimp_pixel_rgn_set_col</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint height);
|
|
void <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgn-set-rect">gimp_pixel_rgn_set_rect</a> (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);
|
|
gpointer <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register">gimp_pixel_rgns_register</a> (gint nrgns,
|
|
...);
|
|
gpointer <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register2">gimp_pixel_rgns_register2</a> (gint nrgns,
|
|
<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> **prs);
|
|
gpointer <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-process">gimp_pixel_rgns_process</a> (gpointer pri_ptr);
|
|
</pre>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2650378"></a><h2>Description</h2>
|
|
<p>
|
|
Functions for operating on pixel regions. These functions provide
|
|
fast ways of accessing and modifying portions of a drawable.
|
|
|
|
</p>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2650395"></a><h2>Details</h2>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2650406"></a><h3>
|
|
<a name="GimpPixelRgn"></a>GimpPixelRgn</h3>
|
|
<a class="indexterm" name="id2650419"></a><pre class="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;
|
|
</pre>
|
|
<p>
|
|
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2650444"></a><h3>
|
|
<a name="gimp-pixel-rgn-init"></a>gimp_pixel_rgn_init ()</h3>
|
|
<a class="indexterm" name="id2650456"></a><pre class="programlisting">void gimp_pixel_rgn_init (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
<a href="libgimp-gimpdrawable.html#GimpDrawable">GimpDrawable</a> *drawable,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height,
|
|
gint dirty,
|
|
gint shadow);</pre>
|
|
<p>
|
|
Initialize the pixel region pointed by <em class="parameter"><code>pr</code></em> with the specified parameters.
|
|
</p>
|
|
<p>
|
|
The <em class="parameter"><code>dirty</code></em> and <em class="parameter"><code>shadow</code></em> flags can be used as follows:
|
|
</p>
|
|
<p>
|
|
- <em class="parameter"><code>dirty</code></em> = FALSE, <em class="parameter"><code>shadow</code></em> = FALSE: the region will be used to read
|
|
the actual drawable datas. This
|
|
is useful for save plug-ins or for
|
|
filters.
|
|
</p>
|
|
<p>
|
|
- <em class="parameter"><code>dirty</code></em> = FALSE, <em class="parameter"><code>shadow</code></em> = 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.
|
|
</p>
|
|
<p>
|
|
- <em class="parameter"><code>dirty</code></em> = TRUE, <em class="parameter"><code>shadow</code></em> = 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
|
|
#<a href="libgimp-gimpdrawable.html#gimp-drawable-merge-shadow"><code class="function">gimp_drawable_merge_shadow()</code></a> to
|
|
merge the changes from the shadow
|
|
tiles using the current selection
|
|
as a mask.
|
|
</p>
|
|
<p>
|
|
- <em class="parameter"><code>dirty</code></em> = TRUE, <em class="parameter"><code>shadow</code></em> = 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.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a> variable.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>drawable</code></em> :</span></td>
|
|
<td> the <a href="libgimp-gimpdrawable.html#GimpDrawable"><span class="type">GimpDrawable</span></a> the new region will be attached to.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the top-left pixel of the region in the
|
|
<em class="parameter"><code>drawable</code></em>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the top-left pixel of the region in the
|
|
<em class="parameter"><code>drawable</code></em>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the width of the region.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the height of the region.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>dirty</code></em> :</span></td>
|
|
<td> a <span class="type">gboolean</span> indicating whether the <em class="parameter"><code>drawable</code></em> should be marked
|
|
as "dirty".
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>shadow</code></em> :</span></td>
|
|
<td> a <span class="type">gboolean</span> indicating whether the region is attached to the
|
|
shadow tiles or the real <em class="parameter"><code>drawable</code></em> tiles.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2648025"></a><h3>
|
|
<a name="gimp-pixel-rgn-resize"></a>gimp_pixel_rgn_resize ()</h3>
|
|
<a class="indexterm" name="id2648036"></a><pre class="programlisting">void gimp_pixel_rgn_resize (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);</pre>
|
|
<p>
|
|
Change the position and size of a previously initialized pixel region.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the new position of the region's
|
|
top-left corner.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the new position of the region's
|
|
top-left corner.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the new width of the region.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the new height of the region.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662046"></a><h3>
|
|
<a name="gimp-pixel-rgn-get-pixel"></a>gimp_pixel_rgn_get_pixel ()</h3>
|
|
<a class="indexterm" name="id2662056"></a><pre class="programlisting">void gimp_pixel_rgn_get_pixel (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y);</pre>
|
|
<p>
|
|
Fill the buffer pointed by <em class="parameter"><code>buf</code></em> with the value of the pixel at (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>)
|
|
in the region <em class="parameter"><code>pr</code></em>. <em class="parameter"><code>buf</code></em> should be large enough to hold the pixel value
|
|
(1 <span class="type">guchar</span> for an indexed or grayscale drawable, 2 <span class="type">guchar</span> for
|
|
indexed with alpha or grayscale with alpha drawable, 3 <span class="type">guchar</span> for
|
|
rgb drawable and 4 <span class="type">guchar</span> for rgb with alpha drawable.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the wanted pixel (relative to the drawable)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the wanted pixel (relative to the drawable)
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662226"></a><h3>
|
|
<a name="gimp-pixel-rgn-get-row"></a>gimp_pixel_rgn_get_row ()</h3>
|
|
<a class="indexterm" name="id2662236"></a><pre class="programlisting">void gimp_pixel_rgn_get_row (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width);</pre>
|
|
<p>
|
|
Get several pixels of a region in a row. This function fills the buffer
|
|
<em class="parameter"><code>buf</code></em> with the values of the pixels from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to (<em class="parameter"><code>x</code></em>+<em class="parameter"><code>width</code></em>-1, <em class="parameter"><code>y</code></em>).
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the number of pixels to get.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662410"></a><h3>
|
|
<a name="gimp-pixel-rgn-get-col"></a>gimp_pixel_rgn_get_col ()</h3>
|
|
<a class="indexterm" name="id2662420"></a><pre class="programlisting">void gimp_pixel_rgn_get_col (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint height);</pre>
|
|
<p>
|
|
Get several pixels of a region's column. This function fills the buffer
|
|
<em class="parameter"><code>buf</code></em> with the values of the pixels from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>+<em class="parameter"><code>height</code></em>-1).
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the number of pixels to get.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662595"></a><h3>
|
|
<a name="gimp-pixel-rgn-get-rect"></a>gimp_pixel_rgn_get_rect ()</h3>
|
|
<a class="indexterm" name="id2662605"></a><pre class="programlisting">void gimp_pixel_rgn_get_rect (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);</pre>
|
|
<p>
|
|
Get all the pixel values from the rectangle defined by <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>, <em class="parameter"><code>width</code></em> and
|
|
<em class="parameter"><code>height</code></em>. This function fills the buffer <em class="parameter"><code>buf</code></em> with the values of the pixels
|
|
from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to (<em class="parameter"><code>x</code></em>+<em class="parameter"><code>width</code></em>-1, <em class="parameter"><code>y</code></em>+<em class="parameter"><code>height</code></em>-1).
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values (<em class="parameter"><code>width</code></em>*<em class="parameter"><code>height</code></em>*bpp).</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the width of the rectangle.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the height of the rectangle.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662835"></a><h3>
|
|
<a name="gimp-pixel-rgn-set-pixel"></a>gimp_pixel_rgn_set_pixel ()</h3>
|
|
<a class="indexterm" name="id2662846"></a><pre class="programlisting">void gimp_pixel_rgn_set_pixel (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y);</pre>
|
|
<p>
|
|
Set the pixel at (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to the values from <em class="parameter"><code>buf</code></em>.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2662978"></a><h3>
|
|
<a name="gimp-pixel-rgn-set-row"></a>gimp_pixel_rgn_set_row ()</h3>
|
|
<a class="indexterm" name="id2662989"></a><pre class="programlisting">void gimp_pixel_rgn_set_row (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width);</pre>
|
|
<p>
|
|
Set several pixels of a region in a row. This function draws the pixels
|
|
from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to (<em class="parameter"><code>x</code></em>+<em class="parameter"><code>width</code></em>-1, <em class="parameter"><code>y</code></em>) using the values of the buffer <em class="parameter"><code>buf</code></em>.
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the number of pixels to set.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2663166"></a><h3>
|
|
<a name="gimp-pixel-rgn-set-col"></a>gimp_pixel_rgn_set_col ()</h3>
|
|
<a class="indexterm" name="id2663176"></a><pre class="programlisting">void gimp_pixel_rgn_set_col (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint height);</pre>
|
|
<p>
|
|
Set several pixels of a region's column. This function draws the pixels
|
|
from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>+<em class="parameter"><code>height</code></em>-1) using the values from the buffer <em class="parameter"><code>buf</code></em>.
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the number of pixels to set.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2663354"></a><h3>
|
|
<a name="gimp-pixel-rgn-set-rect"></a>gimp_pixel_rgn_set_rect ()</h3>
|
|
<a class="indexterm" name="id2663364"></a><pre class="programlisting">void gimp_pixel_rgn_set_rect (<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> *pr,
|
|
const guchar *buf,
|
|
gint x,
|
|
gint y,
|
|
gint width,
|
|
gint height);</pre>
|
|
<p>
|
|
Set all the pixel of the rectangle defined by <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>, <em class="parameter"><code>width</code></em> and
|
|
<em class="parameter"><code>height</code></em>. This function draws the rectangle from (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) to
|
|
(<em class="parameter"><code>x</code></em>+<em class="parameter"><code>width</code></em>-1, <em class="parameter"><code>y</code></em>+<em class="parameter"><code>height</code></em>-1), using the pixel values from the buffer <em class="parameter"><code>buf</code></em>.
|
|
<em class="parameter"><code>buf</code></em> should be large enough to hold all these values (<em class="parameter"><code>width</code></em>*<em class="parameter"><code>height</code></em>*bpp).</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pr</code></em> :</span></td>
|
|
<td> a pointer to a previously initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>buf</code></em> :</span></td>
|
|
<td> a pointer to an array of <span class="type">guchar</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>x</code></em> :</span></td>
|
|
<td> the x coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>y</code></em> :</span></td>
|
|
<td> the y coordinate of the first pixel (relative to the drawable).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>width</code></em> :</span></td>
|
|
<td> the width of the rectangle.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>height</code></em> :</span></td>
|
|
<td> the height of the rectangle.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2663598"></a><h3>
|
|
<a name="gimp-pixel-rgns-register"></a>gimp_pixel_rgns_register ()</h3>
|
|
<a class="indexterm" name="id2663608"></a><pre class="programlisting">gpointer gimp_pixel_rgns_register (gint nrgns,
|
|
...);</pre>
|
|
<p>
|
|
This is the varargs version of <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register2"><span class="type">gimp_pixel_rgns_register2</span></a>.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>nrgns</code></em> :</span></td>
|
|
<td> the number of regions to register.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>...</code></em> :</span></td>
|
|
<td> <em class="parameter"><code>nrgns</code></em> pointers to <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> a <span class="type">gpointer</span> to a regions iterator.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2663701"></a><h3>
|
|
<a name="gimp-pixel-rgns-register2"></a>gimp_pixel_rgns_register2 ()</h3>
|
|
<a class="indexterm" name="id2663712"></a><pre class="programlisting">gpointer gimp_pixel_rgns_register2 (gint nrgns,
|
|
<a href="libgimp-gimppixelrgn.html#GimpPixelRgn">GimpPixelRgn</a> **prs);</pre>
|
|
<p>
|
|
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.
|
|
</p>
|
|
<p>
|
|
Note that the given regions themselves are changed by this function, so
|
|
they are resized to the first subsets.
|
|
</p>
|
|
<p>
|
|
This function has to be used together with gimp_pixel_rgns_process in a loop.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>nrgns</code></em> :</span></td>
|
|
<td> the number of regions to register.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>prs</code></em> :</span></td>
|
|
<td> an array of <em class="parameter"><code>nrgns</code></em> pointers to initialized <a href="libgimp-gimppixelrgn.html#GimpPixelRgn"><span class="type">GimpPixelRgn</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> a <span class="type">gpointer</span> to a regions iterator.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2663818"></a><h3>
|
|
<a name="gimp-pixel-rgns-process"></a>gimp_pixel_rgns_process ()</h3>
|
|
<a class="indexterm" name="id2663829"></a><pre class="programlisting">gpointer gimp_pixel_rgns_process (gpointer pri_ptr);</pre>
|
|
<p>
|
|
This function update the regions registered previously with one of the
|
|
<a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register"><span class="type">gimp_pixel_rgns_register</span></a>* functions to their next tile.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="term"><em class="parameter"><code>pri_ptr</code></em> :</span></td>
|
|
<td> a regions iterator returned by <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register"><span class="type">gimp_pixel_rgns_register</span></a>,
|
|
<a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-register2"><span class="type">gimp_pixel_rgns_register2</span></a> or <a href="libgimp-gimppixelrgn.html#gimp-pixel-rgns-process"><span class="type">gimp_pixel_rgns_process</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> a <span class="type">gpointer</span> to a new regions iterator or <span class="type">NULL</span> if there isn't
|
|
any tiles left.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|