GDK-PixBuf Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <gdk-pixbuf/gdk-pixbuf.h> enum GdkPixbufError; #define GDK_PIXBUF_ERROR enum GdkColorspace; enum GdkPixbufAlphaMode; GdkPixbuf; GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf
); int gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf
); gboolean gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf
); int gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf
); guchar * gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf
); int gdk_pixbuf_get_width (const GdkPixbuf *pixbuf
); int gdk_pixbuf_get_height (const GdkPixbuf *pixbuf
); int gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf
); const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf
,const gchar *key
);
"bits-per-sample" gint : Read / Write / Construct Only "colorspace" GdkColorspace : Read / Write / Construct Only "has-alpha" gboolean : Read / Write / Construct Only "height" gint : Read / Write / Construct Only "n-channels" gint : Read / Write / Construct Only "pixels" gpointer : Read / Write / Construct Only "rowstride" gint : Read / Write / Construct Only "width" gint : Read / Write / Construct Only
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;
typedef enum { GDK_PIXBUF_ALPHA_BILEVEL, GDK_PIXBUF_ALPHA_FULL } GdkPixbufAlphaMode;
GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf
);
Queries the color space of a pixbuf.
|
A pixbuf. |
Returns : |
Color space. |
int gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf
);
Queries the number of channels of a pixbuf.
|
A pixbuf. |
Returns : |
Number of channels. |
gboolean gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf
);
Queries whether a pixbuf has an alpha channel (opacity information).
int gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf
);
Queries the number of bits per color sample in a pixbuf.
|
A pixbuf. |
Returns : |
Number of bits per color sample. |
guchar * gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf
);
Queries a pointer to the pixel data of a pixbuf.
|
A pixbuf. |
Returns : |
A pointer to the pixbuf's pixel data. Please see ??? for information about how the pixel data is stored in memory. |
int gdk_pixbuf_get_width (const GdkPixbuf *pixbuf
);
Queries the width of a pixbuf.
|
A pixbuf. |
Returns : |
Width in pixels. |
int gdk_pixbuf_get_height (const GdkPixbuf *pixbuf
);
Queries the height of a pixbuf.
|
A pixbuf. |
Returns : |
Height in pixels. |
int gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf
);
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.
|
A pixbuf. |
Returns : |
Distance between row starts. |
const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf
,const gchar *key
);
Looks up key
in the list of options that may have been attached to the
pixbuf
when it was loaded, or that may have been attached by another
function using gdk_pixbuf_set_option()
.
For instance, the ANI loader provides "Title" and "Artist" options. The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot options for cursor definitions. The PNG loader provides the tEXt ancillary chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders return an "orientation" option string that corresponds to the embedded TIFF/Exif orientation tag (if present).
"bits-per-sample"
property"bits-per-sample" gint : Read / Write / Construct Only
The number of bits per sample. Currently only 8 bit per sample are supported.
Allowed values: [1,16]
Default value: 8
"colorspace"
property"colorspace" GdkColorspace : Read / Write / Construct Only
The colorspace in which the samples are interpreted.
Default value: GDK_COLORSPACE_RGB
"has-alpha"
property"has-alpha" gboolean : Read / Write / Construct Only
Whether the pixbuf has an alpha channel.
Default value: FALSE
"height"
property"height" gint : Read / Write / Construct Only
The number of rows of the pixbuf.
Allowed values: >= 1
Default value: 1
"n-channels"
property"n-channels" gint : Read / Write / Construct Only
The number of samples per pixel. Currently, only 3 or 4 samples per pixel are supported.
Allowed values: >= 0
Default value: 3
"pixels"
property"pixels" gpointer : Read / Write / Construct Only
A pointer to the pixel data of the pixbuf.
"rowstride"
property"rowstride" gint : Read / Write / Construct Only
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.
Allowed values: >= 1
Default value: 1
"width"
property"width" gint : Read / Write / Construct Only
The number of columns of the pixbuf.
Allowed values: >= 1
Default value: 1