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