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 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);
13 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);
14 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);
15 public Gdk.Pixbuf copy ();
16 public void copy_area (int src_x, int src_y, int width, int height, Gdk.Pixbuf dest_pixbuf, int dest_x, int dest_y);
17 [Version (since = "2.36")]
18 public bool copy_options (Gdk.Pixbuf dest_pixbuf);
19 public void fill (uint32 pixel);
20 [Version (since = "2.6")]
21 public Gdk.Pixbuf? flip (bool horizontal);
22 [CCode (has_construct_function = false)]
23 [Version (since = "2.32")]
24 public Pixbuf.from_bytes (GLib.Bytes data, Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride);
25 [CCode (has_construct_function = false)]
26 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);
27 [CCode (has_construct_function = false)]
28 public Pixbuf.from_file (string filename) throws GLib.Error;
29 [CCode (has_construct_function = false)]
30 [Version (since = "2.6")]
31 public Pixbuf.from_file_at_scale (string filename, int width, int height, bool preserve_aspect_ratio) throws GLib.Error;
32 [CCode (has_construct_function = false)]
33 [Version (since = "2.4")]
34 public Pixbuf.from_file_at_size (string filename, int width, int height) throws GLib.Error;
35 [CCode (has_construct_function = false)]
36 [Version (deprecated = true, deprecated_since = "2.32")]
37 public Pixbuf.from_inline ([CCode (array_length_cname = "data_length", array_length_pos = 0.5)] uint8[] data, bool copy_pixels = true) throws GLib.Error;
38 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h")]
39 [Version (deprecated = true, deprecated_since = "2.32")]
40 public static Gdk.Pixbuf from_pixdata (Gdk.Pixdata pixdata, bool copy_pixels = true) throws GLib.Error;
41 [CCode (has_construct_function = false)]
42 [Version (since = "2.26")]
43 public Pixbuf.from_resource (string resource_path) throws GLib.Error;
44 [CCode (has_construct_function = false)]
45 [Version (since = "2.26")]
46 public Pixbuf.from_resource_at_scale (string resource_path, int width, int height, bool preserve_aspect_ratio) throws GLib.Error;
47 [CCode (has_construct_function = false)]
48 [Version (since = "2.14")]
49 public Pixbuf.from_stream (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
50 [CCode (finish_name = "gdk_pixbuf_new_from_stream_finish", has_construct_function = false, type = "void")]
51 [Version (since = "2.24")]
52 public async Pixbuf.from_stream_async (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
53 [CCode (has_construct_function = false)]
54 [Version (since = "2.14")]
55 public Pixbuf.from_stream_at_scale (GLib.InputStream stream, int width, int height, bool preserve_aspect_ratio, GLib.Cancellable? cancellable = null) throws GLib.Error;
56 [CCode (finish_name = "gdk_pixbuf_new_from_stream_finish", has_construct_function = false, type = "void")]
57 [Version (since = "2.24")]
58 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;
59 [CCode (has_construct_function = false)]
60 public Pixbuf.from_xpm_data ([CCode (array_length = false, array_null_terminated = true)] string[] data);
61 public int get_bits_per_sample ();
62 [Version (since = "2.26")]
63 public size_t get_byte_length ();
64 public Gdk.Colorspace get_colorspace ();
65 [Version (since = "2.4")]
66 public static unowned Gdk.PixbufFormat? get_file_info (string filename, out int width, out int height);
67 [Version (since = "2.32")]
68 public static async unowned Gdk.PixbufFormat get_file_info_async (string filename, GLib.Cancellable? cancellable, out int width, out int height) throws GLib.Error;
69 [Version (since = "2.2")]
70 public static GLib.SList<weak Gdk.PixbufFormat> get_formats ();
71 public bool get_has_alpha ();
72 public int get_height ();
73 public int get_n_channels ();
74 public unowned string get_option (string key);
75 [Version (since = "2.32")]
76 public GLib.HashTable<weak string,weak string> get_options ();
77 [CCode (array_length = false)]
78 public unowned uint8[] get_pixels ();
79 [CCode (array_length_pos = 0.1, array_length_type = "guint")]
80 [Version (since = "2.26")]
81 public unowned uint8[] get_pixels_with_length ();
82 public int get_rowstride ();
83 public int get_width ();
84 [CCode (cname = "gdk_pixbuf_new_from_stream_async", finish_name = "gdk_pixbuf_new_from_stream_finish")]
85 [Version (deprecated_since = "vala-0.18", replacement = "Pixbuf.from_stream_async")]
86 public static async Gdk.Pixbuf new_from_stream_async (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
87 [CCode (cname = "gdk_pixbuf_new_from_stream_at_scale_async", finish_name = "gdk_pixbuf_new_from_stream_finish")]
88 [Version (deprecated_since = "vala-0.18", replacement = "Pixbuf.from_stream_at_scale_async")]
89 public static async Gdk.Pixbuf new_from_stream_at_scale_async (GLib.InputStream stream, int width, int height, bool preserve_aspect_ratio, GLib.Cancellable? cancellable = null) throws GLib.Error;
90 [Version (since = "2.32")]
91 public GLib.Bytes read_pixel_bytes ();
92 [Version (since = "2.32")]
93 public uint8 read_pixels ();
94 [Version (since = "2.36")]
95 public bool remove_option (string key);
96 [Version (since = "2.6")]
97 public Gdk.Pixbuf? rotate_simple (Gdk.PixbufRotation angle);
98 public void saturate_and_pixelate (Gdk.Pixbuf dest, float saturation, bool pixelate);
99 public bool save (string filename, string type, ...) throws GLib.Error;
100 [Version (since = "2.4")]
101 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;
102 [Version (since = "2.4")]
103 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;
104 [Version (since = "2.4")]
105 public bool save_to_callback ([CCode (delegate_target_pos = 1.5)] Gdk.PixbufSaveFunc save_func, string type, ...) throws GLib.Error;
106 [Version (since = "2.4")]
107 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;
108 [Version (since = "2.14")]
109 public bool save_to_stream (GLib.OutputStream stream, string type, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
110 [CCode (finish_instance = false, finish_name = "gdk_pixbuf_save_to_stream_finish", sentinel = "NULL")]
111 [Version (since = "2.24")]
112 public async void save_to_stream_async (GLib.OutputStream stream, string type, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
113 [Version (since = "2.36")]
114 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;
115 [Version (since = "2.36")]
116 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);
117 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;
118 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);
119 public Gdk.Pixbuf scale_simple (int dest_width, int dest_height, Gdk.InterpType interp_type);
120 [Version (since = "2.2")]
121 public bool set_option (string key, string value);
122 [CCode (has_construct_function = false)]
123 public Pixbuf.subpixbuf (Gdk.Pixbuf src_pixbuf, int src_x, int src_y, int width, int height);
124 [CCode (cname = "gdk_pixbuf_new_from_data", has_construct_function = false)]
125 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);
126 public int bits_per_sample { get; construct; }
127 public Gdk.Colorspace colorspace { get; construct; }
128 public bool has_alpha { get; construct; }
129 public int height { get; construct; }
130 public int n_channels { get; construct; }
132 public GLib.Bytes pixel_bytes { owned get; construct; }
133 public void* pixels { get; construct; }
134 public int rowstride { get; construct; }
135 public int width { get; construct; }
137 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_animation_get_type ()")]
138 public class PixbufAnimation : GLib.Object {
139 [CCode (has_construct_function = false)]
140 protected PixbufAnimation ();
141 [CCode (has_construct_function = false)]
142 public PixbufAnimation.from_file (string filename) throws GLib.Error;
143 [CCode (has_construct_function = false)]
144 [Version (since = "2.28")]
145 public PixbufAnimation.from_resource (string resource_path) throws GLib.Error;
146 [CCode (has_construct_function = false)]
147 [Version (since = "2.28")]
148 public PixbufAnimation.from_stream (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
149 [CCode (cname = "gdk_pixbuf_animation_new_from_stream_async", has_construct_function = false)]
150 [Version (since = "2.28")]
151 public async PixbufAnimation.from_stream_async (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
152 public int get_height ();
153 public Gdk.PixbufAnimationIter get_iter (GLib.TimeVal? start_time);
154 public unowned Gdk.Pixbuf get_static_image ();
155 public int get_width ();
156 public bool is_static_image ();
158 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_animation_iter_get_type ()")]
159 public class PixbufAnimationIter : GLib.Object {
160 [CCode (has_construct_function = false)]
161 protected PixbufAnimationIter ();
162 public bool advance (GLib.TimeVal? current_time);
163 public int get_delay_time ();
164 public unowned Gdk.Pixbuf get_pixbuf ();
165 public bool on_currently_loading_frame ();
167 [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 ()")]
169 public class PixbufFormat {
170 [Version (since = "2.22")]
171 public Gdk.PixbufFormat copy ();
172 [Version (since = "2.22")]
174 [Version (since = "2.2")]
175 public string get_description ();
176 [CCode (array_length = false, array_null_terminated = true)]
177 [Version (since = "2.2")]
178 public string[] get_extensions ();
179 [Version (since = "2.6")]
180 public string get_license ();
181 [CCode (array_length = false, array_null_terminated = true)]
182 [Version (since = "2.2")]
183 public string[] get_mime_types ();
184 [Version (since = "2.2")]
185 public string get_name ();
186 [Version (since = "2.6")]
187 public bool is_disabled ();
188 [Version (since = "2.36")]
189 public bool is_save_option_supported (string option_key);
190 [Version (since = "2.6")]
191 public bool is_scalable ();
192 [Version (since = "2.2")]
193 public bool is_writable ();
194 [Version (since = "2.6")]
195 public void set_disabled (bool disabled);
197 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_loader_get_type ()")]
198 public class PixbufLoader : GLib.Object {
199 [CCode (has_construct_function = false)]
200 public PixbufLoader ();
201 public bool close () throws GLib.Error;
202 public unowned Gdk.PixbufAnimation get_animation ();
203 [Version (since = "2.2")]
204 public unowned Gdk.PixbufFormat? get_format ();
205 public unowned Gdk.Pixbuf get_pixbuf ();
206 [Version (since = "2.2")]
207 public void set_size (int width, int height);
208 [CCode (has_construct_function = false)]
209 [Version (since = "2.4")]
210 public PixbufLoader.with_mime_type (string mime_type) throws GLib.Error;
211 [CCode (has_construct_function = false)]
212 public PixbufLoader.with_type (string image_type) throws GLib.Error;
213 public bool write ([CCode (array_length_cname = "count", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] buf) throws GLib.Error;
214 [Version (since = "2.30")]
215 public bool write_bytes (GLib.Bytes buffer) throws GLib.Error;
216 public virtual signal void area_prepared ();
217 public virtual signal void area_updated (int x, int y, int width, int height);
218 public virtual signal void closed ();
219 public virtual signal void size_prepared (int width, int height);
221 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_simple_anim_get_type ()")]
222 public class PixbufSimpleAnim : Gdk.PixbufAnimation {
223 [CCode (has_construct_function = false)]
224 [Version (since = "2.8")]
225 public PixbufSimpleAnim (int width, int height, float rate);
226 [Version (since = "2.8")]
227 public void add_frame (Gdk.Pixbuf pixbuf);
228 [Version (since = "2.18")]
229 public bool get_loop ();
230 [Version (since = "2.18")]
231 public void set_loop (bool loop);
232 [Version (since = "2.18")]
233 public bool loop { get; set; }
235 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", type_id = "gdk_pixbuf_simple_anim_iter_get_type ()")]
236 public class PixbufSimpleAnimIter : Gdk.PixbufAnimationIter {
237 [CCode (has_construct_function = false)]
238 protected PixbufSimpleAnimIter ();
240 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", has_type_id = false)]
241 public struct Pixdata {
244 public uint32 pixdata_type;
245 public uint32 rowstride;
247 public uint32 height;
248 [CCode (array_length = false)]
249 public weak uint8[] pixel_data;
250 [Version (deprecated = true, deprecated_since = "2.32")]
251 public bool deserialize ([CCode (array_length_cname = "stream_length", array_length_pos = 0.5, array_length_type = "guint")] uint8[] stream) throws GLib.Error;
252 [CCode (array_length_pos = 0.1, array_length_type = "guint")]
253 [Version (deprecated = true, deprecated_since = "2.32")]
254 public uint8[] serialize ();
255 [Version (deprecated = true, deprecated_since = "2.32")]
256 public GLib.StringBuilder to_csource (string name, Gdk.PixdataDumpType dump_type);
258 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_COLORSPACE_", type_id = "gdk_colorspace_get_type ()")]
259 public enum Colorspace {
262 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_INTERP_", type_id = "gdk_interp_type_get_type ()")]
263 public enum InterpType {
269 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ALPHA_", type_id = "gdk_pixbuf_alpha_mode_get_type ()")]
270 public enum PixbufAlphaMode {
274 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ROTATE_", type_id = "gdk_pixbuf_rotation_get_type ()")]
275 public enum PixbufRotation {
281 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", cprefix = "GDK_PIXDATA_DUMP_", has_type_id = false)]
283 public enum PixdataDumpType {
293 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", cprefix = "GDK_PIXDATA_", has_type_id = false)]
295 public enum PixdataType {
305 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cprefix = "GDK_PIXBUF_ERROR_")]
306 public errordomain PixbufError {
311 UNSUPPORTED_OPERATION,
313 INCOMPLETE_ANIMATION;
314 public static GLib.Quark quark ();
316 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", instance_pos = 1.9)]
317 public delegate void PixbufDestroyNotify ([CCode (array_length = false)] uint8[] pixels);
318 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", instance_pos = -0.9)]
319 public delegate bool PixbufSaveFunc ([CCode (array_length_type = "gsize")] uint8[] buf) throws GLib.Error;
320 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_FEATURES_H")]
321 public const int PIXBUF_FEATURES_H;
322 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MAGIC_NUMBER")]
323 public const int PIXBUF_MAGIC_NUMBER;
324 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MAJOR")]
325 public const int PIXBUF_MAJOR;
326 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MICRO")]
327 public const int PIXBUF_MICRO;
328 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MINOR")]
329 public const int PIXBUF_MINOR;
330 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_VERSION")]
331 public const string PIXBUF_VERSION;
332 [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXDATA_HEADER_LENGTH")]
333 public const int PIXDATA_HEADER_LENGTH;