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