File: //usr/local/ssl/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.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>The GdkPixbuf Structure</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-Versioning.html" title="Initialization and Versions">
<link rel="next" href="gdk-pixbuf-refcounting.html" title="Reference Counting and Memory Mangement">
<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 A. Porting applications from Imlib to gdk-pixbuf">
<link rel="appendix" href="license.html" title="Appendix B. 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-Versioning.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-refcounting.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="#id3046984" class="shortcut">Top</a>
 | 
<a href="#id3091060" class="shortcut">Description</a>
 | 
<a href="#id3090880" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3090905" class="shortcut">Properties</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3046984"></a><span class="refentrytitle">The GdkPixbuf Structure</span>
</h2>
<p>The GdkPixbuf Structure — Information that describes an image.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="GdkPixbuf"></a><pre class="synopsis">
#include <gdk-pixbuf/gdk-pixbuf.h>
enum <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufError">GdkPixbufError</a>;
#define <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS">GDK_PIXBUF_ERROR</a>
enum <a href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace">GdkColorspace</a>;
enum <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufAlphaMode">GdkPixbufAlphaMode</a>;
<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf-struct">GdkPixbuf</a>;
<a href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace">GdkColorspace</a> <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-colorspace">gdk_pixbuf_get_colorspace</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-n-channels">gdk_pixbuf_get_n_channels</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-has-alpha">gdk_pixbuf_get_has_alpha</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-bits-per-sample">gdk_pixbuf_get_bits_per_sample</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
<a
href="../glib/glib-Basic-Types.html#guchar"
>guchar</a>* <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-pixels">gdk_pixbuf_get_pixels</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-width">gdk_pixbuf_get_width</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-height">gdk_pixbuf_get_height</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-rowstride">gdk_pixbuf_get_rowstride</a> (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-option">gdk_pixbuf_get_option</a> (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *key);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3090880"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----GdkPixbuf
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3090905"></a><h2>Properties</h2>
<pre class="synopsis">
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--bits-per-sample">bits-per-sample</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--colorspace">colorspace</a>" <a href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace">GdkColorspace</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--has-alpha">has-alpha</a>" <a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--height">height</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--n-channels">n-channels</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--pixels">pixels</a>" <a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--rowstride">rowstride</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only
"<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--width">width</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3091060"></a><h2>Description</h2>
<p>
The <span class="structname">GdkPixbuf</span> structure contains
information that describes an image in memory.
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="image-data"></a>Image Data</h2></div></div></div>
<p>
Image data in a pixbuf is stored in memory in uncompressed,
packed format. Rows in the image are stored top to bottom, and
in each row pixels are stored from left to right. There may be
padding at the end of a row. The "rowstride" value of a pixbuf,
as returned by <a href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-rowstride"><code class="function">gdk_pixbuf_get_rowstride()</code></a>, indicates the number
of bytes between rows.
</p>
<div class="example">
<a name="put-pixel"></a><p class="title"><b>Example 1. put_pixel() example</b></p>
<p>
The following code illustrates a simple put_pixel()
function for RGB pixbufs with 8 bits per channel with an alpha
channel. It is not included in the gdk-pixbuf library for
performance reasons; rather than making several function calls
for each pixel, your own code can take shortcuts.
</p>
<pre class="programlisting">
static void
put_pixel (GdkPixbuf *pixbuf, int x, int y, guchar red, guchar green, guchar blue, guchar alpha)
{
int width, height, rowstride, n_channels;
guchar *pixels, *p;
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
g_assert (n_channels == 4);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
g_assert (x >= 0 && x < width);
g_assert (y >= 0 && y < height);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
pixels = gdk_pixbuf_get_pixels (pixbuf);
p = pixels + y * rowstride + x * n_channels;
p[0] = red;
p[1] = green;
p[2] = blue;
p[3] = alpha;
}
</pre>
<p>
This function will not work for pixbufs with images that are
other than 8 bits per sample or channel, but it will work for
most of the pixbufs that GTK+ uses.
</p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
If you are doing <code class="function">memcpy()</code> of raw pixbuf data, note that the
last row in the pixbuf may not be as wide as the full
rowstride, but rather just as wide as the pixel data needs to
be. That is, it is unsafe to do <code class="literal">memcpy (dest,
pixels, rowstride * height)</code> to copy a whole pixbuf.
Use <a href="gdk-pixbuf-creating.html#gdk-pixbuf-copy"><code class="function">gdk_pixbuf_copy()</code></a> instead, or compute the width in bytes
of the last row as <code class="literal">width * ((n_channels *
bits_per_sample + 7) / 8)</code>.
</p>
</div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3091211"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3091221"></a><h3>
<a name="GdkPixbufError"></a>enum GdkPixbufError</h3>
<a class="indexterm" name="id3091233"></a><pre class="programlisting">typedef enum {
/* image data hosed */
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
/* no mem to load image */
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
/* bad option passed to save routine */
GDK_PIXBUF_ERROR_BAD_OPTION,
/* unsupported image type (sort of an ENOSYS) */
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
/* unsupported operation (load, save) for image type */
GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
GDK_PIXBUF_ERROR_FAILED
} GdkPixbufError;
</pre>
<p>
An error code in the <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS"><span class="type">GDK_PIXBUF_ERROR</span></a> domain. Many <span class="application">gdk-pixbuf</span>
operations can cause errors in this domain, or in the <a
href="../glib/glib-File-Utilities.html#G-FILE-ERROR:CAPS"
><span class="type">G_FILE_ERROR</span></a>
domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-CORRUPT-IMAGE:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_CORRUPT_IMAGE</code></span></td>
<td>An image file was broken somehow.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-INSUFFICIENT-MEMORY:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY</code></span></td>
<td>Not enough memory.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-BAD-OPTION:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_BAD_OPTION</code></span></td>
<td>A bad option was passed to a pixbuf save module.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-UNKNOWN-TYPE:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_UNKNOWN_TYPE</code></span></td>
<td>Unknown image type.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-UNSUPPORTED-OPERATION:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION</code></span></td>
<td>Don't know how to perform the
given operation on the type of image at hand.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ERROR-FAILED:CAPS"></a><code class="literal">GDK_PIXBUF_ERROR_FAILED</code></span></td>
<td>Generic failure code, something went wrong.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091562"></a><h3>
<a name="GDK-PIXBUF-ERROR:CAPS"></a>GDK_PIXBUF_ERROR</h3>
<a class="indexterm" name="id3091576"></a><pre class="programlisting">#define GDK_PIXBUF_ERROR gdk_pixbuf_error_quark ()
</pre>
<p>
Error domain used for pixbuf operations. Indicates that the error code
will be in the <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufError"><span class="type">GdkPixbufError</span></a> enumeration. See <a
href="../glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> for
information on error domains and error codes.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091611"></a><h3>
<a name="GdkColorspace"></a>enum GdkColorspace</h3>
<a class="indexterm" name="id3091622"></a><pre class="programlisting">typedef enum {
GDK_COLORSPACE_RGB
} GdkColorspace;
</pre>
<p>
This enumeration defines the color spaces that are supported by
the <span class="application">gdk-pixbuf</span> library. Currently only RGB is supported.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><a name="GDK-COLORSPACE-RGB:CAPS"></a><code class="literal">GDK_COLORSPACE_RGB</code></span></td>
<td>Indicates a red/green/blue additive color space.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091674"></a><h3>
<a name="GdkPixbufAlphaMode"></a>enum GdkPixbufAlphaMode</h3>
<a class="indexterm" name="id3091686"></a><pre class="programlisting">typedef enum
{
GDK_PIXBUF_ALPHA_BILEVEL,
GDK_PIXBUF_ALPHA_FULL
} GdkPixbufAlphaMode;
</pre>
<p>
These values can be passed to
<a
href="../gdk/gdk-Pixbufs.html#gdk-pixbuf-render-to-drawable-alpha"
><code class="function">gdk_pixbuf_render_to_drawable_alpha()</code></a> to control how the alpha
channel of an image should be handled. This function can create a
bilevel clipping mask (black and white) and use it while painting
the image. In the future, when the X Window System gets an alpha
channel extension, it will be possible to do full alpha
compositing onto arbitrary drawables. For now both cases fall
back to a bilevel clipping mask.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ALPHA-BILEVEL:CAPS"></a><code class="literal">GDK_PIXBUF_ALPHA_BILEVEL</code></span></td>
<td>A bilevel clipping mask (black and white)
will be created and used to draw the image. Pixels below 0.5 opacity
will be considered fully transparent, and all others will be
considered fully opaque.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-PIXBUF-ALPHA-FULL:CAPS"></a><code class="literal">GDK_PIXBUF_ALPHA_FULL</code></span></td>
<td>For now falls back to <a href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ALPHA-BILEVEL:CAPS"><span class="type">GDK_PIXBUF_ALPHA_BILEVEL</span></a>.
In the future it will do full alpha compositing.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091785"></a><h3>
<a name="GdkPixbuf-struct"></a>GdkPixbuf</h3>
<a class="indexterm" name="id3091798"></a><pre class="programlisting">typedef struct _GdkPixbuf GdkPixbuf;</pre>
<p>
This is the main structure in the <span class="application">gdk-pixbuf</span> library. It is
used to represent images. It contains information about the
image's pixel data, its color space, bits per sample, width and
height, and the rowstride (the number of bytes between the start of
one row and the start of the next).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091824"></a><h3>
<a name="gdk-pixbuf-get-colorspace"></a>gdk_pixbuf_get_colorspace ()</h3>
<a class="indexterm" name="id3091837"></a><pre class="programlisting"><a href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace">GdkColorspace</a> gdk_pixbuf_get_colorspace (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the color space of a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Color space.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091898"></a><h3>
<a name="gdk-pixbuf-get-n-channels"></a>gdk_pixbuf_get_n_channels ()</h3>
<a class="indexterm" name="id3091910"></a><pre class="programlisting">int gdk_pixbuf_get_n_channels (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the number of channels of a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Number of channels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3091974"></a><h3>
<a name="gdk-pixbuf-get-has-alpha"></a>gdk_pixbuf_get_has_alpha ()</h3>
<a class="indexterm" name="id3091986"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_pixbuf_get_has_alpha (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries whether a pixbuf has an alpha channel (opacity information).</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if it has an alpha channel, <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092070"></a><h3>
<a name="gdk-pixbuf-get-bits-per-sample"></a>gdk_pixbuf_get_bits_per_sample ()</h3>
<a class="indexterm" name="id3092083"></a><pre class="programlisting">int gdk_pixbuf_get_bits_per_sample (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the number of bits per color sample in a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Number of bits per color sample.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092144"></a><h3>
<a name="gdk-pixbuf-get-pixels"></a>gdk_pixbuf_get_pixels ()</h3>
<a class="indexterm" name="id3092157"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#guchar"
>guchar</a>* gdk_pixbuf_get_pixels (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries a pointer to the pixel data of a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A pointer to the pixbuf's pixel data. Please see <a href="gdk-pixbuf-gdk-pixbuf.html#image-data" title="Image Data">the section called “Image Data”</a>
for information about how the pixel data is stored in
memory.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092226"></a><h3>
<a name="gdk-pixbuf-get-width"></a>gdk_pixbuf_get_width ()</h3>
<a class="indexterm" name="id3092239"></a><pre class="programlisting">int gdk_pixbuf_get_width (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the width of a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Width in pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092299"></a><h3>
<a name="gdk-pixbuf-get-height"></a>gdk_pixbuf_get_height ()</h3>
<a class="indexterm" name="id3092312"></a><pre class="programlisting">int gdk_pixbuf_get_height (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the height of a pixbuf.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Height in pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092372"></a><h3>
<a name="gdk-pixbuf-get-rowstride"></a>gdk_pixbuf_get_rowstride ()</h3>
<a class="indexterm" name="id3092385"></a><pre class="programlisting">int gdk_pixbuf_get_rowstride (const <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the rowstride of a pixbuf, which is the number of bytes between the start of a row
and the start of the next row.</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> :</span></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Distance between row starts.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092447"></a><h3>
<a name="gdk-pixbuf-get-option"></a>gdk_pixbuf_get_option ()</h3>
<a class="indexterm" name="id3092460"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gdk_pixbuf_get_option (<a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *key);</pre>
<p>
Looks up <em class="parameter"><code>key</code></em> in the list of options that may have been attached to the
<em class="parameter"><code>pixbuf</code></em> when it was loaded.</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> :</span></td>
<td> a <a href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>key</code></em> :</span></td>
<td> a nul-terminated string.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the value associated with <em class="parameter"><code>key</code></em>. This is a nul-terminated
string that should not be freed or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> was not found.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3092588"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="id3092598"></a><h3>
<a name="GdkPixbuf--bits-per-sample"></a>The "<code class="literal">bits-per-sample</code>" property</h3>
<a class="indexterm" name="id3092615"></a><pre class="programlisting"> "bits-per-sample" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only</pre>
<p>
The number of bits per sample.
Currently only 8 bit per sample are supported.</p>
<p>
</p>
<p>Allowed values: [1,16]</p>
<p>Default value: 8</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092650"></a><h3>
<a name="GdkPixbuf--colorspace"></a>The "<code class="literal">colorspace</code>" property</h3>
<a class="indexterm" name="id3092666"></a><pre class="programlisting"> "colorspace" <a href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace">GdkColorspace</a> : Read / Write / Construct Only</pre>
<p>The colorspace in which the samples are interpreted.</p>
<p>Default value: GDK_COLORSPACE_RGB</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092693"></a><h3>
<a name="GdkPixbuf--has-alpha"></a>The "<code class="literal">has-alpha</code>" property</h3>
<a class="indexterm" name="id3092709"></a><pre class="programlisting"> "has-alpha" <a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> : Read / Write / Construct Only</pre>
<p>Whether the pixbuf has an alpha channel.</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092735"></a><h3>
<a name="GdkPixbuf--height"></a>The "<code class="literal">height</code>" property</h3>
<a class="indexterm" name="id3092751"></a><pre class="programlisting"> "height" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only</pre>
<p>The number of rows of the pixbuf.</p>
<p>Allowed values: >= 1</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092781"></a><h3>
<a name="GdkPixbuf--n-channels"></a>The "<code class="literal">n-channels</code>" property</h3>
<a class="indexterm" name="id3092797"></a><pre class="programlisting"> "n-channels" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only</pre>
<p>
The number of samples per pixel.
Currently, only 3 or 4 samples per pixel are supported.</p>
<p>
</p>
<p>Allowed values: >= 0</p>
<p>Default value: 3</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092832"></a><h3>
<a name="GdkPixbuf--pixels"></a>The "<code class="literal">pixels</code>" property</h3>
<a class="indexterm" name="id3092848"></a><pre class="programlisting"> "pixels" <a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> : Read / Write / Construct Only</pre>
<p>A pointer to the pixel data of the pixbuf.</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092871"></a><h3>
<a name="GdkPixbuf--rowstride"></a>The "<code class="literal">rowstride</code>" property</h3>
<a class="indexterm" name="id3092887"></a><pre class="programlisting"> "rowstride" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only</pre>
<p>
The number of bytes between the start of a row and
the start of the next row. This number must (obviously)
be at least as large as the width of the pixbuf.</p>
<p>
</p>
<p>Allowed values: >= 1</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3092923"></a><h3>
<a name="GdkPixbuf--width"></a>The "<code class="literal">width</code>" property</h3>
<a class="indexterm" name="id3092938"></a><pre class="programlisting"> "width" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read / Write / Construct Only</pre>
<p>The number of columns of the pixbuf.</p>
<p>Allowed values: >= 1</p>
<p>Default value: 1</p>
</div>
</div>
</div>
</body>
</html>