fluidvis
FreeImage.h
1 // ==========================================================
2 // FreeImage 3
3 //
4 // Design and implementation by
5 // - Floris van den Berg (flvdberg@wxs.nl)
6 // - Hervé Drolon (drolon@infonie.fr)
7 //
8 // Contributors:
9 // - see changes log named 'Whatsnew.txt', see header of each .h and .cpp file
10 //
11 // This file is part of FreeImage 3
12 //
13 // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
14 // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
15 // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
16 // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
17 // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
18 // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
19 // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
20 // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
21 // THIS DISCLAIMER.
22 //
23 // Use at your own risk!
24 // ==========================================================
25 
26 #ifndef FREEIMAGE_H
27 #define FREEIMAGE_H
28 
29 // Version information ------------------------------------------------------
30 
31 #define FREEIMAGE_MAJOR_VERSION 3
32 #define FREEIMAGE_MINOR_VERSION 15
33 #define FREEIMAGE_RELEASE_SERIAL 4
34 
35 // Compiler options ---------------------------------------------------------
36 
37 #include <wchar.h> // needed for UNICODE functions
38 
39 #if defined(FREEIMAGE_LIB)
40  #define DLL_API
41  #define DLL_CALLCONV
42 #else
43  #if defined(_WIN32) || defined(__WIN32__)
44  #define DLL_CALLCONV __stdcall
45  // The following ifdef block is the standard way of creating macros which make exporting
46  // from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS
47  // symbol defined on the command line. this symbol should not be defined on any project
48  // that uses this DLL. This way any other project whose source files include this file see
49  // DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
50  // defined with this macro as being exported.
51  #ifdef FREEIMAGE_EXPORTS
52  #define DLL_API __declspec(dllexport)
53  #else
54  #define DLL_API __declspec(dllimport)
55  #endif // FREEIMAGE_EXPORTS
56  #else
57  // try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)
58  #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
59  #ifndef GCC_HASCLASSVISIBILITY
60  #define GCC_HASCLASSVISIBILITY
61  #endif
62  #endif // __GNUC__
63  #define DLL_CALLCONV
64  #if defined(GCC_HASCLASSVISIBILITY)
65  #define DLL_API __attribute__ ((visibility("default")))
66  #else
67  #define DLL_API
68  #endif
69  #endif // WIN32 / !WIN32
70 #endif // FREEIMAGE_LIB
71 
72 // Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined
73 // If your big endian system isn't being detected, add an OS specific check
74 #if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || \
75  (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || \
76  defined(__BIG_ENDIAN__)
77 #define FREEIMAGE_BIGENDIAN
78 #endif // BYTE_ORDER
79 
80 // This really only affects 24 and 32 bit formats, the rest are always RGB order.
81 #define FREEIMAGE_COLORORDER_BGR 0
82 #define FREEIMAGE_COLORORDER_RGB 1
83 #if defined(FREEIMAGE_BIGENDIAN)
84 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB
85 #else
86 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
87 #endif
88 
89 // Ensure 4-byte enums if we're using Borland C++ compilers
90 #if defined(__BORLANDC__)
91 #pragma option push -b
92 #endif
93 
94 // For C compatibility --------------------------------------------------------
95 
96 #ifdef __cplusplus
97 #define FI_DEFAULT(x) = x
98 #define FI_ENUM(x) enum x
99 #define FI_STRUCT(x) struct x
100 #else
101 #define FI_DEFAULT(x)
102 #define FI_ENUM(x) typedef int x; enum x
103 #define FI_STRUCT(x) typedef struct x x; struct x
104 #endif
105 
106 // Bitmap types -------------------------------------------------------------
107 
108 FI_STRUCT (FIBITMAP) { void *data; };
109 FI_STRUCT (FIMULTIBITMAP) { void *data; };
110 
111 // Types used in the library (directly copied from Windows) -----------------
112 
113 #if defined(__MINGW32__) && defined(_WINDOWS_H)
114 #define _WINDOWS_ // prevent a bug in MinGW32
115 #endif // __MINGW32__
116 
117 #ifndef _WINDOWS_
118 #define _WINDOWS_
119 
120 #ifndef FALSE
121 #define FALSE 0
122 #endif
123 #ifndef TRUE
124 #define TRUE 1
125 #endif
126 #ifndef NULL
127 #define NULL 0
128 #endif
129 
130 #ifndef SEEK_SET
131 #define SEEK_SET 0
132 #define SEEK_CUR 1
133 #define SEEK_END 2
134 #endif
135 
136 #ifndef _MSC_VER
137 // define portable types for 32-bit / 64-bit OS
138 #include <inttypes.h>
139 typedef int32_t BOOL;
140 typedef uint8_t BYTE;
141 typedef uint16_t WORD;
142 typedef uint32_t DWORD;
143 typedef int32_t LONG;
144 typedef int64_t INT64;
145 typedef uint64_t UINT64;
146 #else
147 // MS is not C99 ISO compliant
148 typedef long BOOL;
149 typedef unsigned char BYTE;
150 typedef unsigned short WORD;
151 typedef unsigned long DWORD;
152 typedef long LONG;
153 typedef signed __int64 INT64;
154 typedef unsigned __int64 UINT64;
155 #endif // _MSC_VER
156 
157 #if (defined(_WIN32) || defined(__WIN32__))
158 #pragma pack(push, 1)
159 #else
160 #pragma pack(1)
161 #endif // WIN32
162 
163 typedef struct tagRGBQUAD {
164 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
165  BYTE rgbBlue;
166  BYTE rgbGreen;
167  BYTE rgbRed;
168 #else
169  BYTE rgbRed;
170  BYTE rgbGreen;
171  BYTE rgbBlue;
172 #endif // FREEIMAGE_COLORORDER
173  BYTE rgbReserved;
174 } RGBQUAD;
175 
176 typedef struct tagRGBTRIPLE {
177 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
178  BYTE rgbtBlue;
179  BYTE rgbtGreen;
180  BYTE rgbtRed;
181 #else
182  BYTE rgbtRed;
183  BYTE rgbtGreen;
184  BYTE rgbtBlue;
185 #endif // FREEIMAGE_COLORORDER
186 } RGBTRIPLE;
187 
188 #if (defined(_WIN32) || defined(__WIN32__))
189 #pragma pack(pop)
190 #else
191 #pragma pack()
192 #endif // WIN32
193 
194 typedef struct tagBITMAPINFOHEADER{
195  DWORD biSize;
196  LONG biWidth;
197  LONG biHeight;
198  WORD biPlanes;
199  WORD biBitCount;
200  DWORD biCompression;
201  DWORD biSizeImage;
202  LONG biXPelsPerMeter;
203  LONG biYPelsPerMeter;
204  DWORD biClrUsed;
205  DWORD biClrImportant;
207 
208 typedef struct tagBITMAPINFO {
209  BITMAPINFOHEADER bmiHeader;
210  RGBQUAD bmiColors[1];
212 
213 #endif // _WINDOWS_
214 
215 // Types used in the library (specific to FreeImage) ------------------------
216 
217 #if (defined(_WIN32) || defined(__WIN32__))
218 #pragma pack(push, 1)
219 #else
220 #pragma pack(1)
221 #endif // WIN32
222 
225 typedef struct tagFIRGB16 {
226  WORD red;
227  WORD green;
228  WORD blue;
229 } FIRGB16;
230 
233 typedef struct tagFIRGBA16 {
234  WORD red;
235  WORD green;
236  WORD blue;
237  WORD alpha;
238 } FIRGBA16;
239 
242 typedef struct tagFIRGBF {
243  float red;
244  float green;
245  float blue;
246 } FIRGBF;
247 
250 typedef struct tagFIRGBAF {
251  float red;
252  float green;
253  float blue;
254  float alpha;
255 } FIRGBAF;
256 
259 typedef struct tagFICOMPLEX {
261  double r;
263  double i;
264 } FICOMPLEX;
265 
266 #if (defined(_WIN32) || defined(__WIN32__))
267 #pragma pack(pop)
268 #else
269 #pragma pack()
270 #endif // WIN32
271 
272 // Indexes for byte arrays, masks and shifts for treating pixels as words ---
273 // These coincide with the order of RGBQUAD and RGBTRIPLE -------------------
274 
275 #ifndef FREEIMAGE_BIGENDIAN
276 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
277 // Little Endian (x86 / MS Windows, Linux) : BGR(A) order
278 #define FI_RGBA_RED 2
279 #define FI_RGBA_GREEN 1
280 #define FI_RGBA_BLUE 0
281 #define FI_RGBA_ALPHA 3
282 #define FI_RGBA_RED_MASK 0x00FF0000
283 #define FI_RGBA_GREEN_MASK 0x0000FF00
284 #define FI_RGBA_BLUE_MASK 0x000000FF
285 #define FI_RGBA_ALPHA_MASK 0xFF000000
286 #define FI_RGBA_RED_SHIFT 16
287 #define FI_RGBA_GREEN_SHIFT 8
288 #define FI_RGBA_BLUE_SHIFT 0
289 #define FI_RGBA_ALPHA_SHIFT 24
290 #else
291 // Little Endian (x86 / MaxOSX) : RGB(A) order
292 #define FI_RGBA_RED 0
293 #define FI_RGBA_GREEN 1
294 #define FI_RGBA_BLUE 2
295 #define FI_RGBA_ALPHA 3
296 #define FI_RGBA_RED_MASK 0x000000FF
297 #define FI_RGBA_GREEN_MASK 0x0000FF00
298 #define FI_RGBA_BLUE_MASK 0x00FF0000
299 #define FI_RGBA_ALPHA_MASK 0xFF000000
300 #define FI_RGBA_RED_SHIFT 0
301 #define FI_RGBA_GREEN_SHIFT 8
302 #define FI_RGBA_BLUE_SHIFT 16
303 #define FI_RGBA_ALPHA_SHIFT 24
304 #endif // FREEIMAGE_COLORORDER
305 #else
306 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
307 // Big Endian (PPC / none) : BGR(A) order
308 #define FI_RGBA_RED 2
309 #define FI_RGBA_GREEN 1
310 #define FI_RGBA_BLUE 0
311 #define FI_RGBA_ALPHA 3
312 #define FI_RGBA_RED_MASK 0x0000FF00
313 #define FI_RGBA_GREEN_MASK 0x00FF0000
314 #define FI_RGBA_BLUE_MASK 0xFF000000
315 #define FI_RGBA_ALPHA_MASK 0x000000FF
316 #define FI_RGBA_RED_SHIFT 8
317 #define FI_RGBA_GREEN_SHIFT 16
318 #define FI_RGBA_BLUE_SHIFT 24
319 #define FI_RGBA_ALPHA_SHIFT 0
320 #else
321 // Big Endian (PPC / Linux, MaxOSX) : RGB(A) order
322 #define FI_RGBA_RED 0
323 #define FI_RGBA_GREEN 1
324 #define FI_RGBA_BLUE 2
325 #define FI_RGBA_ALPHA 3
326 #define FI_RGBA_RED_MASK 0xFF000000
327 #define FI_RGBA_GREEN_MASK 0x00FF0000
328 #define FI_RGBA_BLUE_MASK 0x0000FF00
329 #define FI_RGBA_ALPHA_MASK 0x000000FF
330 #define FI_RGBA_RED_SHIFT 24
331 #define FI_RGBA_GREEN_SHIFT 16
332 #define FI_RGBA_BLUE_SHIFT 8
333 #define FI_RGBA_ALPHA_SHIFT 0
334 #endif // FREEIMAGE_COLORORDER
335 #endif // FREEIMAGE_BIGENDIAN
336 
337 #define FI_RGBA_RGB_MASK (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK)
338 
339 // The 16bit macros only include masks and shifts, since each color element is not byte aligned
340 
341 #define FI16_555_RED_MASK 0x7C00
342 #define FI16_555_GREEN_MASK 0x03E0
343 #define FI16_555_BLUE_MASK 0x001F
344 #define FI16_555_RED_SHIFT 10
345 #define FI16_555_GREEN_SHIFT 5
346 #define FI16_555_BLUE_SHIFT 0
347 #define FI16_565_RED_MASK 0xF800
348 #define FI16_565_GREEN_MASK 0x07E0
349 #define FI16_565_BLUE_MASK 0x001F
350 #define FI16_565_RED_SHIFT 11
351 #define FI16_565_GREEN_SHIFT 5
352 #define FI16_565_BLUE_SHIFT 0
353 
354 // ICC profile support ------------------------------------------------------
355 
356 #define FIICC_DEFAULT 0x00
357 #define FIICC_COLOR_IS_CMYK 0x01
358 
359 FI_STRUCT (FIICCPROFILE) {
360  WORD flags; // info flag
361  DWORD size; // profile's size measured in bytes
362  void *data; // points to a block of contiguous memory containing the profile
363 };
364 
365 // Important enums ----------------------------------------------------------
366 
369 FI_ENUM(FREE_IMAGE_FORMAT) {
370  FIF_UNKNOWN = -1,
371  FIF_BMP = 0,
372  FIF_ICO = 1,
373  FIF_JPEG = 2,
374  FIF_JNG = 3,
375  FIF_KOALA = 4,
376  FIF_LBM = 5,
377  FIF_IFF = FIF_LBM,
378  FIF_MNG = 6,
379  FIF_PBM = 7,
380  FIF_PBMRAW = 8,
381  FIF_PCD = 9,
382  FIF_PCX = 10,
383  FIF_PGM = 11,
384  FIF_PGMRAW = 12,
385  FIF_PNG = 13,
386  FIF_PPM = 14,
387  FIF_PPMRAW = 15,
388  FIF_RAS = 16,
389  FIF_TARGA = 17,
390  FIF_TIFF = 18,
391  FIF_WBMP = 19,
392  FIF_PSD = 20,
393  FIF_CUT = 21,
394  FIF_XBM = 22,
395  FIF_XPM = 23,
396  FIF_DDS = 24,
397  FIF_GIF = 25,
398  FIF_HDR = 26,
399  FIF_FAXG3 = 27,
400  FIF_SGI = 28,
401  FIF_EXR = 29,
402  FIF_J2K = 30,
403  FIF_JP2 = 31,
404  FIF_PFM = 32,
405  FIF_PICT = 33,
406  FIF_RAW = 34
407 };
408 
411 FI_ENUM(FREE_IMAGE_TYPE) {
412  FIT_UNKNOWN = 0, // unknown type
413  FIT_BITMAP = 1, // standard image : 1-, 4-, 8-, 16-, 24-, 32-bit
414  FIT_UINT16 = 2, // array of unsigned short : unsigned 16-bit
415  FIT_INT16 = 3, // array of short : signed 16-bit
416  FIT_UINT32 = 4, // array of unsigned long : unsigned 32-bit
417  FIT_INT32 = 5, // array of long : signed 32-bit
418  FIT_FLOAT = 6, // array of float : 32-bit IEEE floating point
419  FIT_DOUBLE = 7, // array of double : 64-bit IEEE floating point
420  FIT_COMPLEX = 8, // array of FICOMPLEX : 2 x 64-bit IEEE floating point
421  FIT_RGB16 = 9, // 48-bit RGB image : 3 x 16-bit
422  FIT_RGBA16 = 10, // 64-bit RGBA image : 4 x 16-bit
423  FIT_RGBF = 11, // 96-bit RGB float image : 3 x 32-bit IEEE floating point
424  FIT_RGBAF = 12 // 128-bit RGBA float image : 4 x 32-bit IEEE floating point
425 };
426 
429 FI_ENUM(FREE_IMAGE_COLOR_TYPE) {
430  FIC_MINISWHITE = 0, // min value is white
431  FIC_MINISBLACK = 1, // min value is black
432  FIC_RGB = 2, // RGB color model
433  FIC_PALETTE = 3, // color map indexed
434  FIC_RGBALPHA = 4, // RGB color model with alpha channel
435  FIC_CMYK = 5 // CMYK color model
436 };
437 
441 FI_ENUM(FREE_IMAGE_QUANTIZE) {
442  FIQ_WUQUANT = 0, // Xiaolin Wu color quantization algorithm
443  FIQ_NNQUANT = 1 // NeuQuant neural-net quantization algorithm by Anthony Dekker
444 };
445 
449 FI_ENUM(FREE_IMAGE_DITHER) {
450  FID_FS = 0, // Floyd & Steinberg error diffusion
451  FID_BAYER4x4 = 1, // Bayer ordered dispersed dot dithering (order 2 dithering matrix)
452  FID_BAYER8x8 = 2, // Bayer ordered dispersed dot dithering (order 3 dithering matrix)
453  FID_CLUSTER6x6 = 3, // Ordered clustered dot dithering (order 3 - 6x6 matrix)
454  FID_CLUSTER8x8 = 4, // Ordered clustered dot dithering (order 4 - 8x8 matrix)
455  FID_CLUSTER16x16= 5, // Ordered clustered dot dithering (order 8 - 16x16 matrix)
456  FID_BAYER16x16 = 6 // Bayer ordered dispersed dot dithering (order 4 dithering matrix)
457 };
458 
462 FI_ENUM(FREE_IMAGE_JPEG_OPERATION) {
463  FIJPEG_OP_NONE = 0, // no transformation
464  FIJPEG_OP_FLIP_H = 1, // horizontal flip
465  FIJPEG_OP_FLIP_V = 2, // vertical flip
466  FIJPEG_OP_TRANSPOSE = 3, // transpose across UL-to-LR axis
467  FIJPEG_OP_TRANSVERSE = 4, // transpose across UR-to-LL axis
468  FIJPEG_OP_ROTATE_90 = 5, // 90-degree clockwise rotation
469  FIJPEG_OP_ROTATE_180 = 6, // 180-degree rotation
470  FIJPEG_OP_ROTATE_270 = 7 // 270-degree clockwise (or 90 ccw)
471 };
472 
476 FI_ENUM(FREE_IMAGE_TMO) {
477  FITMO_DRAGO03 = 0, // Adaptive logarithmic mapping (F. Drago, 2003)
478  FITMO_REINHARD05 = 1, // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005)
479  FITMO_FATTAL02 = 2 // Gradient domain high dynamic range compression (R. Fattal, 2002)
480 };
481 
485 FI_ENUM(FREE_IMAGE_FILTER) {
486  FILTER_BOX = 0, // Box, pulse, Fourier window, 1st order (constant) b-spline
487  FILTER_BICUBIC = 1, // Mitchell & Netravali's two-param cubic filter
488  FILTER_BILINEAR = 2, // Bilinear filter
489  FILTER_BSPLINE = 3, // 4th order (cubic) b-spline
490  FILTER_CATMULLROM = 4, // Catmull-Rom spline, Overhauser spline
491  FILTER_LANCZOS3 = 5 // Lanczos3 filter
492 };
493 
497 FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) {
498  FICC_RGB = 0, // Use red, green and blue channels
499  FICC_RED = 1, // Use red channel
500  FICC_GREEN = 2, // Use green channel
501  FICC_BLUE = 3, // Use blue channel
502  FICC_ALPHA = 4, // Use alpha channel
503  FICC_BLACK = 5, // Use black channel
504  FICC_REAL = 6, // Complex images: use real part
505  FICC_IMAG = 7, // Complex images: use imaginary part
506  FICC_MAG = 8, // Complex images: use magnitude
507  FICC_PHASE = 9 // Complex images: use phase
508 };
509 
510 // Metadata support ---------------------------------------------------------
511 
517 FI_ENUM(FREE_IMAGE_MDTYPE) {
518  FIDT_NOTYPE = 0, // placeholder
519  FIDT_BYTE = 1, // 8-bit unsigned integer
520  FIDT_ASCII = 2, // 8-bit bytes w/ last byte null
521  FIDT_SHORT = 3, // 16-bit unsigned integer
522  FIDT_LONG = 4, // 32-bit unsigned integer
523  FIDT_RATIONAL = 5, // 64-bit unsigned fraction
524  FIDT_SBYTE = 6, // 8-bit signed integer
525  FIDT_UNDEFINED = 7, // 8-bit untyped data
526  FIDT_SSHORT = 8, // 16-bit signed integer
527  FIDT_SLONG = 9, // 32-bit signed integer
528  FIDT_SRATIONAL = 10, // 64-bit signed fraction
529  FIDT_FLOAT = 11, // 32-bit IEEE floating point
530  FIDT_DOUBLE = 12, // 64-bit IEEE floating point
531  FIDT_IFD = 13, // 32-bit unsigned integer (offset)
532  FIDT_PALETTE = 14, // 32-bit RGBQUAD
533  FIDT_LONG8 = 16, // 64-bit unsigned integer
534  FIDT_SLONG8 = 17, // 64-bit signed integer
535  FIDT_IFD8 = 18 // 64-bit unsigned integer (offset)
536 };
537 
541 FI_ENUM(FREE_IMAGE_MDMODEL) {
542  FIMD_NODATA = -1,
543  FIMD_COMMENTS = 0, // single comment or keywords
544  FIMD_EXIF_MAIN = 1, // Exif-TIFF metadata
545  FIMD_EXIF_EXIF = 2, // Exif-specific metadata
546  FIMD_EXIF_GPS = 3, // Exif GPS metadata
547  FIMD_EXIF_MAKERNOTE = 4, // Exif maker note metadata
548  FIMD_EXIF_INTEROP = 5, // Exif interoperability metadata
549  FIMD_IPTC = 6, // IPTC/NAA metadata
550  FIMD_XMP = 7, // Abobe XMP metadata
551  FIMD_GEOTIFF = 8, // GeoTIFF metadata
552  FIMD_ANIMATION = 9, // Animation metadata
553  FIMD_CUSTOM = 10, // Used to attach other metadata types to a dib
554  FIMD_EXIF_RAW = 11 // Exif metadata as a raw buffer
555 };
556 
560 FI_STRUCT (FIMETADATA) { void *data; };
561 
565 FI_STRUCT (FITAG) { void *data; };
566 
567 // File IO routines ---------------------------------------------------------
568 
569 #ifndef FREEIMAGE_IO
570 #define FREEIMAGE_IO
571 
572 typedef void* fi_handle;
573 typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
574 typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
575 typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin);
576 typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle);
577 
578 #if (defined(_WIN32) || defined(__WIN32__))
579 #pragma pack(push, 1)
580 #else
581 #pragma pack(1)
582 #endif // WIN32
583 
584 FI_STRUCT(FreeImageIO) {
585  FI_ReadProc read_proc; // pointer to the function used to read data
586  FI_WriteProc write_proc; // pointer to the function used to write data
587  FI_SeekProc seek_proc; // pointer to the function used to seek
588  FI_TellProc tell_proc; // pointer to the function used to aquire the current position
589 };
590 
591 #if (defined(_WIN32) || defined(__WIN32__))
592 #pragma pack(pop)
593 #else
594 #pragma pack()
595 #endif // WIN32
596 
600 FI_STRUCT (FIMEMORY) { void *data; };
601 
602 #endif // FREEIMAGE_IO
603 
604 // Plugin routines ----------------------------------------------------------
605 
606 #ifndef PLUGINS
607 #define PLUGINS
608 
609 typedef const char *(DLL_CALLCONV *FI_FormatProc)(void);
610 typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void);
611 typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void);
612 typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void);
613 typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read);
614 typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data);
615 typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data);
616 typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data);
617 typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data);
618 typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data);
619 typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle);
620 typedef const char *(DLL_CALLCONV *FI_MimeProc)(void);
621 typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp);
622 typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type);
623 typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void);
624 typedef BOOL (DLL_CALLCONV *FI_SupportsNoPixelsProc)(void);
625 
626 FI_STRUCT (Plugin) {
627  FI_FormatProc format_proc;
628  FI_DescriptionProc description_proc;
629  FI_ExtensionListProc extension_proc;
630  FI_RegExprProc regexpr_proc;
631  FI_OpenProc open_proc;
632  FI_CloseProc close_proc;
633  FI_PageCountProc pagecount_proc;
634  FI_PageCapabilityProc pagecapability_proc;
635  FI_LoadProc load_proc;
636  FI_SaveProc save_proc;
637  FI_ValidateProc validate_proc;
638  FI_MimeProc mime_proc;
639  FI_SupportsExportBPPProc supports_export_bpp_proc;
640  FI_SupportsExportTypeProc supports_export_type_proc;
641  FI_SupportsICCProfilesProc supports_icc_profiles_proc;
642  FI_SupportsNoPixelsProc supports_no_pixels_proc;
643 };
644 
645 typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id);
646 
647 #endif // PLUGINS
648 
649 
650 // Load / Save flag constants -----------------------------------------------
651 
652 #define FIF_LOAD_NOPIXELS 0x8000 // loading: load the image header only (not supported by all plugins, default to full loading)
653 
654 #define BMP_DEFAULT 0
655 #define BMP_SAVE_RLE 1
656 #define CUT_DEFAULT 0
657 #define DDS_DEFAULT 0
658 #define EXR_DEFAULT 0 // save data as half with piz-based wavelet compression
659 #define EXR_FLOAT 0x0001 // save data as float instead of as half (not recommended)
660 #define EXR_NONE 0x0002 // save with no compression
661 #define EXR_ZIP 0x0004 // save with zlib compression, in blocks of 16 scan lines
662 #define EXR_PIZ 0x0008 // save with piz-based wavelet compression
663 #define EXR_PXR24 0x0010 // save with lossy 24-bit float compression
664 #define EXR_B44 0x0020 // save with lossy 44% float compression - goes to 22% when combined with EXR_LC
665 #define EXR_LC 0x0040 // save images with one luminance and two chroma channels, rather than as RGB (lossy compression)
666 #define FAXG3_DEFAULT 0
667 #define GIF_DEFAULT 0
668 #define GIF_LOAD256 1 // Load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color
669 #define GIF_PLAYBACK 2 // 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading
670 #define HDR_DEFAULT 0
671 #define ICO_DEFAULT 0
672 #define ICO_MAKEALPHA 1 // convert to 32bpp and create an alpha channel from the AND-mask when loading
673 #define IFF_DEFAULT 0
674 #define J2K_DEFAULT 0 // save with a 16:1 rate
675 #define JP2_DEFAULT 0 // save with a 16:1 rate
676 #define JPEG_DEFAULT 0 // loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420)
677 #define JPEG_FAST 0x0001 // load the file as fast as possible, sacrificing some quality
678 #define JPEG_ACCURATE 0x0002 // load the file with the best quality, sacrificing some speed
679 #define JPEG_CMYK 0x0004 // load separated CMYK "as is" (use | to combine with other load flags)
680 #define JPEG_EXIFROTATE 0x0008 // load and rotate according to Exif 'Orientation' tag if available
681 #define JPEG_GREYSCALE 0x0010 // load and convert to a 8-bit greyscale image
682 #define JPEG_QUALITYSUPERB 0x80 // save with superb quality (100:1)
683 #define JPEG_QUALITYGOOD 0x0100 // save with good quality (75:1)
684 #define JPEG_QUALITYNORMAL 0x0200 // save with normal quality (50:1)
685 #define JPEG_QUALITYAVERAGE 0x0400 // save with average quality (25:1)
686 #define JPEG_QUALITYBAD 0x0800 // save with bad quality (10:1)
687 #define JPEG_PROGRESSIVE 0x2000 // save as a progressive-JPEG (use | to combine with other save flags)
688 #define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1)
689 #define JPEG_SUBSAMPLING_420 0x4000 // save with medium 2x2 medium chroma subsampling (4:2:0) - default value
690 #define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2)
691 #define JPEG_SUBSAMPLING_444 0x10000 // save with no chroma subsampling (4:4:4)
692 #define JPEG_OPTIMIZE 0x20000 // on saving, compute optimal Huffman coding tables (can reduce a few percent of file size)
693 #define JPEG_BASELINE 0x40000 // save basic JPEG, without metadata or any markers
694 #define KOALA_DEFAULT 0
695 #define LBM_DEFAULT 0
696 #define MNG_DEFAULT 0
697 #define PCD_DEFAULT 0
698 #define PCD_BASE 1 // load the bitmap sized 768 x 512
699 #define PCD_BASEDIV4 2 // load the bitmap sized 384 x 256
700 #define PCD_BASEDIV16 3 // load the bitmap sized 192 x 128
701 #define PCX_DEFAULT 0
702 #define PFM_DEFAULT 0
703 #define PICT_DEFAULT 0
704 #define PNG_DEFAULT 0
705 #define PNG_IGNOREGAMMA 1 // loading: avoid gamma correction
706 #define PNG_Z_BEST_SPEED 0x0001 // save using ZLib level 1 compression flag (default value is 6)
707 #define PNG_Z_DEFAULT_COMPRESSION 0x0006 // save using ZLib level 6 compression flag (default recommended value)
708 #define PNG_Z_BEST_COMPRESSION 0x0009 // save using ZLib level 9 compression flag (default value is 6)
709 #define PNG_Z_NO_COMPRESSION 0x0100 // save without ZLib compression
710 #define PNG_INTERLACED 0x0200 // save using Adam7 interlacing (use | to combine with other save flags)
711 #define PNM_DEFAULT 0
712 #define PNM_SAVE_RAW 0 // If set the writer saves in RAW format (i.e. P4, P5 or P6)
713 #define PNM_SAVE_ASCII 1 // If set the writer saves in ASCII format (i.e. P1, P2 or P3)
714 #define PSD_DEFAULT 0
715 #define PSD_CMYK 1 // reads tags for separated CMYK (default is conversion to RGB)
716 #define PSD_LAB 2 // reads tags for CIELab (default is conversion to RGB)
717 #define RAS_DEFAULT 0
718 #define RAW_DEFAULT 0 // load the file as linear RGB 48-bit
719 #define RAW_PREVIEW 1 // try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit
720 #define RAW_DISPLAY 2 // load the file as RGB 24-bit
721 #define RAW_HALFSIZE 4 // output a half-size color image
722 #define SGI_DEFAULT 0
723 #define TARGA_DEFAULT 0
724 #define TARGA_LOAD_RGB888 1 // If set the loader converts RGB555 and ARGB8888 -> RGB888.
725 #define TARGA_SAVE_RLE 2 // If set, the writer saves with RLE compression
726 #define TIFF_DEFAULT 0
727 #define TIFF_CMYK 0x0001 // reads/stores tags for separated CMYK (use | to combine with compression flags)
728 #define TIFF_PACKBITS 0x0100 // save using PACKBITS compression
729 #define TIFF_DEFLATE 0x0200 // save using DEFLATE compression (a.k.a. ZLIB compression)
730 #define TIFF_ADOBE_DEFLATE 0x0400 // save using ADOBE DEFLATE compression
731 #define TIFF_NONE 0x0800 // save without any compression
732 #define TIFF_CCITTFAX3 0x1000 // save using CCITT Group 3 fax encoding
733 #define TIFF_CCITTFAX4 0x2000 // save using CCITT Group 4 fax encoding
734 #define TIFF_LZW 0x4000 // save using LZW compression
735 #define TIFF_JPEG 0x8000 // save using JPEG compression
736 #define TIFF_LOGLUV 0x10000 // save using LogLuv compression
737 #define WBMP_DEFAULT 0
738 #define XBM_DEFAULT 0
739 #define XPM_DEFAULT 0
740 
741 // Background filling options ---------------------------------------------------------
742 // Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas
743 
744 #define FI_COLOR_IS_RGB_COLOR 0x00 // RGBQUAD color is a RGB color (contains no valid alpha channel)
745 #define FI_COLOR_IS_RGBA_COLOR 0x01 // RGBQUAD color is a RGBA color (contains a valid alpha channel)
746 #define FI_COLOR_FIND_EQUAL_COLOR 0x02 // For palettized images: lookup equal RGB color from palette
747 #define FI_COLOR_ALPHA_IS_INDEX 0x04 // The color's rgbReserved member (alpha) contains the palette index to be used
748 #define FI_COLOR_PALETTE_SEARCH_MASK (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX) // No color lookup is performed
749 
750 
751 #ifdef __cplusplus
752 extern "C" {
753 #endif
754 
755 // Init / Error routines ----------------------------------------------------
756 
757 DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));
758 DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void);
759 
760 // Version routines ---------------------------------------------------------
761 
762 DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);
763 DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void);
764 
765 // Message output functions -------------------------------------------------
766 
767 typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);
768 typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg);
769 
770 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf);
771 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);
772 DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);
773 
774 // Allocate / Clone / Unload routines ---------------------------------------
775 
776 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Allocate(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
777 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateT(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
778 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);
779 DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);
780 
781 // Header loading routines
782 DLL_API BOOL DLL_CALLCONV FreeImage_HasPixels(FIBITMAP *dib);
783 
784 // Load / Save routines -----------------------------------------------------
785 
786 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
787 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
788 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
789 DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));
790 DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));
791 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
792 
793 // Memory I/O stream routines -----------------------------------------------
794 
795 DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
796 DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);
797 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
798 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
799 DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);
800 DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);
801 DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
802 DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
803 DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
804 
805 DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
806 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToMemory(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FIMEMORY *stream, int flags);
807 
808 // Plugin Interface ---------------------------------------------------------
809 
810 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterLocalPlugin(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
811 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterExternalPlugin(const char *path, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
812 DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);
813 DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);
814 DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);
815 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);
816 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);
817 DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);
818 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);
819 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);
820 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);
821 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);
822 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);
823 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);
824 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);
825 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);
826 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);
827 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
828 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);
829 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsNoPixels(FREE_IMAGE_FORMAT fif);
830 
831 // Multipaging interface ----------------------------------------------------
832 
833 DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT fif, const char *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0));
834 DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
835 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToHandle(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
836 DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));
837 DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap);
838 DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data);
839 DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);
840 DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page);
841 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page);
842 DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);
843 DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source);
844 DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count);
845 
846 // Filetype request routines ------------------------------------------------
847 
848 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0));
849 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0));
850 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));
851 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0));
852 
853 // Image type request routine -----------------------------------------------
854 
855 DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib);
856 
857 // FreeImage helper routines ------------------------------------------------
858 
859 DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void);
860 DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
861 DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
862 
863 // Pixel access routines ----------------------------------------------------
864 
865 DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib);
866 DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline);
867 
868 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
869 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
870 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
871 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
872 
873 // DIB info routines --------------------------------------------------------
874 
875 DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib);
876 DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib);
877 DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib);
878 DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib);
879 DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib);
880 DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib);
881 DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib);
882 DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib);
883 
884 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib);
885 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib);
886 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res);
887 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res);
888 
889 DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib);
890 DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib);
891 DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib);
892 
893 DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib);
894 DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib);
895 DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib);
896 
897 DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib);
898 DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib);
899 DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled);
900 DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count);
901 DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib);
902 DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index);
903 DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib);
904 
905 DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib);
906 DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
907 DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
908 
909 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetThumbnail(FIBITMAP *dib);
910 DLL_API BOOL DLL_CALLCONV FreeImage_SetThumbnail(FIBITMAP *dib, FIBITMAP *thumbnail);
911 
912 // ICC profile routines -----------------------------------------------------
913 
914 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib);
915 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size);
916 DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib);
917 
918 // Line conversion routines -------------------------------------------------
919 
920 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);
921 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
922 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);
923 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);
924 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);
925 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);
926 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);
927 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);
928 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);
929 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);
930 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);
931 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);
932 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
933 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
934 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
935 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);
936 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);
937 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);
938 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
939 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
940 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
941 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);
942 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);
943 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);
944 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
945 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
946 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
947 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);
948 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);
949 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);
950 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
951 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
952 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
953 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);
954 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);
955 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);
956 
957 // Smart conversion routines ------------------------------------------------
958 
959 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib);
960 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib);
961 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib);
962 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib);
963 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib);
964 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib);
965 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib);
966 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
967 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize FI_DEFAULT(FIQ_WUQUANT), int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL));
968 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T);
969 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);
970 
971 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBits(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
972 DLL_API void DLL_CALLCONV FreeImage_ConvertToRawBits(BYTE *bits, FIBITMAP *dib, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
973 
974 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToFloat(FIBITMAP *dib);
975 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib);
976 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToUINT16(FIBITMAP *dib);
977 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGB16(FIBITMAP *dib);
978 
979 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));
980 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));
981 
982 // tone mapping operators
983 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param FI_DEFAULT(0), double second_param FI_DEFAULT(0));
984 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));
985 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));
986 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05Ex(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0), double adaptation FI_DEFAULT(1), double color_correction FI_DEFAULT(0));
987 
988 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85));
989 
990 // ZLib interface -----------------------------------------------------------
991 
992 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
993 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
994 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
995 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
996 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size);
997 
998 // --------------------------------------------------------------------------
999 // Metadata routines --------------------------------------------------------
1000 // --------------------------------------------------------------------------
1001 
1002 // tag creation / destruction
1003 DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void);
1004 DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag);
1005 DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);
1006 
1007 // tag getters and setters
1008 DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);
1009 DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);
1010 DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
1011 DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);
1012 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);
1013 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);
1014 DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);
1015 
1016 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);
1017 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);
1018 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);
1019 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);
1020 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);
1021 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);
1022 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value);
1023 
1024 // iterator
1025 DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);
1026 DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag);
1027 DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle);
1028 
1029 // metadata setter and getter
1030 DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);
1031 DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);
1032 
1033 // helpers
1034 DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);
1035 DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src);
1036 
1037 // tag to C string conversion
1038 DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));
1039 
1040 // --------------------------------------------------------------------------
1041 // Image manipulation toolkit -----------------------------------------------
1042 // --------------------------------------------------------------------------
1043 
1044 // rotation and flipping
1046 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle);
1047 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL));
1048 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask);
1049 DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib);
1050 DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib);
1051 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE));
1052 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE));
1053 
1054 // upsampling / downsampling
1055 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter);
1056 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));
1057 
1058 // color manipulation routines (point operations)
1059 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);
1060 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma);
1061 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage);
1062 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);
1063 DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);
1064 DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));
1065 DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);
1066 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));
1067 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);
1068 DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);
1069 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap);
1070 DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);
1071 
1072 // channel processing routines
1073 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
1074 DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
1075 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
1076 DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
1077 
1078 // copy / paste / composite routines
1079 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);
1080 DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
1081 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));
1082 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);
1083 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCropU(const wchar_t *src_file, const wchar_t *dst_file, int left, int top, int right, int bottom);
1084 DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib);
1085 
1086 // background filling routines
1087 DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0));
1088 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_EnlargeCanvas(FIBITMAP *src, int left, int top, int right, int bottom, const void *color, int options FI_DEFAULT(0));
1089 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateEx(int width, int height, int bpp, const RGBQUAD *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
1090 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateExT(FREE_IMAGE_TYPE type, int width, int height, int bpp, const void *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
1091 
1092 // miscellaneous algorithms
1093 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3));
1094 
1095 // restore the borland-specific enum size option
1096 #if defined(__BORLANDC__)
1097 #pragma option pop
1098 #endif
1099 
1100 #ifdef __cplusplus
1101 }
1102 #endif
1103 
1104 #endif // FREEIMAGE_H
Definition: FreeImage.h:163
Definition: FreeImage.h:259
Definition: FreeImage.h:176
double i
imaginary part
Definition: FreeImage.h:263
Definition: FreeImage.h:250
Definition: FreeImage.h:208
Definition: FreeImage.h:225
Definition: FreeImage.h:233
Definition: FreeImage.h:194
double r
real part
Definition: FreeImage.h:261
Definition: FreeImage.h:242