MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/local/ssl/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-rendering.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>Xlib Rendering</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="The gdk-pixbuf Library">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gdk-pixbuf-gdk-pixbuf-xlib-init.html" title="gdk-pixbuf Xlib initialization">
<link rel="next" href="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.html" title="X Drawables to Pixbufs">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="rn01.html" title="API Reference">
<link rel="reference" href="rn02.html" title="Tools Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="appendix" href="apa.html" title="Appendix&#160;A.&#160;Porting applications from Imlib to gdk-pixbuf">
<link rel="appendix" href="license.html" title="Appendix&#160;B.&#160;License">
</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="gdk-pixbuf-gdk-pixbuf-xlib-init.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn01.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">The <span class="application">gdk-pixbuf</span> Library</th>
<td><a accesskey="n" href="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.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="#id3137241" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3138569" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf-xlib-rendering"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3137241"></a><span class="refentrytitle">Xlib Rendering</span>
</h2>
<p>Xlib Rendering &#8212; Rendering a pixbuf to an X drawable.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;


void        <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-threshold-alpha">gdk_pixbuf_xlib_render_threshold_alpha</a>
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Pixmap bitmap,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             int alpha_threshold);
void        <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-to-drawable">gdk_pixbuf_xlib_render_to_drawable</a>
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Drawable drawable,
                                             GC gc,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             <a href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html#XlibRgbDither">XlibRgbDither</a> dither,
                                             int x_dither,
                                             int y_dither);
void        <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-to-drawable-alpha">gdk_pixbuf_xlib_render_to_drawable_alpha</a>
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Drawable drawable,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufAlphaMode">GdkPixbufAlphaMode</a> alpha_mode,
                                             int alpha_threshold,
                                             <a href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html#XlibRgbDither">XlibRgbDither</a> dither,
                                             int x_dither,
                                             int y_dither);
void        <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-pixmap-and-mask">gdk_pixbuf_xlib_render_pixmap_and_mask</a>
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Pixmap *pixmap_return,
                                             Pixmap *mask_return,
                                             int alpha_threshold);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3138569"></a><h2>Description</h2>
<p>
    The <span class="application">gdk-pixbuf</span> Xlib library provides several convenience
    functions to render pixbufs to X drawables.  It uses XlibRGB to
    render the image data.
  </p>
<p>
    These functions are analogous to those for the GDK version of
    <span class="application">gdk-pixbuf</span>.
  </p>
</div>
<div class="refsect1" lang="en">
<a name="id3138602"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3138612"></a><h3>
<a name="gdk-pixbuf-xlib-render-threshold-alpha"></a>gdk_pixbuf_xlib_render_threshold_alpha ()</h3>
<a class="indexterm" name="id3138626"></a><pre class="programlisting">void        gdk_pixbuf_xlib_render_threshold_alpha
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Pixmap bitmap,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             int alpha_threshold);</pre>
<p>
Takes the opacity values in a rectangular portion of a pixbuf and thresholds
them to produce a bi-level alpha mask that can be used as a clipping mask for
a 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>pixbuf</code></em>&#160;:</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>bitmap</code></em>&#160;:</span></td>
<td> Bitmap where the bilevel mask will be painted to.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_x</code></em>&#160;:</span></td>
<td> Source X coordinate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_y</code></em>&#160;:</span></td>
<td> source Y coordinate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_x</code></em>&#160;:</span></td>
<td> Destination X coordinate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_y</code></em>&#160;:</span></td>
<td> Destination Y coordinate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></td>
<td> Width of region to threshold.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></td>
<td> Height of region to threshold.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>alpha_threshold</code></em>&#160;:</span></td>
<td> Opacity values below this will be painted as zero; all
other values will be painted as one.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3138852"></a><h3>
<a name="gdk-pixbuf-xlib-render-to-drawable"></a>gdk_pixbuf_xlib_render_to_drawable ()</h3>
<a class="indexterm" name="id3138866"></a><pre class="programlisting">void        gdk_pixbuf_xlib_render_to_drawable
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Drawable drawable,
                                             GC gc,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             <a href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html#XlibRgbDither">XlibRgbDither</a> dither,
                                             int x_dither,
                                             int y_dither);</pre>
<p>
Renders a rectangular portion of a pixbuf to a drawable while using the
specified GC.  This is done using XlibRGB, so the specified drawable must
have the XlibRGB visual and colormap.  Note that this function will ignore
the opacity information for images with an alpha channel; the GC must already
have the clipping mask set if you want transparent regions to show through.
</p>
<p>
For an explanation of dither offsets, see the XlibRGB documentation.  In
brief, the dither offset is important when re-rendering partial regions of an
image to a rendered version of the full image, or for when the offsets to a
base position change, as in scrolling.  The dither matrix has to be shifted
for consistent visual results.  If you do not have any of these cases, the
dither offsets can be both zero.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf</code></em>&#160;:</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>drawable</code></em>&#160;:</span></td>
<td> Destination drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>gc</code></em>&#160;:</span></td>
<td> GC used for rendering.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_x</code></em>&#160;:</span></td>
<td> Source X coordinate within pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_y</code></em>&#160;:</span></td>
<td> Source Y coordinate within pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_x</code></em>&#160;:</span></td>
<td> Destination X coordinate within drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_y</code></em>&#160;:</span></td>
<td> Destination Y coordinate within drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></td>
<td> Width of region to render, in pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></td>
<td> Height of region to render, in pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dither</code></em>&#160;:</span></td>
<td> Dithering mode for XlibRGB.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_dither</code></em>&#160;:</span></td>
<td> X offset for dither.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_dither</code></em>&#160;:</span></td>
<td> Y offset for dither.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3139169"></a><h3>
<a name="gdk-pixbuf-xlib-render-to-drawable-alpha"></a>gdk_pixbuf_xlib_render_to_drawable_alpha ()</h3>
<a class="indexterm" name="id3139182"></a><pre class="programlisting">void        gdk_pixbuf_xlib_render_to_drawable_alpha
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Drawable drawable,
                                             int src_x,
                                             int src_y,
                                             int dest_x,
                                             int dest_y,
                                             int width,
                                             int height,
                                             <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufAlphaMode">GdkPixbufAlphaMode</a> alpha_mode,
                                             int alpha_threshold,
                                             <a href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html#XlibRgbDither">XlibRgbDither</a> dither,
                                             int x_dither,
                                             int y_dither);</pre>
<p>
Renders a rectangular portion of a pixbuf to a drawable.  This is done using
XlibRGB, so the specified drawable must have the XlibRGB visual and colormap.
</p>
<p>
When used with <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ALPHA-BILEVEL:CAPS"><span class="type">GDK_PIXBUF_ALPHA_BILEVEL</span></a>, this function has to create a bitmap
out of the thresholded alpha channel of the image and, it has to set this
bitmap as the clipping mask for the GC used for drawing.  This can be a
significant performance penalty depending on the size and the complexity of
the alpha channel of the image.  If performance is crucial, consider handling
the alpha channel yourself (possibly by caching it in your application) and
using <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-to-drawable"><code class="function">gdk_pixbuf_xlib_render_to_drawable()</code></a> or GdkRGB directly instead.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf</code></em>&#160;:</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>drawable</code></em>&#160;:</span></td>
<td> Destination drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_x</code></em>&#160;:</span></td>
<td> Source X coordinate within pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src_y</code></em>&#160;:</span></td>
<td> Source Y coordinates within pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_x</code></em>&#160;:</span></td>
<td> Destination X coordinate within drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_y</code></em>&#160;:</span></td>
<td> Destination Y coordinate within drawable.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></td>
<td> Width of region to render, in pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></td>
<td> Height of region to render, in pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>alpha_mode</code></em>&#160;:</span></td>
<td> If the image does not have opacity information, this is ignored.
Otherwise, specifies how to handle transparency when rendering.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>alpha_threshold</code></em>&#160;:</span></td>
<td> If the image does have opacity information and <em class="parameter"><code>alpha_mode</code></em>
is GDK_PIXBUF_ALPHA_BILEVEL, specifies the threshold value for opacity
values.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dither</code></em>&#160;:</span></td>
<td> Dithering mode for XlibRGB.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_dither</code></em>&#160;:</span></td>
<td> X offset for dither.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_dither</code></em>&#160;:</span></td>
<td> Y offset for dither.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3139536"></a><h3>
<a name="gdk-pixbuf-xlib-render-pixmap-and-mask"></a>gdk_pixbuf_xlib_render_pixmap_and_mask ()</h3>
<a class="indexterm" name="id3139549"></a><pre class="programlisting">void        gdk_pixbuf_xlib_render_pixmap_and_mask
                                            (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                             Pixmap *pixmap_return,
                                             Pixmap *mask_return,
                                             int alpha_threshold);</pre>
<p>
Creates a pixmap and a mask bitmap which are returned in the <em class="parameter"><code>pixmap_return</code></em>
and <em class="parameter"><code>mask_return</code></em> arguments, respectively, and renders a pixbuf and its
corresponding tresholded alpha mask to them.  This is merely a convenience
function; applications that need to render pixbufs with dither offsets or to
given drawables should use <a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-to-drawable-alpha"><code class="function">gdk_pixbuf_xlib_render_to_drawable_alpha()</code></a> or
<a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-to-drawable"><code class="function">gdk_pixbuf_xlib_render_to_drawable()</code></a>, and
<a href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html#gdk-pixbuf-xlib-render-threshold-alpha"><code class="function">gdk_pixbuf_xlib_render_threshold_alpha()</code></a>.
</p>
<p>
If the pixbuf does not have an alpha channel, then *<em class="parameter"><code>mask_return</code></em> will be set
to None.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixbuf</code></em>&#160;:</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixmap_return</code></em>&#160;:</span></td>
<td> Return value for the created pixmap.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mask_return</code></em>&#160;:</span></td>
<td> Return value for the created mask.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>alpha_threshold</code></em>&#160;:</span></td>
<td> Threshold value for opacity values.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>