1 /* gdk-pixbuf-2.0.vapi generated by vapigen, do not modify. */
3 [CCode (cprefix = "Gdk", gir_namespace = "GdkPixbuf", gir_version = "2.0", lower_case_cprefix = "gdk_")]
5 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_get_type ()")]
6 public class Pixbuf : GLib.Object, GLib.Icon, GLib.LoadableIcon {
7 [CCode (has_construct_function = false)]
8 public Pixbuf (Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height);
9 public Gdk.Pixbuf add_alpha (bool substitute_color, uint8 r, uint8 g, uint8 b);
10 [Version (since = "2.12")]
11 public Gdk.Pixbuf apply_embedded_orientation ();
12 [Version (since = "2.36.8")]
13 public static int calculate_rowstride (Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height);
14 public void composite (Gdk.Pixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, Gdk.InterpType interp_type, int overall_alpha);
15 public void composite_color (Gdk.Pixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, Gdk.InterpType interp_type, int overall_alpha, int check_x, int check_y, int check_size, uint32 color1, uint32 color2);
16 public Gdk.Pixbuf? composite_color_simple (int dest_width, int dest_height, Gdk.InterpType interp_type, int overall_alpha, int check_size, uint32 color1, uint32 color2);
17 public Gdk.Pixbuf? copy ();
18 public void copy_area (int src_x, int src_y, int width, int height, Gdk.Pixbuf dest_pixbuf, int dest_x, int dest_y);
19 [Version (since = "2.36")]
20 public bool copy_options (Gdk.Pixbuf dest_pixbuf);
21 public void fill (uint32 pixel);
22 [Version (since = "2.6")]
23 public Gdk.Pixbuf? flip (bool horizontal);
24 [CCode (has_construct_function = false)]
25 [Version (since = "2.32")]
26 public Pixbuf.from_bytes (GLib.Bytes data, Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride);
27 [CCode (has_construct_function = false)]
28 public Pixbuf.from_data ([CCode (array_length = false)] owned uint8[] data, Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride, [CCode (scope = "async")] Gdk.PixbufDestroyNotify? destroy_fn = GLib.free);
29 [CCode (has_construct_function = false)]
30 public Pixbuf.from_file (string filename) throws GLib.Error;
31 [CCode (has_construct_function = false)]
32 [Version (since = "2.6")]
33 public Pixbuf.from_file_at_scale (string filename, int width, int height, bool preserve_aspect_ratio) throws GLib.Error;
34 [CCode (has_construct_function = false)]
35 [Version (since = "2.4")]
36 public Pixbuf.from_file_at_size (string filename, int width, int height) throws GLib.Error;
37 [CCode (has_construct_function = false)]
38 [Version (deprecated = true, deprecated_since = "2.32")]
39 public Pixbuf.from_inline ([CCode (array_length_cname = "data_length", array_length_pos = 0.5)] uint8[] data, bool copy_pixels = true) throws GLib.Error;
40 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h")]
41 [Version (deprecated = true, deprecated_since = "2.32")]
42 public static Gdk.Pixbuf from_pixdata (Gdk.Pixdata pixdata, bool copy_pixels = true) throws GLib.Error;
43 [CCode (has_construct_function = false)]
44 [Version (since = "2.26")]
45 public Pixbuf.from_resource (string resource_path) throws GLib.Error;
46 [CCode (has_construct_function = false)]
47 [Version (since = "2.26")]
48 public Pixbuf.from_resource_at_scale (string resource_path, int width, int height, bool preserve_aspect_ratio) throws GLib.Error;
49 [CCode (has_construct_function = false)]
50 [Version (since = "2.14")]
51 public Pixbuf.from_stream (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
52 [CCode (finish_name = "gdk_pixbuf_new_from_stream_finish", has_construct_function = false, type = "void")]
53 [Version (since = "2.24")]
54 public async Pixbuf.from_stream_async (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
55 [CCode (has_construct_function = false)]
56 [Version (since = "2.14")]
57 public Pixbuf.from_stream_at_scale (GLib.InputStream stream, int width, int height, bool preserve_aspect_ratio, GLib.Cancellable? cancellable = null) throws GLib.Error;
58 [CCode (finish_name = "gdk_pixbuf_new_from_stream_finish", has_construct_function = false, type = "void")]
59 [Version (since = "2.24")]
60 public async Pixbuf.from_stream_at_scale_async (GLib.InputStream stream, int width, int height, bool preserve_aspect_ratio, GLib.Cancellable? cancellable = null) throws GLib.Error;
61 [CCode (has_construct_function = false)]
62 public Pixbuf.from_xpm_data ([CCode (array_length = false, array_null_terminated = true)] string[] data);
63 public int get_bits_per_sample ();
64 [Version (since = "2.26")]
65 public size_t get_byte_length ();
66 public Gdk.Colorspace get_colorspace ();
67 [Version (since = "2.4")]
68 public static unowned Gdk.PixbufFormat? get_file_info (string filename, out int width, out int height);
69 [Version (since = "2.32")]
70 public static async unowned Gdk.PixbufFormat get_file_info_async (string filename, GLib.Cancellable? cancellable, out int width, out int height) throws GLib.Error;
71 [Version (since = "2.2")]
72 public static GLib.SList<weak Gdk.PixbufFormat> get_formats ();
73 public bool get_has_alpha ();
74 public int get_height ();
75 public int get_n_channels ();
76 public unowned string get_option (string key);
77 [Version (since = "2.32")]
78 public GLib.HashTable<weak string,weak string> get_options ();
79 [CCode (array_length = false)]
80 public unowned uint8[] get_pixels ();
81 [CCode (array_length_pos = 0.1, array_length_type = "guint")]
82 [Version (since = "2.26")]
83 public unowned uint8[] get_pixels_with_length ();
84 public int get_rowstride ();
85 public int get_width ();
86 [Version (since = "2.32")]
87 public GLib.Bytes read_pixel_bytes ();
88 [Version (since = "2.32")]
89 public uint8 read_pixels ();
90 [Version (since = "2.36")]
91 public bool remove_option (string key);
92 [Version (since = "2.6")]
93 public Gdk.Pixbuf? rotate_simple (Gdk.PixbufRotation angle);
94 public void saturate_and_pixelate (Gdk.Pixbuf dest, float saturation, bool pixelate);
95 public bool save (string filename, string type, ...) throws GLib.Error;
96 [Version (since = "2.4")]
97 public bool save_to_buffer ([CCode (array_length_cname = "buffer_size", array_length_pos = 1.5, array_length_type = "gsize")] out uint8[] buffer, string type, ...) throws GLib.Error;
98 [Version (since = "2.4")]
99 public bool save_to_bufferv ([CCode (array_length_cname = "buffer_size", array_length_pos = 1.5, array_length_type = "gsize")] out uint8[] buffer, string type, [CCode (array_length = false, array_null_terminated = true)] string[] option_keys, [CCode (array_length = false, array_null_terminated = true)] string[] option_values) throws GLib.Error;
100 [Version (since = "2.4")]
101 public bool save_to_callback ([CCode (delegate_target_pos = 1.5)] Gdk.PixbufSaveFunc save_func, string type, ...) throws GLib.Error;
102 [Version (since = "2.4")]
103 public bool save_to_callbackv ([CCode (delegate_target_pos = 1.5)] Gdk.PixbufSaveFunc save_func, string type, [CCode (array_length = false, array_null_terminated = true)] string[] option_keys, [CCode (array_length = false, array_null_terminated = true)] string[] option_values) throws GLib.Error;
104 [Version (since = "2.14")]
105 public bool save_to_stream (GLib.OutputStream stream, string type, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
106 [CCode (finish_instance = false, finish_name = "gdk_pixbuf_save_to_stream_finish", sentinel = "NULL")]
107 [Version (since = "2.24")]
108 public async void save_to_stream_async (GLib.OutputStream stream, string type, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
109 [Version (since = "2.36")]
110 public bool save_to_streamv (GLib.OutputStream stream, string type, [CCode (array_length = false, array_null_terminated = true)] string[] option_keys, [CCode (array_length = false, array_null_terminated = true)] string[] option_values, GLib.Cancellable? cancellable = null) throws GLib.Error;
111 [Version (since = "2.36")]
112 public async void save_to_streamv_async (GLib.OutputStream stream, string type, [CCode (array_length = false, array_null_terminated = true)] string[] option_keys, [CCode (array_length = false, array_null_terminated = true)] string[] option_values, GLib.Cancellable? cancellable = null);
113 public bool savev (string filename, string type, [CCode (array_length = false, array_null_terminated = true)] string[] option_keys, [CCode (array_length = false, array_null_terminated = true)] string[] option_values) throws GLib.Error;
114 public void scale (Gdk.Pixbuf dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, Gdk.InterpType interp_type);
115 public Gdk.Pixbuf? scale_simple (int dest_width, int dest_height, Gdk.InterpType interp_type);
116 [Version (since = "2.2")]
117 public bool set_option (string key, string value);
118 [CCode (has_construct_function = false)]
119 public Pixbuf.subpixbuf (Gdk.Pixbuf src_pixbuf, int src_x, int src_y, int width, int height);
120 [CCode (cname = "gdk_pixbuf_new_from_data", has_construct_function = false)]
121 public Pixbuf.with_unowned_data ([CCode (array_length = false)] uint8[] data, Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride, [CCode (type = "GdkPixbufDestroyNotify")] Gdk.PixbufDestroyNotify? destroy_fn = null);
122 public int bits_per_sample { get; construct; }
123 public Gdk.Colorspace colorspace { get; construct; }
124 public bool has_alpha { get; construct; }
125 public int height { get; construct; }
126 public int n_channels { get; construct; }
128 public GLib.Bytes pixel_bytes { owned get; construct; }
129 public void* pixels { get; construct; }
130 public int rowstride { get; construct; }
131 public int width { get; construct; }
133 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_animation_get_type ()")]
134 public class PixbufAnimation : GLib.Object {
135 [CCode (has_construct_function = false)]
136 protected PixbufAnimation ();
137 [CCode (has_construct_function = false)]
138 public PixbufAnimation.from_file (string filename) throws GLib.Error;
139 [CCode (has_construct_function = false)]
140 [Version (since = "2.28")]
141 public PixbufAnimation.from_resource (string resource_path) throws GLib.Error;
142 [CCode (has_construct_function = false)]
143 [Version (since = "2.28")]
144 public PixbufAnimation.from_stream (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
145 [CCode (cname = "gdk_pixbuf_animation_new_from_stream_async", has_construct_function = false)]
146 [Version (since = "2.28")]
147 public async PixbufAnimation.from_stream_async (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
148 public int get_height ();
149 public Gdk.PixbufAnimationIter get_iter (GLib.TimeVal? start_time);
150 public unowned Gdk.Pixbuf get_static_image ();
151 public int get_width ();
152 public bool is_static_image ();
154 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_animation_iter_get_type ()")]
155 public class PixbufAnimationIter : GLib.Object {
156 [CCode (has_construct_function = false)]
157 protected PixbufAnimationIter ();
158 public bool advance (GLib.TimeVal? current_time);
159 public int get_delay_time ();
160 public unowned Gdk.Pixbuf get_pixbuf ();
161 public bool on_currently_loading_frame ();
163 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gdk_pixbuf_format_get_type ()")]
165 public class PixbufFormat {
166 [Version (since = "2.22")]
167 public Gdk.PixbufFormat copy ();
168 [Version (since = "2.22")]
170 [Version (since = "2.2")]
171 public string get_description ();
172 [CCode (array_length = false, array_null_terminated = true)]
173 [Version (since = "2.2")]
174 public string[] get_extensions ();
175 [Version (since = "2.6")]
176 public string get_license ();
177 [CCode (array_length = false, array_null_terminated = true)]
178 [Version (since = "2.2")]
179 public string[] get_mime_types ();
180 [Version (since = "2.2")]
181 public string get_name ();
182 [Version (since = "2.6")]
183 public bool is_disabled ();
184 [Version (since = "2.36")]
185 public bool is_save_option_supported (string option_key);
186 [Version (since = "2.6")]
187 public bool is_scalable ();
188 [Version (since = "2.2")]
189 public bool is_writable ();
190 [Version (since = "2.6")]
191 public void set_disabled (bool disabled);
193 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_loader_get_type ()")]
194 public class PixbufLoader : GLib.Object {
195 [CCode (has_construct_function = false)]
196 public PixbufLoader ();
197 public bool close () throws GLib.Error;
198 public unowned Gdk.PixbufAnimation get_animation ();
199 [Version (since = "2.2")]
200 public unowned Gdk.PixbufFormat? get_format ();
201 public unowned Gdk.Pixbuf get_pixbuf ();
202 [Version (since = "2.2")]
203 public void set_size (int width, int height);
204 [CCode (has_construct_function = false)]
205 [Version (since = "2.4")]
206 public PixbufLoader.with_mime_type (string mime_type) throws GLib.Error;
207 [CCode (has_construct_function = false)]
208 public PixbufLoader.with_type (string image_type) throws GLib.Error;
209 public bool write ([CCode (array_length_cname = "count", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] buf) throws GLib.Error;
210 [Version (since = "2.30")]
211 public bool write_bytes (GLib.Bytes buffer) throws GLib.Error;
212 public virtual signal void area_prepared ();
213 public virtual signal void area_updated (int x, int y, int width, int height);
214 public virtual signal void closed ();
215 public virtual signal void size_prepared (int width, int height);
217 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_simple_anim_get_type ()")]
218 public class PixbufSimpleAnim : Gdk.PixbufAnimation {
219 [CCode (has_construct_function = false)]
220 [Version (since = "2.8")]
221 public PixbufSimpleAnim (int width, int height, float rate);
222 [Version (since = "2.8")]
223 public void add_frame (Gdk.Pixbuf pixbuf);
224 [Version (since = "2.18")]
225 public bool get_loop ();
226 [Version (since = "2.18")]
227 public void set_loop (bool loop);
228 [Version (since = "2.18")]
229 public bool loop { get; set; }
231 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_simple_anim_iter_get_type ()")]
232 public class PixbufSimpleAnimIter : Gdk.PixbufAnimationIter {
233 [CCode (has_construct_function = false)]
234 protected PixbufSimpleAnimIter ();
236 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", has_type_id = false)]
237 public struct Pixdata {
240 public uint32 pixdata_type;
241 public uint32 rowstride;
243 public uint32 height;
244 [CCode (array_length = false)]
245 public weak uint8[] pixel_data;
246 [Version (deprecated = true, deprecated_since = "2.32")]
247 public bool deserialize ([CCode (array_length_cname = "stream_length", array_length_pos = 0.5, array_length_type = "guint")] uint8[] stream) throws GLib.Error;
248 [CCode (array_length_pos = 0.1, array_length_type = "guint")]
249 [Version (deprecated = true, deprecated_since = "2.32")]
250 public uint8[] serialize ();
251 [Version (deprecated = true, deprecated_since = "2.32")]
252 public GLib.StringBuilder to_csource (string name, Gdk.PixdataDumpType dump_type);
254 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_COLORSPACE_", type_id = "gdk_colorspace_get_type ()")]
255 public enum Colorspace {
258 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_INTERP_", type_id = "gdk_interp_type_get_type ()")]
259 public enum InterpType {
265 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ALPHA_", type_id = "gdk_pixbuf_alpha_mode_get_type ()")]
266 public enum PixbufAlphaMode {
270 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ROTATE_", type_id = "gdk_pixbuf_rotation_get_type ()")]
271 public enum PixbufRotation {
277 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", cprefix = "GDK_PIXDATA_DUMP_", has_type_id = false)]
279 public enum PixdataDumpType {
289 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", cprefix = "GDK_PIXDATA_", has_type_id = false)]
291 public enum PixdataType {
301 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ERROR_")]
302 public errordomain PixbufError {
307 UNSUPPORTED_OPERATION,
309 INCOMPLETE_ANIMATION;
310 public static GLib.Quark quark ();
312 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", instance_pos = 1.9)]
313 public delegate void PixbufDestroyNotify ([CCode (array_length = false)] uint8[] pixels);
314 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", instance_pos = -0.9)]
315 public delegate bool PixbufSaveFunc ([CCode (array_length_type = "gsize")] uint8[] buf) throws GLib.Error;
316 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_FEATURES_H")]
317 public const int PIXBUF_FEATURES_H;
318 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MAGIC_NUMBER")]
319 public const int PIXBUF_MAGIC_NUMBER;
320 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MAJOR")]
321 public const int PIXBUF_MAJOR;
322 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MICRO")]
323 public const int PIXBUF_MICRO;
324 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MINOR")]
325 public const int PIXBUF_MINOR;
326 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_VERSION")]
327 public const string PIXBUF_VERSION;
328 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXDATA_HEADER_LENGTH")]
329 public const int PIXDATA_HEADER_LENGTH;