• R/O
  • SSH
  • HTTPS

oricsdk: Commit


Commit MetaInfo

Revision1566 (tree)
Time2021-08-12 00:45:38
Authordbug

Log Message

Updated FreeImage project files to build with VS2019

Change Summary

Incremental Difference

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