1 | /* GdkPixbuf library - GdkPixbuf data structure |
2 | * |
3 | * Copyright (C) 2003 The Free Software Foundation |
4 | * |
5 | * Authors: Mark Crichton <crichton@gimp.org> |
6 | * Miguel de Icaza <miguel@gnu.org> |
7 | * Federico Mena-Quintero <federico@gimp.org> |
8 | * Havoc Pennington <hp@redhat.com> |
9 | * |
10 | * This library is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU Lesser General Public |
12 | * License as published by the Free Software Foundation; either |
13 | * version 2 of the License, or (at your option) any later version. |
14 | * |
15 | * This library is distributed in the hope that it will be useful, |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 | * Lesser General Public License for more details. |
19 | * |
20 | * You should have received a copy of the GNU Lesser General Public |
21 | * License along with this library; if not, see <http://www.gnu.org/licenses/>. |
22 | */ |
23 | |
24 | #ifndef GDK_PIXBUF_CORE_H |
25 | #define GDK_PIXBUF_CORE_H |
26 | |
27 | #if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) |
28 | #error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly." |
29 | #endif |
30 | |
31 | #include <glib.h> |
32 | #include <glib-object.h> |
33 | #include <gio/gio.h> |
34 | |
35 | #include <gdk-pixbuf/gdk-pixbuf-macros.h> |
36 | |
37 | G_BEGIN_DECLS |
38 | |
39 | /** |
40 | * SECTION:gdk-pixbuf |
41 | * @Short_description: Information that describes an image. |
42 | * @Title: The GdkPixbuf Structure |
43 | * |
44 | * The #GdkPixbuf structure contains |
45 | * information that describes an image in memory. |
46 | * |
47 | * ## Image Data ## {#image-data} |
48 | * |
49 | * Image data in a pixbuf is stored in memory in uncompressed, |
50 | * packed format. Rows in the image are stored top to bottom, and |
51 | * in each row pixels are stored from left to right. There may be |
52 | * padding at the end of a row. The "rowstride" value of a pixbuf, |
53 | * as returned by gdk_pixbuf_get_rowstride(), indicates the number |
54 | * of bytes between rows. |
55 | * |
56 | * ## put_pixel() Example ## {#put-pixel} |
57 | * |
58 | * The following code illustrates a simple put_pixel() |
59 | * function for RGB pixbufs with 8 bits per channel with an alpha |
60 | * channel. It is not included in the gdk-pixbuf library for |
61 | * performance reasons; rather than making several function calls |
62 | * for each pixel, your own code can take shortcuts. |
63 | * |
64 | * |[<!-- language="C" --> |
65 | * static void |
66 | * put_pixel (GdkPixbuf *pixbuf, int x, int y, guchar red, guchar green, guchar blue, guchar alpha) |
67 | * { |
68 | * int width, height, rowstride, n_channels; |
69 | * guchar *pixels, *p; |
70 | * |
71 | * n_channels = gdk_pixbuf_get_n_channels (pixbuf); |
72 | * |
73 | * g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); |
74 | * g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8); |
75 | * g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); |
76 | * g_assert (n_channels == 4); |
77 | * |
78 | * width = gdk_pixbuf_get_width (pixbuf); |
79 | * height = gdk_pixbuf_get_height (pixbuf); |
80 | * |
81 | * g_assert (x >= 0 && x < width); |
82 | * g_assert (y >= 0 && y < height); |
83 | * |
84 | * rowstride = gdk_pixbuf_get_rowstride (pixbuf); |
85 | * pixels = gdk_pixbuf_get_pixels (pixbuf); |
86 | * |
87 | * p = pixels + y * rowstride + x * n_channels; |
88 | * p[0] = red; |
89 | * p[1] = green; |
90 | * p[2] = blue; |
91 | * p[3] = alpha; |
92 | * } |
93 | * ]| |
94 | * |
95 | * This function will not work for pixbufs with images that are |
96 | * other than 8 bits per sample or channel, but it will work for |
97 | * most of the pixbufs that GTK+ uses. |
98 | * |
99 | * If you are doing memcpy() of raw pixbuf data, note that the last row |
100 | * in the pixbuf may not be as wide as the full rowstride, but rather |
101 | * just as wide as the pixel data needs to be. That is, it is unsafe to |
102 | * do `memcpy (dest, pixels, rowstride * height)` to copy a whole pixbuf. |
103 | * Use gdk_pixbuf_copy() instead, or compute the width in bytes of the |
104 | * last row as `width * ((n_channels * bits_per_sample + 7) / 8)`. |
105 | */ |
106 | |
107 | |
108 | /** |
109 | * GdkPixbufAlphaMode: |
110 | * @GDK_PIXBUF_ALPHA_BILEVEL: A bilevel clipping mask (black and white) |
111 | * will be created and used to draw the image. Pixels below 0.5 opacity |
112 | * will be considered fully transparent, and all others will be |
113 | * considered fully opaque. |
114 | * @GDK_PIXBUF_ALPHA_FULL: For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL. |
115 | * In the future it will do full alpha compositing. |
116 | * |
117 | * These values can be passed to |
118 | * gdk_pixbuf_xlib_render_to_drawable_alpha() to control how the alpha |
119 | * channel of an image should be handled. This function can create a |
120 | * bilevel clipping mask (black and white) and use it while painting |
121 | * the image. In the future, when the X Window System gets an alpha |
122 | * channel extension, it will be possible to do full alpha |
123 | * compositing onto arbitrary drawables. For now both cases fall |
124 | * back to a bilevel clipping mask. |
125 | */ |
126 | typedef enum |
127 | { |
128 | GDK_PIXBUF_ALPHA_BILEVEL, |
129 | GDK_PIXBUF_ALPHA_FULL |
130 | } GdkPixbufAlphaMode; |
131 | |
132 | /** |
133 | * GdkColorspace: |
134 | * @GDK_COLORSPACE_RGB: Indicates a red/green/blue additive color space. |
135 | * |
136 | * This enumeration defines the color spaces that are supported by |
137 | * the gdk-pixbuf library. Currently only RGB is supported. |
138 | */ |
139 | /* Note that these values are encoded in inline pixbufs |
140 | * as ints, so don't reorder them |
141 | */ |
142 | typedef enum { |
143 | GDK_COLORSPACE_RGB |
144 | } GdkColorspace; |
145 | |
146 | /* All of these are opaque structures */ |
147 | |
148 | /** |
149 | * GdkPixbuf: |
150 | * |
151 | * This is the main structure in the gdk-pixbuf library. It is |
152 | * used to represent images. It contains information about the |
153 | * image's pixel data, its color space, bits per sample, width and |
154 | * height, and the rowstride (the number of bytes between the start of |
155 | * one row and the start of the next). |
156 | */ |
157 | typedef struct _GdkPixbuf GdkPixbuf; |
158 | |
159 | #define GDK_TYPE_PIXBUF (gdk_pixbuf_get_type ()) |
160 | #define GDK_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF, GdkPixbuf)) |
161 | #define GDK_IS_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF)) |
162 | |
163 | |
164 | /** |
165 | * GdkPixbufDestroyNotify: |
166 | * @pixels: (array) (element-type guint8): The pixel array of the pixbuf |
167 | * that is being finalized. |
168 | * @data: (closure): User closure data. |
169 | * |
170 | * A function of this type is responsible for freeing the pixel array |
171 | * of a pixbuf. The gdk_pixbuf_new_from_data() function lets you |
172 | * pass in a pre-allocated pixel array so that a pixbuf can be |
173 | * created from it; in this case you will need to pass in a function |
174 | * of #GdkPixbufDestroyNotify so that the pixel data can be freed |
175 | * when the pixbuf is finalized. |
176 | */ |
177 | typedef void (* GdkPixbufDestroyNotify) (guchar *pixels, gpointer data); |
178 | |
179 | /** |
180 | * GDK_PIXBUF_ERROR: |
181 | * |
182 | * Error domain used for pixbuf operations. Indicates that the error code |
183 | * will be in the #GdkPixbufError enumeration. See #GError for |
184 | * information on error domains and error codes. |
185 | */ |
186 | #define GDK_PIXBUF_ERROR gdk_pixbuf_error_quark () |
187 | |
188 | /** |
189 | * GdkPixbufError: |
190 | * @GDK_PIXBUF_ERROR_CORRUPT_IMAGE: An image file was broken somehow. |
191 | * @GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY: Not enough memory. |
192 | * @GDK_PIXBUF_ERROR_BAD_OPTION: A bad option was passed to a pixbuf save module. |
193 | * @GDK_PIXBUF_ERROR_UNKNOWN_TYPE: Unknown image type. |
194 | * @GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION: Don't know how to perform the |
195 | * given operation on the type of image at hand. |
196 | * @GDK_PIXBUF_ERROR_FAILED: Generic failure code, something went wrong. |
197 | * @GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION: Only part of the animation was loaded. |
198 | * |
199 | * An error code in the #GDK_PIXBUF_ERROR domain. Many gdk-pixbuf |
200 | * operations can cause errors in this domain, or in the #G_FILE_ERROR |
201 | * domain. |
202 | */ |
203 | typedef enum { |
204 | /* image data hosed */ |
205 | GDK_PIXBUF_ERROR_CORRUPT_IMAGE, |
206 | /* no mem to load image */ |
207 | GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, |
208 | /* bad option passed to save routine */ |
209 | GDK_PIXBUF_ERROR_BAD_OPTION, |
210 | /* unsupported image type (sort of an ENOSYS) */ |
211 | GDK_PIXBUF_ERROR_UNKNOWN_TYPE, |
212 | /* unsupported operation (load, save) for image type */ |
213 | GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, |
214 | GDK_PIXBUF_ERROR_FAILED, |
215 | GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION |
216 | } GdkPixbufError; |
217 | |
218 | GDK_PIXBUF_AVAILABLE_IN_ALL |
219 | GQuark gdk_pixbuf_error_quark (void); |
220 | |
221 | |
222 | |
223 | GDK_PIXBUF_AVAILABLE_IN_ALL |
224 | GType gdk_pixbuf_get_type (void) G_GNUC_CONST; |
225 | |
226 | /* Reference counting */ |
227 | |
228 | #ifndef GDK_PIXBUF_DISABLE_DEPRECATED |
229 | GDK_PIXBUF_DEPRECATED_IN_2_0_FOR(g_object_ref) |
230 | GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf); |
231 | GDK_PIXBUF_DEPRECATED_IN_2_0_FOR(g_object_unref) |
232 | void gdk_pixbuf_unref (GdkPixbuf *pixbuf); |
233 | #endif |
234 | |
235 | /* GdkPixbuf accessors */ |
236 | |
237 | GDK_PIXBUF_AVAILABLE_IN_ALL |
238 | GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf); |
239 | GDK_PIXBUF_AVAILABLE_IN_ALL |
240 | int gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf); |
241 | GDK_PIXBUF_AVAILABLE_IN_ALL |
242 | gboolean gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf); |
243 | GDK_PIXBUF_AVAILABLE_IN_ALL |
244 | int gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf); |
245 | GDK_PIXBUF_AVAILABLE_IN_ALL |
246 | guchar *gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf); |
247 | GDK_PIXBUF_AVAILABLE_IN_ALL |
248 | int gdk_pixbuf_get_width (const GdkPixbuf *pixbuf); |
249 | GDK_PIXBUF_AVAILABLE_IN_ALL |
250 | int gdk_pixbuf_get_height (const GdkPixbuf *pixbuf); |
251 | GDK_PIXBUF_AVAILABLE_IN_ALL |
252 | int gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf); |
253 | GDK_PIXBUF_AVAILABLE_IN_2_26 |
254 | gsize gdk_pixbuf_get_byte_length (const GdkPixbuf *pixbuf); |
255 | |
256 | GDK_PIXBUF_AVAILABLE_IN_2_26 |
257 | guchar *gdk_pixbuf_get_pixels_with_length (const GdkPixbuf *pixbuf, |
258 | guint *length); |
259 | |
260 | GDK_PIXBUF_AVAILABLE_IN_2_32 |
261 | const guint8* gdk_pixbuf_read_pixels (const GdkPixbuf *pixbuf); |
262 | GDK_PIXBUF_AVAILABLE_IN_2_32 |
263 | GBytes * gdk_pixbuf_read_pixel_bytes (const GdkPixbuf *pixbuf); |
264 | |
265 | |
266 | |
267 | /* Create a blank pixbuf with an optimal rowstride and a new buffer */ |
268 | |
269 | GDK_PIXBUF_AVAILABLE_IN_ALL |
270 | GdkPixbuf *gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, |
271 | int width, int height); |
272 | |
273 | /* Copy a pixbuf */ |
274 | GDK_PIXBUF_AVAILABLE_IN_ALL |
275 | GdkPixbuf *gdk_pixbuf_copy (const GdkPixbuf *pixbuf); |
276 | |
277 | /* Create a pixbuf which points to the pixels of another pixbuf */ |
278 | GDK_PIXBUF_AVAILABLE_IN_ALL |
279 | GdkPixbuf *gdk_pixbuf_new_subpixbuf (GdkPixbuf *src_pixbuf, |
280 | int src_x, |
281 | int src_y, |
282 | int width, |
283 | int height); |
284 | |
285 | /* Simple loading */ |
286 | |
287 | #ifdef G_OS_WIN32 |
288 | /* In previous versions these _utf8 variants where exported and linked to |
289 | * by default. Export them here for ABI (and gi API) compat. |
290 | */ |
291 | |
292 | GDK_PIXBUF_AVAILABLE_IN_ALL |
293 | GdkPixbuf *gdk_pixbuf_new_from_file_utf8 (const char *filename, |
294 | GError **error); |
295 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
296 | GdkPixbuf *gdk_pixbuf_new_from_file_at_size_utf8 (const char *filename, |
297 | int width, |
298 | int height, |
299 | GError **error); |
300 | GDK_PIXBUF_AVAILABLE_IN_2_6 |
301 | GdkPixbuf *gdk_pixbuf_new_from_file_at_scale_utf8 (const char *filename, |
302 | int width, |
303 | int height, |
304 | gboolean preserve_aspect_ratio, |
305 | GError **error); |
306 | #endif |
307 | |
308 | GDK_PIXBUF_AVAILABLE_IN_ALL |
309 | GdkPixbuf *gdk_pixbuf_new_from_file (const char *filename, |
310 | GError **error); |
311 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
312 | GdkPixbuf *gdk_pixbuf_new_from_file_at_size (const char *filename, |
313 | int width, |
314 | int height, |
315 | GError **error); |
316 | GDK_PIXBUF_AVAILABLE_IN_2_6 |
317 | GdkPixbuf *gdk_pixbuf_new_from_file_at_scale (const char *filename, |
318 | int width, |
319 | int height, |
320 | gboolean preserve_aspect_ratio, |
321 | GError **error); |
322 | GDK_PIXBUF_AVAILABLE_IN_2_26 |
323 | GdkPixbuf *gdk_pixbuf_new_from_resource (const char *resource_path, |
324 | GError **error); |
325 | GDK_PIXBUF_AVAILABLE_IN_2_26 |
326 | GdkPixbuf *gdk_pixbuf_new_from_resource_at_scale (const char *resource_path, |
327 | int width, |
328 | int height, |
329 | gboolean preserve_aspect_ratio, |
330 | GError **error); |
331 | |
332 | GDK_PIXBUF_AVAILABLE_IN_ALL |
333 | GdkPixbuf *gdk_pixbuf_new_from_data (const guchar *data, |
334 | GdkColorspace colorspace, |
335 | gboolean has_alpha, |
336 | int bits_per_sample, |
337 | int width, int height, |
338 | int rowstride, |
339 | GdkPixbufDestroyNotify destroy_fn, |
340 | gpointer destroy_fn_data); |
341 | |
342 | GDK_PIXBUF_AVAILABLE_IN_2_32 |
343 | GdkPixbuf *gdk_pixbuf_new_from_bytes (GBytes *data, |
344 | GdkColorspace colorspace, |
345 | gboolean has_alpha, |
346 | int bits_per_sample, |
347 | int width, int height, |
348 | int rowstride); |
349 | |
350 | GDK_PIXBUF_AVAILABLE_IN_ALL |
351 | GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const char **data); |
352 | |
353 | #ifndef GDK_PIXBUF_DISABLE_DEPRECATED |
354 | GDK_PIXBUF_DEPRECATED_IN_2_32 |
355 | GdkPixbuf* gdk_pixbuf_new_from_inline (gint data_length, |
356 | const guint8 *data, |
357 | gboolean copy_pixels, |
358 | GError **error); |
359 | #endif |
360 | |
361 | /* Mutations */ |
362 | GDK_PIXBUF_AVAILABLE_IN_ALL |
363 | void gdk_pixbuf_fill (GdkPixbuf *pixbuf, |
364 | guint32 pixel); |
365 | |
366 | /* Saving */ |
367 | |
368 | #ifndef __GTK_DOC_IGNORE__ |
369 | #ifdef G_OS_WIN32 |
370 | /* DLL ABI stability hack. */ |
371 | #define gdk_pixbuf_save gdk_pixbuf_save_utf8 |
372 | #endif |
373 | #endif |
374 | |
375 | GDK_PIXBUF_AVAILABLE_IN_ALL |
376 | gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf, |
377 | const char *filename, |
378 | const char *type, |
379 | GError **error, |
380 | ...) G_GNUC_NULL_TERMINATED; |
381 | |
382 | GDK_PIXBUF_AVAILABLE_IN_ALL |
383 | gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf, |
384 | const char *filename, |
385 | const char *type, |
386 | char **option_keys, |
387 | char **option_values, |
388 | GError **error); |
389 | |
390 | #ifdef G_OS_WIN32 |
391 | GDK_PIXBUF_AVAILABLE_IN_ALL |
392 | gboolean gdk_pixbuf_savev_utf8 (GdkPixbuf *pixbuf, |
393 | const char *filename, |
394 | const char *type, |
395 | char **option_keys, |
396 | char **option_values, |
397 | GError **error); |
398 | #endif |
399 | |
400 | /* Saving to a callback function */ |
401 | |
402 | |
403 | /** |
404 | * GdkPixbufSaveFunc: |
405 | * @buf: (array length=count) (element-type guint8): bytes to be written. |
406 | * @count: number of bytes in @buf. |
407 | * @error: (out): A location to return an error. |
408 | * @data: (closure): user data passed to gdk_pixbuf_save_to_callback(). |
409 | * |
410 | * Specifies the type of the function passed to |
411 | * gdk_pixbuf_save_to_callback(). It is called once for each block of |
412 | * bytes that is "written" by gdk_pixbuf_save_to_callback(). If |
413 | * successful it should return %TRUE. If an error occurs it should set |
414 | * @error and return %FALSE, in which case gdk_pixbuf_save_to_callback() |
415 | * will fail with the same error. |
416 | * |
417 | * Since: 2.4 |
418 | * Returns: %TRUE if successful, %FALSE (with @error set) if failed. |
419 | */ |
420 | |
421 | typedef gboolean (*GdkPixbufSaveFunc) (const gchar *buf, |
422 | gsize count, |
423 | GError **error, |
424 | gpointer data); |
425 | |
426 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
427 | gboolean gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf, |
428 | GdkPixbufSaveFunc save_func, |
429 | gpointer user_data, |
430 | const char *type, |
431 | GError **error, |
432 | ...) G_GNUC_NULL_TERMINATED; |
433 | |
434 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
435 | gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, |
436 | GdkPixbufSaveFunc save_func, |
437 | gpointer user_data, |
438 | const char *type, |
439 | char **option_keys, |
440 | char **option_values, |
441 | GError **error); |
442 | |
443 | /* Saving into a newly allocated char array */ |
444 | |
445 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
446 | gboolean gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf, |
447 | gchar **buffer, |
448 | gsize *buffer_size, |
449 | const char *type, |
450 | GError **error, |
451 | ...) G_GNUC_NULL_TERMINATED; |
452 | |
453 | GDK_PIXBUF_AVAILABLE_IN_2_4 |
454 | gboolean gdk_pixbuf_save_to_bufferv (GdkPixbuf *pixbuf, |
455 | gchar **buffer, |
456 | gsize *buffer_size, |
457 | const char *type, |
458 | char **option_keys, |
459 | char **option_values, |
460 | GError **error); |
461 | |
462 | GDK_PIXBUF_AVAILABLE_IN_2_14 |
463 | GdkPixbuf *gdk_pixbuf_new_from_stream (GInputStream *stream, |
464 | GCancellable *cancellable, |
465 | GError **error); |
466 | |
467 | GDK_PIXBUF_AVAILABLE_IN_ALL |
468 | void gdk_pixbuf_new_from_stream_async (GInputStream *stream, |
469 | GCancellable *cancellable, |
470 | GAsyncReadyCallback callback, |
471 | gpointer user_data); |
472 | |
473 | GDK_PIXBUF_AVAILABLE_IN_ALL |
474 | GdkPixbuf *gdk_pixbuf_new_from_stream_finish (GAsyncResult *async_result, |
475 | GError **error); |
476 | |
477 | GDK_PIXBUF_AVAILABLE_IN_2_14 |
478 | GdkPixbuf *gdk_pixbuf_new_from_stream_at_scale (GInputStream *stream, |
479 | gint width, |
480 | gint height, |
481 | gboolean preserve_aspect_ratio, |
482 | GCancellable *cancellable, |
483 | GError **error); |
484 | |
485 | GDK_PIXBUF_AVAILABLE_IN_ALL |
486 | void gdk_pixbuf_new_from_stream_at_scale_async (GInputStream *stream, |
487 | gint width, |
488 | gint height, |
489 | gboolean preserve_aspect_ratio, |
490 | GCancellable *cancellable, |
491 | GAsyncReadyCallback callback, |
492 | gpointer user_data); |
493 | |
494 | GDK_PIXBUF_AVAILABLE_IN_2_14 |
495 | gboolean gdk_pixbuf_save_to_stream (GdkPixbuf *pixbuf, |
496 | GOutputStream *stream, |
497 | const char *type, |
498 | GCancellable *cancellable, |
499 | GError **error, |
500 | ...); |
501 | |
502 | GDK_PIXBUF_AVAILABLE_IN_ALL |
503 | void gdk_pixbuf_save_to_stream_async (GdkPixbuf *pixbuf, |
504 | GOutputStream *stream, |
505 | const gchar *type, |
506 | GCancellable *cancellable, |
507 | GAsyncReadyCallback callback, |
508 | gpointer user_data, |
509 | ...); |
510 | |
511 | GDK_PIXBUF_AVAILABLE_IN_ALL |
512 | gboolean gdk_pixbuf_save_to_stream_finish (GAsyncResult *async_result, |
513 | GError **error); |
514 | |
515 | GDK_PIXBUF_AVAILABLE_IN_2_36 |
516 | void gdk_pixbuf_save_to_streamv_async (GdkPixbuf *pixbuf, |
517 | GOutputStream *stream, |
518 | const gchar *type, |
519 | gchar **option_keys, |
520 | gchar **option_values, |
521 | GCancellable *cancellable, |
522 | GAsyncReadyCallback callback, |
523 | gpointer user_data); |
524 | |
525 | GDK_PIXBUF_AVAILABLE_IN_2_36 |
526 | gboolean gdk_pixbuf_save_to_streamv (GdkPixbuf *pixbuf, |
527 | GOutputStream *stream, |
528 | const char *type, |
529 | char **option_keys, |
530 | char **option_values, |
531 | GCancellable *cancellable, |
532 | GError **error); |
533 | |
534 | /* Adding an alpha channel */ |
535 | GDK_PIXBUF_AVAILABLE_IN_ALL |
536 | GdkPixbuf *gdk_pixbuf_add_alpha (const GdkPixbuf *pixbuf, gboolean substitute_color, |
537 | guchar r, guchar g, guchar b); |
538 | |
539 | /* Copy an area of a pixbuf onto another one */ |
540 | GDK_PIXBUF_AVAILABLE_IN_ALL |
541 | void gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf, |
542 | int src_x, int src_y, |
543 | int width, int height, |
544 | GdkPixbuf *dest_pixbuf, |
545 | int dest_x, int dest_y); |
546 | |
547 | /* Brighten/darken and optionally make it pixelated-looking */ |
548 | GDK_PIXBUF_AVAILABLE_IN_ALL |
549 | void gdk_pixbuf_saturate_and_pixelate (const GdkPixbuf *src, |
550 | GdkPixbuf *dest, |
551 | gfloat saturation, |
552 | gboolean pixelate); |
553 | |
554 | /* Transform an image to agree with its embedded orientation option / tag */ |
555 | GDK_PIXBUF_AVAILABLE_IN_2_12 |
556 | GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src); |
557 | |
558 | /* key/value pairs that can be attached by the pixbuf loader */ |
559 | GDK_PIXBUF_AVAILABLE_IN_ALL |
560 | gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf, |
561 | const gchar *key, |
562 | const gchar *value); |
563 | GDK_PIXBUF_AVAILABLE_IN_ALL |
564 | const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf, |
565 | const gchar *key); |
566 | GDK_PIXBUF_AVAILABLE_IN_2_36 |
567 | gboolean gdk_pixbuf_remove_option (GdkPixbuf *pixbuf, |
568 | const gchar *key); |
569 | GDK_PIXBUF_AVAILABLE_IN_2_32 |
570 | GHashTable * gdk_pixbuf_get_options (GdkPixbuf *pixbuf); |
571 | GDK_PIXBUF_AVAILABLE_IN_2_36 |
572 | gboolean gdk_pixbuf_copy_options (GdkPixbuf *src_pixbuf, |
573 | GdkPixbuf *dest_pixbuf); |
574 | |
575 | |
576 | G_END_DECLS |
577 | |
578 | |
579 | #endif /* GDK_PIXBUF_CORE_H */ |
580 | |