1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdkpixbuf.c.types;
26 
27 public import gio.c.types;
28 public import glib.c.types;
29 public import gobject.c.types;
30 
31 
32 /**
33  * This enumeration defines the color spaces that are supported by
34  * the gdk-pixbuf library.  Currently only RGB is supported.
35  */
36 public enum GdkColorspace
37 {
38 	/**
39 	 * Indicates a red/green/blue additive color space.
40 	 */
41 	RGB = 0,
42 }
43 alias GdkColorspace Colorspace;
44 
45 /**
46  * This enumeration describes the different interpolation modes that
47  * can be used with the scaling functions. @GDK_INTERP_NEAREST is
48  * the fastest scaling method, but has horrible quality when
49  * scaling down. @GDK_INTERP_BILINEAR is the best choice if you
50  * aren't sure what to choose, it has a good speed/quality balance.
51  *
52  * **Note**: Cubic filtering is missing from the list; hyperbolic
53  * interpolation is just as fast and results in higher quality.
54  */
55 public enum GdkInterpType
56 {
57 	/**
58 	 * Nearest neighbor sampling; this is the fastest
59 	 * and lowest quality mode. Quality is normally unacceptable when scaling
60 	 * down, but may be OK when scaling up.
61 	 */
62 	NEAREST = 0,
63 	/**
64 	 * This is an accurate simulation of the PostScript
65 	 * image operator without any interpolation enabled.  Each pixel is
66 	 * rendered as a tiny parallelogram of solid color, the edges of which
67 	 * are implemented with antialiasing.  It resembles nearest neighbor for
68 	 * enlargement, and bilinear for reduction.
69 	 */
70 	TILES = 1,
71 	/**
72 	 * Best quality/speed balance; use this mode by
73 	 * default. Bilinear interpolation.  For enlargement, it is
74 	 * equivalent to point-sampling the ideal bilinear-interpolated image.
75 	 * For reduction, it is equivalent to laying down small tiles and
76 	 * integrating over the coverage area.
77 	 */
78 	BILINEAR = 2,
79 	/**
80 	 * This is the slowest and highest quality
81 	 * reconstruction function. It is derived from the hyperbolic filters in
82 	 * Wolberg's "Digital Image Warping", and is formally defined as the
83 	 * hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
84 	 * image (the filter is designed to be idempotent for 1:1 pixel mapping).
85 	 * **Deprecated**: this interpolation filter is deprecated, as in reality
86 	 * it has a lower quality than the @GDK_INTERP_BILINEAR filter
87 	 * (Since: 2.38)
88 	 */
89 	HYPER = 3,
90 }
91 alias GdkInterpType InterpType;
92 
93 /**
94  * These values can be passed to
95  * gdk_pixbuf_xlib_render_to_drawable_alpha() to control how the alpha
96  * channel of an image should be handled.  This function can create a
97  * bilevel clipping mask (black and white) and use it while painting
98  * the image.  In the future, when the X Window System gets an alpha
99  * channel extension, it will be possible to do full alpha
100  * compositing onto arbitrary drawables.  For now both cases fall
101  * back to a bilevel clipping mask.
102  */
103 public enum GdkPixbufAlphaMode
104 {
105 	/**
106 	 * A bilevel clipping mask (black and white)
107 	 * will be created and used to draw the image.  Pixels below 0.5 opacity
108 	 * will be considered fully transparent, and all others will be
109 	 * considered fully opaque.
110 	 */
111 	BILEVEL = 0,
112 	/**
113 	 * For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
114 	 * In the future it will do full alpha compositing.
115 	 */
116 	FULL = 1,
117 }
118 alias GdkPixbufAlphaMode PixbufAlphaMode;
119 
120 /**
121  * An error code in the #GDK_PIXBUF_ERROR domain. Many gdk-pixbuf
122  * operations can cause errors in this domain, or in the #G_FILE_ERROR
123  * domain.
124  */
125 public enum GdkPixbufError
126 {
127 	/**
128 	 * An image file was broken somehow.
129 	 */
130 	CORRUPT_IMAGE = 0,
131 	/**
132 	 * Not enough memory.
133 	 */
134 	INSUFFICIENT_MEMORY = 1,
135 	/**
136 	 * A bad option was passed to a pixbuf save module.
137 	 */
138 	BAD_OPTION = 2,
139 	/**
140 	 * Unknown image type.
141 	 */
142 	UNKNOWN_TYPE = 3,
143 	/**
144 	 * Don't know how to perform the
145 	 * given operation on the type of image at hand.
146 	 */
147 	UNSUPPORTED_OPERATION = 4,
148 	/**
149 	 * Generic failure code, something went wrong.
150 	 */
151 	FAILED = 5,
152 	/**
153 	 * Only part of the animation was loaded.
154 	 */
155 	INCOMPLETE_ANIMATION = 6,
156 }
157 alias GdkPixbufError PixbufError;
158 
159 /**
160  * The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
161  * To make them easier to use, their numerical values are the actual degrees.
162  */
163 public enum GdkPixbufRotation
164 {
165 	/**
166 	 * No rotation.
167 	 */
168 	NONE = 0,
169 	/**
170 	 * Rotate by 90 degrees.
171 	 */
172 	COUNTERCLOCKWISE = 90,
173 	/**
174 	 * Rotate by 180 degrees.
175 	 */
176 	UPSIDEDOWN = 180,
177 	/**
178 	 * Rotate by 270 degrees.
179 	 */
180 	CLOCKWISE = 270,
181 }
182 alias GdkPixbufRotation PixbufRotation;
183 
184 /**
185  * An enumeration which is used by gdk_pixdata_to_csource() to
186  * determine the form of C source to be generated. The three values
187  * @GDK_PIXDATA_DUMP_PIXDATA_STREAM, @GDK_PIXDATA_DUMP_PIXDATA_STRUCT
188  * and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are
189  * @GDK_PIXBUF_DUMP_GTYPES and @GDK_PIXBUF_DUMP_CTYPES. The remaining
190  * elements are optional flags that can be freely added.
191  */
192 public enum GdkPixdataDumpType
193 {
194 	/**
195 	 * Generate pixbuf data stream (a single
196 	 * string containing a serialized #GdkPixdata structure in network byte
197 	 * order).
198 	 */
199 	PIXDATA_STREAM = 0,
200 	/**
201 	 * Generate #GdkPixdata structure (needs
202 	 * the #GdkPixdata structure definition from gdk-pixdata.h).
203 	 */
204 	PIXDATA_STRUCT = 1,
205 	/**
206 	 * Generate <function>*_ROWSTRIDE</function>,
207 	 * <function>*_WIDTH</function>, <function>*_HEIGHT</function>,
208 	 * <function>*_BYTES_PER_PIXEL</function> and
209 	 * <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function>
210 	 * macro definitions for the image.
211 	 */
212 	MACROS = 2,
213 	/**
214 	 * Generate GLib data types instead of
215 	 * standard C data types.
216 	 */
217 	GTYPES = 0,
218 	/**
219 	 * Generate standard C data types instead of
220 	 * GLib data types.
221 	 */
222 	CTYPES = 256,
223 	/**
224 	 * Generate static symbols.
225 	 */
226 	STATIC = 512,
227 	/**
228 	 * Generate const symbols.
229 	 */
230 	CONST = 1024,
231 	/**
232 	 * Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function>
233 	 * macro definition  to  decode  run-length encoded image data.
234 	 */
235 	RLE_DECODER = 65536,
236 }
237 alias GdkPixdataDumpType PixdataDumpType;
238 
239 /**
240  * An enumeration containing three sets of flags for a #GdkPixdata struct:
241  * one for the used colorspace, one for the width of the samples and one
242  * for the encoding of the pixel data.
243  */
244 public enum GdkPixdataType
245 {
246 	/**
247 	 * each pixel has red, green and blue samples.
248 	 */
249 	COLOR_TYPE_RGB = 1,
250 	/**
251 	 * each pixel has red, green and blue samples
252 	 * and an alpha value.
253 	 */
254 	COLOR_TYPE_RGBA = 2,
255 	/**
256 	 * mask for the colortype flags of the enum.
257 	 */
258 	COLOR_TYPE_MASK = 255,
259 	/**
260 	 * each sample has 8 bits.
261 	 */
262 	SAMPLE_WIDTH_8 = 65536,
263 	/**
264 	 * mask for the sample width flags of the enum.
265 	 */
266 	SAMPLE_WIDTH_MASK = 983040,
267 	/**
268 	 * the pixel data is in raw form.
269 	 */
270 	ENCODING_RAW = 16777216,
271 	/**
272 	 * the pixel data is run-length encoded. Runs may
273 	 * be up to 127 bytes long; their length is stored in a single byte
274 	 * preceding the pixel data for the run. If a run is constant, its length
275 	 * byte has the high bit set and the pixel data consists of a single pixel
276 	 * which must be repeated.
277 	 */
278 	ENCODING_RLE = 33554432,
279 	/**
280 	 * mask for the encoding flags of the enum.
281 	 */
282 	ENCODING_MASK = 251658240,
283 }
284 alias GdkPixdataType PixdataType;
285 
286 struct GdkPixbuf;
287 
288 struct GdkPixbufAnimation;
289 
290 struct GdkPixbufAnimationIter;
291 
292 struct GdkPixbufFormat;
293 
294 struct GdkPixbufLoader
295 {
296 	GObject parentInstance;
297 	void* priv;
298 }
299 
300 struct GdkPixbufLoaderClass
301 {
302 	GObjectClass parentClass;
303 	/** */
304 	extern(C) void function(GdkPixbufLoader* loader, int width, int height) sizePrepared;
305 	/** */
306 	extern(C) void function(GdkPixbufLoader* loader) areaPrepared;
307 	/** */
308 	extern(C) void function(GdkPixbufLoader* loader, int x, int y, int width, int height) areaUpdated;
309 	/** */
310 	extern(C) void function(GdkPixbufLoader* loader) closed;
311 }
312 
313 struct GdkPixbufSimpleAnim;
314 
315 struct GdkPixbufSimpleAnimClass;
316 
317 struct GdkPixbufSimpleAnimIter;
318 
319 struct GdkPixdata
320 {
321 	/**
322 	 * magic number. A valid #GdkPixdata structure must have
323 	 * #GDK_PIXBUF_MAGIC_NUMBER here.
324 	 */
325 	uint magic;
326 	/**
327 	 * less than 1 to disable length checks, otherwise
328 	 * #GDK_PIXDATA_HEADER_LENGTH + length of @pixel_data.
329 	 */
330 	int length;
331 	/**
332 	 * information about colorspace, sample width and
333 	 * encoding, in a #GdkPixdataType.
334 	 */
335 	uint pixdataType;
336 	/**
337 	 * Distance in bytes between rows.
338 	 */
339 	uint rowstride;
340 	/**
341 	 * Width of the image in pixels.
342 	 */
343 	uint width;
344 	/**
345 	 * Height of the image in pixels.
346 	 */
347 	uint height;
348 	/**
349 	 * @width x @height pixels, encoded according to @pixdata_type
350 	 * and @rowstride.
351 	 */
352 	ubyte* pixelData;
353 }
354 
355 /**
356  * A function of this type is responsible for freeing the pixel array
357  * of a pixbuf.  The gdk_pixbuf_new_from_data() function lets you
358  * pass in a pre-allocated pixel array so that a pixbuf can be
359  * created from it; in this case you will need to pass in a function
360  * of #GdkPixbufDestroyNotify so that the pixel data can be freed
361  * when the pixbuf is finalized.
362  *
363  * Params:
364  *     pixels = The pixel array of the pixbuf
365  *         that is being finalized.
366  *     data = User closure data.
367  */
368 public alias extern(C) void function(char* pixels, void* data) GdkPixbufDestroyNotify;
369 
370 /**
371  * Specifies the type of the function passed to
372  * gdk_pixbuf_save_to_callback().  It is called once for each block of
373  * bytes that is "written" by gdk_pixbuf_save_to_callback().  If
374  * successful it should return %TRUE.  If an error occurs it should set
375  * @error and return %FALSE, in which case gdk_pixbuf_save_to_callback()
376  * will fail with the same error.
377  *
378  * Params:
379  *     buf = bytes to be written.
380  *     count = number of bytes in @buf.
381  *     error = A location to return an error.
382  *     data = user data passed to gdk_pixbuf_save_to_callback().
383  *
384  * Returns: %TRUE if successful, %FALSE (with @error set) if failed.
385  *
386  * Since: 2.4
387  */
388 public alias extern(C) int function(char* buf, size_t count, GError** error, void* data) GdkPixbufSaveFunc;
389 
390 enum PIXBUF_FEATURES_H = 1;
391 alias GDK_PIXBUF_FEATURES_H = PIXBUF_FEATURES_H;
392 
393 /**
394  * Major version of gdk-pixbuf library, that is the "0" in
395  * "0.8.2" for example.
396  */
397 enum PIXBUF_MAJOR = 2;
398 alias GDK_PIXBUF_MAJOR = PIXBUF_MAJOR;
399 
400 /**
401  * Micro version of gdk-pixbuf library, that is the "2" in
402  * "0.8.2" for example.
403  */
404 enum PIXBUF_MICRO = 1;
405 alias GDK_PIXBUF_MICRO = PIXBUF_MICRO;
406 
407 /**
408  * Minor version of gdk-pixbuf library, that is the "8" in
409  * "0.8.2" for example.
410  */
411 enum PIXBUF_MINOR = 38;
412 alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;
413 
414 /**
415  * Contains the full version of the gdk-pixbuf header as a string.
416  * This is the version being compiled against; contrast with
417  * #gdk_pixbuf_version.
418  */
419 enum PIXBUF_VERSION = "2.38.1";
420 alias GDK_PIXBUF_VERSION = PIXBUF_VERSION;
421 
422 /**
423  * Magic number for #GdkPixdata structures.
424  */
425 enum PIXBUF_MAGIC_NUMBER = 1197763408;
426 alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;
427 
428 /**
429  * The length of a #GdkPixdata structure without the @pixel_data pointer.
430  */
431 enum PIXDATA_HEADER_LENGTH = 24;
432 alias GDK_PIXDATA_HEADER_LENGTH = PIXDATA_HEADER_LENGTH;