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