Update. Clutter now working.
[girtod.git] / gtk2 / gdkpixbuf2.d
blob5bd94b98e4bf3fec9a90bdae861b12b90a634c7f
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/GdkPixbuf-2.0.gir"
4 module GdkPixbuf2;
5 public import gtk2.glib2;
6 alias gtk2.glib2 GLib2;
7 public import gtk2.gmodule2;
8 alias gtk2.gmodule2 GModule2;
9 public import gtk2.gobject2;
10 alias gtk2.gobject2 GObject2;
11 public import gtk2.gio2;
12 alias gtk2.gio2 Gio2;
14 // package: "gdk-pixbuf-2.0";
15 // C header: "gdk-pixbuf/gdk-pixbuf.h";
17 // c:symbol-prefixes: ["gdk"]
18 // c:identifier-prefixes: ["Gdk"]
20 // module GdkPixbuf2;
23 // This enumeration defines the color spaces that are supported by
24 // the &gdk-pixbuf; library. Currently only RGB is supported.
25 enum Colorspace {
26 RGB = 0
29 // This enumeration describes the different interpolation modes that
30 // can be used with the scaling functions. @GDK_INTERP_NEAREST is
31 // the fastest scaling method, but has horrible quality when
32 // scaling down. @GDK_INTERP_BILINEAR is the best choice if you
33 // aren't sure what to choose, it has a good speed/quality balance.
34 // <note>
35 // Cubic filtering is missing from the list; hyperbolic
36 // interpolation is just as fast and results in higher quality.
37 // </note>
38 enum InterpType {
39 NEAREST = 0,
40 TILES = 1,
41 BILINEAR = 2,
42 HYPER = 3
44 enum int PIXBUF_FEATURES_H = 1;
45 enum int PIXBUF_MAGIC_NUMBER = 1197763408;
46 enum int PIXBUF_MAJOR = 2;
47 enum int PIXBUF_MICRO = 1;
48 enum int PIXBUF_MINOR = 24;
49 enum PIXBUF_VERSION = "2.24.1";
50 enum int PIXDATA_HEADER_LENGTH = 24;
52 // This is the main structure in the &gdk-pixbuf; library. It is
53 // used to represent images. It contains information about the
54 // image's pixel data, its color space, bits per sample, width and
55 // height, and the rowstride (the number of bytes between the start of
56 // one row and the start of the next).
57 struct Pixbuf /* : GObject.Object */ {
58 alias method_parent this;
59 alias method_parent super_;
60 alias method_parent object;
61 GObject2.Object method_parent;
64 // Creates a new #GdkPixbuf structure and allocates a buffer for it. The
65 // buffer has an optimal rowstride. Note that the buffer is not cleared;
66 // you will have to fill it completely yourself.
67 // %NULL if not enough memory could be allocated for the image buffer.
68 // RETURNS: A newly-created #GdkPixbuf with a reference count of 1, or
69 // <colorspace>: Color space for image
70 // <has_alpha>: Whether the image should have transparency information
71 // <bits_per_sample>: Number of bits per color sample
72 // <width>: Width of image in pixels, must be > 0
73 // <height>: Height of image in pixels, must be > 0
74 static Pixbuf* /*new*/ new_(Colorspace colorspace, int has_alpha, int bits_per_sample, int width, int height) {
75 return gdk_pixbuf_new(colorspace, has_alpha, bits_per_sample, width, height);
78 // Creates a new #GdkPixbuf out of in-memory image data. Currently only RGB
79 // images with 8 bits per sample are supported.
80 // RETURNS: A newly-created #GdkPixbuf structure with a reference count of 1.
81 // <data>: Image data in 8-bit/sample packed format
82 // <colorspace>: Colorspace for the image data
83 // <has_alpha>: Whether the data has an opacity channel
84 // <bits_per_sample>: Number of bits per sample
85 // <width>: Width of the image in pixels, must be > 0
86 // <height>: Height of the image in pixels, must be > 0
87 // <rowstride>: Distance in bytes between row starts
88 // <destroy_fn>: Function used to free the data when the pixbuf's reference count drops to zero, or %NULL if the data should not be freed
89 // <destroy_fn_data>: Closure data to pass to the destroy notification function
90 static Pixbuf* /*new*/ new_from_data(ubyte* data, Colorspace colorspace, int has_alpha, int bits_per_sample, int width, int height, int rowstride, PixbufDestroyNotify destroy_fn, void* destroy_fn_data) {
91 return gdk_pixbuf_new_from_data(data, colorspace, has_alpha, bits_per_sample, width, height, rowstride, destroy_fn, destroy_fn_data);
94 // Creates a new pixbuf by loading an image from a file. The file format is
95 // detected automatically. If %NULL is returned, then @error will be set.
96 // Possible errors are in the #GDK_PIXBUF_ERROR and #G_FILE_ERROR domains.
97 // there was no loader for the file's format, there was not enough memory to
98 // allocate the image buffer, or the image file contained invalid data.
99 // RETURNS: A newly-created pixbuf with a reference count of 1, or %NULL if
100 // <filename>: Name of file to load, in the GLib file name encoding
101 static Pixbuf* /*new*/ new_from_file(char* filename, GLib2.Error** error=null) {
102 return gdk_pixbuf_new_from_file(filename, error);
105 // Creates a new pixbuf by loading an image from a file. The file format is
106 // detected automatically. If %NULL is returned, then @error will be set.
107 // Possible errors are in the #GDK_PIXBUF_ERROR and #G_FILE_ERROR domains.
108 // The image will be scaled to fit in the requested size, optionally preserving
109 // the image's aspect ratio.
110 // When preserving the aspect ratio, a @width of -1 will cause the image
111 // to be scaled to the exact given height, and a @height of -1 will cause
112 // the image to be scaled to the exact given width. When not preserving
113 // aspect ratio, a @width or @height of -1 means to not scale the image
114 // at all in that dimension. Negative values for @width and @height are
115 // allowed since 2.8.
116 // there was no loader for the file's format, there was not enough memory to
117 // allocate the image buffer, or the image file contained invalid data.
118 // RETURNS: A newly-created pixbuf with a reference count of 1, or %NULL
119 // <filename>: Name of file to load, in the GLib file name encoding
120 // <width>: The width the image should have or -1 to not constrain the width
121 // <height>: The height the image should have or -1 to not constrain the height
122 // <preserve_aspect_ratio>: %TRUE to preserve the image's aspect ratio
123 static Pixbuf* /*new*/ new_from_file_at_scale(char* filename, int width, int height, int preserve_aspect_ratio, GLib2.Error** error=null) {
124 return gdk_pixbuf_new_from_file_at_scale(filename, width, height, preserve_aspect_ratio, error);
127 // Creates a new pixbuf by loading an image from a file.
128 // The file format is detected automatically. If %NULL is returned, then
129 // #G_FILE_ERROR domains.
130 // The image will be scaled to fit in the requested size, preserving
131 // the image's aspect ratio. Note that the returned pixbuf may be smaller
132 // than @width x @height, if the aspect ratio requires it. To load
133 // and image at the requested size, regardless of aspect ratio, use
134 // gdk_pixbuf_new_from_file_at_scale().
135 // %NULL if any of several error conditions occurred: the file could not
136 // be opened, there was no loader for the file's format, there was not
137 // enough memory to allocate the image buffer, or the image file contained
138 // invalid data.
139 // RETURNS: A newly-created pixbuf with a reference count of 1, or
140 // <filename>: Name of file to load, in the GLib file name encoding
141 // <width>: The width the image should have or -1 to not constrain the width
142 // <height>: The height the image should have or -1 to not constrain the height
143 static Pixbuf* /*new*/ new_from_file_at_size(char* filename, int width, int height, GLib2.Error** error=null) {
144 return gdk_pixbuf_new_from_file_at_size(filename, width, height, error);
147 // Create a #GdkPixbuf from a flat representation that is suitable for
148 // storing as inline data in a program. This is useful if you want to
149 // ship a program with images, but don't want to depend on any
150 // external files.
151 // gdk-pixbuf ships with a program called <command>gdk-pixbuf-csource</command>
152 // which allows for conversion of #GdkPixbufs into such a inline representation.
153 // In almost all cases, you should pass the <option>--raw</option> flag to
154 // <command>gdk-pixbuf-csource</command>. A sample invocation would be:
155 // <informalexample><programlisting>
156 // gdk-pixbuf-csource --raw --name=myimage_inline myimage.png
157 // </programlisting></informalexample>
158 // For the typical case where the inline pixbuf is read-only static data,
159 // you don't need to copy the pixel data unless you intend to write to
160 // it, so you can pass %FALSE for @copy_pixels. (If you pass
161 // <option>--rle</option> to <command>gdk-pixbuf-csource</command>, a copy
162 // will be made even if @copy_pixels is %FALSE, so using this option is
163 // generally a bad idea.)
164 // If you create a pixbuf from const inline data compiled into your
165 // program, it's probably safe to ignore errors and disable length checks,
166 // since things will always succeed:
167 // <informalexample><programlisting>
168 // pixbuf = gdk_pixbuf_new_from_inline (-1, myimage_inline, FALSE, NULL);
169 // </programlisting></informalexample>
170 // For non-const inline data, you could get out of memory. For untrusted
171 // inline data located at runtime, you could have corrupt inline data in
172 // addition.
173 // count of 1, or %NULL if an error occurred.
174 // RETURNS: A newly-created #GdkPixbuf structure with a reference,
175 // <data_length>: Length in bytes of the @data argument or -1 to disable length checks
176 // <data>: Byte data containing a serialized #GdkPixdata structure
177 // <copy_pixels>: Whether to copy the pixel data, or use direct pointers
178 static Pixbuf* /*new*/ new_from_inline(int data_length, ubyte* data, int copy_pixels, GLib2.Error** error=null) {
179 return gdk_pixbuf_new_from_inline(data_length, data, copy_pixels, error);
182 // Creates a new pixbuf by loading an image from an input stream.
183 // The file format is detected automatically. If %NULL is returned, then
184 // from another thread. If the operation was cancelled, the error
185 // %GIO_ERROR_CANCELLED will be returned. Other possible errors are in
186 // the #GDK_PIXBUF_ERROR and %G_IO_ERROR domains.
187 // The stream is not closed.
188 // not supported, there was not enough memory to allocate the image buffer,
189 // the stream contained invalid data, or the operation was cancelled.
190 // RETURNS: A newly-created pixbuf, or %NULL if any of several error
191 // <stream>: a #GInputStream to load the pixbuf from
192 // <cancellable>: optional #GCancellable object, %NULL to ignore
193 static Pixbuf* /*new*/ new_from_stream(Gio2.InputStream* stream, Gio2.Cancellable* cancellable, GLib2.Error** error=null) {
194 return gdk_pixbuf_new_from_stream(stream, cancellable, error);
197 // Creates a new pixbuf by loading an image from an input stream.
198 // The file format is detected automatically. If %NULL is returned, then
199 // from another thread. If the operation was cancelled, the error
200 // %GIO_ERROR_CANCELLED will be returned. Other possible errors are in
201 // the #GDK_PIXBUF_ERROR and %G_IO_ERROR domains.
202 // The image will be scaled to fit in the requested size, optionally
203 // preserving the image's aspect ratio. When preserving the aspect ratio,
204 // a @width of -1 will cause the image to be scaled to the exact given
205 // height, and a @height of -1 will cause the image to be scaled to the
206 // exact given width. When not preserving aspect ratio, a @width or
207 // The stream is not closed.
208 // not supported, there was not enough memory to allocate the image buffer,
209 // the stream contained invalid data, or the operation was cancelled.
210 // RETURNS: A newly-created pixbuf, or %NULL if any of several error
211 // <stream>: a #GInputStream to load the pixbuf from
212 // <width>: The width the image should have or -1 to not constrain the width
213 // <height>: The height the image should have or -1 to not constrain the height
214 // <preserve_aspect_ratio>: %TRUE to preserve the image's aspect ratio
215 // <cancellable>: optional #GCancellable object, %NULL to ignore
216 static Pixbuf* /*new*/ new_from_stream_at_scale(Gio2.InputStream* stream, int width, int height, int preserve_aspect_ratio, Gio2.Cancellable* cancellable, GLib2.Error** error=null) {
217 return gdk_pixbuf_new_from_stream_at_scale(stream, width, height, preserve_aspect_ratio, cancellable, error);
220 // Finishes an asynchronous pixbuf creation operation started with
221 // gdk_pixbuf_new_from_stream_async().
222 // object with g_object_unref().
223 // RETURNS: a #GdkPixbuf or %NULL on error. Free the returned
224 // <async_result>: a #GAsyncResult
225 static Pixbuf* /*new*/ new_from_stream_finish(Gio2.AsyncResult* async_result, GLib2.Error** error=null) {
226 return gdk_pixbuf_new_from_stream_finish(async_result, error);
229 // Creates a new pixbuf by parsing XPM data in memory. This data is commonly
230 // the result of including an XPM file into a program's C source.
231 // RETURNS: A newly-created pixbuf with a reference count of 1.
232 // <data>: Pointer to inline XPM data.
233 static Pixbuf* /*new*/ new_from_xpm_data(char** data) {
234 return gdk_pixbuf_new_from_xpm_data(data);
237 // Unintrospectable function: from_pixdata() / gdk_pixbuf_from_pixdata()
238 // Converts a #GdkPixdata to a #GdkPixbuf. If @copy_pixels is %TRUE or
239 // if the pixel data is run-length-encoded, the pixel data is copied into
240 // newly-allocated memory; otherwise it is reused.
241 // RETURNS: a new #GdkPixbuf.
242 // <pixdata>: a #GdkPixdata to convert into a #GdkPixbuf.
243 // <copy_pixels>: whether to copy raw pixel data; run-length encoded pixel data is always copied.
244 static Pixbuf* from_pixdata(Pixdata* pixdata, int copy_pixels, GLib2.Error** error=null) {
245 return gdk_pixbuf_from_pixdata(pixdata, copy_pixels, error);
248 // Parses an image file far enough to determine its format and size.
249 // or %NULL if the image format wasn't recognized. The return value
250 // is owned by GdkPixbuf and should not be freed.
251 // RETURNS: A #GdkPixbufFormat describing the image format of the file
252 // <filename>: The name of the file to identify.
253 // <width>: Return location for the width of the image, or %NULL
254 // <height>: Return location for the height of the image, or %NULL
255 static PixbufFormat* /*new*/ get_file_info(char* filename, int* width, int* height) {
256 return gdk_pixbuf_get_file_info(filename, width, height);
259 // Obtains the available information about the image formats supported
260 // by GdkPixbuf.
261 // #GdkPixbufFormat<!-- -->s describing the supported
262 // image formats. The list should be freed when it is no longer needed,
263 // but the structures themselves are owned by #GdkPixbuf and should not be
264 // freed.
265 // RETURNS: A list of
266 static GLib2.SList* /*new container*/ get_formats() {
267 return gdk_pixbuf_get_formats();
269 static char* gettext(char* msgid) {
270 return gdk_pixbuf_gettext(msgid);
273 // Creates a new pixbuf by asynchronously loading an image from an input stream.
274 // For more details see gdk_pixbuf_new_from_stream(), which is the synchronous
275 // version of this function.
276 // When the operation is finished, @callback will be called in the main thread.
277 // You can then call gdk_pixbuf_new_from_stream_finish() to get the result of the operation.
278 // <stream>: a #GInputStream from which to load the pixbuf
279 // <cancellable>: optional #GCancellable object, %NULL to ignore
280 // <callback>: a #GAsyncReadyCallback to call when the the pixbuf is loaded
281 // <user_data>: the data to pass to the callback function
282 static void new_from_stream_async(Gio2.InputStream* stream, Gio2.Cancellable* cancellable, Gio2.AsyncReadyCallback callback, void* user_data) {
283 gdk_pixbuf_new_from_stream_async(stream, cancellable, callback, user_data);
286 // Creates a new pixbuf by asynchronously loading an image from an input stream.
287 // For more details see gdk_pixbuf_new_from_stream_at_scale(), which is the synchronous
288 // version of this function.
289 // When the operation is finished, @callback will be called in the main thread.
290 // You can then call gdk_pixbuf_new_from_stream_finish() to get the result of the operation.
291 // <stream>: a #GInputStream from which to load the pixbuf
292 // <width>: the width the image should have or -1 to not constrain the width
293 // <height>: the height the image should have or -1 to not constrain the height
294 // <preserve_aspect_ratio>: %TRUE to preserve the image's aspect ratio
295 // <cancellable>: optional #GCancellable object, %NULL to ignore
296 // <callback>: a #GAsyncReadyCallback to call when the the pixbuf is loaded
297 // <user_data>: the data to pass to the callback function
298 static void new_from_stream_at_scale_async(Gio2.InputStream* stream, int width, int height, int preserve_aspect_ratio, Gio2.Cancellable* cancellable, Gio2.AsyncReadyCallback callback, void* user_data) {
299 gdk_pixbuf_new_from_stream_at_scale_async(stream, width, height, preserve_aspect_ratio, cancellable, callback, user_data);
302 // Finishes an asynchronous pixbuf save operation started with
303 // gdk_pixbuf_save_to_stream_async().
304 // RETURNS: %TRUE if the pixbuf was saved successfully, %FALSE if an error was set.
305 // <async_result>: a #GAsyncResult
306 static int save_to_stream_finish(Gio2.AsyncResult* async_result, GLib2.Error** error=null) {
307 return gdk_pixbuf_save_to_stream_finish(async_result, error);
310 // Takes an existing pixbuf and adds an alpha channel to it.
311 // If the existing pixbuf already had an alpha channel, the channel
312 // values are copied from the original; otherwise, the alpha channel
313 // is initialized to 255 (full opacity).
314 // If @substitute_color is %TRUE, then the color specified by (@r, @g, @b) will be
315 // assigned zero opacity. That is, if you pass (255, 255, 255) for the
316 // substitute color, all white pixels will become fully transparent.
317 // RETURNS: A newly-created pixbuf with a reference count of 1.
318 // <substitute_color>: Whether to set a color to zero opacity. If this is %FALSE, then the (@r, @g, @b) arguments will be ignored.
319 // <r>: Red value to substitute.
320 // <g>: Green value to substitute.
321 // <b>: Blue value to substitute.
322 Pixbuf* /*new*/ add_alpha(int substitute_color, ubyte r, ubyte g, ubyte b) {
323 return gdk_pixbuf_add_alpha(&this, substitute_color, r, g, b);
326 // Takes an existing pixbuf and checks for the presence of an
327 // associated "orientation" option, which may be provided by the
328 // jpeg loader (which reads the exif orientation tag) or the
329 // tiff loader (which reads the tiff orientation tag, and
330 // compensates it for the partial transforms performed by
331 // libtiff). If an orientation option/tag is present, the
332 // appropriate transform will be performed so that the pixbuf
333 // is oriented correctly.
334 // input pixbuf (with an increased reference count).
335 // RETURNS: A newly-created pixbuf, or a reference to the
336 Pixbuf* /*new*/ apply_embedded_orientation() {
337 return gdk_pixbuf_apply_embedded_orientation(&this);
340 // Creates a transformation of the source image @src by scaling by
341 // This gives an image in the coordinates of the destination pixbuf.
342 // The rectangle (@dest_x, @dest_y, @dest_width, @dest_height)
343 // is then composited onto the corresponding rectangle of the
344 // original destination image.
345 // When the destination rectangle contains parts not in the source
346 // image, the data at the edges of the source image is replicated
347 // to infinity.
348 // <figure id="pixbuf-composite-diagram">
349 // <title>Compositing of pixbufs</title>
350 // <graphic fileref="composite.png" format="PNG"/>
351 // </figure>
352 // <dest>: the #GdkPixbuf into which to render the results
353 // <dest_x>: the left coordinate for region to render
354 // <dest_y>: the top coordinate for region to render
355 // <dest_width>: the width of the region to render
356 // <dest_height>: the height of the region to render
357 // <offset_x>: the offset in the X direction (currently rounded to an integer)
358 // <offset_y>: the offset in the Y direction (currently rounded to an integer)
359 // <scale_x>: the scale factor in the X direction
360 // <scale_y>: the scale factor in the Y direction
361 // <interp_type>: the interpolation type for the transformation.
362 // <overall_alpha>: overall alpha for source image (0..255)
363 void composite(Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha) {
364 gdk_pixbuf_composite(&this, dest, dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, interp_type, overall_alpha);
367 // Creates a transformation of the source image @src by scaling by
368 // then composites the rectangle (@dest_x ,@dest_y, @dest_width,
369 // colors @color1 and @color2 and renders it onto the destination
370 // image.
371 // See gdk_pixbuf_composite_color_simple() for a simpler variant of this
372 // function suitable for many tasks.
373 // <dest>: the #GdkPixbuf into which to render the results
374 // <dest_x>: the left coordinate for region to render
375 // <dest_y>: the top coordinate for region to render
376 // <dest_width>: the width of the region to render
377 // <dest_height>: the height of the region to render
378 // <offset_x>: the offset in the X direction (currently rounded to an integer)
379 // <offset_y>: the offset in the Y direction (currently rounded to an integer)
380 // <scale_x>: the scale factor in the X direction
381 // <scale_y>: the scale factor in the Y direction
382 // <interp_type>: the interpolation type for the transformation.
383 // <overall_alpha>: overall alpha for source image (0..255)
384 // <check_x>: the X offset for the checkboard (origin of checkboard is at -@check_x, -@check_y)
385 // <check_y>: the Y offset for the checkboard
386 // <check_size>: the size of checks in the checkboard (must be a power of two)
387 // <color1>: the color of check at upper left
388 // <color2>: the color of the other check
389 void composite_color(Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha, int check_x, int check_y, int check_size, uint color1, uint color2) {
390 gdk_pixbuf_composite_color(&this, dest, dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, interp_type, overall_alpha, check_x, check_y, check_size, color1, color2);
393 // Creates a new #GdkPixbuf by scaling @src to @dest_width x
394 // allocated for it.
395 // RETURNS: the new #GdkPixbuf, or %NULL if not enough memory could be
396 // <dest_width>: the width of destination image
397 // <dest_height>: the height of destination image
398 // <interp_type>: the interpolation type for the transformation.
399 // <overall_alpha>: overall alpha for source image (0..255)
400 // <check_size>: the size of checks in the checkboard (must be a power of two)
401 // <color1>: the color of check at upper left
402 // <color2>: the color of the other check
403 Pixbuf* /*new*/ composite_color_simple(int dest_width, int dest_height, InterpType interp_type, int overall_alpha, int check_size, uint color1, uint color2) {
404 return gdk_pixbuf_composite_color_simple(&this, dest_width, dest_height, interp_type, overall_alpha, check_size, color1, color2);
407 // Creates a new #GdkPixbuf with a copy of the information in the specified
408 // not enough memory could be allocated.
409 // RETURNS: A newly-created pixbuf with a reference count of 1, or %NULL if
410 Pixbuf* /*new*/ copy() {
411 return gdk_pixbuf_copy(&this);
414 // Copies a rectangular area from @src_pixbuf to @dest_pixbuf. Conversion of
415 // pixbuf formats is done automatically.
416 // If the source rectangle overlaps the destination rectangle on the
417 // same pixbuf, it will be overwritten during the copy operation.
418 // Therefore, you can not use this function to scroll a pixbuf.
419 // <src_x>: Source X coordinate within @src_pixbuf.
420 // <src_y>: Source Y coordinate within @src_pixbuf.
421 // <width>: Width of the area to copy.
422 // <height>: Height of the area to copy.
423 // <dest_pixbuf>: Destination pixbuf.
424 // <dest_x>: X coordinate within @dest_pixbuf.
425 // <dest_y>: Y coordinate within @dest_pixbuf.
426 void copy_area(int src_x, int src_y, int width, int height, Pixbuf* dest_pixbuf, int dest_x, int dest_y) {
427 gdk_pixbuf_copy_area(&this, src_x, src_y, width, height, dest_pixbuf, dest_x, dest_y);
430 // Clears a pixbuf to the given RGBA value, converting the RGBA value into
431 // the pixbuf's pixel format. The alpha will be ignored if the pixbuf
432 // doesn't have an alpha channel.
433 // <pixel>: RGBA pixel to clear to (0xffffffff is opaque white, 0x00000000 transparent black)
434 void fill(uint pixel) {
435 gdk_pixbuf_fill(&this, pixel);
438 // Flips a pixbuf horizontally or vertically and returns the
439 // result in a new pixbuf.
440 // allocated for it.
441 // RETURNS: the new #GdkPixbuf, or %NULL if not enough memory could be
442 // <horizontal>: %TRUE to flip horizontally, %FALSE to flip vertically
443 Pixbuf* /*new*/ flip(int horizontal) {
444 return gdk_pixbuf_flip(&this, horizontal);
447 // Queries the number of bits per color sample in a pixbuf.
448 // RETURNS: Number of bits per color sample.
449 int get_bits_per_sample() {
450 return gdk_pixbuf_get_bits_per_sample(&this);
453 // Queries the color space of a pixbuf.
454 // RETURNS: Color space.
455 Colorspace get_colorspace() {
456 return gdk_pixbuf_get_colorspace(&this);
459 // Queries whether a pixbuf has an alpha channel (opacity information).
460 // RETURNS: %TRUE if it has an alpha channel, %FALSE otherwise.
461 int get_has_alpha() {
462 return gdk_pixbuf_get_has_alpha(&this);
465 // Queries the height of a pixbuf.
466 // RETURNS: Height in pixels.
467 int get_height() {
468 return gdk_pixbuf_get_height(&this);
471 // Queries the number of channels of a pixbuf.
472 // RETURNS: Number of channels.
473 int get_n_channels() {
474 return gdk_pixbuf_get_n_channels(&this);
477 // Looks up @key in the list of options that may have been attached to the
478 // function using gdk_pixbuf_set_option().
479 // For instance, the ANI loader provides "Title" and "Artist" options.
480 // The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot
481 // options for cursor definitions. The PNG loader provides the tEXt ancillary
482 // chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders
483 // return an "orientation" option string that corresponds to the embedded
484 // TIFF/Exif orientation tag (if present).
485 // string that should not be freed or %NULL if @key was not found.
486 // RETURNS: the value associated with @key. This is a nul-terminated
487 // <key>: a nul-terminated string.
488 char* get_option(char* key) {
489 return gdk_pixbuf_get_option(&this, key);
492 // Queries a pointer to the pixel data of a pixbuf.
493 // for information about how the pixel data is stored in
494 // memory.
495 // RETURNS: A pointer to the pixbuf's pixel data. Please see <xref linkend="image-data"/>
496 ubyte* get_pixels() {
497 return gdk_pixbuf_get_pixels(&this);
500 // Queries the rowstride of a pixbuf, which is the number of bytes between the start of a row
501 // and the start of the next row.
502 // RETURNS: Distance between row starts.
503 int get_rowstride() {
504 return gdk_pixbuf_get_rowstride(&this);
507 // Queries the width of a pixbuf.
508 // RETURNS: Width in pixels.
509 int get_width() {
510 return gdk_pixbuf_get_width(&this);
513 // Creates a new pixbuf which represents a sub-region of
514 // original pixbuf, so writing to one affects both.
515 // The new pixbuf holds a reference to @src_pixbuf, so
516 // is finalized.
517 // RETURNS: a new pixbuf
518 // <src_x>: X coord in @src_pixbuf
519 // <src_y>: Y coord in @src_pixbuf
520 // <width>: width of region in @src_pixbuf
521 // <height>: height of region in @src_pixbuf
522 Pixbuf* /*new*/ new_subpixbuf(int src_x, int src_y, int width, int height) {
523 return gdk_pixbuf_new_subpixbuf(&this, src_x, src_y, width, height);
526 // Unintrospectable method: ref() / gdk_pixbuf_ref()
527 // Adds a reference to a pixbuf.
528 // RETURNS: The same as the @pixbuf argument.
529 Pixbuf* ref_() {
530 return gdk_pixbuf_ref(&this);
533 // Rotates a pixbuf by a multiple of 90 degrees, and returns the
534 // result in a new pixbuf.
535 // allocated for it.
536 // RETURNS: the new #GdkPixbuf, or %NULL if not enough memory could be
537 // <angle>: the angle to rotate by
538 Pixbuf* /*new*/ rotate_simple(PixbufRotation angle) {
539 return gdk_pixbuf_rotate_simple(&this, angle);
542 // Modifies saturation and optionally pixelates @src, placing the result in
543 // saturation is reduced (the image turns toward grayscale); if greater than
544 // 1.0, saturation is increased (the image gets more vivid colors). If @pixelate
545 // is %TRUE, then pixels are faded in a checkerboard pattern to create a
546 // pixelated image. @src and @dest must have the same image format, size, and
547 // rowstride.
548 // <dest>: place to write modified version of @src
549 // <saturation>: saturation factor
550 // <pixelate>: whether to pixelate
551 void saturate_and_pixelate(Pixbuf* dest, float saturation, int pixelate) {
552 gdk_pixbuf_saturate_and_pixelate(&this, dest, saturation, pixelate);
555 // Unintrospectable method: save() / gdk_pixbuf_save()
556 // Saves pixbuf to a file in format @type. By default, "jpeg", "png", "ico"
557 // and "bmp" are possible file formats to save in, but more formats may be
558 // installed. The list of all writable formats can be determined in the
559 // following way:
560 // |[
561 // void add_if_writable (GdkPixbufFormat *data, GSList **list)
562 // {
563 // if (gdk_pixbuf_format_is_writable (data))
564 // *list = g_slist_prepend (*list, data);
565 // }
566 // GSList *formats = gdk_pixbuf_get_formats ();
567 // GSList *writable_formats = NULL;
568 // g_slist_foreach (formats, add_if_writable, &writable_formats);
569 // g_slist_free (formats);
570 // ]|
571 // If @error is set, %FALSE will be returned. Possible errors include
572 // those in the #GDK_PIXBUF_ERROR domain and those in the #G_FILE_ERROR domain.
573 // The variable argument list should be %NULL-terminated; if not empty,
574 // it should contain pairs of strings that modify the save
575 // parameters. For example:
576 // <informalexample><programlisting>
577 // gdk_pixbuf_save (pixbuf, handle, "jpeg", &amp;error,
578 // "quality", "100", NULL);
579 // </programlisting></informalexample>
580 // Currently only few parameters exist. JPEG images can be saved with a
581 // "quality" parameter; its value should be in the range [0,100].
582 // Text chunks can be attached to PNG images by specifying parameters of
583 // the form "tEXt::key", where key is an ASCII string of length 1-79.
584 // The values are UTF-8 encoded strings. The PNG compression level can
585 // be specified using the "compression" parameter; it's value is in an
586 // integer in the range of [0,9].
587 // ICC color profiles can also be embedded into PNG and TIFF images.
588 // The "icc-profile" value should be the complete ICC profile encoded
589 // into base64.
590 // <informalexample><programlisting>
591 // gchar *contents;
592 // gchar *contents_encode;
593 // gsize length;
594 // g_file_get_contents ("/home/hughsie/.color/icc/L225W.icm", &contents, &length, NULL);
595 // contents_encode = g_base64_encode ((const guchar *) contents, length);
596 // gdk_pixbuf_save (pixbuf, handle, "png", &amp;error,
597 // "icc-profile", contents_encode,
598 // NULL);
599 // </programlisting></informalexample>
600 // TIFF images recognize a "compression" option which acceps an integer value.
601 // Among the codecs are 1 None, 2 Huffman, 5 LZW, 7 JPEG and 8 Deflate, see
602 // the libtiff documentation and tiff.h for all supported codec values.
603 // ICO images can be saved in depth 16, 24, or 32, by using the "depth"
604 // parameter. When the ICO saver is given "x_hot" and "y_hot" parameters,
605 // it produces a CUR instead of an ICO.
606 // RETURNS: whether an error was set
607 // <filename>: name of file to save.
608 // <type>: name of file format.
609 // <error>: return location for error, or %NULL
610 /+ Not available -- variadic methods unsupported - use the C function directly.
611 alias gdk_pixbuf_save save; // Variadic
614 // Unintrospectable method: save_to_buffer() / gdk_pixbuf_save_to_buffer()
615 // Saves pixbuf to a new buffer in format @type, which is currently "jpeg",
616 // "png", "tiff", "ico" or "bmp". This is a convenience function that uses
617 // gdk_pixbuf_save_to_callback() to do the real work. Note that the buffer
618 // is not nul-terminated and may contain embedded nuls.
619 // If @error is set, %FALSE will be returned and @buffer will be set to
620 // %NULL. Possible errors include those in the #GDK_PIXBUF_ERROR
621 // domain.
622 // See gdk_pixbuf_save() for more details.
623 // RETURNS: whether an error was set
624 // <buffer>: location to receive a pointer to the new buffer.
625 // <buffer_size>: location to receive the size of the new buffer.
626 // <type>: name of file format.
627 // <error>: return location for error, or %NULL
628 /+ Not available -- variadic methods unsupported - use the C function directly.
629 alias gdk_pixbuf_save_to_buffer save_to_buffer; // Variadic
632 // Saves pixbuf to a new buffer in format @type, which is currently "jpeg",
633 // "tiff", "png", "ico" or "bmp". See gdk_pixbuf_save_to_buffer()
634 // for more details.
635 // RETURNS: whether an error was set
636 // <buffer>: location to receive a pointer to the new buffer.
637 // <buffer_size>: location to receive the size of the new buffer.
638 // <type>: name of file format.
639 // <option_keys>: name of options to set, %NULL-terminated
640 // <option_values>: values for named options
641 int save_to_bufferv(char** buffer, size_t* buffer_size, char* type, char** option_keys, char** option_values, GLib2.Error** error=null) {
642 return gdk_pixbuf_save_to_bufferv(&this, buffer, buffer_size, type, option_keys, option_values, error);
645 // Unintrospectable method: save_to_callback() / gdk_pixbuf_save_to_callback()
646 // Saves pixbuf in format @type by feeding the produced data to a
647 // callback. Can be used when you want to store the image to something
648 // other than a file, such as an in-memory buffer or a socket.
649 // If @error is set, %FALSE will be returned. Possible errors
650 // include those in the #GDK_PIXBUF_ERROR domain and whatever the save
651 // function generates.
652 // See gdk_pixbuf_save() for more details.
653 // RETURNS: whether an error was set
654 // <save_func>: a function that is called to save each block of data that the save routine generates.
655 // <user_data>: user data to pass to the save function.
656 // <type>: name of file format.
657 // <error>: return location for error, or %NULL
658 /+ Not available -- variadic methods unsupported - use the C function directly.
659 alias gdk_pixbuf_save_to_callback save_to_callback; // Variadic
662 // Saves pixbuf to a callback in format @type, which is currently "jpeg",
663 // "png", "tiff", "ico" or "bmp". If @error is set, %FALSE will be returned. See
664 // gdk_pixbuf_save_to_callback () for more details.
665 // RETURNS: whether an error was set
666 // <save_func>: a function that is called to save each block of data that the save routine generates.
667 // <user_data>: user data to pass to the save function.
668 // <type>: name of file format.
669 // <option_keys>: name of options to set, %NULL-terminated
670 // <option_values>: values for named options
671 int save_to_callbackv(PixbufSaveFunc save_func, void* user_data, char* type, char** option_keys, char** option_values, GLib2.Error** error=null) {
672 return gdk_pixbuf_save_to_callbackv(&this, save_func, user_data, type, option_keys, option_values, error);
675 // Unintrospectable method: save_to_stream() / gdk_pixbuf_save_to_stream()
676 // Saves @pixbuf to an output stream.
677 // Supported file formats are currently "jpeg", "tiff", "png", "ico" or
678 // "bmp". See gdk_pixbuf_save_to_buffer() for more details.
679 // The @cancellable can be used to abort the operation from another
680 // thread. If the operation was cancelled, the error %GIO_ERROR_CANCELLED
681 // will be returned. Other possible errors are in the #GDK_PIXBUF_ERROR
682 // and %G_IO_ERROR domains.
683 // The stream is not closed.
684 // error was set.
685 // RETURNS: %TRUE if the pixbuf was saved successfully, %FALSE if an
686 // <stream>: a #GOutputStream to save the pixbuf to
687 // <type>: name of file format
688 // <cancellable>: optional #GCancellable object, %NULL to ignore
689 // <error>: return location for error, or %NULL
690 /+ Not available -- variadic methods unsupported - use the C function directly.
691 alias gdk_pixbuf_save_to_stream save_to_stream; // Variadic
694 // Unintrospectable method: save_to_stream_async() / gdk_pixbuf_save_to_stream_async()
695 // Saves @pixbuf to an output stream asynchronously.
696 // For more details see gdk_pixbuf_save_to_stream(), which is the synchronous
697 // version of this function.
698 // When the operation is finished, @callback will be called in the main thread.
699 // You can then call gdk_pixbuf_save_to_stream_finish() to get the result of the operation.
700 // <stream>: a #GOutputStream to which to save the pixbuf
701 // <type>: name of file format
702 // <cancellable>: optional #GCancellable object, %NULL to ignore
703 // <callback>: a #GAsyncReadyCallback to call when the the pixbuf is loaded
704 // <user_data>: the data to pass to the callback function
705 /+ Not available -- variadic methods unsupported - use the C function directly.
706 alias gdk_pixbuf_save_to_stream_async save_to_stream_async; // Variadic
709 // Saves pixbuf to a file in @type, which is currently "jpeg", "png", "tiff", "ico" or "bmp".
710 // If @error is set, %FALSE will be returned.
711 // See gdk_pixbuf_save () for more details.
712 // RETURNS: whether an error was set
713 // <filename>: name of file to save.
714 // <type>: name of file format.
715 // <option_keys>: name of options to set, %NULL-terminated
716 // <option_values>: values for named options
717 int savev(char* filename, char* type, char** option_keys, char** option_values, GLib2.Error** error=null) {
718 return gdk_pixbuf_savev(&this, filename, type, option_keys, option_values, error);
721 // Creates a transformation of the source image @src by scaling by
722 // then renders the rectangle (@dest_x, @dest_y, @dest_width,
723 // replacing the previous contents.
724 // Try to use gdk_pixbuf_scale_simple() first, this function is
725 // the industrial-strength power tool you can fall back to if
726 // gdk_pixbuf_scale_simple() isn't powerful enough.
727 // If the source rectangle overlaps the destination rectangle on the
728 // same pixbuf, it will be overwritten during the scaling which
729 // results in rendering artifacts.
730 // <dest>: the #GdkPixbuf into which to render the results
731 // <dest_x>: the left coordinate for region to render
732 // <dest_y>: the top coordinate for region to render
733 // <dest_width>: the width of the region to render
734 // <dest_height>: the height of the region to render
735 // <offset_x>: the offset in the X direction (currently rounded to an integer)
736 // <offset_y>: the offset in the Y direction (currently rounded to an integer)
737 // <scale_x>: the scale factor in the X direction
738 // <scale_y>: the scale factor in the Y direction
739 // <interp_type>: the interpolation type for the transformation.
740 void scale(Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type) {
741 gdk_pixbuf_scale(&this, dest, dest_x, dest_y, dest_width, dest_height, offset_x, offset_y, scale_x, scale_y, interp_type);
744 // Create a new #GdkPixbuf containing a copy of @src scaled to
745 // should be #GDK_INTERP_NEAREST if you want maximum speed (but when
746 // scaling down #GDK_INTERP_NEAREST is usually unusably ugly). The
747 // default @interp_type should be #GDK_INTERP_BILINEAR which offers
748 // reasonable quality and speed.
749 // You can scale a sub-portion of @src by creating a sub-pixbuf
750 // pointing into @src; see gdk_pixbuf_new_subpixbuf().
751 // For more complicated scaling/compositing see gdk_pixbuf_scale()
752 // and gdk_pixbuf_composite().
753 // allocated for it.
754 // RETURNS: the new #GdkPixbuf, or %NULL if not enough memory could be
755 // <dest_width>: the width of destination image
756 // <dest_height>: the height of destination image
757 // <interp_type>: the interpolation type for the transformation.
758 Pixbuf* /*new*/ scale_simple(int dest_width, int dest_height, InterpType interp_type) {
759 return gdk_pixbuf_scale_simple(&this, dest_width, dest_height, interp_type);
762 // Unintrospectable method: unref() / gdk_pixbuf_unref()
763 // Removes a reference from a pixbuf.
764 void unref() {
765 gdk_pixbuf_unref(&this);
770 // These values can be passed to
771 // gdk_pixbuf_render_to_drawable_alpha() to control how the alpha
772 // channel of an image should be handled. This function can create a
773 // bilevel clipping mask (black and white) and use it while painting
774 // the image. In the future, when the X Window System gets an alpha
775 // channel extension, it will be possible to do full alpha
776 // compositing onto arbitrary drawables. For now both cases fall
777 // back to a bilevel clipping mask.
778 enum PixbufAlphaMode {
779 BILEVEL = 0,
780 FULL = 1
782 // An opaque struct representing an animation.
783 struct PixbufAnimation /* : GObject.Object */ {
784 alias method_parent this;
785 alias method_parent super_;
786 alias method_parent object;
787 GObject2.Object method_parent;
790 // Creates a new animation by loading it from a file. The file format is
791 // detected automatically. If the file's format does not support multi-frame
792 // images, then an animation with a single frame will be created. Possible errors
793 // are in the #GDK_PIXBUF_ERROR and #G_FILE_ERROR domains.
794 // there was no loader for the file's format, there was not enough memory to
795 // allocate the image buffer, or the image file contained invalid data.
796 // RETURNS: A newly-created animation with a reference count of 1, or %NULL
797 // <filename>: Name of file to load, in the GLib file name encoding
798 static PixbufAnimation* /*new*/ new_from_file(char* filename, GLib2.Error** error=null) {
799 return gdk_pixbuf_animation_new_from_file(filename, error);
802 // Queries the height of the bounding box of a pixbuf animation.
803 // RETURNS: Height of the bounding box of the animation.
804 int get_height() {
805 return gdk_pixbuf_animation_get_height(&this);
808 // Get an iterator for displaying an animation. The iterator provides
809 // the frames that should be displayed at a given time.
810 // It should be freed after use with g_object_unref().
811 // marks the beginning of animation playback. After creating an
812 // iterator, you should immediately display the pixbuf returned by
813 // gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install a
814 // timeout (with g_timeout_add()) or by some other mechanism ensure
815 // that you'll update the image after
816 // gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time
817 // the image is updated, you should reinstall the timeout with the new,
818 // possibly-changed delay time.
819 // As a shortcut, if @start_time is %NULL, the result of
820 // g_get_current_time() will be used automatically.
821 // To update the image (i.e. possibly change the result of
822 // gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation),
823 // call gdk_pixbuf_animation_iter_advance().
824 // If you're using #GdkPixbufLoader, in addition to updating the image
825 // after the delay time, you should also update it whenever you
826 // receive the area_updated signal and
827 // gdk_pixbuf_animation_iter_on_currently_loading_frame() returns
828 // %TRUE. In this case, the frame currently being fed into the loader
829 // has received new data, so needs to be refreshed. The delay time for
830 // a frame may also be modified after an area_updated signal, for
831 // example if the delay time for a frame is encoded in the data after
832 // the frame itself. So your timeout should be reinstalled after any
833 // area_updated signal.
834 // A delay time of -1 is possible, indicating "infinite."
835 // RETURNS: an iterator to move over the animation
836 // <start_time>: time when the animation starts playing
837 PixbufAnimationIter* /*new*/ get_iter(GLib2.TimeVal* start_time) {
838 return gdk_pixbuf_animation_get_iter(&this, start_time);
841 // If an animation is really just a plain image (has only one frame),
842 // this function returns that image. If the animation is an animation,
843 // this function returns a reasonable thing to display as a static
844 // unanimated image, which might be the first frame, or something more
845 // sophisticated. If an animation hasn't loaded any frames yet, this
846 // function will return %NULL.
847 // RETURNS: unanimated image representing the animation
848 Pixbuf* get_static_image() {
849 return gdk_pixbuf_animation_get_static_image(&this);
852 // Queries the width of the bounding box of a pixbuf animation.
853 // RETURNS: Width of the bounding box of the animation.
854 int get_width() {
855 return gdk_pixbuf_animation_get_width(&this);
858 // If you load a file with gdk_pixbuf_animation_new_from_file() and it turns
859 // out to be a plain, unanimated image, then this function will return
860 // %TRUE. Use gdk_pixbuf_animation_get_static_image() to retrieve
861 // the image.
862 // RETURNS: %TRUE if the "animation" was really just an image
863 int is_static_image() {
864 return gdk_pixbuf_animation_is_static_image(&this);
867 // Unintrospectable method: ref() / gdk_pixbuf_animation_ref()
868 // Adds a reference to an animation.
869 // RETURNS: The same as the @animation argument.
870 PixbufAnimation* ref_() {
871 return gdk_pixbuf_animation_ref(&this);
874 // Unintrospectable method: unref() / gdk_pixbuf_animation_unref()
875 // Removes a reference from an animation.
876 void unref() {
877 gdk_pixbuf_animation_unref(&this);
882 // An opaque struct representing an iterator which points to a
883 // certain position in an animation.
884 struct PixbufAnimationIter /* : GObject.Object */ {
885 alias method_parent this;
886 alias method_parent super_;
887 alias method_parent object;
888 GObject2.Object method_parent;
891 // Possibly advances an animation to a new frame. Chooses the frame based
892 // on the start time passed to gdk_pixbuf_animation_get_iter().
893 // must be greater than or equal to the time passed to
894 // gdk_pixbuf_animation_get_iter(), and must increase or remain
895 // unchanged each time gdk_pixbuf_animation_iter_get_pixbuf() is
896 // called. That is, you can't go backward in time; animations only
897 // play forward.
898 // As a shortcut, pass %NULL for the current time and g_get_current_time()
899 // will be invoked on your behalf. So you only need to explicitly pass
900 // at double speed.
901 // If this function returns %FALSE, there's no need to update the animation
902 // display, assuming the display had been rendered prior to advancing;
903 // if %TRUE, you need to call gdk_animation_iter_get_pixbuf() and update the
904 // display with the new pixbuf.
905 // RETURNS: %TRUE if the image may need updating
906 // <current_time>: current time
907 int advance(GLib2.TimeVal* current_time) {
908 return gdk_pixbuf_animation_iter_advance(&this, current_time);
911 // Gets the number of milliseconds the current pixbuf should be displayed,
912 // or -1 if the current pixbuf should be displayed forever. g_timeout_add()
913 // conveniently takes a timeout in milliseconds, so you can use a timeout
914 // to schedule the next update.
915 // RETURNS: delay time in milliseconds (thousandths of a second)
916 int get_delay_time() {
917 return gdk_pixbuf_animation_iter_get_delay_time(&this);
920 // Gets the current pixbuf which should be displayed; the pixbuf will
921 // be the same size as the animation itself
922 // (gdk_pixbuf_animation_get_width(), gdk_pixbuf_animation_get_height()).
923 // This pixbuf should be displayed for
924 // gdk_pixbuf_animation_iter_get_delay_time() milliseconds. The caller
925 // of this function does not own a reference to the returned pixbuf;
926 // the returned pixbuf will become invalid when the iterator advances
927 // to the next frame, which may happen anytime you call
928 // gdk_pixbuf_animation_iter_advance(). Copy the pixbuf to keep it
929 // (don't just add a reference), as it may get recycled as you advance
930 // the iterator.
931 // RETURNS: the pixbuf to be displayed
932 Pixbuf* get_pixbuf() {
933 return gdk_pixbuf_animation_iter_get_pixbuf(&this);
936 // Used to determine how to respond to the area_updated signal on
937 // #GdkPixbufLoader when loading an animation. area_updated is emitted
938 // for an area of the frame currently streaming in to the loader. So if
939 // you're on the currently loading frame, you need to redraw the screen for
940 // the updated area.
941 // RETURNS: %TRUE if the frame we're on is partially loaded, or the last frame
942 int on_currently_loading_frame() {
943 return gdk_pixbuf_animation_iter_on_currently_loading_frame(&this);
948 // A function of this type is responsible for freeing the pixel array
949 // of a pixbuf. The gdk_pixbuf_new_from_data() function lets you
950 // pass in a pre-allocated pixel array so that a pixbuf can be
951 // created from it; in this case you will need to pass in a function
952 // of #GdkPixbufDestroyNotify so that the pixel data can be freed
953 // when the pixbuf is finalized.
954 // <pixels>: The pixel array of the pixbuf that is being finalized.
955 // <data>: User closure data.
956 extern (C) alias void function (ubyte* pixels, void* data) PixbufDestroyNotify;
959 // An error code in the #GDK_PIXBUF_ERROR domain. Many &gdk-pixbuf;
960 // operations can cause errors in this domain, or in the #G_FILE_ERROR
961 // domain.
962 enum PixbufError {
963 CORRUPT_IMAGE = 0,
964 INSUFFICIENT_MEMORY = 1,
965 BAD_OPTION = 2,
966 UNKNOWN_TYPE = 3,
967 UNSUPPORTED_OPERATION = 4,
968 FAILED = 5
970 struct PixbufFormat {
972 // Creates a copy of @format
973 // gdk_pixbuf_format_free() to free the resources when done
974 // RETURNS: the newly allocated copy of a #GdkPixbufFormat. Use
975 PixbufFormat* /*new*/ copy() {
976 return gdk_pixbuf_format_copy(&this);
979 // Frees the resources allocated when copying a #GdkPixbufFormat
980 // using gdk_pixbuf_format_copy()
981 void free() {
982 gdk_pixbuf_format_free(&this);
985 // Returns a description of the format.
986 // RETURNS: a description of the format.
987 char* /*new*/ get_description() {
988 return gdk_pixbuf_format_get_description(&this);
991 // Returns the filename extensions typically used for files in the
992 // given format.
993 // freed with g_strfreev() when it is no longer needed.
994 // RETURNS: a %NULL-terminated array of filename extensions which must be
995 char** /*new*/ get_extensions() {
996 return gdk_pixbuf_format_get_extensions(&this);
999 // Returns information about the license of the image loader for the format. The
1000 // returned string should be a shorthand for a wellknown license, e.g. "LGPL",
1001 // "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license. This
1002 // string should be freed with g_free() when it's no longer needed.
1003 // RETURNS: a string describing the license of @format.
1004 char* /*new*/ get_license() {
1005 return gdk_pixbuf_format_get_license(&this);
1008 // Returns the mime types supported by the format.
1009 // g_strfreev() when it is no longer needed.
1010 // RETURNS: a %NULL-terminated array of mime types which must be freed with
1011 char** /*new*/ get_mime_types() {
1012 return gdk_pixbuf_format_get_mime_types(&this);
1015 // Returns the name of the format.
1016 // RETURNS: the name of the format.
1017 char* /*new*/ get_name() {
1018 return gdk_pixbuf_format_get_name(&this);
1021 // Returns whether this image format is disabled. See
1022 // gdk_pixbuf_format_set_disabled().
1023 // RETURNS: whether this image format is disabled.
1024 int is_disabled() {
1025 return gdk_pixbuf_format_is_disabled(&this);
1028 // Returns whether this image format is scalable. If a file is in a
1029 // scalable format, it is preferable to load it at the desired size,
1030 // rather than loading it at the default size and scaling the
1031 // resulting pixbuf to the desired size.
1032 // RETURNS: whether this image format is scalable.
1033 int is_scalable() {
1034 return gdk_pixbuf_format_is_scalable(&this);
1037 // Returns whether pixbufs can be saved in the given format.
1038 // RETURNS: whether pixbufs can be saved in the given format.
1039 int is_writable() {
1040 return gdk_pixbuf_format_is_writable(&this);
1043 // Disables or enables an image format. If a format is disabled,
1044 // gdk-pixbuf won't use the image loader for this format to load
1045 // images. Applications can use this to avoid using image loaders
1046 // with an inappropriate license, see gdk_pixbuf_format_get_license().
1047 // <disabled>: %TRUE to disable the format @format
1048 void set_disabled(int disabled) {
1049 gdk_pixbuf_format_set_disabled(&this, disabled);
1054 // The <structname>GdkPixbufLoader</structname> struct contains only private
1055 // fields.
1056 struct PixbufLoader /* : GObject.Object */ {
1057 alias parent_instance this;
1058 alias parent_instance super_;
1059 alias parent_instance object;
1060 GObject2.Object parent_instance;
1061 private void* priv;
1064 // Creates a new pixbuf loader object.
1065 // RETURNS: A newly-created pixbuf loader.
1066 static PixbufLoader* /*new*/ new_() {
1067 return gdk_pixbuf_loader_new();
1070 // Creates a new pixbuf loader object that always attempts to parse
1071 // image data as if it were an image of mime type @mime_type, instead of
1072 // identifying the type automatically. Useful if you want an error if
1073 // the image isn't the expected mime type, for loading image formats
1074 // that can't be reliably identified by looking at the data, or if
1075 // the user manually forces a specific mime type.
1076 // The list of supported mime types depends on what image loaders
1077 // are installed, but typically "image/png", "image/jpeg", "image/gif",
1078 // "image/tiff" and "image/x-xpixmap" are among the supported mime types.
1079 // To obtain the full list of supported mime types, call
1080 // gdk_pixbuf_format_get_mime_types() on each of the #GdkPixbufFormat
1081 // structs returned by gdk_pixbuf_get_formats().
1082 // RETURNS: A newly-created pixbuf loader.
1083 // <mime_type>: the mime type to be loaded
1084 static PixbufLoader* /*new*/ new_with_mime_type(char* mime_type, GLib2.Error** error=null) {
1085 return gdk_pixbuf_loader_new_with_mime_type(mime_type, error);
1088 // Creates a new pixbuf loader object that always attempts to parse
1089 // image data as if it were an image of type @image_type, instead of
1090 // identifying the type automatically. Useful if you want an error if
1091 // the image isn't the expected type, for loading image formats
1092 // that can't be reliably identified by looking at the data, or if
1093 // the user manually forces a specific type.
1094 // The list of supported image formats depends on what image loaders
1095 // are installed, but typically "png", "jpeg", "gif", "tiff" and
1096 // "xpm" are among the supported formats. To obtain the full list of
1097 // supported image formats, call gdk_pixbuf_format_get_name() on each
1098 // of the #GdkPixbufFormat structs returned by gdk_pixbuf_get_formats().
1099 // RETURNS: A newly-created pixbuf loader.
1100 // <image_type>: name of the image format to be loaded with the image
1101 static PixbufLoader* /*new*/ new_with_type(char* image_type, GLib2.Error** error=null) {
1102 return gdk_pixbuf_loader_new_with_type(image_type, error);
1105 // Informs a pixbuf loader that no further writes with
1106 // gdk_pixbuf_loader_write() will occur, so that it can free its
1107 // internal loading structures. Also, tries to parse any data that
1108 // hasn't yet been parsed; if the remaining data is partial or
1109 // corrupt, an error will be returned. If %FALSE is returned, @error
1110 // will be set to an error from the #GDK_PIXBUF_ERROR or #G_FILE_ERROR
1111 // domains. If you're just cancelling a load rather than expecting it
1112 // to be finished, passing %NULL for @error to ignore it is
1113 // reasonable.
1114 // Remember that this does not unref the loader, so if you plan not to
1115 // use it anymore, please g_object_unref() it.
1116 // RETURNS: %TRUE if all image data written so far was successfully
1117 int close(GLib2.Error** error=null) {
1118 return gdk_pixbuf_loader_close(&this, error);
1121 // Queries the #GdkPixbufAnimation that a pixbuf loader is currently creating.
1122 // In general it only makes sense to call this function after the "area-prepared"
1123 // signal has been emitted by the loader. If the loader doesn't have enough
1124 // bytes yet (hasn't emitted the "area-prepared" signal) this function will
1125 // return %NULL.
1126 // RETURNS: The #GdkPixbufAnimation that the loader is loading, or %NULL if
1127 PixbufAnimation* get_animation() {
1128 return gdk_pixbuf_loader_get_animation(&this);
1131 // Obtains the available information about the format of the
1132 // currently loading image file.
1133 // by GdkPixbuf and should not be freed.
1134 // RETURNS: A #GdkPixbufFormat or %NULL. The return value is owned
1135 PixbufFormat* /*new*/ get_format() {
1136 return gdk_pixbuf_loader_get_format(&this);
1139 // Queries the #GdkPixbuf that a pixbuf loader is currently creating.
1140 // In general it only makes sense to call this function after the
1141 // "area-prepared" signal has been emitted by the loader; this means
1142 // that enough data has been read to know the size of the image that
1143 // will be allocated. If the loader has not received enough data via
1144 // gdk_pixbuf_loader_write(), then this function returns %NULL. The
1145 // returned pixbuf will be the same in all future calls to the loader,
1146 // so simply calling g_object_ref() should be sufficient to continue
1147 // using it. Additionally, if the loader is an animation, it will
1148 // return the "static image" of the animation
1149 // (see gdk_pixbuf_animation_get_static_image()).
1150 // enough data has been read to determine how to create the image buffer.
1151 // RETURNS: The #GdkPixbuf that the loader is creating, or %NULL if not
1152 Pixbuf* get_pixbuf() {
1153 return gdk_pixbuf_loader_get_pixbuf(&this);
1156 // Causes the image to be scaled while it is loaded. The desired
1157 // image size can be determined relative to the original size of
1158 // the image by calling gdk_pixbuf_loader_set_size() from a
1159 // signal handler for the ::size-prepared signal.
1160 // Attempts to set the desired image size are ignored after the
1161 // emission of the ::size-prepared signal.
1162 // <width>: The desired width of the image being loaded.
1163 // <height>: The desired height of the image being loaded.
1164 void set_size(int width, int height) {
1165 gdk_pixbuf_loader_set_size(&this, width, height);
1168 // This will cause a pixbuf loader to parse the next @count bytes of
1169 // an image. It will return %TRUE if the data was loaded successfully,
1170 // and %FALSE if an error occurred. In the latter case, the loader
1171 // will be closed, and will not accept further writes. If %FALSE is
1172 // returned, @error will be set to an error from the #GDK_PIXBUF_ERROR
1173 // or #G_FILE_ERROR domains.
1174 // cannot parse the buffer.
1175 // RETURNS: %TRUE if the write was successful, or %FALSE if the loader
1176 // <buf>: Pointer to image data.
1177 // <count>: Length of the @buf buffer in bytes.
1178 int write(ubyte* buf, size_t count, GLib2.Error** error=null) {
1179 return gdk_pixbuf_loader_write(&this, buf, count, error);
1182 // This signal is emitted when the pixbuf loader has allocated the
1183 // pixbuf in the desired size. After this signal is emitted,
1184 // applications can call gdk_pixbuf_loader_get_pixbuf() to fetch
1185 // the partially-loaded pixbuf.
1186 extern (C) alias static void function (PixbufLoader* this_, void* user_data=null) signal_area_prepared;
1188 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1189 return super_.signal_connect!name(cb, data, cf);
1192 ulong signal_connect(string name:"area-prepared", CB/*:signal_area_prepared*/)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1193 return signal_connect_data(&this, cast(char*)"area-prepared",
1194 cast(GObject2.Callback)cb, data, null, cf);
1197 // This signal is emitted when a significant area of the image being
1198 // loaded has been updated. Normally it means that a complete
1199 // scanline has been read in, but it could be a different area as
1200 // well. Applications can use this signal to know when to repaint
1201 // areas of an image that is being loaded.
1202 // <x>: X offset of upper-left corner of the updated area.
1203 // <y>: Y offset of upper-left corner of the updated area.
1204 // <width>: Width of updated area.
1205 // <height>: Height of updated area.
1206 extern (C) alias static void function (PixbufLoader* this_, int x, int y, int width, int height, void* user_data=null) signal_area_updated;
1207 ulong signal_connect(string name:"area-updated", CB/*:signal_area_updated*/)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1208 return signal_connect_data(&this, cast(char*)"area-updated",
1209 cast(GObject2.Callback)cb, data, null, cf);
1212 // This signal is emitted when gdk_pixbuf_loader_close() is called.
1213 // It can be used by different parts of an application to receive
1214 // notification when an image loader is closed by the code that
1215 // drives it.
1216 extern (C) alias static void function (PixbufLoader* this_, void* user_data=null) signal_closed;
1217 ulong signal_connect(string name:"closed", CB/*:signal_closed*/)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1218 return signal_connect_data(&this, cast(char*)"closed",
1219 cast(GObject2.Callback)cb, data, null, cf);
1222 // This signal is emitted when the pixbuf loader has been fed the
1223 // initial amount of data that is required to figure out the size
1224 // of the image that it will create. Applications can call
1225 // gdk_pixbuf_loader_set_size() in response to this signal to set
1226 // the desired size to which the image should be scaled.
1227 // <width>: the original width of the image
1228 // <height>: the original height of the image
1229 extern (C) alias static void function (PixbufLoader* this_, int width, int height, void* user_data=null) signal_size_prepared;
1230 ulong signal_connect(string name:"size-prepared", CB/*:signal_size_prepared*/)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1231 return signal_connect_data(&this, cast(char*)"size-prepared",
1232 cast(GObject2.Callback)cb, data, null, cf);
1236 struct PixbufLoaderClass {
1237 GObject2.ObjectClass parent_class;
1238 extern (C) void function (PixbufLoader* loader, int width, int height) size_prepared;
1239 extern (C) void function (PixbufLoader* loader) area_prepared;
1240 extern (C) void function (PixbufLoader* loader, int x, int y, int width, int height) area_updated;
1241 extern (C) void function (PixbufLoader* loader) closed;
1245 // The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
1246 // To make them easier to use, their numerical values are the actual degrees.
1247 enum PixbufRotation {
1248 NONE = 0,
1249 COUNTERCLOCKWISE = 90,
1250 UPSIDEDOWN = 180,
1251 CLOCKWISE = 270
1254 // Specifies the type of the function passed to
1255 // gdk_pixbuf_save_to_callback(). It is called once for each block of
1256 // bytes that is "written" by gdk_pixbuf_save_to_callback(). If
1257 // successful it should return %TRUE. If an error occurs it should set
1258 // will fail with the same error.
1259 // RETURNS: %TRUE if successful, %FALSE (with @error set) if failed.
1260 // <buf>: bytes to be written.
1261 // <count>: number of bytes in @buf.
1262 // <error>: A location to return an error.
1263 // <data>: user data passed to gdk_pixbuf_save_to_callback().
1264 extern (C) alias int function (char* buf, size_t count, /*out*/ GLib2.Error** error, void* data) PixbufSaveFunc;
1266 // An opaque struct representing a simple animation.
1267 struct PixbufSimpleAnim /* : PixbufAnimation */ {
1268 alias method_parent this;
1269 alias method_parent super_;
1270 alias method_parent pixbufanimation;
1271 PixbufAnimation method_parent;
1274 // Creates a new, empty animation.
1275 // RETURNS: a newly allocated #GdkPixbufSimpleAnim
1276 // <width>: the width of the animation
1277 // <height>: the height of the animation
1278 // <rate>: the speed of the animation, in frames per second
1279 static PixbufSimpleAnim* /*new*/ new_(int width, int height, float rate) {
1280 return gdk_pixbuf_simple_anim_new(width, height, rate);
1283 // Adds a new frame to @animation. The @pixbuf must
1284 // have the dimensions specified when the animation
1285 // was constructed.
1286 // <pixbuf>: the pixbuf to add
1287 void add_frame(Pixbuf* pixbuf) {
1288 gdk_pixbuf_simple_anim_add_frame(&this, pixbuf);
1291 // Gets whether @animation should loop indefinitely when it reaches the end.
1292 // RETURNS: %TRUE if the animation loops forever, %FALSE otherwise
1293 int get_loop() {
1294 return gdk_pixbuf_simple_anim_get_loop(&this);
1297 // Sets whether @animation should loop indefinitely when it reaches the end.
1298 // <loop>: whether to loop the animation
1299 void set_loop(int loop) {
1300 gdk_pixbuf_simple_anim_set_loop(&this, loop);
1304 struct PixbufSimpleAnimClass {
1307 struct PixbufSimpleAnimIter /* : PixbufAnimationIter */ {
1308 alias method_parent this;
1309 alias method_parent super_;
1310 alias method_parent pixbufanimationiter;
1311 PixbufAnimationIter method_parent;
1315 // A #GdkPixdata contains pixbuf information in a form suitable for
1316 // serialization and streaming.
1317 struct Pixdata {
1318 uint magic;
1319 int length;
1320 uint pixdata_type, rowstride, width, height;
1321 ubyte* pixel_data;
1324 // Deserializes (reconstruct) a #GdkPixdata structure from a byte stream.
1325 // The byte stream consists of a straightforward writeout of the
1326 // #GdkPixdata fields in network byte order, plus the @pixel_data
1327 // bytes the structure points to.
1328 // The @pixdata contents are reconstructed byte by byte and are checked
1329 // for validity. This function may fail with %GDK_PIXBUF_CORRUPT_IMAGE
1330 // or %GDK_PIXBUF_ERROR_UNKNOWN_TYPE.
1331 // %FALSE otherwise.
1332 // RETURNS: Upon successful deserialization %TRUE is returned,
1333 // <stream_length>: length of the stream used for deserialization.
1334 // <stream>: stream of bytes containing a serialized #GdkPixdata structure.
1335 int deserialize(uint stream_length, ubyte* stream, GLib2.Error** error=null) {
1336 return gdk_pixdata_deserialize(&this, stream_length, stream, error);
1339 // Unintrospectable method: from_pixbuf() / gdk_pixdata_from_pixbuf()
1340 // Converts a #GdkPixbuf to a #GdkPixdata. If @use_rle is %TRUE, the
1341 // pixel data is run-length encoded into newly-allocated memory and a
1342 // pointer to that memory is returned.
1343 // for the run-length encoded pixel data, otherwise %NULL.
1344 // RETURNS: If @ure_rle is %TRUE, a pointer to the newly-allocated memory
1345 // <pixbuf>: the data to fill @pixdata with.
1346 // <use_rle>: whether to use run-length encoding for the pixel data.
1347 void* from_pixbuf(Pixbuf* pixbuf, int use_rle) {
1348 return gdk_pixdata_from_pixbuf(&this, pixbuf, use_rle);
1351 // Serializes a #GdkPixdata structure into a byte stream.
1352 // The byte stream consists of a straightforward writeout of the
1353 // #GdkPixdata fields in network byte order, plus the @pixel_data
1354 // bytes the structure points to.
1355 // #GdkPixdata structure.
1356 // RETURNS: A newly-allocated string containing the serialized
1357 // <stream_length_p>: location to store the resulting stream length in.
1358 ubyte* serialize(uint* stream_length_p) {
1359 return gdk_pixdata_serialize(&this, stream_length_p);
1362 // Unintrospectable method: to_csource() / gdk_pixdata_to_csource()
1363 // Generates C source code suitable for compiling images directly
1364 // into programs.
1365 // gdk-pixbuf ships with a program called <command>gdk-pixbuf-csource</command>
1366 // which offers a command line interface to this function.
1367 // of @pixdata.
1368 // RETURNS: a newly-allocated string containing the C source form
1369 // <name>: used for naming generated data structures or macros.
1370 // <dump_type>: a #GdkPixdataDumpType determining the kind of C source to be generated.
1371 GLib2.String* to_csource(char* name, PixdataDumpType dump_type) {
1372 return gdk_pixdata_to_csource(&this, name, dump_type);
1377 // An enumeration which is used by gdk_pixdata_to_csource() to
1378 // determine the form of C source to be generated. The three values
1379 // and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are
1380 // elements are optional flags that can be freely added.
1381 enum PixdataDumpType {
1382 PIXDATA_STREAM = 0,
1383 PIXDATA_STRUCT = 1,
1384 MACROS = 2,
1385 GTYPES = 0,
1386 CTYPES = 256,
1387 STATIC = 512,
1388 CONST = 1024,
1389 RLE_DECODER = 65536
1392 // one for the used colorspace, one for the width of the samples and one
1393 // for the encoding of the pixel data.
1394 enum PixdataType {
1395 COLOR_TYPE_RGB = 1,
1396 COLOR_TYPE_RGBA = 2,
1397 COLOR_TYPE_MASK = 255,
1398 SAMPLE_WIDTH_8 = 65536,
1399 SAMPLE_WIDTH_MASK = 983040,
1400 ENCODING_RAW = 16777216,
1401 ENCODING_RLE = 33554432,
1402 ENCODING_MASK = 251658240
1404 static GLib2.Quark pixbuf_error_quark() {
1405 return gdk_pixbuf_error_quark();
1409 // C prototypes:
1411 extern (C) {
1412 Pixbuf* /*new*/ gdk_pixbuf_new(Colorspace colorspace, int has_alpha, int bits_per_sample, int width, int height);
1413 Pixbuf* /*new*/ gdk_pixbuf_new_from_data(ubyte* data, Colorspace colorspace, int has_alpha, int bits_per_sample, int width, int height, int rowstride, PixbufDestroyNotify destroy_fn, void* destroy_fn_data);
1414 Pixbuf* /*new*/ gdk_pixbuf_new_from_file(char* filename, GLib2.Error** error);
1415 Pixbuf* /*new*/ gdk_pixbuf_new_from_file_at_scale(char* filename, int width, int height, int preserve_aspect_ratio, GLib2.Error** error);
1416 Pixbuf* /*new*/ gdk_pixbuf_new_from_file_at_size(char* filename, int width, int height, GLib2.Error** error);
1417 Pixbuf* /*new*/ gdk_pixbuf_new_from_inline(int data_length, ubyte* data, int copy_pixels, GLib2.Error** error);
1418 Pixbuf* /*new*/ gdk_pixbuf_new_from_stream(Gio2.InputStream* stream, Gio2.Cancellable* cancellable, GLib2.Error** error);
1419 Pixbuf* /*new*/ gdk_pixbuf_new_from_stream_at_scale(Gio2.InputStream* stream, int width, int height, int preserve_aspect_ratio, Gio2.Cancellable* cancellable, GLib2.Error** error);
1420 Pixbuf* /*new*/ gdk_pixbuf_new_from_stream_finish(Gio2.AsyncResult* async_result, GLib2.Error** error);
1421 Pixbuf* /*new*/ gdk_pixbuf_new_from_xpm_data(char** data);
1422 Pixbuf* gdk_pixbuf_from_pixdata(Pixdata* pixdata, int copy_pixels, GLib2.Error** error);
1423 PixbufFormat* /*new*/ gdk_pixbuf_get_file_info(char* filename, int* width, int* height);
1424 GLib2.SList* /*new container*/ gdk_pixbuf_get_formats();
1425 char* gdk_pixbuf_gettext(char* msgid);
1426 void gdk_pixbuf_new_from_stream_async(Gio2.InputStream* stream, Gio2.Cancellable* cancellable, Gio2.AsyncReadyCallback callback, void* user_data);
1427 void gdk_pixbuf_new_from_stream_at_scale_async(Gio2.InputStream* stream, int width, int height, int preserve_aspect_ratio, Gio2.Cancellable* cancellable, Gio2.AsyncReadyCallback callback, void* user_data);
1428 int gdk_pixbuf_save_to_stream_finish(Gio2.AsyncResult* async_result, GLib2.Error** error);
1429 Pixbuf* /*new*/ gdk_pixbuf_add_alpha(Pixbuf* this_, int substitute_color, ubyte r, ubyte g, ubyte b);
1430 Pixbuf* /*new*/ gdk_pixbuf_apply_embedded_orientation(Pixbuf* this_);
1431 void gdk_pixbuf_composite(Pixbuf* this_, Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha);
1432 void gdk_pixbuf_composite_color(Pixbuf* this_, Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha, int check_x, int check_y, int check_size, uint color1, uint color2);
1433 Pixbuf* /*new*/ gdk_pixbuf_composite_color_simple(Pixbuf* this_, int dest_width, int dest_height, InterpType interp_type, int overall_alpha, int check_size, uint color1, uint color2);
1434 Pixbuf* /*new*/ gdk_pixbuf_copy(Pixbuf* this_);
1435 void gdk_pixbuf_copy_area(Pixbuf* this_, int src_x, int src_y, int width, int height, Pixbuf* dest_pixbuf, int dest_x, int dest_y);
1436 void gdk_pixbuf_fill(Pixbuf* this_, uint pixel);
1437 Pixbuf* /*new*/ gdk_pixbuf_flip(Pixbuf* this_, int horizontal);
1438 int gdk_pixbuf_get_bits_per_sample(Pixbuf* this_);
1439 Colorspace gdk_pixbuf_get_colorspace(Pixbuf* this_);
1440 int gdk_pixbuf_get_has_alpha(Pixbuf* this_);
1441 int gdk_pixbuf_get_height(Pixbuf* this_);
1442 int gdk_pixbuf_get_n_channels(Pixbuf* this_);
1443 char* gdk_pixbuf_get_option(Pixbuf* this_, char* key);
1444 ubyte* gdk_pixbuf_get_pixels(Pixbuf* this_);
1445 int gdk_pixbuf_get_rowstride(Pixbuf* this_);
1446 int gdk_pixbuf_get_width(Pixbuf* this_);
1447 Pixbuf* /*new*/ gdk_pixbuf_new_subpixbuf(Pixbuf* this_, int src_x, int src_y, int width, int height);
1448 Pixbuf* gdk_pixbuf_ref(Pixbuf* this_);
1449 Pixbuf* /*new*/ gdk_pixbuf_rotate_simple(Pixbuf* this_, PixbufRotation angle);
1450 void gdk_pixbuf_saturate_and_pixelate(Pixbuf* this_, Pixbuf* dest, float saturation, int pixelate);
1451 int gdk_pixbuf_save(Pixbuf* this_, char* filename, char* type, GLib2.Error** error=null, ...);
1452 int gdk_pixbuf_save_to_buffer(Pixbuf* this_, char** buffer, size_t* buffer_size, char* type, GLib2.Error** error=null, ...);
1453 int gdk_pixbuf_save_to_bufferv(Pixbuf* this_, char** buffer, size_t* buffer_size, char* type, char** option_keys, char** option_values, GLib2.Error** error);
1454 int gdk_pixbuf_save_to_callback(Pixbuf* this_, PixbufSaveFunc save_func, void* user_data, char* type, GLib2.Error** error=null, ...);
1455 int gdk_pixbuf_save_to_callbackv(Pixbuf* this_, PixbufSaveFunc save_func, void* user_data, char* type, char** option_keys, char** option_values, GLib2.Error** error);
1456 int gdk_pixbuf_save_to_stream(Pixbuf* this_, Gio2.OutputStream* stream, char* type, Gio2.Cancellable* cancellable=null, GLib2.Error** error=null, ...);
1457 void gdk_pixbuf_save_to_stream_async(Pixbuf* this_, Gio2.OutputStream* stream, char* type, Gio2.Cancellable* cancellable, Gio2.AsyncReadyCallback callback, void* user_data, ...);
1458 int gdk_pixbuf_savev(Pixbuf* this_, char* filename, char* type, char** option_keys, char** option_values, GLib2.Error** error);
1459 void gdk_pixbuf_scale(Pixbuf* this_, Pixbuf* dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type);
1460 Pixbuf* /*new*/ gdk_pixbuf_scale_simple(Pixbuf* this_, int dest_width, int dest_height, InterpType interp_type);
1461 void gdk_pixbuf_unref(Pixbuf* this_);
1462 PixbufAnimation* /*new*/ gdk_pixbuf_animation_new_from_file(char* filename, GLib2.Error** error);
1463 int gdk_pixbuf_animation_get_height(PixbufAnimation* this_);
1464 PixbufAnimationIter* /*new*/ gdk_pixbuf_animation_get_iter(PixbufAnimation* this_, GLib2.TimeVal* start_time);
1465 Pixbuf* gdk_pixbuf_animation_get_static_image(PixbufAnimation* this_);
1466 int gdk_pixbuf_animation_get_width(PixbufAnimation* this_);
1467 int gdk_pixbuf_animation_is_static_image(PixbufAnimation* this_);
1468 PixbufAnimation* gdk_pixbuf_animation_ref(PixbufAnimation* this_);
1469 void gdk_pixbuf_animation_unref(PixbufAnimation* this_);
1470 int gdk_pixbuf_animation_iter_advance(PixbufAnimationIter* this_, GLib2.TimeVal* current_time);
1471 int gdk_pixbuf_animation_iter_get_delay_time(PixbufAnimationIter* this_);
1472 Pixbuf* gdk_pixbuf_animation_iter_get_pixbuf(PixbufAnimationIter* this_);
1473 int gdk_pixbuf_animation_iter_on_currently_loading_frame(PixbufAnimationIter* this_);
1474 PixbufFormat* /*new*/ gdk_pixbuf_format_copy(PixbufFormat* this_);
1475 void gdk_pixbuf_format_free(PixbufFormat* this_);
1476 char* /*new*/ gdk_pixbuf_format_get_description(PixbufFormat* this_);
1477 char** /*new*/ gdk_pixbuf_format_get_extensions(PixbufFormat* this_);
1478 char* /*new*/ gdk_pixbuf_format_get_license(PixbufFormat* this_);
1479 char** /*new*/ gdk_pixbuf_format_get_mime_types(PixbufFormat* this_);
1480 char* /*new*/ gdk_pixbuf_format_get_name(PixbufFormat* this_);
1481 int gdk_pixbuf_format_is_disabled(PixbufFormat* this_);
1482 int gdk_pixbuf_format_is_scalable(PixbufFormat* this_);
1483 int gdk_pixbuf_format_is_writable(PixbufFormat* this_);
1484 void gdk_pixbuf_format_set_disabled(PixbufFormat* this_, int disabled);
1485 PixbufLoader* /*new*/ gdk_pixbuf_loader_new();
1486 PixbufLoader* /*new*/ gdk_pixbuf_loader_new_with_mime_type(char* mime_type, GLib2.Error** error);
1487 PixbufLoader* /*new*/ gdk_pixbuf_loader_new_with_type(char* image_type, GLib2.Error** error);
1488 int gdk_pixbuf_loader_close(PixbufLoader* this_, GLib2.Error** error);
1489 PixbufAnimation* gdk_pixbuf_loader_get_animation(PixbufLoader* this_);
1490 PixbufFormat* /*new*/ gdk_pixbuf_loader_get_format(PixbufLoader* this_);
1491 Pixbuf* gdk_pixbuf_loader_get_pixbuf(PixbufLoader* this_);
1492 void gdk_pixbuf_loader_set_size(PixbufLoader* this_, int width, int height);
1493 int gdk_pixbuf_loader_write(PixbufLoader* this_, ubyte* buf, size_t count, GLib2.Error** error);
1494 PixbufSimpleAnim* /*new*/ gdk_pixbuf_simple_anim_new(int width, int height, float rate);
1495 void gdk_pixbuf_simple_anim_add_frame(PixbufSimpleAnim* this_, Pixbuf* pixbuf);
1496 int gdk_pixbuf_simple_anim_get_loop(PixbufSimpleAnim* this_);
1497 void gdk_pixbuf_simple_anim_set_loop(PixbufSimpleAnim* this_, int loop);
1498 int gdk_pixdata_deserialize(Pixdata* this_, uint stream_length, ubyte* stream, GLib2.Error** error);
1499 void* gdk_pixdata_from_pixbuf(Pixdata* this_, Pixbuf* pixbuf, int use_rle);
1500 ubyte* gdk_pixdata_serialize(Pixdata* this_, uint* stream_length_p);
1501 GLib2.String* gdk_pixdata_to_csource(Pixdata* this_, char* name, PixdataDumpType dump_type);
1502 GLib2.Quark gdk_pixbuf_error_quark();