@girs/gdkpixbuf-2.0 2.0.0-3.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2707 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * GdkPixbuf-2.0
10
+ */
11
+
12
+ import type Gio from '@girs/gio-2.0';
13
+ import type GObject from '@girs/gobject-2.0';
14
+ import type GLib from '@girs/glib-2.0';
15
+ import type GModule from '@girs/gmodule-2.0';
16
+
17
+ /**
18
+ * This enumeration defines the color spaces that are supported by
19
+ * the gdk-pixbuf library.
20
+ *
21
+ * Currently only RGB is supported.
22
+ */
23
+ export enum Colorspace {
24
+ /**
25
+ * Indicates a red/green/blue additive color space.
26
+ */
27
+ RGB,
28
+ }
29
+ /**
30
+ * Interpolation modes for scaling functions.
31
+ *
32
+ * The `GDK_INTERP_NEAREST` mode is the fastest scaling method, but has
33
+ * horrible quality when scaling down; `GDK_INTERP_BILINEAR` is the best
34
+ * choice if you aren't sure what to choose, it has a good speed/quality
35
+ * balance.
36
+ *
37
+ * **Note**: Cubic filtering is missing from the list; hyperbolic
38
+ * interpolation is just as fast and results in higher quality.
39
+ */
40
+ export enum InterpType {
41
+ /**
42
+ * Nearest neighbor sampling; this is the fastest
43
+ * and lowest quality mode. Quality is normally unacceptable when scaling
44
+ * down, but may be OK when scaling up.
45
+ */
46
+ NEAREST,
47
+ /**
48
+ * This is an accurate simulation of the PostScript
49
+ * image operator without any interpolation enabled. Each pixel is
50
+ * rendered as a tiny parallelogram of solid color, the edges of which
51
+ * are implemented with antialiasing. It resembles nearest neighbor for
52
+ * enlargement, and bilinear for reduction.
53
+ */
54
+ TILES,
55
+ /**
56
+ * Best quality/speed balance; use this mode by
57
+ * default. Bilinear interpolation. For enlargement, it is
58
+ * equivalent to point-sampling the ideal bilinear-interpolated image.
59
+ * For reduction, it is equivalent to laying down small tiles and
60
+ * integrating over the coverage area.
61
+ */
62
+ BILINEAR,
63
+ /**
64
+ * This is the slowest and highest quality
65
+ * reconstruction function. It is derived from the hyperbolic filters in
66
+ * Wolberg's "Digital Image Warping", and is formally defined as the
67
+ * hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
68
+ * image (the filter is designed to be idempotent for 1:1 pixel mapping).
69
+ * **Deprecated**: this interpolation filter is deprecated, as in reality
70
+ * it has a lower quality than the `GDK_INTERP_BILINEAR` filter
71
+ * (Since: 2.38)
72
+ */
73
+ HYPER,
74
+ }
75
+ /**
76
+ * Control the alpha channel for drawables.
77
+ *
78
+ * These values can be passed to gdk_pixbuf_xlib_render_to_drawable_alpha()
79
+ * in gdk-pixbuf-xlib to control how the alpha channel of an image should
80
+ * be handled.
81
+ *
82
+ * This function can create a bilevel clipping mask (black and white) and use
83
+ * it while painting the image.
84
+ *
85
+ * In the future, when the X Window System gets an alpha channel extension,
86
+ * it will be possible to do full alpha compositing onto arbitrary drawables.
87
+ * For now both cases fall back to a bilevel clipping mask.
88
+ */
89
+ export enum PixbufAlphaMode {
90
+ /**
91
+ * A bilevel clipping mask (black and white)
92
+ * will be created and used to draw the image. Pixels below 0.5 opacity
93
+ * will be considered fully transparent, and all others will be
94
+ * considered fully opaque.
95
+ */
96
+ BILEVEL,
97
+ /**
98
+ * For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
99
+ * In the future it will do full alpha compositing.
100
+ */
101
+ FULL,
102
+ }
103
+ /**
104
+ * An error code in the `GDK_PIXBUF_ERROR` domain.
105
+ *
106
+ * Many gdk-pixbuf operations can cause errors in this domain, or in
107
+ * the `G_FILE_ERROR` domain.
108
+ */
109
+ export enum PixbufError {
110
+ /**
111
+ * An image file was broken somehow.
112
+ */
113
+ CORRUPT_IMAGE,
114
+ /**
115
+ * Not enough memory.
116
+ */
117
+ INSUFFICIENT_MEMORY,
118
+ /**
119
+ * A bad option was passed to a pixbuf save module.
120
+ */
121
+ BAD_OPTION,
122
+ /**
123
+ * Unknown image type.
124
+ */
125
+ UNKNOWN_TYPE,
126
+ /**
127
+ * Don't know how to perform the
128
+ * given operation on the type of image at hand.
129
+ */
130
+ UNSUPPORTED_OPERATION,
131
+ /**
132
+ * Generic failure code, something went wrong.
133
+ */
134
+ FAILED,
135
+ /**
136
+ * Only part of the animation was loaded.
137
+ */
138
+ INCOMPLETE_ANIMATION,
139
+ }
140
+ /**
141
+ * The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
142
+ *
143
+ * To make them easier to use, their numerical values are the actual degrees.
144
+ */
145
+ export enum PixbufRotation {
146
+ /**
147
+ * No rotation.
148
+ */
149
+ NONE,
150
+ /**
151
+ * Rotate by 90 degrees.
152
+ */
153
+ COUNTERCLOCKWISE,
154
+ /**
155
+ * Rotate by 180 degrees.
156
+ */
157
+ UPSIDEDOWN,
158
+ /**
159
+ * Rotate by 270 degrees.
160
+ */
161
+ CLOCKWISE,
162
+ }
163
+ /**
164
+ * Flags which allow a module to specify further details about the supported
165
+ * operations.
166
+ * @bitfield
167
+ */
168
+ export enum PixbufFormatFlags {
169
+ /**
170
+ * the module can write out images in the format.
171
+ */
172
+ WRITABLE,
173
+ /**
174
+ * the image format is scalable
175
+ */
176
+ SCALABLE,
177
+ /**
178
+ * the module is threadsafe. gdk-pixbuf
179
+ * ignores modules that are not marked as threadsafe. (Since 2.28).
180
+ */
181
+ THREADSAFE,
182
+ }
183
+ /**
184
+ * Major version of gdk-pixbuf library, that is the "0" in
185
+ * "0.8.2" for example.
186
+ */
187
+ export const PIXBUF_MAJOR: number
188
+ /**
189
+ * Micro version of gdk-pixbuf library, that is the "2" in
190
+ * "0.8.2" for example.
191
+ */
192
+ export const PIXBUF_MICRO: number
193
+ /**
194
+ * Minor version of gdk-pixbuf library, that is the "8" in
195
+ * "0.8.2" for example.
196
+ */
197
+ export const PIXBUF_MINOR: number
198
+ /**
199
+ * Contains the full version of GdkPixbuf as a string.
200
+ *
201
+ * This is the version being compiled against; contrast with
202
+ * `gdk_pixbuf_version`.
203
+ */
204
+ export const PIXBUF_VERSION: string | null
205
+ export function pixbuf_error_quark(): GLib.Quark
206
+ /**
207
+ * A function of this type is responsible for freeing the pixel array
208
+ * of a pixbuf.
209
+ *
210
+ * The gdk_pixbuf_new_from_data() function lets you pass in a pre-allocated
211
+ * pixel array so that a pixbuf can be created from it; in this case you
212
+ * will need to pass in a function of type `GdkPixbufDestroyNotify` so that
213
+ * the pixel data can be freed when the pixbuf is finalized.
214
+ * @callback
215
+ * @param pixels The pixel array of the pixbuf that is being finalized.
216
+ */
217
+ export interface PixbufDestroyNotify {
218
+ (pixels: Uint8Array): void
219
+ }
220
+ /**
221
+ * Defines the type of the function used to fill a
222
+ * #GdkPixbufFormat structure with information about a module.
223
+ * @callback
224
+ * @param info a #GdkPixbufFormat.
225
+ */
226
+ export interface PixbufModuleFillInfoFunc {
227
+ (info: PixbufFormat): void
228
+ }
229
+ /**
230
+ * Defines the type of the function used to set the vtable of a
231
+ * #GdkPixbufModule when it is loaded.
232
+ * @callback
233
+ * @param module a #GdkPixbufModule.
234
+ */
235
+ export interface PixbufModuleFillVtableFunc {
236
+ (module: PixbufModule): void
237
+ }
238
+ /**
239
+ * Defines the type of the function that gets called once the initial
240
+ * setup of `pixbuf` is done.
241
+ *
242
+ * #GdkPixbufLoader uses a function of this type to emit the
243
+ * "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>"
244
+ * signal.
245
+ * @callback
246
+ * @param pixbuf the #GdkPixbuf that is currently being loaded.
247
+ * @param anim if an animation is being loaded, the #GdkPixbufAnimation, else %NULL.
248
+ */
249
+ export interface PixbufModulePreparedFunc {
250
+ (pixbuf: Pixbuf, anim: PixbufAnimation): void
251
+ }
252
+ /**
253
+ * Defines the type of the function that gets called once the size
254
+ * of the loaded image is known.
255
+ *
256
+ * The function is expected to set `width` and `height` to the desired
257
+ * size to which the image should be scaled. If a module has no efficient
258
+ * way to achieve the desired scaling during the loading of the image, it may
259
+ * either ignore the size request, or only approximate it - gdk-pixbuf will
260
+ * then perform the required scaling on the completely loaded image.
261
+ *
262
+ * If the function sets `width` or `height` to zero, the module should interpret
263
+ * this as a hint that it will be closed soon and shouldn't allocate further
264
+ * resources. This convention is used to implement gdk_pixbuf_get_file_info()
265
+ * efficiently.
266
+ * @callback
267
+ * @param width pointer to a location containing the current image width
268
+ * @param height pointer to a location containing the current image height
269
+ */
270
+ export interface PixbufModuleSizeFunc {
271
+ (width: number, height: number): void
272
+ }
273
+ /**
274
+ * Defines the type of the function that gets called every time a region
275
+ * of `pixbuf` is updated.
276
+ *
277
+ * #GdkPixbufLoader uses a function of this type to emit the
278
+ * "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>"
279
+ * signal.
280
+ * @callback
281
+ * @param pixbuf the #GdkPixbuf that is currently being loaded.
282
+ * @param x the X origin of the updated area.
283
+ * @param y the Y origin of the updated area.
284
+ * @param width the width of the updated area.
285
+ * @param height the height of the updated area.
286
+ */
287
+ export interface PixbufModuleUpdatedFunc {
288
+ (pixbuf: Pixbuf, x: number, y: number, width: number, height: number): void
289
+ }
290
+ /**
291
+ * Save functions used by [method`GdkPixbuf`.Pixbuf.save_to_callback].
292
+ *
293
+ * This function is called once for each block of bytes that is "written"
294
+ * by `gdk_pixbuf_save_to_callback()`.
295
+ *
296
+ * If successful it should return `TRUE`; if an error occurs it should set
297
+ * `error` and return `FALSE`, in which case `gdk_pixbuf_save_to_callback()`
298
+ * will fail with the same error.
299
+ * @callback
300
+ * @param buf bytes to be written.
301
+ * @returns `TRUE` if successful, `FALSE` otherwise
302
+ */
303
+ export interface PixbufSaveFunc {
304
+ (buf: Uint8Array): boolean
305
+ }
306
+ export module Pixbuf {
307
+
308
+ // Constructor properties interface
309
+
310
+ export interface ConstructorProperties extends Gio.Icon.ConstructorProperties, Gio.LoadableIcon.ConstructorProperties, GObject.Object.ConstructorProperties {
311
+
312
+ // Own constructor properties of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
313
+
314
+ /**
315
+ * The number of bits per sample.
316
+ *
317
+ * Currently only 8 bit per sample are supported.
318
+ */
319
+ bits_per_sample?: number | null
320
+ /**
321
+ * The color space of the pixbuf.
322
+ *
323
+ * Currently, only `GDK_COLORSPACE_RGB` is supported.
324
+ */
325
+ colorspace?: Colorspace | null
326
+ /**
327
+ * Whether the pixbuf has an alpha channel.
328
+ */
329
+ has_alpha?: boolean | null
330
+ /**
331
+ * The number of rows of the pixbuf.
332
+ */
333
+ height?: number | null
334
+ /**
335
+ * The number of samples per pixel.
336
+ *
337
+ * Currently, only 3 or 4 samples per pixel are supported.
338
+ */
339
+ n_channels?: number | null
340
+ pixel_bytes?: GLib.Bytes | null
341
+ /**
342
+ * A pointer to the pixel data of the pixbuf.
343
+ */
344
+ pixels?: any | null
345
+ /**
346
+ * The number of bytes between the start of a row and
347
+ * the start of the next row.
348
+ *
349
+ * This number must (obviously) be at least as large as the
350
+ * width of the pixbuf.
351
+ */
352
+ rowstride?: number | null
353
+ /**
354
+ * The number of columns of the pixbuf.
355
+ */
356
+ width?: number | null
357
+ }
358
+
359
+ }
360
+
361
+ export interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
362
+
363
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
364
+
365
+ /**
366
+ * The number of bits per sample.
367
+ *
368
+ * Currently only 8 bit per sample are supported.
369
+ */
370
+ readonly bits_per_sample: number
371
+ /**
372
+ * The color space of the pixbuf.
373
+ *
374
+ * Currently, only `GDK_COLORSPACE_RGB` is supported.
375
+ */
376
+ readonly colorspace: Colorspace
377
+ /**
378
+ * Whether the pixbuf has an alpha channel.
379
+ */
380
+ readonly has_alpha: boolean
381
+ /**
382
+ * The number of rows of the pixbuf.
383
+ */
384
+ readonly height: number
385
+ /**
386
+ * The number of samples per pixel.
387
+ *
388
+ * Currently, only 3 or 4 samples per pixel are supported.
389
+ */
390
+ readonly n_channels: number
391
+ readonly pixel_bytes: GLib.Bytes
392
+ /**
393
+ * A pointer to the pixel data of the pixbuf.
394
+ */
395
+ readonly pixels: any
396
+ /**
397
+ * The number of bytes between the start of a row and
398
+ * the start of the next row.
399
+ *
400
+ * This number must (obviously) be at least as large as the
401
+ * width of the pixbuf.
402
+ */
403
+ readonly rowstride: number
404
+ /**
405
+ * The number of columns of the pixbuf.
406
+ */
407
+ readonly width: number
408
+
409
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
410
+
411
+ /**
412
+ * Takes an existing pixbuf and adds an alpha channel to it.
413
+ *
414
+ * If the existing pixbuf already had an alpha channel, the channel
415
+ * values are copied from the original; otherwise, the alpha channel
416
+ * is initialized to 255 (full opacity).
417
+ *
418
+ * If `substitute_color` is `TRUE`, then the color specified by the
419
+ * (`r`, `g`, `b`) arguments will be assigned zero opacity. That is,
420
+ * if you pass `(255, 255, 255)` for the substitute color, all white
421
+ * pixels will become fully transparent.
422
+ *
423
+ * If `substitute_color` is `FALSE`, then the (`r`, `g`, `b`) arguments
424
+ * will be ignored.
425
+ * @param substitute_color Whether to set a color to zero opacity.
426
+ * @param r Red value to substitute.
427
+ * @param g Green value to substitute.
428
+ * @param b Blue value to substitute.
429
+ * @returns A newly-created pixbuf
430
+ */
431
+ add_alpha(substitute_color: boolean, r: number, g: number, b: number): Pixbuf
432
+ /**
433
+ * Takes an existing pixbuf and checks for the presence of an
434
+ * associated "orientation" option.
435
+ *
436
+ * The orientation option may be provided by the JPEG loader (which
437
+ * reads the exif orientation tag) or the TIFF loader (which reads
438
+ * the TIFF orientation tag, and compensates it for the partial
439
+ * transforms performed by libtiff).
440
+ *
441
+ * If an orientation option/tag is present, the appropriate transform
442
+ * will be performed so that the pixbuf is oriented correctly.
443
+ * @returns A newly-created pixbuf
444
+ */
445
+ apply_embedded_orientation(): Pixbuf | null
446
+ /**
447
+ * Creates a transformation of the source image `src` by scaling by
448
+ * `scale_x` and `scale_y` then translating by `offset_x` and `offset_y`.
449
+ *
450
+ * This gives an image in the coordinates of the destination pixbuf.
451
+ * The rectangle (`dest_x,` `dest_y,` `dest_width,` `dest_height)`
452
+ * is then alpha blended onto the corresponding rectangle of the
453
+ * original destination image.
454
+ *
455
+ * When the destination rectangle contains parts not in the source
456
+ * image, the data at the edges of the source image is replicated
457
+ * to infinity.
458
+ *
459
+ * ![](composite.png)
460
+ * @param dest the #GdkPixbuf into which to render the results
461
+ * @param dest_x the left coordinate for region to render
462
+ * @param dest_y the top coordinate for region to render
463
+ * @param dest_width the width of the region to render
464
+ * @param dest_height the height of the region to render
465
+ * @param offset_x the offset in the X direction (currently rounded to an integer)
466
+ * @param offset_y the offset in the Y direction (currently rounded to an integer)
467
+ * @param scale_x the scale factor in the X direction
468
+ * @param scale_y the scale factor in the Y direction
469
+ * @param interp_type the interpolation type for the transformation.
470
+ * @param overall_alpha overall alpha for source image (0..255)
471
+ */
472
+ composite(dest: Pixbuf, dest_x: number, dest_y: number, dest_width: number, dest_height: number, offset_x: number, offset_y: number, scale_x: number, scale_y: number, interp_type: InterpType, overall_alpha: number): void
473
+ /**
474
+ * Creates a transformation of the source image `src` by scaling by
475
+ * `scale_x` and `scale_y` then translating by `offset_x` and `offset_y,`
476
+ * then alpha blends the rectangle (`dest_x` ,`dest_y,` `dest_width,`
477
+ * `dest_height)` of the resulting image with a checkboard of the
478
+ * colors `color1` and `color2` and renders it onto the destination
479
+ * image.
480
+ *
481
+ * If the source image has no alpha channel, and `overall_alpha` is 255, a fast
482
+ * path is used which omits the alpha blending and just performs the scaling.
483
+ *
484
+ * See gdk_pixbuf_composite_color_simple() for a simpler variant of this
485
+ * function suitable for many tasks.
486
+ * @param dest the #GdkPixbuf into which to render the results
487
+ * @param dest_x the left coordinate for region to render
488
+ * @param dest_y the top coordinate for region to render
489
+ * @param dest_width the width of the region to render
490
+ * @param dest_height the height of the region to render
491
+ * @param offset_x the offset in the X direction (currently rounded to an integer)
492
+ * @param offset_y the offset in the Y direction (currently rounded to an integer)
493
+ * @param scale_x the scale factor in the X direction
494
+ * @param scale_y the scale factor in the Y direction
495
+ * @param interp_type the interpolation type for the transformation.
496
+ * @param overall_alpha overall alpha for source image (0..255)
497
+ * @param check_x the X offset for the checkboard (origin of checkboard is at -`check_x,` -`check_y)`
498
+ * @param check_y the Y offset for the checkboard
499
+ * @param check_size the size of checks in the checkboard (must be a power of two)
500
+ * @param color1 the color of check at upper left
501
+ * @param color2 the color of the other check
502
+ */
503
+ composite_color(dest: Pixbuf, dest_x: number, dest_y: number, dest_width: number, dest_height: number, offset_x: number, offset_y: number, scale_x: number, scale_y: number, interp_type: InterpType, overall_alpha: number, check_x: number, check_y: number, check_size: number, color1: number, color2: number): void
504
+ /**
505
+ * Creates a new pixbuf by scaling `src` to `dest_width` x `dest_height`
506
+ * and alpha blending the result with a checkboard of colors `color1`
507
+ * and `color2`.
508
+ * @param dest_width the width of destination image
509
+ * @param dest_height the height of destination image
510
+ * @param interp_type the interpolation type for the transformation.
511
+ * @param overall_alpha overall alpha for source image (0..255)
512
+ * @param check_size the size of checks in the checkboard (must be a power of two)
513
+ * @param color1 the color of check at upper left
514
+ * @param color2 the color of the other check
515
+ * @returns the new pixbuf
516
+ */
517
+ composite_color_simple(dest_width: number, dest_height: number, interp_type: InterpType, overall_alpha: number, check_size: number, color1: number, color2: number): Pixbuf | null
518
+ /**
519
+ * Creates a new `GdkPixbuf` with a copy of the information in the specified
520
+ * `pixbuf`.
521
+ *
522
+ * Note that this does not copy the options set on the original `GdkPixbuf`,
523
+ * use gdk_pixbuf_copy_options() for this.
524
+ * @returns A newly-created pixbuf
525
+ */
526
+ copy(): Pixbuf | null
527
+ /**
528
+ * Copies a rectangular area from `src_pixbuf` to `dest_pixbuf`.
529
+ *
530
+ * Conversion of pixbuf formats is done automatically.
531
+ *
532
+ * If the source rectangle overlaps the destination rectangle on the
533
+ * same pixbuf, it will be overwritten during the copy operation.
534
+ * Therefore, you can not use this function to scroll a pixbuf.
535
+ * @param src_x Source X coordinate within `src_pixbuf`.
536
+ * @param src_y Source Y coordinate within `src_pixbuf`.
537
+ * @param width Width of the area to copy.
538
+ * @param height Height of the area to copy.
539
+ * @param dest_pixbuf Destination pixbuf.
540
+ * @param dest_x X coordinate within `dest_pixbuf`.
541
+ * @param dest_y Y coordinate within `dest_pixbuf`.
542
+ */
543
+ copy_area(src_x: number, src_y: number, width: number, height: number, dest_pixbuf: Pixbuf, dest_x: number, dest_y: number): void
544
+ /**
545
+ * Copies the key/value pair options attached to a `GdkPixbuf` to another
546
+ * `GdkPixbuf`.
547
+ *
548
+ * This is useful to keep original metadata after having manipulated
549
+ * a file. However be careful to remove metadata which you've already
550
+ * applied, such as the "orientation" option after rotating the image.
551
+ * @param dest_pixbuf the destination pixbuf
552
+ * @returns `TRUE` on success.
553
+ */
554
+ copy_options(dest_pixbuf: Pixbuf): boolean
555
+ /**
556
+ * Clears a pixbuf to the given RGBA value, converting the RGBA value into
557
+ * the pixbuf's pixel format.
558
+ *
559
+ * The alpha component will be ignored if the pixbuf doesn't have an alpha
560
+ * channel.
561
+ * @param pixel RGBA pixel to used to clear (`0xffffffff` is opaque white, `0x00000000` transparent black)
562
+ */
563
+ fill(pixel: number): void
564
+ /**
565
+ * Flips a pixbuf horizontally or vertically and returns the
566
+ * result in a new pixbuf.
567
+ * @param horizontal `TRUE` to flip horizontally, `FALSE` to flip vertically
568
+ * @returns the new pixbuf
569
+ */
570
+ flip(horizontal: boolean): Pixbuf | null
571
+ /**
572
+ * Queries the number of bits per color sample in a pixbuf.
573
+ * @returns Number of bits per color sample.
574
+ */
575
+ get_bits_per_sample(): number
576
+ /**
577
+ * Returns the length of the pixel data, in bytes.
578
+ * @returns The length of the pixel data.
579
+ */
580
+ get_byte_length(): number
581
+ /**
582
+ * Queries the color space of a pixbuf.
583
+ * @returns Color space.
584
+ */
585
+ get_colorspace(): Colorspace
586
+ /**
587
+ * Queries whether a pixbuf has an alpha channel (opacity information).
588
+ * @returns `TRUE` if it has an alpha channel, `FALSE` otherwise.
589
+ */
590
+ get_has_alpha(): boolean
591
+ /**
592
+ * Queries the height of a pixbuf.
593
+ * @returns Height in pixels.
594
+ */
595
+ get_height(): number
596
+ /**
597
+ * Queries the number of channels of a pixbuf.
598
+ * @returns Number of channels.
599
+ */
600
+ get_n_channels(): number
601
+ /**
602
+ * Looks up `key` in the list of options that may have been attached to the
603
+ * `pixbuf` when it was loaded, or that may have been attached by another
604
+ * function using gdk_pixbuf_set_option().
605
+ *
606
+ * For instance, the ANI loader provides "Title" and "Artist" options.
607
+ * The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot
608
+ * options for cursor definitions. The PNG loader provides the tEXt ancillary
609
+ * chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders
610
+ * return an "orientation" option string that corresponds to the embedded
611
+ * TIFF/Exif orientation tag (if present). Since 2.32, the TIFF loader sets
612
+ * the "multipage" option string to "yes" when a multi-page TIFF is loaded.
613
+ * Since 2.32 the JPEG and PNG loaders set "x-dpi" and "y-dpi" if the file
614
+ * contains image density information in dots per inch.
615
+ * Since 2.36.6, the JPEG loader sets the "comment" option with the comment
616
+ * EXIF tag.
617
+ * @param key a nul-terminated string.
618
+ * @returns the value associated with `key`
619
+ */
620
+ get_option(key: string | null): string | null
621
+ /**
622
+ * Returns a `GHashTable` with a list of all the options that may have been
623
+ * attached to the `pixbuf` when it was loaded, or that may have been
624
+ * attached by another function using [method`GdkPixbuf`.Pixbuf.set_option].
625
+ * @returns a #GHashTable of key/values pairs
626
+ */
627
+ get_options(): GLib.HashTable
628
+ /**
629
+ * Queries a pointer to the pixel data of a pixbuf.
630
+ *
631
+ * This function will cause an implicit copy of the pixbuf data if the
632
+ * pixbuf was created from read-only data.
633
+ *
634
+ * Please see the section on [image data](class.Pixbuf.html#image-data) for information
635
+ * about how the pixel data is stored in memory.
636
+ * @returns A pointer to the pixbuf's pixel data.
637
+ */
638
+ get_pixels(): Uint8Array
639
+ /**
640
+ * Queries the rowstride of a pixbuf, which is the number of bytes between
641
+ * the start of a row and the start of the next row.
642
+ * @returns Distance between row starts.
643
+ */
644
+ get_rowstride(): number
645
+ /**
646
+ * Queries the width of a pixbuf.
647
+ * @returns Width in pixels.
648
+ */
649
+ get_width(): number
650
+ /**
651
+ * Creates a new pixbuf which represents a sub-region of `src_pixbuf`.
652
+ *
653
+ * The new pixbuf shares its pixels with the original pixbuf, so
654
+ * writing to one affects both. The new pixbuf holds a reference to
655
+ * `src_pixbuf`, so `src_pixbuf` will not be finalized until the new
656
+ * pixbuf is finalized.
657
+ *
658
+ * Note that if `src_pixbuf` is read-only, this function will force it
659
+ * to be mutable.
660
+ * @param src_x X coord in `src_pixbuf`
661
+ * @param src_y Y coord in `src_pixbuf`
662
+ * @param width width of region in `src_pixbuf`
663
+ * @param height height of region in `src_pixbuf`
664
+ * @returns a new pixbuf
665
+ */
666
+ new_subpixbuf(src_x: number, src_y: number, width: number, height: number): Pixbuf
667
+ /**
668
+ * Provides a #GBytes buffer containing the raw pixel data; the data
669
+ * must not be modified.
670
+ *
671
+ * This function allows skipping the implicit copy that must be made
672
+ * if gdk_pixbuf_get_pixels() is called on a read-only pixbuf.
673
+ * @returns A new reference to a read-only copy of the pixel data. Note that for mutable pixbufs, this function will incur a one-time copy of the pixel data for conversion into the returned #GBytes.
674
+ */
675
+ read_pixel_bytes(): GLib.Bytes
676
+ /**
677
+ * Provides a read-only pointer to the raw pixel data.
678
+ *
679
+ * This function allows skipping the implicit copy that must be made
680
+ * if gdk_pixbuf_get_pixels() is called on a read-only pixbuf.
681
+ * @returns a read-only pointer to the raw pixel data
682
+ */
683
+ read_pixels(): number
684
+ /**
685
+ * Removes the key/value pair option attached to a `GdkPixbuf`.
686
+ * @param key a nul-terminated string representing the key to remove.
687
+ * @returns `TRUE` if an option was removed, `FALSE` if not.
688
+ */
689
+ remove_option(key: string | null): boolean
690
+ /**
691
+ * Rotates a pixbuf by a multiple of 90 degrees, and returns the
692
+ * result in a new pixbuf.
693
+ *
694
+ * If `angle` is 0, this function will return a copy of `src`.
695
+ * @param angle the angle to rotate by
696
+ * @returns the new pixbuf
697
+ */
698
+ rotate_simple(angle: PixbufRotation): Pixbuf | null
699
+ /**
700
+ * Modifies saturation and optionally pixelates `src`, placing the result in
701
+ * `dest`.
702
+ *
703
+ * The `src` and `dest` pixbufs must have the same image format, size, and
704
+ * rowstride.
705
+ *
706
+ * The `src` and `dest` arguments may be the same pixbuf with no ill effects.
707
+ *
708
+ * If `saturation` is 1.0 then saturation is not changed. If it's less than 1.0,
709
+ * saturation is reduced (the image turns toward grayscale); if greater than
710
+ * 1.0, saturation is increased (the image gets more vivid colors).
711
+ *
712
+ * If `pixelate` is `TRUE`, then pixels are faded in a checkerboard pattern to
713
+ * create a pixelated image.
714
+ * @param dest place to write modified version of `src`
715
+ * @param saturation saturation factor
716
+ * @param pixelate whether to pixelate
717
+ */
718
+ saturate_and_pixelate(dest: Pixbuf, saturation: number, pixelate: boolean): void
719
+ /**
720
+ * Vector version of `gdk_pixbuf_save_to_buffer()`.
721
+ *
722
+ * Saves pixbuf to a new buffer in format `type,` which is currently "jpeg",
723
+ * "tiff", "png", "ico" or "bmp".
724
+ *
725
+ * See [method`GdkPixbuf`.Pixbuf.save_to_buffer] for more details.
726
+ * @param type name of file format.
727
+ * @param option_keys name of options to set
728
+ * @param option_values values for named options
729
+ * @returns whether an error was set
730
+ */
731
+ save_to_bufferv(type: string | null, option_keys: string[] | null, option_values: string[] | null): [ /* returnType */ boolean, /* buffer */ Uint8Array ]
732
+ /**
733
+ * Vector version of `gdk_pixbuf_save_to_callback()`.
734
+ *
735
+ * Saves pixbuf to a callback in format `type,` which is currently "jpeg",
736
+ * "png", "tiff", "ico" or "bmp".
737
+ *
738
+ * If `error` is set, `FALSE` will be returned.
739
+ *
740
+ * See [method`GdkPixbuf`.Pixbuf.save_to_callback] for more details.
741
+ * @param save_func a function that is called to save each block of data that the save routine generates.
742
+ * @param type name of file format.
743
+ * @param option_keys name of options to set
744
+ * @param option_values values for named options
745
+ * @returns whether an error was set
746
+ */
747
+ save_to_callbackv(save_func: PixbufSaveFunc, type: string | null, option_keys: string[] | null, option_values: string[] | null): boolean
748
+ /**
749
+ * Saves `pixbuf` to an output stream.
750
+ *
751
+ * Supported file formats are currently "jpeg", "tiff", "png", "ico" or
752
+ * "bmp".
753
+ *
754
+ * See [method`GdkPixbuf`.Pixbuf.save_to_stream] for more details.
755
+ * @param stream a `GOutputStream` to save the pixbuf to
756
+ * @param type name of file format
757
+ * @param option_keys name of options to set
758
+ * @param option_values values for named options
759
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
760
+ * @returns `TRUE` if the pixbuf was saved successfully, `FALSE` if an error was set.
761
+ */
762
+ save_to_streamv(stream: Gio.OutputStream, type: string | null, option_keys: string[] | null, option_values: string[] | null, cancellable: Gio.Cancellable | null): boolean
763
+ /**
764
+ * Saves `pixbuf` to an output stream asynchronously.
765
+ *
766
+ * For more details see gdk_pixbuf_save_to_streamv(), which is the synchronous
767
+ * version of this function.
768
+ *
769
+ * When the operation is finished, `callback` will be called in the main thread.
770
+ *
771
+ * You can then call gdk_pixbuf_save_to_stream_finish() to get the result of
772
+ * the operation.
773
+ * @param stream a `GOutputStream` to which to save the pixbuf
774
+ * @param type name of file format
775
+ * @param option_keys name of options to set
776
+ * @param option_values values for named options
777
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
778
+ * @param callback a `GAsyncReadyCallback` to call when the pixbuf is saved
779
+ */
780
+ save_to_streamv_async(stream: Gio.OutputStream, type: string | null, option_keys: string[] | null, option_values: string[] | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
781
+ /**
782
+ * Vector version of `gdk_pixbuf_save()`.
783
+ *
784
+ * Saves pixbuf to a file in `type`, which is currently "jpeg", "png", "tiff", "ico" or "bmp".
785
+ *
786
+ * If `error` is set, `FALSE` will be returned.
787
+ *
788
+ * See [method`GdkPixbuf`.Pixbuf.save] for more details.
789
+ * @param filename name of file to save.
790
+ * @param type name of file format.
791
+ * @param option_keys name of options to set
792
+ * @param option_values values for named options
793
+ * @returns whether an error was set
794
+ */
795
+ savev(filename: string, type: string | null, option_keys: string[] | null, option_values: string[] | null): boolean
796
+ /**
797
+ * Creates a transformation of the source image `src` by scaling by
798
+ * `scale_x` and `scale_y` then translating by `offset_x` and `offset_y,`
799
+ * then renders the rectangle (`dest_x,` `dest_y,` `dest_width,`
800
+ * `dest_height)` of the resulting image onto the destination image
801
+ * replacing the previous contents.
802
+ *
803
+ * Try to use gdk_pixbuf_scale_simple() first; this function is
804
+ * the industrial-strength power tool you can fall back to, if
805
+ * gdk_pixbuf_scale_simple() isn't powerful enough.
806
+ *
807
+ * If the source rectangle overlaps the destination rectangle on the
808
+ * same pixbuf, it will be overwritten during the scaling which
809
+ * results in rendering artifacts.
810
+ * @param dest the #GdkPixbuf into which to render the results
811
+ * @param dest_x the left coordinate for region to render
812
+ * @param dest_y the top coordinate for region to render
813
+ * @param dest_width the width of the region to render
814
+ * @param dest_height the height of the region to render
815
+ * @param offset_x the offset in the X direction (currently rounded to an integer)
816
+ * @param offset_y the offset in the Y direction (currently rounded to an integer)
817
+ * @param scale_x the scale factor in the X direction
818
+ * @param scale_y the scale factor in the Y direction
819
+ * @param interp_type the interpolation type for the transformation.
820
+ */
821
+ scale(dest: Pixbuf, dest_x: number, dest_y: number, dest_width: number, dest_height: number, offset_x: number, offset_y: number, scale_x: number, scale_y: number, interp_type: InterpType): void
822
+ /**
823
+ * Create a new pixbuf containing a copy of `src` scaled to
824
+ * `dest_width` x `dest_height`.
825
+ *
826
+ * This function leaves `src` unaffected.
827
+ *
828
+ * The `interp_type` should be `GDK_INTERP_NEAREST` if you want maximum
829
+ * speed (but when scaling down `GDK_INTERP_NEAREST` is usually unusably
830
+ * ugly). The default `interp_type` should be `GDK_INTERP_BILINEAR` which
831
+ * offers reasonable quality and speed.
832
+ *
833
+ * You can scale a sub-portion of `src` by creating a sub-pixbuf
834
+ * pointing into `src`; see [method`GdkPixbuf`.Pixbuf.new_subpixbuf].
835
+ *
836
+ * If `dest_width` and `dest_height` are equal to the width and height of
837
+ * `src`, this function will return an unscaled copy of `src`.
838
+ *
839
+ * For more complicated scaling/alpha blending see [method`GdkPixbuf`.Pixbuf.scale]
840
+ * and [method`GdkPixbuf`.Pixbuf.composite].
841
+ * @param dest_width the width of destination image
842
+ * @param dest_height the height of destination image
843
+ * @param interp_type the interpolation type for the transformation.
844
+ * @returns the new pixbuf
845
+ */
846
+ scale_simple(dest_width: number, dest_height: number, interp_type: InterpType): Pixbuf | null
847
+ /**
848
+ * Attaches a key/value pair as an option to a `GdkPixbuf`.
849
+ *
850
+ * If `key` already exists in the list of options attached to the `pixbuf`,
851
+ * the new value is ignored and `FALSE` is returned.
852
+ * @param key a nul-terminated string.
853
+ * @param value a nul-terminated string.
854
+ * @returns `TRUE` on success
855
+ */
856
+ set_option(key: string | null, value: string | null): boolean
857
+
858
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
859
+
860
+ connect(sigName: "notify::bits-per-sample", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
861
+ connect_after(sigName: "notify::bits-per-sample", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
862
+ emit(sigName: "notify::bits-per-sample", ...args: any[]): void
863
+ connect(sigName: "notify::colorspace", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
864
+ connect_after(sigName: "notify::colorspace", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
865
+ emit(sigName: "notify::colorspace", ...args: any[]): void
866
+ connect(sigName: "notify::has-alpha", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
867
+ connect_after(sigName: "notify::has-alpha", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
868
+ emit(sigName: "notify::has-alpha", ...args: any[]): void
869
+ connect(sigName: "notify::height", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
870
+ connect_after(sigName: "notify::height", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
871
+ emit(sigName: "notify::height", ...args: any[]): void
872
+ connect(sigName: "notify::n-channels", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
873
+ connect_after(sigName: "notify::n-channels", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
874
+ emit(sigName: "notify::n-channels", ...args: any[]): void
875
+ connect(sigName: "notify::pixel-bytes", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
876
+ connect_after(sigName: "notify::pixel-bytes", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
877
+ emit(sigName: "notify::pixel-bytes", ...args: any[]): void
878
+ connect(sigName: "notify::pixels", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
879
+ connect_after(sigName: "notify::pixels", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
880
+ emit(sigName: "notify::pixels", ...args: any[]): void
881
+ connect(sigName: "notify::rowstride", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
882
+ connect_after(sigName: "notify::rowstride", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
883
+ emit(sigName: "notify::rowstride", ...args: any[]): void
884
+ connect(sigName: "notify::width", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
885
+ connect_after(sigName: "notify::width", callback: (($obj: Pixbuf, pspec: GObject.ParamSpec) => void)): number
886
+ emit(sigName: "notify::width", ...args: any[]): void
887
+ connect(sigName: string, callback: (...args: any[]) => void): number
888
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
889
+ emit(sigName: string, ...args: any[]): void
890
+ disconnect(id: number): void
891
+ }
892
+
893
+ /**
894
+ * A pixel buffer.
895
+ *
896
+ * `GdkPixbuf` contains information about an image's pixel data,
897
+ * its color space, bits per sample, width and height, and the
898
+ * rowstride (the number of bytes between the start of one row
899
+ * and the start of the next).
900
+ *
901
+ * ## Creating new `GdkPixbuf`
902
+ *
903
+ * The most basic way to create a pixbuf is to wrap an existing pixel
904
+ * buffer with a [class`GdkPixbuf`.Pixbuf] instance. You can use the
905
+ * [`ctor`GdkPixbuf`.Pixbuf.new_from_data`] function to do this.
906
+ *
907
+ * Every time you create a new `GdkPixbuf` instance for some data, you
908
+ * will need to specify the destroy notification function that will be
909
+ * called when the data buffer needs to be freed; this will happen when
910
+ * a `GdkPixbuf` is finalized by the reference counting functions. If
911
+ * you have a chunk of static data compiled into your application, you
912
+ * can pass in `NULL` as the destroy notification function so that the
913
+ * data will not be freed.
914
+ *
915
+ * The [`ctor`GdkPixbuf`.Pixbuf.new`] constructor function can be used
916
+ * as a convenience to create a pixbuf with an empty buffer; this is
917
+ * equivalent to allocating a data buffer using `malloc()` and then
918
+ * wrapping it with `gdk_pixbuf_new_from_data()`. The `gdk_pixbuf_new()`
919
+ * function will compute an optimal rowstride so that rendering can be
920
+ * performed with an efficient algorithm.
921
+ *
922
+ * As a special case, you can use the [`ctor`GdkPixbuf`.Pixbuf.new_from_xpm_data`]
923
+ * function to create a pixbuf from inline XPM image data.
924
+ *
925
+ * You can also copy an existing pixbuf with the [method`Pixbuf`.copy]
926
+ * function. This is not the same as just acquiring a reference to
927
+ * the old pixbuf instance: the copy function will actually duplicate
928
+ * the pixel data in memory and create a new [class`Pixbuf]` instance
929
+ * for it.
930
+ *
931
+ * ## Reference counting
932
+ *
933
+ * `GdkPixbuf` structures are reference counted. This means that an
934
+ * application can share a single pixbuf among many parts of the
935
+ * code. When a piece of the program needs to use a pixbuf, it should
936
+ * acquire a reference to it by calling `g_object_ref()`; when it no
937
+ * longer needs the pixbuf, it should release the reference it acquired
938
+ * by calling `g_object_unref()`. The resources associated with a
939
+ * `GdkPixbuf` will be freed when its reference count drops to zero.
940
+ * Newly-created `GdkPixbuf` instances start with a reference count
941
+ * of one.
942
+ *
943
+ * ## Image Data
944
+ *
945
+ * Image data in a pixbuf is stored in memory in an uncompressed,
946
+ * packed format. Rows in the image are stored top to bottom, and
947
+ * in each row pixels are stored from left to right.
948
+ *
949
+ * There may be padding at the end of a row.
950
+ *
951
+ * The "rowstride" value of a pixbuf, as returned by [`method`GdkPixbuf`.Pixbuf.get_rowstride`],
952
+ * indicates the number of bytes between rows.
953
+ *
954
+ * **NOTE**: If you are copying raw pixbuf data with `memcpy()` note that the
955
+ * last row in the pixbuf may not be as wide as the full rowstride, but rather
956
+ * just as wide as the pixel data needs to be; that is: it is unsafe to do
957
+ * `memcpy (dest, pixels, rowstride * height)` to copy a whole pixbuf. Use
958
+ * [method`GdkPixbuf`.Pixbuf.copy] instead, or compute the width in bytes of the
959
+ * last row as:
960
+ *
961
+ * ```c
962
+ * last_row = width * ((n_channels * bits_per_sample + 7) / 8);
963
+ * ```
964
+ *
965
+ * The same rule applies when iterating over each row of a `GdkPixbuf` pixels
966
+ * array.
967
+ *
968
+ * The following code illustrates a simple `put_pixel()`
969
+ * function for RGB pixbufs with 8 bits per channel with an alpha
970
+ * channel.
971
+ *
972
+ * ```c
973
+ * static void
974
+ * put_pixel (GdkPixbuf *pixbuf,
975
+ * int x,
976
+ * int y,
977
+ * guchar red,
978
+ * guchar green,
979
+ * guchar blue,
980
+ * guchar alpha)
981
+ * {
982
+ * int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
983
+ *
984
+ * // Ensure that the pixbuf is valid
985
+ * g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
986
+ * g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
987
+ * g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
988
+ * g_assert (n_channels == 4);
989
+ *
990
+ * int width = gdk_pixbuf_get_width (pixbuf);
991
+ * int height = gdk_pixbuf_get_height (pixbuf);
992
+ *
993
+ * // Ensure that the coordinates are in a valid range
994
+ * g_assert (x >= 0 && x < width);
995
+ * g_assert (y >= 0 && y < height);
996
+ *
997
+ * int rowstride = gdk_pixbuf_get_rowstride (pixbuf);
998
+ *
999
+ * // The pixel buffer in the GdkPixbuf instance
1000
+ * guchar *pixels = gdk_pixbuf_get_pixels (pixbuf);
1001
+ *
1002
+ * // The pixel we wish to modify
1003
+ * guchar *p = pixels + y * rowstride + x * n_channels;
1004
+ * p[0] = red;
1005
+ * p[1] = green;
1006
+ * p[2] = blue;
1007
+ * p[3] = alpha;
1008
+ * }
1009
+ * ```
1010
+ *
1011
+ * ## Loading images
1012
+ *
1013
+ * The `GdkPixBuf` class provides a simple mechanism for loading
1014
+ * an image from a file in synchronous and asynchronous fashion.
1015
+ *
1016
+ * For GUI applications, it is recommended to use the asynchronous
1017
+ * stream API to avoid blocking the control flow of the application.
1018
+ *
1019
+ * Additionally, `GdkPixbuf` provides the [class`GdkPixbuf`.PixbufLoader`]
1020
+ * API for progressive image loading.
1021
+ *
1022
+ * ## Saving images
1023
+ *
1024
+ * The `GdkPixbuf` class provides methods for saving image data in
1025
+ * a number of file formats. The formatted data can be written to a
1026
+ * file or to a memory buffer. `GdkPixbuf` can also call a user-defined
1027
+ * callback on the data, which allows to e.g. write the image
1028
+ * to a socket or store it in a database.
1029
+ * @class
1030
+ */
1031
+ export class Pixbuf extends GObject.Object {
1032
+
1033
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
1034
+
1035
+ static name: string
1036
+ static $gtype: GObject.GType<Pixbuf>
1037
+
1038
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.Pixbuf
1039
+
1040
+ constructor(config?: Pixbuf.ConstructorProperties)
1041
+ /**
1042
+ * Creates a new `GdkPixbuf` structure and allocates a buffer for it.
1043
+ *
1044
+ * If the allocation of the buffer failed, this function will return `NULL`.
1045
+ *
1046
+ * The buffer has an optimal rowstride. Note that the buffer is not cleared;
1047
+ * you will have to fill it completely yourself.
1048
+ * @constructor
1049
+ * @param colorspace Color space for image
1050
+ * @param has_alpha Whether the image should have transparency information
1051
+ * @param bits_per_sample Number of bits per color sample
1052
+ * @param width Width of image in pixels, must be > 0
1053
+ * @param height Height of image in pixels, must be > 0
1054
+ * @returns A newly-created pixel buffer
1055
+ */
1056
+ constructor(colorspace: Colorspace, has_alpha: boolean, bits_per_sample: number, width: number, height: number)
1057
+ /**
1058
+ * Creates a new `GdkPixbuf` structure and allocates a buffer for it.
1059
+ *
1060
+ * If the allocation of the buffer failed, this function will return `NULL`.
1061
+ *
1062
+ * The buffer has an optimal rowstride. Note that the buffer is not cleared;
1063
+ * you will have to fill it completely yourself.
1064
+ * @constructor
1065
+ * @param colorspace Color space for image
1066
+ * @param has_alpha Whether the image should have transparency information
1067
+ * @param bits_per_sample Number of bits per color sample
1068
+ * @param width Width of image in pixels, must be > 0
1069
+ * @param height Height of image in pixels, must be > 0
1070
+ * @returns A newly-created pixel buffer
1071
+ */
1072
+ static new(colorspace: Colorspace, has_alpha: boolean, bits_per_sample: number, width: number, height: number): Pixbuf
1073
+ /**
1074
+ * Creates a new #GdkPixbuf out of in-memory readonly image data.
1075
+ *
1076
+ * Currently only RGB images with 8 bits per sample are supported.
1077
+ *
1078
+ * This is the `GBytes` variant of gdk_pixbuf_new_from_data(), useful
1079
+ * for language bindings.
1080
+ * @constructor
1081
+ * @param data Image data in 8-bit/sample packed format inside a #GBytes
1082
+ * @param colorspace Colorspace for the image data
1083
+ * @param has_alpha Whether the data has an opacity channel
1084
+ * @param bits_per_sample Number of bits per sample
1085
+ * @param width Width of the image in pixels, must be > 0
1086
+ * @param height Height of the image in pixels, must be > 0
1087
+ * @param rowstride Distance in bytes between row starts
1088
+ * @returns A newly-created pixbuf
1089
+ */
1090
+ static new_from_bytes(data: GLib.Bytes, colorspace: Colorspace, has_alpha: boolean, bits_per_sample: number, width: number, height: number, rowstride: number): Pixbuf
1091
+ /**
1092
+ * Creates a new #GdkPixbuf out of in-memory image data.
1093
+ *
1094
+ * Currently only RGB images with 8 bits per sample are supported.
1095
+ *
1096
+ * Since you are providing a pre-allocated pixel buffer, you must also
1097
+ * specify a way to free that data. This is done with a function of
1098
+ * type `GdkPixbufDestroyNotify`. When a pixbuf created with is
1099
+ * finalized, your destroy notification function will be called, and
1100
+ * it is its responsibility to free the pixel array.
1101
+ *
1102
+ * See also: [ctor`GdkPixbuf`.Pixbuf.new_from_bytes]
1103
+ * @constructor
1104
+ * @param data Image data in 8-bit/sample packed format
1105
+ * @param colorspace Colorspace for the image data
1106
+ * @param has_alpha Whether the data has an opacity channel
1107
+ * @param bits_per_sample Number of bits per sample
1108
+ * @param width Width of the image in pixels, must be > 0
1109
+ * @param height Height of the image in pixels, must be > 0
1110
+ * @param rowstride Distance in bytes between row starts
1111
+ * @param 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
1112
+ * @returns A newly-created pixbuf
1113
+ */
1114
+ static new_from_data(data: Uint8Array, colorspace: Colorspace, has_alpha: boolean, bits_per_sample: number, width: number, height: number, rowstride: number, destroy_fn: PixbufDestroyNotify | null): Pixbuf
1115
+ /**
1116
+ * Creates a new pixbuf by loading an image from a file.
1117
+ *
1118
+ * The file format is detected automatically.
1119
+ *
1120
+ * If `NULL` is returned, then `error` will be set. Possible errors are:
1121
+ *
1122
+ * - the file could not be opened
1123
+ * - there is no loader for the file's format
1124
+ * - there is not enough memory to allocate the image buffer
1125
+ * - the image buffer contains invalid data
1126
+ *
1127
+ * The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`.
1128
+ * @constructor
1129
+ * @param filename Name of file to load, in the GLib file name encoding
1130
+ * @returns A newly-created pixbuf
1131
+ */
1132
+ static new_from_file(filename: string): Pixbuf
1133
+ /**
1134
+ * Creates a new pixbuf by loading an image from a file.
1135
+ *
1136
+ * The file format is detected automatically.
1137
+ *
1138
+ * If `NULL` is returned, then `error` will be set. Possible errors are:
1139
+ *
1140
+ * - the file could not be opened
1141
+ * - there is no loader for the file's format
1142
+ * - there is not enough memory to allocate the image buffer
1143
+ * - the image buffer contains invalid data
1144
+ *
1145
+ * The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`.
1146
+ *
1147
+ * The image will be scaled to fit in the requested size, optionally preserving
1148
+ * the image's aspect ratio.
1149
+ *
1150
+ * When preserving the aspect ratio, a `width` of -1 will cause the image
1151
+ * to be scaled to the exact given height, and a `height` of -1 will cause
1152
+ * the image to be scaled to the exact given width. When not preserving
1153
+ * aspect ratio, a `width` or `height` of -1 means to not scale the image
1154
+ * at all in that dimension. Negative values for `width` and `height` are
1155
+ * allowed since 2.8.
1156
+ * @constructor
1157
+ * @param filename Name of file to load, in the GLib file name encoding
1158
+ * @param width The width the image should have or -1 to not constrain the width
1159
+ * @param height The height the image should have or -1 to not constrain the height
1160
+ * @param preserve_aspect_ratio `TRUE` to preserve the image's aspect ratio
1161
+ * @returns A newly-created pixbuf
1162
+ */
1163
+ static new_from_file_at_scale(filename: string, width: number, height: number, preserve_aspect_ratio: boolean): Pixbuf
1164
+ /**
1165
+ * Creates a new pixbuf by loading an image from a file.
1166
+ *
1167
+ * The file format is detected automatically.
1168
+ *
1169
+ * If `NULL` is returned, then `error` will be set. Possible errors are:
1170
+ *
1171
+ * - the file could not be opened
1172
+ * - there is no loader for the file's format
1173
+ * - there is not enough memory to allocate the image buffer
1174
+ * - the image buffer contains invalid data
1175
+ *
1176
+ * The error domains are `GDK_PIXBUF_ERROR` and `G_FILE_ERROR`.
1177
+ *
1178
+ * The image will be scaled to fit in the requested size, preserving
1179
+ * the image's aspect ratio. Note that the returned pixbuf may be smaller
1180
+ * than `width` x `height`, if the aspect ratio requires it. To load
1181
+ * and image at the requested size, regardless of aspect ratio, use
1182
+ * [ctor`GdkPixbuf`.Pixbuf.new_from_file_at_scale].
1183
+ * @constructor
1184
+ * @param filename Name of file to load, in the GLib file name encoding
1185
+ * @param width The width the image should have or -1 to not constrain the width
1186
+ * @param height The height the image should have or -1 to not constrain the height
1187
+ * @returns A newly-created pixbuf
1188
+ */
1189
+ static new_from_file_at_size(filename: string, width: number, height: number): Pixbuf
1190
+ /**
1191
+ * Creates a `GdkPixbuf` from a flat representation that is suitable for
1192
+ * storing as inline data in a program.
1193
+ *
1194
+ * This is useful if you want to ship a program with images, but don't want
1195
+ * to depend on any external files.
1196
+ *
1197
+ * GdkPixbuf ships with a program called `gdk-pixbuf-csource`, which allows
1198
+ * for conversion of `GdkPixbuf`s into such a inline representation.
1199
+ *
1200
+ * In almost all cases, you should pass the `--raw` option to
1201
+ * `gdk-pixbuf-csource`. A sample invocation would be:
1202
+ *
1203
+ * ```
1204
+ * gdk-pixbuf-csource --raw --name=myimage_inline myimage.png
1205
+ * ```
1206
+ *
1207
+ * For the typical case where the inline pixbuf is read-only static data,
1208
+ * you don't need to copy the pixel data unless you intend to write to
1209
+ * it, so you can pass `FALSE` for `copy_pixels`. If you pass `--rle` to
1210
+ * `gdk-pixbuf-csource`, a copy will be made even if `copy_pixels` is `FALSE`,
1211
+ * so using this option is generally a bad idea.
1212
+ *
1213
+ * If you create a pixbuf from const inline data compiled into your
1214
+ * program, it's probably safe to ignore errors and disable length checks,
1215
+ * since things will always succeed:
1216
+ *
1217
+ * ```c
1218
+ * pixbuf = gdk_pixbuf_new_from_inline (-1, myimage_inline, FALSE, NULL);
1219
+ * ```
1220
+ *
1221
+ * For non-const inline data, you could get out of memory. For untrusted
1222
+ * inline data located at runtime, you could have corrupt inline data in
1223
+ * addition.
1224
+ * @constructor
1225
+ * @param data Byte data containing a serialized `GdkPixdata` structure
1226
+ * @param copy_pixels Whether to copy the pixel data, or use direct pointers `data` for the resulting pixbuf
1227
+ * @returns A newly-created pixbuf
1228
+ */
1229
+ static new_from_inline(data: Uint8Array, copy_pixels: boolean): Pixbuf
1230
+ /**
1231
+ * Creates a new pixbuf by loading an image from an resource.
1232
+ *
1233
+ * The file format is detected automatically. If `NULL` is returned, then
1234
+ * `error` will be set.
1235
+ * @constructor
1236
+ * @param resource_path the path of the resource file
1237
+ * @returns A newly-created pixbuf
1238
+ */
1239
+ static new_from_resource(resource_path: string | null): Pixbuf
1240
+ /**
1241
+ * Creates a new pixbuf by loading an image from an resource.
1242
+ *
1243
+ * The file format is detected automatically. If `NULL` is returned, then
1244
+ * `error` will be set.
1245
+ *
1246
+ * The image will be scaled to fit in the requested size, optionally
1247
+ * preserving the image's aspect ratio. When preserving the aspect ratio,
1248
+ * a `width` of -1 will cause the image to be scaled to the exact given
1249
+ * height, and a `height` of -1 will cause the image to be scaled to the
1250
+ * exact given width. When not preserving aspect ratio, a `width` or
1251
+ * `height` of -1 means to not scale the image at all in that dimension.
1252
+ *
1253
+ * The stream is not closed.
1254
+ * @constructor
1255
+ * @param resource_path the path of the resource file
1256
+ * @param width The width the image should have or -1 to not constrain the width
1257
+ * @param height The height the image should have or -1 to not constrain the height
1258
+ * @param preserve_aspect_ratio `TRUE` to preserve the image's aspect ratio
1259
+ * @returns A newly-created pixbuf
1260
+ */
1261
+ static new_from_resource_at_scale(resource_path: string | null, width: number, height: number, preserve_aspect_ratio: boolean): Pixbuf
1262
+ /**
1263
+ * Creates a new pixbuf by loading an image from an input stream.
1264
+ *
1265
+ * The file format is detected automatically.
1266
+ *
1267
+ * If `NULL` is returned, then `error` will be set.
1268
+ *
1269
+ * The `cancellable` can be used to abort the operation from another thread.
1270
+ * If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` will be
1271
+ * returned. Other possible errors are in the `GDK_PIXBUF_ERROR` and
1272
+ * `G_IO_ERROR` domains.
1273
+ *
1274
+ * The stream is not closed.
1275
+ * @constructor
1276
+ * @param stream a `GInputStream` to load the pixbuf from
1277
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
1278
+ * @returns A newly-created pixbuf
1279
+ */
1280
+ static new_from_stream(stream: Gio.InputStream, cancellable: Gio.Cancellable | null): Pixbuf
1281
+ /**
1282
+ * Creates a new pixbuf by loading an image from an input stream.
1283
+ *
1284
+ * The file format is detected automatically. If `NULL` is returned, then
1285
+ * `error` will be set. The `cancellable` can be used to abort the operation
1286
+ * from another thread. If the operation was cancelled, the error
1287
+ * `G_IO_ERROR_CANCELLED` will be returned. Other possible errors are in
1288
+ * the `GDK_PIXBUF_ERROR` and `G_IO_ERROR` domains.
1289
+ *
1290
+ * The image will be scaled to fit in the requested size, optionally
1291
+ * preserving the image's aspect ratio.
1292
+ *
1293
+ * When preserving the aspect ratio, a `width` of -1 will cause the image to be
1294
+ * scaled to the exact given height, and a `height` of -1 will cause the image
1295
+ * to be scaled to the exact given width. If both `width` and `height` are
1296
+ * given, this function will behave as if the smaller of the two values
1297
+ * is passed as -1.
1298
+ *
1299
+ * When not preserving aspect ratio, a `width` or `height` of -1 means to not
1300
+ * scale the image at all in that dimension.
1301
+ *
1302
+ * The stream is not closed.
1303
+ * @constructor
1304
+ * @param stream a `GInputStream` to load the pixbuf from
1305
+ * @param width The width the image should have or -1 to not constrain the width
1306
+ * @param height The height the image should have or -1 to not constrain the height
1307
+ * @param preserve_aspect_ratio `TRUE` to preserve the image's aspect ratio
1308
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
1309
+ * @returns A newly-created pixbuf
1310
+ */
1311
+ static new_from_stream_at_scale(stream: Gio.InputStream, width: number, height: number, preserve_aspect_ratio: boolean, cancellable: Gio.Cancellable | null): Pixbuf
1312
+ /**
1313
+ * Finishes an asynchronous pixbuf creation operation started with
1314
+ * gdk_pixbuf_new_from_stream_async().
1315
+ * @constructor
1316
+ * @param async_result a `GAsyncResult`
1317
+ * @returns the newly created pixbuf
1318
+ */
1319
+ static new_from_stream_finish(async_result: Gio.AsyncResult): Pixbuf
1320
+ /**
1321
+ * Creates a new pixbuf by parsing XPM data in memory.
1322
+ *
1323
+ * This data is commonly the result of including an XPM file into a
1324
+ * program's C source.
1325
+ * @constructor
1326
+ * @param data Pointer to inline XPM data.
1327
+ * @returns A newly-created pixbuf
1328
+ */
1329
+ static new_from_xpm_data(data: string[]): Pixbuf
1330
+ _init(config?: Pixbuf.ConstructorProperties): void
1331
+ /**
1332
+ * Creates a new pixbuf by asynchronously loading an image from an input stream.
1333
+ *
1334
+ * For more details see gdk_pixbuf_new_from_stream(), which is the synchronous
1335
+ * version of this function.
1336
+ *
1337
+ * When the operation is finished, `callback` will be called in the main thread.
1338
+ * You can then call gdk_pixbuf_new_from_stream_finish() to get the result of
1339
+ * the operation.
1340
+ * @param stream a `GInputStream` from which to load the pixbuf
1341
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
1342
+ * @param callback a `GAsyncReadyCallback` to call when the pixbuf is loaded
1343
+ */
1344
+ static new_from_stream_async(stream: Gio.InputStream, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Pixbuf> | null): void
1345
+ /**
1346
+ * Creates a new pixbuf by asynchronously loading an image from an input stream.
1347
+ *
1348
+ * For more details see gdk_pixbuf_new_from_stream_at_scale(), which is the synchronous
1349
+ * version of this function.
1350
+ *
1351
+ * When the operation is finished, `callback` will be called in the main thread.
1352
+ * You can then call gdk_pixbuf_new_from_stream_finish() to get the result of the operation.
1353
+ * @param stream a `GInputStream` from which to load the pixbuf
1354
+ * @param width the width the image should have or -1 to not constrain the width
1355
+ * @param height the height the image should have or -1 to not constrain the height
1356
+ * @param preserve_aspect_ratio `TRUE` to preserve the image's aspect ratio
1357
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
1358
+ * @param callback a `GAsyncReadyCallback` to call when the pixbuf is loaded
1359
+ */
1360
+ static new_from_stream_at_scale_async(stream: Gio.InputStream, width: number, height: number, preserve_aspect_ratio: boolean, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Pixbuf> | null): void
1361
+ /**
1362
+ * Calculates the rowstride that an image created with those values would
1363
+ * have.
1364
+ *
1365
+ * This function is useful for front-ends and backends that want to check
1366
+ * image values without needing to create a `GdkPixbuf`.
1367
+ * @param colorspace Color space for image
1368
+ * @param has_alpha Whether the image should have transparency information
1369
+ * @param bits_per_sample Number of bits per color sample
1370
+ * @param width Width of image in pixels, must be > 0
1371
+ * @param height Height of image in pixels, must be > 0
1372
+ * @returns the rowstride for the given values, or -1 in case of error.
1373
+ */
1374
+ static calculate_rowstride(colorspace: Colorspace, has_alpha: boolean, bits_per_sample: number, width: number, height: number): number
1375
+ /**
1376
+ * Parses an image file far enough to determine its format and size.
1377
+ * @param filename The name of the file to identify.
1378
+ * @returns A `GdkPixbufFormat` describing the image format of the file
1379
+ */
1380
+ static get_file_info(filename: string): [ /* returnType */ PixbufFormat | null, /* width */ number, /* height */ number ]
1381
+ /**
1382
+ * Asynchronously parses an image file far enough to determine its
1383
+ * format and size.
1384
+ *
1385
+ * For more details see gdk_pixbuf_get_file_info(), which is the synchronous
1386
+ * version of this function.
1387
+ *
1388
+ * When the operation is finished, `callback` will be called in the
1389
+ * main thread. You can then call gdk_pixbuf_get_file_info_finish() to
1390
+ * get the result of the operation.
1391
+ * @param filename The name of the file to identify
1392
+ * @param cancellable optional `GCancellable` object, `NULL` to ignore
1393
+ * @param callback a `GAsyncReadyCallback` to call when the file info is available
1394
+ */
1395
+ static get_file_info_async(filename: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<Pixbuf> | null): void
1396
+ /**
1397
+ * Finishes an asynchronous pixbuf parsing operation started with
1398
+ * gdk_pixbuf_get_file_info_async().
1399
+ * @param async_result a `GAsyncResult`
1400
+ * @returns A `GdkPixbufFormat` describing the image format of the file
1401
+ */
1402
+ static get_file_info_finish(async_result: Gio.AsyncResult): [ /* returnType */ PixbufFormat | null, /* width */ number, /* height */ number ]
1403
+ /**
1404
+ * Obtains the available information about the image formats supported
1405
+ * by GdkPixbuf.
1406
+ * @returns A list of support image formats.
1407
+ */
1408
+ static get_formats(): PixbufFormat[]
1409
+ /**
1410
+ * Initalizes the gdk-pixbuf loader modules referenced by the `loaders.cache`
1411
+ * file present inside that directory.
1412
+ *
1413
+ * This is to be used by applications that want to ship certain loaders
1414
+ * in a different location from the system ones.
1415
+ *
1416
+ * This is needed when the OS or runtime ships a minimal number of loaders
1417
+ * so as to reduce the potential attack surface of carefully crafted image
1418
+ * files, especially for uncommon file types. Applications that require
1419
+ * broader image file types coverage, such as image viewers, would be
1420
+ * expected to ship the gdk-pixbuf modules in a separate location, bundled
1421
+ * with the application in a separate directory from the OS or runtime-
1422
+ * provided modules.
1423
+ * @param path Path to directory where the `loaders.cache` is installed
1424
+ */
1425
+ static init_modules(path: string | null): boolean
1426
+ /**
1427
+ * Finishes an asynchronous pixbuf save operation started with
1428
+ * gdk_pixbuf_save_to_stream_async().
1429
+ * @param async_result a `GAsyncResult`
1430
+ * @returns `TRUE` if the pixbuf was saved successfully, `FALSE` if an error was set.
1431
+ */
1432
+ static save_to_stream_finish(async_result: Gio.AsyncResult): boolean
1433
+ }
1434
+
1435
+ export module PixbufAnimation {
1436
+
1437
+ // Constructor properties interface
1438
+
1439
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1440
+ }
1441
+
1442
+ }
1443
+
1444
+ export interface PixbufAnimation {
1445
+
1446
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1447
+
1448
+ parent_instance: GObject.Object
1449
+
1450
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1451
+
1452
+ /**
1453
+ * Queries the height of the bounding box of a pixbuf animation.
1454
+ * @returns Height of the bounding box of the animation.
1455
+ */
1456
+ get_height(): number
1457
+ /**
1458
+ * Get an iterator for displaying an animation.
1459
+ *
1460
+ * The iterator provides the frames that should be displayed at a
1461
+ * given time.
1462
+ *
1463
+ * `start_time` would normally come from g_get_current_time(), and marks
1464
+ * the beginning of animation playback. After creating an iterator, you
1465
+ * should immediately display the pixbuf returned by
1466
+ * gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install
1467
+ * a timeout (with g_timeout_add()) or by some other mechanism ensure
1468
+ * that you'll update the image after
1469
+ * gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time
1470
+ * the image is updated, you should reinstall the timeout with the new,
1471
+ * possibly-changed delay time.
1472
+ *
1473
+ * As a shortcut, if `start_time` is `NULL`, the result of
1474
+ * g_get_current_time() will be used automatically.
1475
+ *
1476
+ * To update the image (i.e. possibly change the result of
1477
+ * gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation),
1478
+ * call gdk_pixbuf_animation_iter_advance().
1479
+ *
1480
+ * If you're using #GdkPixbufLoader, in addition to updating the image
1481
+ * after the delay time, you should also update it whenever you
1482
+ * receive the area_updated signal and
1483
+ * gdk_pixbuf_animation_iter_on_currently_loading_frame() returns
1484
+ * `TRUE`. In this case, the frame currently being fed into the loader
1485
+ * has received new data, so needs to be refreshed. The delay time for
1486
+ * a frame may also be modified after an area_updated signal, for
1487
+ * example if the delay time for a frame is encoded in the data after
1488
+ * the frame itself. So your timeout should be reinstalled after any
1489
+ * area_updated signal.
1490
+ *
1491
+ * A delay time of -1 is possible, indicating "infinite".
1492
+ * @param start_time time when the animation starts playing
1493
+ * @returns an iterator to move over the animation
1494
+ */
1495
+ get_iter(start_time: GLib.TimeVal | null): PixbufAnimationIter
1496
+ /**
1497
+ * Retrieves a static image for the animation.
1498
+ *
1499
+ * If an animation is really just a plain image (has only one frame),
1500
+ * this function returns that image.
1501
+ *
1502
+ * If the animation is an animation, this function returns a reasonable
1503
+ * image to use as a static unanimated image, which might be the first
1504
+ * frame, or something more sophisticated depending on the file format.
1505
+ *
1506
+ * If an animation hasn't loaded any frames yet, this function will
1507
+ * return `NULL`.
1508
+ * @returns unanimated image representing the animation
1509
+ */
1510
+ get_static_image(): Pixbuf
1511
+ /**
1512
+ * Queries the width of the bounding box of a pixbuf animation.
1513
+ * @returns Width of the bounding box of the animation.
1514
+ */
1515
+ get_width(): number
1516
+ /**
1517
+ * Checks whether the animation is a static image.
1518
+ *
1519
+ * If you load a file with gdk_pixbuf_animation_new_from_file() and it
1520
+ * turns out to be a plain, unanimated image, then this function will
1521
+ * return `TRUE`. Use gdk_pixbuf_animation_get_static_image() to retrieve
1522
+ * the image.
1523
+ * @returns `TRUE` if the "animation" was really just an image
1524
+ */
1525
+ is_static_image(): boolean
1526
+
1527
+ // Own virtual methods of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1528
+
1529
+ /**
1530
+ * Get an iterator for displaying an animation.
1531
+ *
1532
+ * The iterator provides the frames that should be displayed at a
1533
+ * given time.
1534
+ *
1535
+ * `start_time` would normally come from g_get_current_time(), and marks
1536
+ * the beginning of animation playback. After creating an iterator, you
1537
+ * should immediately display the pixbuf returned by
1538
+ * gdk_pixbuf_animation_iter_get_pixbuf(). Then, you should install
1539
+ * a timeout (with g_timeout_add()) or by some other mechanism ensure
1540
+ * that you'll update the image after
1541
+ * gdk_pixbuf_animation_iter_get_delay_time() milliseconds. Each time
1542
+ * the image is updated, you should reinstall the timeout with the new,
1543
+ * possibly-changed delay time.
1544
+ *
1545
+ * As a shortcut, if `start_time` is `NULL`, the result of
1546
+ * g_get_current_time() will be used automatically.
1547
+ *
1548
+ * To update the image (i.e. possibly change the result of
1549
+ * gdk_pixbuf_animation_iter_get_pixbuf() to a new frame of the animation),
1550
+ * call gdk_pixbuf_animation_iter_advance().
1551
+ *
1552
+ * If you're using #GdkPixbufLoader, in addition to updating the image
1553
+ * after the delay time, you should also update it whenever you
1554
+ * receive the area_updated signal and
1555
+ * gdk_pixbuf_animation_iter_on_currently_loading_frame() returns
1556
+ * `TRUE`. In this case, the frame currently being fed into the loader
1557
+ * has received new data, so needs to be refreshed. The delay time for
1558
+ * a frame may also be modified after an area_updated signal, for
1559
+ * example if the delay time for a frame is encoded in the data after
1560
+ * the frame itself. So your timeout should be reinstalled after any
1561
+ * area_updated signal.
1562
+ *
1563
+ * A delay time of -1 is possible, indicating "infinite".
1564
+ * @virtual
1565
+ * @param start_time time when the animation starts playing
1566
+ * @returns an iterator to move over the animation
1567
+ */
1568
+ vfunc_get_iter(start_time: GLib.TimeVal | null): PixbufAnimationIter
1569
+ vfunc_get_size(width: number, height: number): void
1570
+ /**
1571
+ * Retrieves a static image for the animation.
1572
+ *
1573
+ * If an animation is really just a plain image (has only one frame),
1574
+ * this function returns that image.
1575
+ *
1576
+ * If the animation is an animation, this function returns a reasonable
1577
+ * image to use as a static unanimated image, which might be the first
1578
+ * frame, or something more sophisticated depending on the file format.
1579
+ *
1580
+ * If an animation hasn't loaded any frames yet, this function will
1581
+ * return `NULL`.
1582
+ * @virtual
1583
+ * @returns unanimated image representing the animation
1584
+ */
1585
+ vfunc_get_static_image(): Pixbuf
1586
+ /**
1587
+ * Checks whether the animation is a static image.
1588
+ *
1589
+ * If you load a file with gdk_pixbuf_animation_new_from_file() and it
1590
+ * turns out to be a plain, unanimated image, then this function will
1591
+ * return `TRUE`. Use gdk_pixbuf_animation_get_static_image() to retrieve
1592
+ * the image.
1593
+ * @virtual
1594
+ * @returns `TRUE` if the "animation" was really just an image
1595
+ */
1596
+ vfunc_is_static_image(): boolean
1597
+
1598
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1599
+
1600
+ connect(sigName: string, callback: (...args: any[]) => void): number
1601
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1602
+ emit(sigName: string, ...args: any[]): void
1603
+ disconnect(id: number): void
1604
+ }
1605
+
1606
+ /**
1607
+ * An opaque object representing an animation.
1608
+ *
1609
+ * The GdkPixBuf library provides a simple mechanism to load and
1610
+ * represent animations. An animation is conceptually a series of
1611
+ * frames to be displayed over time.
1612
+ *
1613
+ * The animation may not be represented as a series of frames
1614
+ * internally; for example, it may be stored as a sprite and
1615
+ * instructions for moving the sprite around a background.
1616
+ *
1617
+ * To display an animation you don't need to understand its
1618
+ * representation, however; you just ask `GdkPixbuf` what should
1619
+ * be displayed at a given point in time.
1620
+ * @class
1621
+ */
1622
+ export class PixbufAnimation extends GObject.Object {
1623
+
1624
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1625
+
1626
+ static name: string
1627
+ static $gtype: GObject.GType<PixbufAnimation>
1628
+
1629
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimation
1630
+
1631
+ constructor(config?: PixbufAnimation.ConstructorProperties)
1632
+ /**
1633
+ * Creates a new animation by loading it from a file.
1634
+ *
1635
+ * The file format is detected automatically.
1636
+ *
1637
+ * If the file's format does not support multi-frame images, then an animation
1638
+ * with a single frame will be created.
1639
+ *
1640
+ * Possible errors are in the `GDK_PIXBUF_ERROR` and `G_FILE_ERROR` domains.
1641
+ * @constructor
1642
+ * @param filename Name of file to load, in the GLib file name encoding
1643
+ * @returns A newly-created animation
1644
+ */
1645
+ static new_from_file(filename: string): PixbufAnimation
1646
+ /**
1647
+ * Creates a new pixbuf animation by loading an image from an resource.
1648
+ *
1649
+ * The file format is detected automatically. If `NULL` is returned, then
1650
+ * `error` will be set.
1651
+ * @constructor
1652
+ * @param resource_path the path of the resource file
1653
+ * @returns A newly-created animation
1654
+ */
1655
+ static new_from_resource(resource_path: string | null): PixbufAnimation
1656
+ /**
1657
+ * Creates a new animation by loading it from an input stream.
1658
+ *
1659
+ * The file format is detected automatically.
1660
+ *
1661
+ * If `NULL` is returned, then `error` will be set.
1662
+ *
1663
+ * The `cancellable` can be used to abort the operation from another thread.
1664
+ * If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` will be
1665
+ * returned. Other possible errors are in the `GDK_PIXBUF_ERROR` and
1666
+ * `G_IO_ERROR` domains.
1667
+ *
1668
+ * The stream is not closed.
1669
+ * @constructor
1670
+ * @param stream a `GInputStream` to load the pixbuf from
1671
+ * @param cancellable optional `GCancellable` object
1672
+ * @returns A newly-created animation
1673
+ */
1674
+ static new_from_stream(stream: Gio.InputStream, cancellable: Gio.Cancellable | null): PixbufAnimation
1675
+ /**
1676
+ * Finishes an asynchronous pixbuf animation creation operation started with
1677
+ * [func`GdkPixbuf`.PixbufAnimation.new_from_stream_async].
1678
+ * @constructor
1679
+ * @param async_result a #GAsyncResult
1680
+ * @returns the newly created animation
1681
+ */
1682
+ static new_from_stream_finish(async_result: Gio.AsyncResult): PixbufAnimation
1683
+ _init(config?: PixbufAnimation.ConstructorProperties): void
1684
+ /**
1685
+ * Creates a new animation by asynchronously loading an image from an input stream.
1686
+ *
1687
+ * For more details see gdk_pixbuf_new_from_stream(), which is the synchronous
1688
+ * version of this function.
1689
+ *
1690
+ * When the operation is finished, `callback` will be called in the main thread.
1691
+ * You can then call gdk_pixbuf_animation_new_from_stream_finish() to get the
1692
+ * result of the operation.
1693
+ * @param stream a #GInputStream from which to load the animation
1694
+ * @param cancellable optional #GCancellable object
1695
+ * @param callback a `GAsyncReadyCallback` to call when the pixbuf is loaded
1696
+ */
1697
+ static new_from_stream_async(stream: Gio.InputStream, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<PixbufAnimation> | null): void
1698
+ }
1699
+
1700
+ export module PixbufAnimationIter {
1701
+
1702
+ // Constructor properties interface
1703
+
1704
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1705
+ }
1706
+
1707
+ }
1708
+
1709
+ export interface PixbufAnimationIter {
1710
+
1711
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1712
+
1713
+ parent_instance: GObject.Object
1714
+
1715
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1716
+
1717
+ /**
1718
+ * Possibly advances an animation to a new frame.
1719
+ *
1720
+ * Chooses the frame based on the start time passed to
1721
+ * gdk_pixbuf_animation_get_iter().
1722
+ *
1723
+ * `current_time` would normally come from g_get_current_time(), and
1724
+ * must be greater than or equal to the time passed to
1725
+ * gdk_pixbuf_animation_get_iter(), and must increase or remain
1726
+ * unchanged each time gdk_pixbuf_animation_iter_get_pixbuf() is
1727
+ * called. That is, you can't go backward in time; animations only
1728
+ * play forward.
1729
+ *
1730
+ * As a shortcut, pass `NULL` for the current time and g_get_current_time()
1731
+ * will be invoked on your behalf. So you only need to explicitly pass
1732
+ * `current_time` if you're doing something odd like playing the animation
1733
+ * at double speed.
1734
+ *
1735
+ * If this function returns `FALSE`, there's no need to update the animation
1736
+ * display, assuming the display had been rendered prior to advancing;
1737
+ * if `TRUE`, you need to call gdk_pixbuf_animation_iter_get_pixbuf()
1738
+ * and update the display with the new pixbuf.
1739
+ * @param current_time current time
1740
+ * @returns `TRUE` if the image may need updating
1741
+ */
1742
+ advance(current_time: GLib.TimeVal | null): boolean
1743
+ /**
1744
+ * Gets the number of milliseconds the current pixbuf should be displayed,
1745
+ * or -1 if the current pixbuf should be displayed forever.
1746
+ *
1747
+ * The `g_timeout_add()` function conveniently takes a timeout in milliseconds,
1748
+ * so you can use a timeout to schedule the next update.
1749
+ *
1750
+ * Note that some formats, like GIF, might clamp the timeout values in the
1751
+ * image file to avoid updates that are just too quick. The minimum timeout
1752
+ * for GIF images is currently 20 milliseconds.
1753
+ * @returns delay time in milliseconds (thousandths of a second)
1754
+ */
1755
+ get_delay_time(): number
1756
+ /**
1757
+ * Gets the current pixbuf which should be displayed.
1758
+ *
1759
+ * The pixbuf might not be the same size as the animation itself
1760
+ * (gdk_pixbuf_animation_get_width(), gdk_pixbuf_animation_get_height()).
1761
+ *
1762
+ * This pixbuf should be displayed for gdk_pixbuf_animation_iter_get_delay_time()
1763
+ * milliseconds.
1764
+ *
1765
+ * The caller of this function does not own a reference to the returned
1766
+ * pixbuf; the returned pixbuf will become invalid when the iterator
1767
+ * advances to the next frame, which may happen anytime you call
1768
+ * gdk_pixbuf_animation_iter_advance().
1769
+ *
1770
+ * Copy the pixbuf to keep it (don't just add a reference), as it may get
1771
+ * recycled as you advance the iterator.
1772
+ * @returns the pixbuf to be displayed
1773
+ */
1774
+ get_pixbuf(): Pixbuf
1775
+ /**
1776
+ * Used to determine how to respond to the area_updated signal on
1777
+ * #GdkPixbufLoader when loading an animation.
1778
+ *
1779
+ * The `::area_updated` signal is emitted for an area of the frame currently
1780
+ * streaming in to the loader. So if you're on the currently loading frame,
1781
+ * you will need to redraw the screen for the updated area.
1782
+ * @returns `TRUE` if the frame we're on is partially loaded, or the last frame
1783
+ */
1784
+ on_currently_loading_frame(): boolean
1785
+
1786
+ // Own virtual methods of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1787
+
1788
+ /**
1789
+ * Possibly advances an animation to a new frame.
1790
+ *
1791
+ * Chooses the frame based on the start time passed to
1792
+ * gdk_pixbuf_animation_get_iter().
1793
+ *
1794
+ * `current_time` would normally come from g_get_current_time(), and
1795
+ * must be greater than or equal to the time passed to
1796
+ * gdk_pixbuf_animation_get_iter(), and must increase or remain
1797
+ * unchanged each time gdk_pixbuf_animation_iter_get_pixbuf() is
1798
+ * called. That is, you can't go backward in time; animations only
1799
+ * play forward.
1800
+ *
1801
+ * As a shortcut, pass `NULL` for the current time and g_get_current_time()
1802
+ * will be invoked on your behalf. So you only need to explicitly pass
1803
+ * `current_time` if you're doing something odd like playing the animation
1804
+ * at double speed.
1805
+ *
1806
+ * If this function returns `FALSE`, there's no need to update the animation
1807
+ * display, assuming the display had been rendered prior to advancing;
1808
+ * if `TRUE`, you need to call gdk_pixbuf_animation_iter_get_pixbuf()
1809
+ * and update the display with the new pixbuf.
1810
+ * @virtual
1811
+ * @param current_time current time
1812
+ * @returns `TRUE` if the image may need updating
1813
+ */
1814
+ vfunc_advance(current_time: GLib.TimeVal | null): boolean
1815
+ /**
1816
+ * Gets the number of milliseconds the current pixbuf should be displayed,
1817
+ * or -1 if the current pixbuf should be displayed forever.
1818
+ *
1819
+ * The `g_timeout_add()` function conveniently takes a timeout in milliseconds,
1820
+ * so you can use a timeout to schedule the next update.
1821
+ *
1822
+ * Note that some formats, like GIF, might clamp the timeout values in the
1823
+ * image file to avoid updates that are just too quick. The minimum timeout
1824
+ * for GIF images is currently 20 milliseconds.
1825
+ * @virtual
1826
+ * @returns delay time in milliseconds (thousandths of a second)
1827
+ */
1828
+ vfunc_get_delay_time(): number
1829
+ /**
1830
+ * Gets the current pixbuf which should be displayed.
1831
+ *
1832
+ * The pixbuf might not be the same size as the animation itself
1833
+ * (gdk_pixbuf_animation_get_width(), gdk_pixbuf_animation_get_height()).
1834
+ *
1835
+ * This pixbuf should be displayed for gdk_pixbuf_animation_iter_get_delay_time()
1836
+ * milliseconds.
1837
+ *
1838
+ * The caller of this function does not own a reference to the returned
1839
+ * pixbuf; the returned pixbuf will become invalid when the iterator
1840
+ * advances to the next frame, which may happen anytime you call
1841
+ * gdk_pixbuf_animation_iter_advance().
1842
+ *
1843
+ * Copy the pixbuf to keep it (don't just add a reference), as it may get
1844
+ * recycled as you advance the iterator.
1845
+ * @virtual
1846
+ * @returns the pixbuf to be displayed
1847
+ */
1848
+ vfunc_get_pixbuf(): Pixbuf
1849
+ /**
1850
+ * Used to determine how to respond to the area_updated signal on
1851
+ * #GdkPixbufLoader when loading an animation.
1852
+ *
1853
+ * The `::area_updated` signal is emitted for an area of the frame currently
1854
+ * streaming in to the loader. So if you're on the currently loading frame,
1855
+ * you will need to redraw the screen for the updated area.
1856
+ * @virtual
1857
+ * @returns `TRUE` if the frame we're on is partially loaded, or the last frame
1858
+ */
1859
+ vfunc_on_currently_loading_frame(): boolean
1860
+
1861
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1862
+
1863
+ connect(sigName: string, callback: (...args: any[]) => void): number
1864
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1865
+ emit(sigName: string, ...args: any[]): void
1866
+ disconnect(id: number): void
1867
+ }
1868
+
1869
+ /**
1870
+ * An opaque object representing an iterator which points to a
1871
+ * certain position in an animation.
1872
+ * @class
1873
+ */
1874
+ export class PixbufAnimationIter extends GObject.Object {
1875
+
1876
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1877
+
1878
+ static name: string
1879
+ static $gtype: GObject.GType<PixbufAnimationIter>
1880
+
1881
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIter
1882
+
1883
+ constructor(config?: PixbufAnimationIter.ConstructorProperties)
1884
+ _init(config?: PixbufAnimationIter.ConstructorProperties): void
1885
+ }
1886
+
1887
+ export module PixbufLoader {
1888
+
1889
+ // Signal callback interfaces
1890
+
1891
+ /**
1892
+ * Signal callback interface for `area-prepared`
1893
+ */
1894
+ export interface AreaPreparedSignalCallback {
1895
+ ($obj: PixbufLoader): void
1896
+ }
1897
+
1898
+ /**
1899
+ * Signal callback interface for `area-updated`
1900
+ */
1901
+ export interface AreaUpdatedSignalCallback {
1902
+ ($obj: PixbufLoader, x: number, y: number, width: number, height: number): void
1903
+ }
1904
+
1905
+ /**
1906
+ * Signal callback interface for `closed`
1907
+ */
1908
+ export interface ClosedSignalCallback {
1909
+ ($obj: PixbufLoader): void
1910
+ }
1911
+
1912
+ /**
1913
+ * Signal callback interface for `size-prepared`
1914
+ */
1915
+ export interface SizePreparedSignalCallback {
1916
+ ($obj: PixbufLoader, width: number, height: number): void
1917
+ }
1918
+
1919
+
1920
+ // Constructor properties interface
1921
+
1922
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1923
+ }
1924
+
1925
+ }
1926
+
1927
+ export interface PixbufLoader {
1928
+
1929
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
1930
+
1931
+ /**
1932
+ * Informs a pixbuf loader that no further writes with
1933
+ * gdk_pixbuf_loader_write() will occur, so that it can free its
1934
+ * internal loading structures.
1935
+ *
1936
+ * This function also tries to parse any data that hasn't yet been parsed;
1937
+ * if the remaining data is partial or corrupt, an error will be returned.
1938
+ *
1939
+ * If `FALSE` is returned, `error` will be set to an error from the
1940
+ * `GDK_PIXBUF_ERROR` or `G_FILE_ERROR` domains.
1941
+ *
1942
+ * If you're just cancelling a load rather than expecting it to be finished,
1943
+ * passing `NULL` for `error` to ignore it is reasonable.
1944
+ *
1945
+ * Remember that this function does not release a reference on the loader, so
1946
+ * you will need to explicitly release any reference you hold.
1947
+ * @returns `TRUE` if all image data written so far was successfully passed out via the update_area signal
1948
+ */
1949
+ close(): boolean
1950
+ /**
1951
+ * Queries the #GdkPixbufAnimation that a pixbuf loader is currently creating.
1952
+ *
1953
+ * In general it only makes sense to call this function after the
1954
+ * [signal`GdkPixbuf`.PixbufLoader::area-prepared] signal has been emitted by
1955
+ * the loader.
1956
+ *
1957
+ * If the loader doesn't have enough bytes yet, and hasn't emitted the `area-prepared`
1958
+ * signal, this function will return `NULL`.
1959
+ * @returns The animation that the loader is currently loading
1960
+ */
1961
+ get_animation(): PixbufAnimation | null
1962
+ /**
1963
+ * Obtains the available information about the format of the
1964
+ * currently loading image file.
1965
+ * @returns A #GdkPixbufFormat
1966
+ */
1967
+ get_format(): PixbufFormat | null
1968
+ /**
1969
+ * Queries the #GdkPixbuf that a pixbuf loader is currently creating.
1970
+ *
1971
+ * In general it only makes sense to call this function after the
1972
+ * [signal`GdkPixbuf`.PixbufLoader::area-prepared] signal has been
1973
+ * emitted by the loader; this means that enough data has been read
1974
+ * to know the size of the image that will be allocated.
1975
+ *
1976
+ * If the loader has not received enough data via gdk_pixbuf_loader_write(),
1977
+ * then this function returns `NULL`.
1978
+ *
1979
+ * The returned pixbuf will be the same in all future calls to the loader,
1980
+ * so if you want to keep using it, you should acquire a reference to it.
1981
+ *
1982
+ * Additionally, if the loader is an animation, it will return the "static
1983
+ * image" of the animation (see gdk_pixbuf_animation_get_static_image()).
1984
+ * @returns The pixbuf that the loader is creating
1985
+ */
1986
+ get_pixbuf(): Pixbuf | null
1987
+ /**
1988
+ * Causes the image to be scaled while it is loaded.
1989
+ *
1990
+ * The desired image size can be determined relative to the original
1991
+ * size of the image by calling gdk_pixbuf_loader_set_size() from a
1992
+ * signal handler for the ::size-prepared signal.
1993
+ *
1994
+ * Attempts to set the desired image size are ignored after the
1995
+ * emission of the ::size-prepared signal.
1996
+ * @param width The desired width of the image being loaded.
1997
+ * @param height The desired height of the image being loaded.
1998
+ */
1999
+ set_size(width: number, height: number): void
2000
+ /**
2001
+ * Parses the next `count` bytes in the given image buffer.
2002
+ * @param buf Pointer to image data.
2003
+ * @returns `TRUE` if the write was successful, or `FALSE` if the loader cannot parse the buffer
2004
+ */
2005
+ write(buf: Uint8Array): boolean
2006
+ /**
2007
+ * Parses the next contents of the given image buffer.
2008
+ * @param buffer The image data as a `GBytes` buffer.
2009
+ * @returns `TRUE` if the write was successful, or `FALSE` if the loader cannot parse the buffer
2010
+ */
2011
+ write_bytes(buffer: GLib.Bytes): boolean
2012
+
2013
+ // Own virtual methods of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
2014
+
2015
+ vfunc_area_prepared(): void
2016
+ vfunc_area_updated(x: number, y: number, width: number, height: number): void
2017
+ vfunc_closed(): void
2018
+ vfunc_size_prepared(width: number, height: number): void
2019
+
2020
+ // Own signals of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
2021
+
2022
+ connect(sigName: "area-prepared", callback: PixbufLoader.AreaPreparedSignalCallback): number
2023
+ connect_after(sigName: "area-prepared", callback: PixbufLoader.AreaPreparedSignalCallback): number
2024
+ emit(sigName: "area-prepared", ...args: any[]): void
2025
+ connect(sigName: "area-updated", callback: PixbufLoader.AreaUpdatedSignalCallback): number
2026
+ connect_after(sigName: "area-updated", callback: PixbufLoader.AreaUpdatedSignalCallback): number
2027
+ emit(sigName: "area-updated", x: number, y: number, width: number, height: number, ...args: any[]): void
2028
+ connect(sigName: "closed", callback: PixbufLoader.ClosedSignalCallback): number
2029
+ connect_after(sigName: "closed", callback: PixbufLoader.ClosedSignalCallback): number
2030
+ emit(sigName: "closed", ...args: any[]): void
2031
+ connect(sigName: "size-prepared", callback: PixbufLoader.SizePreparedSignalCallback): number
2032
+ connect_after(sigName: "size-prepared", callback: PixbufLoader.SizePreparedSignalCallback): number
2033
+ emit(sigName: "size-prepared", width: number, height: number, ...args: any[]): void
2034
+
2035
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
2036
+
2037
+ connect(sigName: string, callback: (...args: any[]) => void): number
2038
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2039
+ emit(sigName: string, ...args: any[]): void
2040
+ disconnect(id: number): void
2041
+ }
2042
+
2043
+ /**
2044
+ * Incremental image loader.
2045
+ *
2046
+ * `GdkPixbufLoader` provides a way for applications to drive the
2047
+ * process of loading an image, by letting them send the image data
2048
+ * directly to the loader instead of having the loader read the data
2049
+ * from a file. Applications can use this functionality instead of
2050
+ * `gdk_pixbuf_new_from_file()` or `gdk_pixbuf_animation_new_from_file()`
2051
+ * when they need to parse image data in small chunks. For example,
2052
+ * it should be used when reading an image from a (potentially) slow
2053
+ * network connection, or when loading an extremely large file.
2054
+ *
2055
+ * To use `GdkPixbufLoader` to load an image, create a new instance,
2056
+ * and call [method`GdkPixbuf`.PixbufLoader.write] to send the data
2057
+ * to it. When done, [method`GdkPixbuf`.PixbufLoader.close] should be
2058
+ * called to end the stream and finalize everything.
2059
+ *
2060
+ * The loader will emit three important signals throughout the process:
2061
+ *
2062
+ * - [signal`GdkPixbuf`.PixbufLoader::size-prepared] will be emitted as
2063
+ * soon as the image has enough information to determine the size of
2064
+ * the image to be used. If you want to scale the image while loading
2065
+ * it, you can call [method`GdkPixbuf`.PixbufLoader.set_size] in
2066
+ * response to this signal.
2067
+ * - [signal`GdkPixbuf`.PixbufLoader::area-prepared] will be emitted as
2068
+ * soon as the pixbuf of the desired has been allocated. You can obtain
2069
+ * the `GdkPixbuf` instance by calling [method`GdkPixbuf`.PixbufLoader.get_pixbuf].
2070
+ * If you want to use it, simply acquire a reference to it. You can
2071
+ * also call `gdk_pixbuf_loader_get_pixbuf()` later to get the same
2072
+ * pixbuf.
2073
+ * - [signal`GdkPixbuf`.PixbufLoader::area-updated] will be emitted every
2074
+ * time a region is updated. This way you can update a partially
2075
+ * completed image. Note that you do not know anything about the
2076
+ * completeness of an image from the updated area. For example, in an
2077
+ * interlaced image you will need to make several passes before the
2078
+ * image is done loading.
2079
+ *
2080
+ * ## Loading an animation
2081
+ *
2082
+ * Loading an animation is almost as easy as loading an image. Once the
2083
+ * first [signal`GdkPixbuf`.PixbufLoader::area-prepared] signal has been
2084
+ * emitted, you can call [method`GdkPixbuf`.PixbufLoader.get_animation] to
2085
+ * get the [class`GdkPixbuf`.PixbufAnimation] instance, and then call
2086
+ * and [method`GdkPixbuf`.PixbufAnimation.get_iter] to get a
2087
+ * [class`GdkPixbuf`.PixbufAnimationIter] to retrieve the pixbuf for the
2088
+ * desired time stamp.
2089
+ * @class
2090
+ */
2091
+ export class PixbufLoader extends GObject.Object {
2092
+
2093
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
2094
+
2095
+ static name: string
2096
+ static $gtype: GObject.GType<PixbufLoader>
2097
+
2098
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufLoader
2099
+
2100
+ constructor(config?: PixbufLoader.ConstructorProperties)
2101
+ /**
2102
+ * Creates a new pixbuf loader object.
2103
+ * @constructor
2104
+ * @returns A newly-created pixbuf loader.
2105
+ */
2106
+ constructor()
2107
+ /**
2108
+ * Creates a new pixbuf loader object.
2109
+ * @constructor
2110
+ * @returns A newly-created pixbuf loader.
2111
+ */
2112
+ static new(): PixbufLoader
2113
+ /**
2114
+ * Creates a new pixbuf loader object that always attempts to parse
2115
+ * image data as if it were an image of MIME type `mime_type,` instead of
2116
+ * identifying the type automatically.
2117
+ *
2118
+ * This function is useful if you want an error if the image isn't the
2119
+ * expected MIME type; for loading image formats that can't be reliably
2120
+ * identified by looking at the data; or if the user manually forces a
2121
+ * specific MIME type.
2122
+ *
2123
+ * The list of supported mime types depends on what image loaders
2124
+ * are installed, but typically "image/png", "image/jpeg", "image/gif",
2125
+ * "image/tiff" and "image/x-xpixmap" are among the supported mime types.
2126
+ * To obtain the full list of supported mime types, call
2127
+ * gdk_pixbuf_format_get_mime_types() on each of the #GdkPixbufFormat
2128
+ * structs returned by gdk_pixbuf_get_formats().
2129
+ * @constructor
2130
+ * @param mime_type the mime type to be loaded
2131
+ * @returns A newly-created pixbuf loader.
2132
+ */
2133
+ static new_with_mime_type(mime_type: string | null): PixbufLoader
2134
+ /**
2135
+ * Creates a new pixbuf loader object that always attempts to parse
2136
+ * image data as if it were an image of type `image_type,` instead of
2137
+ * identifying the type automatically.
2138
+ *
2139
+ * This function is useful if you want an error if the image isn't the
2140
+ * expected type; for loading image formats that can't be reliably
2141
+ * identified by looking at the data; or if the user manually forces
2142
+ * a specific type.
2143
+ *
2144
+ * The list of supported image formats depends on what image loaders
2145
+ * are installed, but typically "png", "jpeg", "gif", "tiff" and
2146
+ * "xpm" are among the supported formats. To obtain the full list of
2147
+ * supported image formats, call gdk_pixbuf_format_get_name() on each
2148
+ * of the #GdkPixbufFormat structs returned by gdk_pixbuf_get_formats().
2149
+ * @constructor
2150
+ * @param image_type name of the image format to be loaded with the image
2151
+ * @returns A newly-created pixbuf loader.
2152
+ */
2153
+ static new_with_type(image_type: string | null): PixbufLoader
2154
+ _init(config?: PixbufLoader.ConstructorProperties): void
2155
+ }
2156
+
2157
+ export module PixbufNonAnim {
2158
+
2159
+ // Constructor properties interface
2160
+
2161
+ export interface ConstructorProperties extends PixbufAnimation.ConstructorProperties {
2162
+ }
2163
+
2164
+ }
2165
+
2166
+ export interface PixbufNonAnim {
2167
+
2168
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufNonAnim
2169
+
2170
+ connect(sigName: string, callback: (...args: any[]) => void): number
2171
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2172
+ emit(sigName: string, ...args: any[]): void
2173
+ disconnect(id: number): void
2174
+ }
2175
+
2176
+ export class PixbufNonAnim extends PixbufAnimation {
2177
+
2178
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufNonAnim
2179
+
2180
+ static name: string
2181
+ static $gtype: GObject.GType<PixbufNonAnim>
2182
+
2183
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufNonAnim
2184
+
2185
+ constructor(config?: PixbufNonAnim.ConstructorProperties)
2186
+ constructor(pixbuf: Pixbuf)
2187
+ static new(pixbuf: Pixbuf): PixbufNonAnim
2188
+ _init(config?: PixbufNonAnim.ConstructorProperties): void
2189
+ }
2190
+
2191
+ export module PixbufSimpleAnim {
2192
+
2193
+ // Constructor properties interface
2194
+
2195
+ export interface ConstructorProperties extends PixbufAnimation.ConstructorProperties {
2196
+
2197
+ // Own constructor properties of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2198
+
2199
+ /**
2200
+ * Whether the animation should loop when it reaches the end.
2201
+ */
2202
+ loop?: boolean | null
2203
+ }
2204
+
2205
+ }
2206
+
2207
+ export interface PixbufSimpleAnim {
2208
+
2209
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2210
+
2211
+ /**
2212
+ * Whether the animation should loop when it reaches the end.
2213
+ */
2214
+ loop: boolean
2215
+
2216
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2217
+
2218
+ /**
2219
+ * Adds a new frame to `animation`. The `pixbuf` must
2220
+ * have the dimensions specified when the animation
2221
+ * was constructed.
2222
+ * @param pixbuf the pixbuf to add
2223
+ */
2224
+ add_frame(pixbuf: Pixbuf): void
2225
+ /**
2226
+ * Gets whether `animation` should loop indefinitely when it reaches the end.
2227
+ * @returns %TRUE if the animation loops forever, %FALSE otherwise
2228
+ */
2229
+ get_loop(): boolean
2230
+ /**
2231
+ * Sets whether `animation` should loop indefinitely when it reaches the end.
2232
+ * @param loop whether to loop the animation
2233
+ */
2234
+ set_loop(loop: boolean): void
2235
+
2236
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2237
+
2238
+ connect(sigName: "notify::loop", callback: (($obj: PixbufSimpleAnim, pspec: GObject.ParamSpec) => void)): number
2239
+ connect_after(sigName: "notify::loop", callback: (($obj: PixbufSimpleAnim, pspec: GObject.ParamSpec) => void)): number
2240
+ emit(sigName: "notify::loop", ...args: any[]): void
2241
+ connect(sigName: string, callback: (...args: any[]) => void): number
2242
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2243
+ emit(sigName: string, ...args: any[]): void
2244
+ disconnect(id: number): void
2245
+ }
2246
+
2247
+ /**
2248
+ * An opaque struct representing a simple animation.
2249
+ * @class
2250
+ */
2251
+ export class PixbufSimpleAnim extends PixbufAnimation {
2252
+
2253
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2254
+
2255
+ static name: string
2256
+ static $gtype: GObject.GType<PixbufSimpleAnim>
2257
+
2258
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnim
2259
+
2260
+ constructor(config?: PixbufSimpleAnim.ConstructorProperties)
2261
+ /**
2262
+ * Creates a new, empty animation.
2263
+ * @constructor
2264
+ * @param width the width of the animation
2265
+ * @param height the height of the animation
2266
+ * @param rate the speed of the animation, in frames per second
2267
+ * @returns a newly allocated #GdkPixbufSimpleAnim
2268
+ */
2269
+ constructor(width: number, height: number, rate: number)
2270
+ /**
2271
+ * Creates a new, empty animation.
2272
+ * @constructor
2273
+ * @param width the width of the animation
2274
+ * @param height the height of the animation
2275
+ * @param rate the speed of the animation, in frames per second
2276
+ * @returns a newly allocated #GdkPixbufSimpleAnim
2277
+ */
2278
+ static new(width: number, height: number, rate: number): PixbufSimpleAnim
2279
+ _init(config?: PixbufSimpleAnim.ConstructorProperties): void
2280
+ }
2281
+
2282
+ export module PixbufSimpleAnimIter {
2283
+
2284
+ // Constructor properties interface
2285
+
2286
+ export interface ConstructorProperties extends PixbufAnimationIter.ConstructorProperties {
2287
+ }
2288
+
2289
+ }
2290
+
2291
+ export interface PixbufSimpleAnimIter {
2292
+
2293
+ // Class property signals of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnimIter
2294
+
2295
+ connect(sigName: string, callback: (...args: any[]) => void): number
2296
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2297
+ emit(sigName: string, ...args: any[]): void
2298
+ disconnect(id: number): void
2299
+ }
2300
+
2301
+ export class PixbufSimpleAnimIter extends PixbufAnimationIter {
2302
+
2303
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnimIter
2304
+
2305
+ static name: string
2306
+ static $gtype: GObject.GType<PixbufSimpleAnimIter>
2307
+
2308
+ // Constructors of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnimIter
2309
+
2310
+ constructor(config?: PixbufSimpleAnimIter.ConstructorProperties)
2311
+ _init(config?: PixbufSimpleAnimIter.ConstructorProperties): void
2312
+ }
2313
+
2314
+ export interface PixbufAnimationClass {
2315
+
2316
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationClass
2317
+
2318
+ /**
2319
+ * the parent class
2320
+ * @field
2321
+ */
2322
+ parent_class: GObject.ObjectClass
2323
+ is_static_image: (animation: PixbufAnimation) => boolean
2324
+ get_static_image: (animation: PixbufAnimation) => Pixbuf
2325
+ get_size: (animation: PixbufAnimation, width: number, height: number) => void
2326
+ get_iter: (animation: PixbufAnimation, start_time: GLib.TimeVal | null) => PixbufAnimationIter
2327
+ }
2328
+
2329
+ /**
2330
+ * Modules supporting animations must derive a type from
2331
+ * #GdkPixbufAnimation, providing suitable implementations of the
2332
+ * virtual functions.
2333
+ * @record
2334
+ */
2335
+ export abstract class PixbufAnimationClass {
2336
+
2337
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationClass
2338
+
2339
+ static name: string
2340
+ }
2341
+
2342
+ export interface PixbufAnimationIterClass {
2343
+
2344
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIterClass
2345
+
2346
+ /**
2347
+ * the parent class
2348
+ * @field
2349
+ */
2350
+ parent_class: GObject.ObjectClass
2351
+ get_delay_time: (iter: PixbufAnimationIter) => number
2352
+ get_pixbuf: (iter: PixbufAnimationIter) => Pixbuf
2353
+ on_currently_loading_frame: (iter: PixbufAnimationIter) => boolean
2354
+ advance: (iter: PixbufAnimationIter, current_time: GLib.TimeVal | null) => boolean
2355
+ }
2356
+
2357
+ /**
2358
+ * Modules supporting animations must derive a type from
2359
+ * #GdkPixbufAnimationIter, providing suitable implementations of the
2360
+ * virtual functions.
2361
+ * @record
2362
+ */
2363
+ export abstract class PixbufAnimationIterClass {
2364
+
2365
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufAnimationIterClass
2366
+
2367
+ static name: string
2368
+ }
2369
+
2370
+ export interface PixbufFormat {
2371
+
2372
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufFormat
2373
+
2374
+ /**
2375
+ * the name of the image format
2376
+ * @field
2377
+ */
2378
+ name: string | null
2379
+ /**
2380
+ * the signature of the module
2381
+ * @field
2382
+ */
2383
+ signature: PixbufModulePattern
2384
+ /**
2385
+ * the message domain for the `description`
2386
+ * @field
2387
+ */
2388
+ domain: string | null
2389
+ /**
2390
+ * a description of the image format
2391
+ * @field
2392
+ */
2393
+ description: string | null
2394
+ /**
2395
+ * the MIME types for the image format
2396
+ * @field
2397
+ */
2398
+ mime_types: string[]
2399
+ /**
2400
+ * typical filename extensions for the
2401
+ * image format
2402
+ * @field
2403
+ */
2404
+ extensions: string[]
2405
+ /**
2406
+ * a combination of `GdkPixbufFormatFlags`
2407
+ * @field
2408
+ */
2409
+ flags: number
2410
+ /**
2411
+ * a boolean determining whether the loader is disabled`
2412
+ * @field
2413
+ */
2414
+ disabled: boolean
2415
+ /**
2416
+ * a string containing license information, typically set to
2417
+ * shorthands like "GPL", "LGPL", etc.
2418
+ * @field
2419
+ */
2420
+ license: string | null
2421
+
2422
+ // Owm methods of GdkPixbuf-2.0.GdkPixbuf.PixbufFormat
2423
+
2424
+ /**
2425
+ * Creates a copy of `format`.
2426
+ * @returns the newly allocated copy of a `GdkPixbufFormat`. Use gdk_pixbuf_format_free() to free the resources when done
2427
+ */
2428
+ copy(): PixbufFormat
2429
+ /**
2430
+ * Frees the resources allocated when copying a `GdkPixbufFormat`
2431
+ * using gdk_pixbuf_format_copy()
2432
+ */
2433
+ free(): void
2434
+ /**
2435
+ * Returns a description of the format.
2436
+ * @returns a description of the format.
2437
+ */
2438
+ get_description(): string | null
2439
+ /**
2440
+ * Returns the filename extensions typically used for files in the
2441
+ * given format.
2442
+ * @returns an array of filename extensions
2443
+ */
2444
+ get_extensions(): string[]
2445
+ /**
2446
+ * Returns information about the license of the image loader for the format.
2447
+ *
2448
+ * The returned string should be a shorthand for a well known license, e.g.
2449
+ * "LGPL", "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license.
2450
+ * @returns a string describing the license of the pixbuf format
2451
+ */
2452
+ get_license(): string | null
2453
+ /**
2454
+ * Returns the mime types supported by the format.
2455
+ * @returns an array of mime types
2456
+ */
2457
+ get_mime_types(): string[]
2458
+ /**
2459
+ * Returns the name of the format.
2460
+ * @returns the name of the format.
2461
+ */
2462
+ get_name(): string | null
2463
+ /**
2464
+ * Returns whether this image format is disabled.
2465
+ *
2466
+ * See gdk_pixbuf_format_set_disabled().
2467
+ * @returns whether this image format is disabled.
2468
+ */
2469
+ is_disabled(): boolean
2470
+ /**
2471
+ * Returns `TRUE` if the save option specified by `option_key` is supported when
2472
+ * saving a pixbuf using the module implementing `format`.
2473
+ *
2474
+ * See gdk_pixbuf_save() for more information about option keys.
2475
+ * @param option_key the name of an option
2476
+ * @returns `TRUE` if the specified option is supported
2477
+ */
2478
+ is_save_option_supported(option_key: string | null): boolean
2479
+ /**
2480
+ * Returns whether this image format is scalable.
2481
+ *
2482
+ * If a file is in a scalable format, it is preferable to load it at
2483
+ * the desired size, rather than loading it at the default size and
2484
+ * scaling the resulting pixbuf to the desired size.
2485
+ * @returns whether this image format is scalable.
2486
+ */
2487
+ is_scalable(): boolean
2488
+ /**
2489
+ * Returns whether pixbufs can be saved in the given format.
2490
+ * @returns whether pixbufs can be saved in the given format.
2491
+ */
2492
+ is_writable(): boolean
2493
+ /**
2494
+ * Disables or enables an image format.
2495
+ *
2496
+ * If a format is disabled, GdkPixbuf won't use the image loader for
2497
+ * this format to load images.
2498
+ *
2499
+ * Applications can use this to avoid using image loaders with an
2500
+ * inappropriate license, see gdk_pixbuf_format_get_license().
2501
+ * @param disabled `TRUE` to disable the format `format`
2502
+ */
2503
+ set_disabled(disabled: boolean): void
2504
+ }
2505
+
2506
+ /**
2507
+ * A `GdkPixbufFormat` contains information about the image format accepted
2508
+ * by a module.
2509
+ *
2510
+ * Only modules should access the fields directly, applications should
2511
+ * use the `gdk_pixbuf_format_*` family of functions.
2512
+ * @record
2513
+ */
2514
+ export class PixbufFormat {
2515
+
2516
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufFormat
2517
+
2518
+ static name: string
2519
+ }
2520
+
2521
+ export interface PixbufLoaderClass {
2522
+
2523
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufLoaderClass
2524
+
2525
+ parent_class: GObject.ObjectClass
2526
+ size_prepared: (loader: PixbufLoader, width: number, height: number) => void
2527
+ area_prepared: (loader: PixbufLoader) => void
2528
+ area_updated: (loader: PixbufLoader, x: number, y: number, width: number, height: number) => void
2529
+ closed: (loader: PixbufLoader) => void
2530
+ }
2531
+
2532
+ export abstract class PixbufLoaderClass {
2533
+
2534
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufLoaderClass
2535
+
2536
+ static name: string
2537
+ }
2538
+
2539
+ export interface PixbufModule {
2540
+
2541
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufModule
2542
+
2543
+ /**
2544
+ * the name of the module, usually the same as the
2545
+ * usual file extension for images of this type, eg. "xpm", "jpeg" or "png".
2546
+ * @field
2547
+ */
2548
+ module_name: string | null
2549
+ /**
2550
+ * the path from which the module is loaded.
2551
+ * @field
2552
+ */
2553
+ module_path: string | null
2554
+ /**
2555
+ * the loaded `GModule`.
2556
+ * @field
2557
+ */
2558
+ module: GModule.Module
2559
+ /**
2560
+ * a `GdkPixbufFormat` holding information about the module.
2561
+ * @field
2562
+ */
2563
+ info: PixbufFormat
2564
+ stop_load: (context: any) => boolean
2565
+ load_increment: (context: any, buf: number, size: number) => boolean
2566
+ save: (f: any, pixbuf: Pixbuf, param_keys: string | null, param_values: string | null) => boolean
2567
+ is_save_option_supported: (option_key: string | null) => boolean
2568
+ }
2569
+
2570
+ /**
2571
+ * A `GdkPixbufModule` contains the necessary functions to load and save
2572
+ * images in a certain file format.
2573
+ *
2574
+ * If `GdkPixbuf` has been compiled with `GModule` support, it can be extended
2575
+ * by modules which can load (and perhaps also save) new image and animation
2576
+ * formats.
2577
+ *
2578
+ * ## Implementing modules
2579
+ *
2580
+ * The `GdkPixbuf` interfaces needed for implementing modules are contained in
2581
+ * `gdk-pixbuf-io.h` (and `gdk-pixbuf-animation.h` if the module supports
2582
+ * animations). They are not covered by the same stability guarantees as the
2583
+ * regular GdkPixbuf API. To underline this fact, they are protected by the
2584
+ * `GDK_PIXBUF_ENABLE_BACKEND` pre-processor symbol.
2585
+ *
2586
+ * Each loadable module must contain a `GdkPixbufModuleFillVtableFunc` function
2587
+ * named `fill_vtable`, which will get called when the module
2588
+ * is loaded and must set the function pointers of the `GdkPixbufModule`.
2589
+ *
2590
+ * In order to make format-checking work before actually loading the modules
2591
+ * (which may require calling `dlopen` to load image libraries), modules export
2592
+ * their signatures (and other information) via the `fill_info` function. An
2593
+ * external utility, `gdk-pixbuf-query-loaders`, uses this to create a text
2594
+ * file containing a list of all available loaders and their signatures.
2595
+ * This file is then read at runtime by `GdkPixbuf` to obtain the list of
2596
+ * available loaders and their signatures.
2597
+ *
2598
+ * Modules may only implement a subset of the functionality available via
2599
+ * `GdkPixbufModule`. If a particular functionality is not implemented, the
2600
+ * `fill_vtable` function will simply not set the corresponding
2601
+ * function pointers of the `GdkPixbufModule` structure. If a module supports
2602
+ * incremental loading (i.e. provides `begin_load`, `stop_load` and
2603
+ * `load_increment`), it doesn't have to implement `load`, since `GdkPixbuf`
2604
+ * can supply a generic `load` implementation wrapping the incremental loading.
2605
+ *
2606
+ * ## Installing modules
2607
+ *
2608
+ * Installing a module is a two-step process:
2609
+ *
2610
+ * - copy the module file(s) to the loader directory (normally
2611
+ * `$libdir/gdk-pixbuf-2.0/$version/loaders`, unless overridden by the
2612
+ * environment variable `GDK_PIXBUF_MODULEDIR`)
2613
+ * - call `gdk-pixbuf-query-loaders` to update the module file (normally
2614
+ * `$libdir/gdk-pixbuf-2.0/$version/loaders.cache`, unless overridden
2615
+ * by the environment variable `GDK_PIXBUF_MODULE_FILE`)
2616
+ * @record
2617
+ */
2618
+ export class PixbufModule {
2619
+
2620
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufModule
2621
+
2622
+ static name: string
2623
+ }
2624
+
2625
+ export interface PixbufModulePattern {
2626
+
2627
+ // Own fields of GdkPixbuf-2.0.GdkPixbuf.PixbufModulePattern
2628
+
2629
+ /**
2630
+ * the prefix for this pattern
2631
+ * @field
2632
+ */
2633
+ prefix: string | null
2634
+ /**
2635
+ * mask containing bytes which modify how the prefix is matched against
2636
+ * test data
2637
+ * @field
2638
+ */
2639
+ mask: string | null
2640
+ /**
2641
+ * relevance of this pattern
2642
+ * @field
2643
+ */
2644
+ relevance: number
2645
+ }
2646
+
2647
+ /**
2648
+ * The signature prefix for a module.
2649
+ *
2650
+ * The signature of a module is a set of prefixes. Prefixes are encoded as
2651
+ * pairs of ordinary strings, where the second string, called the mask, if
2652
+ * not `NULL`, must be of the same length as the first one and may contain
2653
+ * ' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched,
2654
+ * not matched, "don't-care"-bytes, zeros and non-zeros, respectively.
2655
+ *
2656
+ * Each prefix has an associated integer that describes the relevance of
2657
+ * the prefix, with 0 meaning a mismatch and 100 a "perfect match".
2658
+ *
2659
+ * Starting with gdk-pixbuf 2.8, the first byte of the mask may be '*',
2660
+ * indicating an unanchored pattern that matches not only at the beginning,
2661
+ * but also in the middle. Versions prior to 2.8 will interpret the '*'
2662
+ * like an 'x'.
2663
+ *
2664
+ * The signature of a module is stored as an array of
2665
+ * `GdkPixbufModulePatterns`. The array is terminated by a pattern
2666
+ * where the `prefix` is `NULL`.
2667
+ *
2668
+ * ```c
2669
+ * GdkPixbufModulePattern *signature[] = {
2670
+ * { "abcdx", " !x z", 100 },
2671
+ * { "bla", NULL, 90 },
2672
+ * { NULL, NULL, 0 }
2673
+ * };
2674
+ * ```
2675
+ *
2676
+ * In the example above, the signature matches e.g. "auud\0" with
2677
+ * relevance 100, and "blau" with relevance 90.
2678
+ * @record
2679
+ */
2680
+ export class PixbufModulePattern {
2681
+
2682
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufModulePattern
2683
+
2684
+ static name: string
2685
+ }
2686
+
2687
+ export interface PixbufSimpleAnimClass {
2688
+ }
2689
+
2690
+ export abstract class PixbufSimpleAnimClass {
2691
+
2692
+ // Own properties of GdkPixbuf-2.0.GdkPixbuf.PixbufSimpleAnimClass
2693
+
2694
+ static name: string
2695
+ }
2696
+
2697
+ /**
2698
+ * Name of the imported GIR library
2699
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
2700
+ */
2701
+ export const __name__: string
2702
+ /**
2703
+ * Version of the imported GIR library
2704
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
2705
+ */
2706
+ export const __version__: string
2707
+ // END