--- /dev/null
+// ==========================================================\r
+// FreeImage 3\r
+//\r
+// Design and implementation by\r
+// - Floris van den Berg (flvdberg@wxs.nl)\r
+// - Hervé Drolon (drolon@infonie.fr)\r
+//\r
+// Contributors:\r
+// - Adam Gates (radad@xoasis.com)\r
+// - Alex Kwak\r
+// - Alexander Dymerets (sashad@te.net.ua)\r
+// - Detlev Vendt (detlev.vendt@brillit.de)\r
+// - Jan L. Nauta (jln@magentammt.com)\r
+// - Jani Kajala (janik@remedy.fi)\r
+// - Juergen Riecker (j.riecker@gmx.de)\r
+// - Karl-Heinz Bussian (khbussian@moss.de)\r
+// - Laurent Rocher (rocherl@club-internet.fr)\r
+// - Luca Piergentili (l.pierge@terra.es)\r
+// - Machiel ten Brinke (brinkem@uni-one.nl)\r
+// - Markus Loibl (markus.loibl@epost.de)\r
+// - Martin Weber (martweb@gmx.net)\r
+// - Matthias Wandel (mwandel@rim.net)\r
+// - Michal Novotny (michal@etc.cz)\r
+// - Petr Pytelka (pyta@lightcomp.com)\r
+// - Riley McNiff (rmcniff@marexgroup.com)\r
+// - Ryan Rubley (ryan@lostreality.org)\r
+// - Volker Gärtner (volkerg@gmx.at)\r
+//\r
+// This file is part of FreeImage 3\r
+//\r
+// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY\r
+// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES\r
+// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE\r
+// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED\r
+// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT\r
+// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY\r
+// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL\r
+// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER\r
+// THIS DISCLAIMER.\r
+//\r
+// Use at your own risk!\r
+// ==========================================================\r
+\r
+#ifndef FREEIMAGE_H\r
+#define FREEIMAGE_H\r
+\r
+// Version information ------------------------------------------------------\r
+\r
+#define FREEIMAGE_MAJOR_VERSION 3\r
+#define FREEIMAGE_MINOR_VERSION 13\r
+#define FREEIMAGE_RELEASE_SERIAL 1\r
+\r
+// Compiler options ---------------------------------------------------------\r
+\r
+#include <wchar.h> // needed for UNICODE functions\r
+\r
+#if defined(FREEIMAGE_LIB)\r
+ #define DLL_API\r
+ #define DLL_CALLCONV\r
+#else\r
+ #if defined(_WIN32) || defined(__WIN32__)\r
+ #define DLL_CALLCONV __stdcall\r
+ // The following ifdef block is the standard way of creating macros which make exporting \r
+ // from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS\r
+ // symbol defined on the command line. this symbol should not be defined on any project\r
+ // that uses this DLL. This way any other project whose source files include this file see \r
+ // DLL_API functions as being imported from a DLL, wheras this DLL sees symbols\r
+ // defined with this macro as being exported.\r
+ #ifdef FREEIMAGE_EXPORTS\r
+ #define DLL_API __declspec(dllexport)\r
+ #else\r
+ #define DLL_API __declspec(dllimport)\r
+ #endif // FREEIMAGE_EXPORTS\r
+ #else \r
+ // try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)\r
+ #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))\r
+ #ifndef GCC_HASCLASSVISIBILITY\r
+ #define GCC_HASCLASSVISIBILITY\r
+ #endif\r
+ #endif // __GNUC__\r
+ #define DLL_CALLCONV\r
+ #if defined(GCC_HASCLASSVISIBILITY)\r
+ #define DLL_API __attribute__ ((visibility("default")))\r
+ #else\r
+ #define DLL_API\r
+ #endif \r
+ #endif // WIN32 / !WIN32\r
+#endif // FREEIMAGE_LIB\r
+\r
+// Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined\r
+// If your big endian system isn't being detected, add an OS specific check\r
+#if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || \\r
+ (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || \\r
+ defined(__BIG_ENDIAN__)\r
+#define FREEIMAGE_BIGENDIAN\r
+#endif // BYTE_ORDER\r
+\r
+// This really only affects 24 and 32 bit formats, the rest are always RGB order.\r
+#define FREEIMAGE_COLORORDER_BGR 0\r
+#define FREEIMAGE_COLORORDER_RGB 1\r
+#if defined(FREEIMAGE_BIGENDIAN)\r
+#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB\r
+#else\r
+#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR\r
+#endif\r
+\r
+// Ensure 4-byte enums if we're using Borland C++ compilers\r
+#if defined(__BORLANDC__)\r
+#pragma option push -b\r
+#endif\r
+\r
+// For C compatibility --------------------------------------------------------\r
+\r
+#ifdef __cplusplus\r
+#define FI_DEFAULT(x) = x\r
+#define FI_ENUM(x) enum x\r
+#define FI_STRUCT(x) struct x\r
+#else\r
+#define FI_DEFAULT(x)\r
+#define FI_ENUM(x) typedef int x; enum x\r
+#define FI_STRUCT(x) typedef struct x x; struct x\r
+#endif\r
+\r
+// Bitmap types -------------------------------------------------------------\r
+\r
+FI_STRUCT (FIBITMAP) { void *data; };\r
+FI_STRUCT (FIMULTIBITMAP) { void *data; };\r
+\r
+// Types used in the library (directly copied from Windows) -----------------\r
+\r
+#if defined(__MINGW32__) && defined(_WINDOWS_H)\r
+#define _WINDOWS_ // prevent a bug in MinGW32\r
+#endif // __MINGW32__\r
+\r
+#ifndef _WINDOWS_\r
+#define _WINDOWS_\r
+\r
+#ifndef FALSE\r
+#define FALSE 0\r
+#endif\r
+#ifndef TRUE\r
+#define TRUE 1\r
+#endif\r
+#ifndef NULL\r
+#define NULL 0\r
+#endif\r
+\r
+#ifndef SEEK_SET\r
+#define SEEK_SET 0\r
+#define SEEK_CUR 1\r
+#define SEEK_END 2\r
+#endif\r
+\r
+#ifndef _MSC_VER\r
+// define portable types for 32-bit / 64-bit OS\r
+#include <inttypes.h>\r
+typedef int32_t BOOL;\r
+typedef uint8_t BYTE;\r
+typedef uint16_t WORD;\r
+typedef uint32_t DWORD;\r
+typedef int32_t LONG;\r
+#else\r
+// MS is not C99 ISO compliant\r
+typedef long BOOL;\r
+typedef unsigned char BYTE;\r
+typedef unsigned short WORD;\r
+typedef unsigned long DWORD;\r
+typedef long LONG;\r
+#endif // _MSC_VER\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(push, 1)\r
+#else\r
+#pragma pack(1)\r
+#endif // WIN32\r
+\r
+typedef struct tagRGBQUAD {\r
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR\r
+ BYTE rgbBlue;\r
+ BYTE rgbGreen;\r
+ BYTE rgbRed;\r
+#else\r
+ BYTE rgbRed;\r
+ BYTE rgbGreen;\r
+ BYTE rgbBlue;\r
+#endif // FREEIMAGE_COLORORDER\r
+ BYTE rgbReserved;\r
+} RGBQUAD;\r
+\r
+typedef struct tagRGBTRIPLE {\r
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR\r
+ BYTE rgbtBlue;\r
+ BYTE rgbtGreen;\r
+ BYTE rgbtRed;\r
+#else\r
+ BYTE rgbtRed;\r
+ BYTE rgbtGreen;\r
+ BYTE rgbtBlue;\r
+#endif // FREEIMAGE_COLORORDER\r
+} RGBTRIPLE;\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(pop)\r
+#else\r
+#pragma pack()\r
+#endif // WIN32\r
+\r
+typedef struct tagBITMAPINFOHEADER{\r
+ DWORD biSize;\r
+ LONG biWidth; \r
+ LONG biHeight; \r
+ WORD biPlanes; \r
+ WORD biBitCount;\r
+ DWORD biCompression; \r
+ DWORD biSizeImage; \r
+ LONG biXPelsPerMeter; \r
+ LONG biYPelsPerMeter; \r
+ DWORD biClrUsed; \r
+ DWORD biClrImportant;\r
+} BITMAPINFOHEADER, *PBITMAPINFOHEADER; \r
+\r
+typedef struct tagBITMAPINFO { \r
+ BITMAPINFOHEADER bmiHeader; \r
+ RGBQUAD bmiColors[1];\r
+} BITMAPINFO, *PBITMAPINFO;\r
+\r
+#endif // _WINDOWS_\r
+\r
+// Types used in the library (specific to FreeImage) ------------------------\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(push, 1)\r
+#else\r
+#pragma pack(1)\r
+#endif // WIN32\r
+\r
+/** 48-bit RGB \r
+*/\r
+typedef struct tagFIRGB16 {\r
+ WORD red;\r
+ WORD green;\r
+ WORD blue;\r
+} FIRGB16;\r
+\r
+/** 64-bit RGBA\r
+*/\r
+typedef struct tagFIRGBA16 {\r
+ WORD red;\r
+ WORD green;\r
+ WORD blue;\r
+ WORD alpha;\r
+} FIRGBA16;\r
+\r
+/** 96-bit RGB Float\r
+*/\r
+typedef struct tagFIRGBF {\r
+ float red;\r
+ float green;\r
+ float blue;\r
+} FIRGBF;\r
+\r
+/** 128-bit RGBA Float\r
+*/\r
+typedef struct tagFIRGBAF {\r
+ float red;\r
+ float green;\r
+ float blue;\r
+ float alpha;\r
+} FIRGBAF;\r
+\r
+/** Data structure for COMPLEX type (complex number)\r
+*/\r
+typedef struct tagFICOMPLEX {\r
+ /// real part\r
+ double r;\r
+ /// imaginary part\r
+ double i;\r
+} FICOMPLEX;\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(pop)\r
+#else\r
+#pragma pack()\r
+#endif // WIN32\r
+\r
+// Indexes for byte arrays, masks and shifts for treating pixels as words ---\r
+// These coincide with the order of RGBQUAD and RGBTRIPLE -------------------\r
+\r
+#ifndef FREEIMAGE_BIGENDIAN\r
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR\r
+// Little Endian (x86 / MS Windows, Linux) : BGR(A) order\r
+#define FI_RGBA_RED 2\r
+#define FI_RGBA_GREEN 1\r
+#define FI_RGBA_BLUE 0\r
+#define FI_RGBA_ALPHA 3\r
+#define FI_RGBA_RED_MASK 0x00FF0000\r
+#define FI_RGBA_GREEN_MASK 0x0000FF00\r
+#define FI_RGBA_BLUE_MASK 0x000000FF\r
+#define FI_RGBA_ALPHA_MASK 0xFF000000\r
+#define FI_RGBA_RED_SHIFT 16\r
+#define FI_RGBA_GREEN_SHIFT 8\r
+#define FI_RGBA_BLUE_SHIFT 0\r
+#define FI_RGBA_ALPHA_SHIFT 24\r
+#else\r
+// Little Endian (x86 / MaxOSX) : RGB(A) order\r
+#define FI_RGBA_RED 0\r
+#define FI_RGBA_GREEN 1\r
+#define FI_RGBA_BLUE 2\r
+#define FI_RGBA_ALPHA 3\r
+#define FI_RGBA_RED_MASK 0x000000FF\r
+#define FI_RGBA_GREEN_MASK 0x0000FF00\r
+#define FI_RGBA_BLUE_MASK 0x00FF0000\r
+#define FI_RGBA_ALPHA_MASK 0xFF000000\r
+#define FI_RGBA_RED_SHIFT 0\r
+#define FI_RGBA_GREEN_SHIFT 8\r
+#define FI_RGBA_BLUE_SHIFT 16\r
+#define FI_RGBA_ALPHA_SHIFT 24\r
+#endif // FREEIMAGE_COLORORDER\r
+#else\r
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR\r
+// Big Endian (PPC / none) : BGR(A) order\r
+#define FI_RGBA_RED 2\r
+#define FI_RGBA_GREEN 1\r
+#define FI_RGBA_BLUE 0\r
+#define FI_RGBA_ALPHA 3\r
+#define FI_RGBA_RED_MASK 0x0000FF00\r
+#define FI_RGBA_GREEN_MASK 0x00FF0000\r
+#define FI_RGBA_BLUE_MASK 0xFF000000\r
+#define FI_RGBA_ALPHA_MASK 0x000000FF\r
+#define FI_RGBA_RED_SHIFT 8\r
+#define FI_RGBA_GREEN_SHIFT 16\r
+#define FI_RGBA_BLUE_SHIFT 24\r
+#define FI_RGBA_ALPHA_SHIFT 0\r
+#else\r
+// Big Endian (PPC / Linux, MaxOSX) : RGB(A) order\r
+#define FI_RGBA_RED 0\r
+#define FI_RGBA_GREEN 1\r
+#define FI_RGBA_BLUE 2\r
+#define FI_RGBA_ALPHA 3\r
+#define FI_RGBA_RED_MASK 0xFF000000\r
+#define FI_RGBA_GREEN_MASK 0x00FF0000\r
+#define FI_RGBA_BLUE_MASK 0x0000FF00\r
+#define FI_RGBA_ALPHA_MASK 0x000000FF\r
+#define FI_RGBA_RED_SHIFT 24\r
+#define FI_RGBA_GREEN_SHIFT 16\r
+#define FI_RGBA_BLUE_SHIFT 8\r
+#define FI_RGBA_ALPHA_SHIFT 0\r
+#endif // FREEIMAGE_COLORORDER\r
+#endif // FREEIMAGE_BIGENDIAN\r
+\r
+#define FI_RGBA_RGB_MASK (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK)\r
+\r
+// The 16bit macros only include masks and shifts, since each color element is not byte aligned\r
+\r
+#define FI16_555_RED_MASK 0x7C00\r
+#define FI16_555_GREEN_MASK 0x03E0\r
+#define FI16_555_BLUE_MASK 0x001F\r
+#define FI16_555_RED_SHIFT 10\r
+#define FI16_555_GREEN_SHIFT 5\r
+#define FI16_555_BLUE_SHIFT 0\r
+#define FI16_565_RED_MASK 0xF800\r
+#define FI16_565_GREEN_MASK 0x07E0\r
+#define FI16_565_BLUE_MASK 0x001F\r
+#define FI16_565_RED_SHIFT 11\r
+#define FI16_565_GREEN_SHIFT 5\r
+#define FI16_565_BLUE_SHIFT 0\r
+\r
+// ICC profile support ------------------------------------------------------\r
+\r
+#define FIICC_DEFAULT 0x00\r
+#define FIICC_COLOR_IS_CMYK 0x01\r
+\r
+FI_STRUCT (FIICCPROFILE) { \r
+ WORD flags; // info flag\r
+ DWORD size; // profile's size measured in bytes\r
+ void *data; // points to a block of contiguous memory containing the profile\r
+};\r
+\r
+// Important enums ----------------------------------------------------------\r
+\r
+/** I/O image format identifiers.\r
+*/\r
+FI_ENUM(FREE_IMAGE_FORMAT) {\r
+ FIF_UNKNOWN = -1,\r
+ FIF_BMP = 0,\r
+ FIF_ICO = 1,\r
+ FIF_JPEG = 2,\r
+ FIF_JNG = 3,\r
+ FIF_KOALA = 4,\r
+ FIF_LBM = 5,\r
+ FIF_IFF = FIF_LBM,\r
+ FIF_MNG = 6,\r
+ FIF_PBM = 7,\r
+ FIF_PBMRAW = 8,\r
+ FIF_PCD = 9,\r
+ FIF_PCX = 10,\r
+ FIF_PGM = 11,\r
+ FIF_PGMRAW = 12,\r
+ FIF_PNG = 13,\r
+ FIF_PPM = 14,\r
+ FIF_PPMRAW = 15,\r
+ FIF_RAS = 16,\r
+ FIF_TARGA = 17,\r
+ FIF_TIFF = 18,\r
+ FIF_WBMP = 19,\r
+ FIF_PSD = 20,\r
+ FIF_CUT = 21,\r
+ FIF_XBM = 22,\r
+ FIF_XPM = 23,\r
+ FIF_DDS = 24,\r
+ FIF_GIF = 25,\r
+ FIF_HDR = 26,\r
+ FIF_FAXG3 = 27,\r
+ FIF_SGI = 28,\r
+ FIF_EXR = 29,\r
+ FIF_J2K = 30,\r
+ FIF_JP2 = 31,\r
+ FIF_PFM = 32,\r
+ FIF_PICT = 33,\r
+ FIF_RAW = 34\r
+};\r
+\r
+/** Image type used in FreeImage.\r
+*/\r
+FI_ENUM(FREE_IMAGE_TYPE) {\r
+ FIT_UNKNOWN = 0, // unknown type\r
+ FIT_BITMAP = 1, // standard image : 1-, 4-, 8-, 16-, 24-, 32-bit\r
+ FIT_UINT16 = 2, // array of unsigned short : unsigned 16-bit\r
+ FIT_INT16 = 3, // array of short : signed 16-bit\r
+ FIT_UINT32 = 4, // array of unsigned long : unsigned 32-bit\r
+ FIT_INT32 = 5, // array of long : signed 32-bit\r
+ FIT_FLOAT = 6, // array of float : 32-bit IEEE floating point\r
+ FIT_DOUBLE = 7, // array of double : 64-bit IEEE floating point\r
+ FIT_COMPLEX = 8, // array of FICOMPLEX : 2 x 64-bit IEEE floating point\r
+ FIT_RGB16 = 9, // 48-bit RGB image : 3 x 16-bit\r
+ FIT_RGBA16 = 10, // 64-bit RGBA image : 4 x 16-bit\r
+ FIT_RGBF = 11, // 96-bit RGB float image : 3 x 32-bit IEEE floating point\r
+ FIT_RGBAF = 12 // 128-bit RGBA float image : 4 x 32-bit IEEE floating point\r
+};\r
+\r
+/** Image color type used in FreeImage.\r
+*/\r
+FI_ENUM(FREE_IMAGE_COLOR_TYPE) {\r
+ FIC_MINISWHITE = 0, // min value is white\r
+ FIC_MINISBLACK = 1, // min value is black\r
+ FIC_RGB = 2, // RGB color model\r
+ FIC_PALETTE = 3, // color map indexed\r
+ FIC_RGBALPHA = 4, // RGB color model with alpha channel\r
+ FIC_CMYK = 5 // CMYK color model\r
+};\r
+\r
+/** Color quantization algorithms.\r
+Constants used in FreeImage_ColorQuantize.\r
+*/\r
+FI_ENUM(FREE_IMAGE_QUANTIZE) {\r
+ FIQ_WUQUANT = 0, // Xiaolin Wu color quantization algorithm\r
+ FIQ_NNQUANT = 1 // NeuQuant neural-net quantization algorithm by Anthony Dekker\r
+};\r
+\r
+/** Dithering algorithms.\r
+Constants used in FreeImage_Dither.\r
+*/\r
+FI_ENUM(FREE_IMAGE_DITHER) {\r
+ FID_FS = 0, // Floyd & Steinberg error diffusion\r
+ FID_BAYER4x4 = 1, // Bayer ordered dispersed dot dithering (order 2 dithering matrix)\r
+ FID_BAYER8x8 = 2, // Bayer ordered dispersed dot dithering (order 3 dithering matrix)\r
+ FID_CLUSTER6x6 = 3, // Ordered clustered dot dithering (order 3 - 6x6 matrix)\r
+ FID_CLUSTER8x8 = 4, // Ordered clustered dot dithering (order 4 - 8x8 matrix)\r
+ FID_CLUSTER16x16= 5, // Ordered clustered dot dithering (order 8 - 16x16 matrix)\r
+ FID_BAYER16x16 = 6 // Bayer ordered dispersed dot dithering (order 4 dithering matrix)\r
+};\r
+\r
+/** Lossless JPEG transformations\r
+Constants used in FreeImage_JPEGTransform\r
+*/\r
+FI_ENUM(FREE_IMAGE_JPEG_OPERATION) {\r
+ FIJPEG_OP_NONE = 0, // no transformation\r
+ FIJPEG_OP_FLIP_H = 1, // horizontal flip\r
+ FIJPEG_OP_FLIP_V = 2, // vertical flip\r
+ FIJPEG_OP_TRANSPOSE = 3, // transpose across UL-to-LR axis\r
+ FIJPEG_OP_TRANSVERSE = 4, // transpose across UR-to-LL axis\r
+ FIJPEG_OP_ROTATE_90 = 5, // 90-degree clockwise rotation\r
+ FIJPEG_OP_ROTATE_180 = 6, // 180-degree rotation\r
+ FIJPEG_OP_ROTATE_270 = 7 // 270-degree clockwise (or 90 ccw)\r
+};\r
+\r
+/** Tone mapping operators.\r
+Constants used in FreeImage_ToneMapping.\r
+*/\r
+FI_ENUM(FREE_IMAGE_TMO) {\r
+ FITMO_DRAGO03 = 0, // Adaptive logarithmic mapping (F. Drago, 2003)\r
+ FITMO_REINHARD05 = 1, // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005)\r
+ FITMO_FATTAL02 = 2 // Gradient domain high dynamic range compression (R. Fattal, 2002)\r
+};\r
+\r
+/** Upsampling / downsampling filters. \r
+Constants used in FreeImage_Rescale.\r
+*/\r
+FI_ENUM(FREE_IMAGE_FILTER) {\r
+ FILTER_BOX = 0, // Box, pulse, Fourier window, 1st order (constant) b-spline\r
+ FILTER_BICUBIC = 1, // Mitchell & Netravali's two-param cubic filter\r
+ FILTER_BILINEAR = 2, // Bilinear filter\r
+ FILTER_BSPLINE = 3, // 4th order (cubic) b-spline\r
+ FILTER_CATMULLROM = 4, // Catmull-Rom spline, Overhauser spline\r
+ FILTER_LANCZOS3 = 5 // Lanczos3 filter\r
+};\r
+\r
+/** Color channels.\r
+Constants used in color manipulation routines.\r
+*/\r
+FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) {\r
+ FICC_RGB = 0, // Use red, green and blue channels\r
+ FICC_RED = 1, // Use red channel\r
+ FICC_GREEN = 2, // Use green channel\r
+ FICC_BLUE = 3, // Use blue channel\r
+ FICC_ALPHA = 4, // Use alpha channel\r
+ FICC_BLACK = 5, // Use black channel\r
+ FICC_REAL = 6, // Complex images: use real part\r
+ FICC_IMAG = 7, // Complex images: use imaginary part\r
+ FICC_MAG = 8, // Complex images: use magnitude\r
+ FICC_PHASE = 9 // Complex images: use phase\r
+};\r
+\r
+// Metadata support ---------------------------------------------------------\r
+\r
+/**\r
+ Tag data type information (based on TIFF specifications)\r
+\r
+ Note: RATIONALs are the ratio of two 32-bit integer values.\r
+*/\r
+FI_ENUM(FREE_IMAGE_MDTYPE) {\r
+ FIDT_NOTYPE = 0, // placeholder \r
+ FIDT_BYTE = 1, // 8-bit unsigned integer \r
+ FIDT_ASCII = 2, // 8-bit bytes w/ last byte null \r
+ FIDT_SHORT = 3, // 16-bit unsigned integer \r
+ FIDT_LONG = 4, // 32-bit unsigned integer \r
+ FIDT_RATIONAL = 5, // 64-bit unsigned fraction \r
+ FIDT_SBYTE = 6, // 8-bit signed integer \r
+ FIDT_UNDEFINED = 7, // 8-bit untyped data \r
+ FIDT_SSHORT = 8, // 16-bit signed integer \r
+ FIDT_SLONG = 9, // 32-bit signed integer \r
+ FIDT_SRATIONAL = 10, // 64-bit signed fraction \r
+ FIDT_FLOAT = 11, // 32-bit IEEE floating point \r
+ FIDT_DOUBLE = 12, // 64-bit IEEE floating point \r
+ FIDT_IFD = 13, // 32-bit unsigned integer (offset) \r
+ FIDT_PALETTE = 14 // 32-bit RGBQUAD \r
+};\r
+\r
+/**\r
+ Metadata models supported by FreeImage\r
+*/\r
+FI_ENUM(FREE_IMAGE_MDMODEL) {\r
+ FIMD_NODATA = -1,\r
+ FIMD_COMMENTS = 0, // single comment or keywords\r
+ FIMD_EXIF_MAIN = 1, // Exif-TIFF metadata\r
+ FIMD_EXIF_EXIF = 2, // Exif-specific metadata\r
+ FIMD_EXIF_GPS = 3, // Exif GPS metadata\r
+ FIMD_EXIF_MAKERNOTE = 4, // Exif maker note metadata\r
+ FIMD_EXIF_INTEROP = 5, // Exif interoperability metadata\r
+ FIMD_IPTC = 6, // IPTC/NAA metadata\r
+ FIMD_XMP = 7, // Abobe XMP metadata\r
+ FIMD_GEOTIFF = 8, // GeoTIFF metadata\r
+ FIMD_ANIMATION = 9, // Animation metadata\r
+ FIMD_CUSTOM = 10 // Used to attach other metadata types to a dib\r
+};\r
+\r
+/**\r
+ Handle to a metadata model\r
+*/\r
+FI_STRUCT (FIMETADATA) { void *data; };\r
+\r
+/**\r
+ Handle to a FreeImage tag\r
+*/\r
+FI_STRUCT (FITAG) { void *data; };\r
+\r
+// File IO routines ---------------------------------------------------------\r
+\r
+#ifndef FREEIMAGE_IO\r
+#define FREEIMAGE_IO\r
+\r
+typedef void* fi_handle;\r
+typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);\r
+typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);\r
+typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin);\r
+typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle);\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(push, 1)\r
+#else\r
+#pragma pack(1)\r
+#endif // WIN32\r
+\r
+FI_STRUCT(FreeImageIO) {\r
+ FI_ReadProc read_proc; // pointer to the function used to read data\r
+ FI_WriteProc write_proc; // pointer to the function used to write data\r
+ FI_SeekProc seek_proc; // pointer to the function used to seek\r
+ FI_TellProc tell_proc; // pointer to the function used to aquire the current position\r
+};\r
+\r
+#if (defined(_WIN32) || defined(__WIN32__))\r
+#pragma pack(pop)\r
+#else\r
+#pragma pack()\r
+#endif // WIN32\r
+\r
+/**\r
+Handle to a memory I/O stream\r
+*/\r
+FI_STRUCT (FIMEMORY) { void *data; };\r
+\r
+#endif // FREEIMAGE_IO\r
+\r
+// Plugin routines ----------------------------------------------------------\r
+\r
+#ifndef PLUGINS\r
+#define PLUGINS\r
+\r
+typedef const char *(DLL_CALLCONV *FI_FormatProc)(void);\r
+typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void);\r
+typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void);\r
+typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void);\r
+typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read);\r
+typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data);\r
+typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data);\r
+typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data);\r
+typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data);\r
+typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data);\r
+typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle);\r
+typedef const char *(DLL_CALLCONV *FI_MimeProc)(void);\r
+typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp);\r
+typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type);\r
+typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void);\r
+\r
+FI_STRUCT (Plugin) {\r
+ FI_FormatProc format_proc;\r
+ FI_DescriptionProc description_proc;\r
+ FI_ExtensionListProc extension_proc;\r
+ FI_RegExprProc regexpr_proc;\r
+ FI_OpenProc open_proc;\r
+ FI_CloseProc close_proc;\r
+ FI_PageCountProc pagecount_proc;\r
+ FI_PageCapabilityProc pagecapability_proc;\r
+ FI_LoadProc load_proc;\r
+ FI_SaveProc save_proc;\r
+ FI_ValidateProc validate_proc;\r
+ FI_MimeProc mime_proc;\r
+ FI_SupportsExportBPPProc supports_export_bpp_proc;\r
+ FI_SupportsExportTypeProc supports_export_type_proc;\r
+ FI_SupportsICCProfilesProc supports_icc_profiles_proc;\r
+};\r
+\r
+typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id);\r
+\r
+#endif // PLUGINS\r
+\r
+\r
+// Load / Save flag constants -----------------------------------------------\r
+\r
+#define BMP_DEFAULT 0\r
+#define BMP_SAVE_RLE 1\r
+#define CUT_DEFAULT 0\r
+#define DDS_DEFAULT 0\r
+#define EXR_DEFAULT 0 // save data as half with piz-based wavelet compression\r
+#define EXR_FLOAT 0x0001 // save data as float instead of as half (not recommended)\r
+#define EXR_NONE 0x0002 // save with no compression\r
+#define EXR_ZIP 0x0004 // save with zlib compression, in blocks of 16 scan lines\r
+#define EXR_PIZ 0x0008 // save with piz-based wavelet compression\r
+#define EXR_PXR24 0x0010 // save with lossy 24-bit float compression\r
+#define EXR_B44 0x0020 // save with lossy 44% float compression - goes to 22% when combined with EXR_LC\r
+#define EXR_LC 0x0040 // save images with one luminance and two chroma channels, rather than as RGB (lossy compression)\r
+#define FAXG3_DEFAULT 0\r
+#define GIF_DEFAULT 0\r
+#define GIF_LOAD256 1 // Load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color\r
+#define GIF_PLAYBACK 2 // 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading\r
+#define HDR_DEFAULT 0\r
+#define ICO_DEFAULT 0\r
+#define ICO_MAKEALPHA 1 // convert to 32bpp and create an alpha channel from the AND-mask when loading\r
+#define IFF_DEFAULT 0\r
+#define J2K_DEFAULT 0 // save with a 16:1 rate\r
+#define JP2_DEFAULT 0 // save with a 16:1 rate\r
+#define JPEG_DEFAULT 0 // loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420)\r
+#define JPEG_FAST 0x0001 // load the file as fast as possible, sacrificing some quality\r
+#define JPEG_ACCURATE 0x0002 // load the file with the best quality, sacrificing some speed\r
+#define JPEG_CMYK 0x0004 // load separated CMYK "as is" (use | to combine with other load flags)\r
+#define JPEG_EXIFROTATE 0x0008 // load and rotate according to Exif 'Orientation' tag if available\r
+#define JPEG_QUALITYSUPERB 0x80 // save with superb quality (100:1)\r
+#define JPEG_QUALITYGOOD 0x0100 // save with good quality (75:1)\r
+#define JPEG_QUALITYNORMAL 0x0200 // save with normal quality (50:1)\r
+#define JPEG_QUALITYAVERAGE 0x0400 // save with average quality (25:1)\r
+#define JPEG_QUALITYBAD 0x0800 // save with bad quality (10:1)\r
+#define JPEG_PROGRESSIVE 0x2000 // save as a progressive-JPEG (use | to combine with other save flags)\r
+#define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1) \r
+#define JPEG_SUBSAMPLING_420 0x4000 // save with medium 2x2 medium chroma subsampling (4:2:0) - default value\r
+#define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2) \r
+#define JPEG_SUBSAMPLING_444 0x10000 // save with no chroma subsampling (4:4:4)\r
+#define KOALA_DEFAULT 0\r
+#define LBM_DEFAULT 0\r
+#define MNG_DEFAULT 0\r
+#define PCD_DEFAULT 0\r
+#define PCD_BASE 1 // load the bitmap sized 768 x 512\r
+#define PCD_BASEDIV4 2 // load the bitmap sized 384 x 256\r
+#define PCD_BASEDIV16 3 // load the bitmap sized 192 x 128\r
+#define PCX_DEFAULT 0\r
+#define PFM_DEFAULT 0\r
+#define PICT_DEFAULT 0\r
+#define PNG_DEFAULT 0\r
+#define PNG_IGNOREGAMMA 1 // loading: avoid gamma correction\r
+#define PNG_Z_BEST_SPEED 0x0001 // save using ZLib level 1 compression flag (default value is 6)\r
+#define PNG_Z_DEFAULT_COMPRESSION 0x0006 // save using ZLib level 6 compression flag (default recommended value)\r
+#define PNG_Z_BEST_COMPRESSION 0x0009 // save using ZLib level 9 compression flag (default value is 6)\r
+#define PNG_Z_NO_COMPRESSION 0x0100 // save without ZLib compression\r
+#define PNG_INTERLACED 0x0200 // save using Adam7 interlacing (use | to combine with other save flags)\r
+#define PNM_DEFAULT 0\r
+#define PNM_SAVE_RAW 0 // If set the writer saves in RAW format (i.e. P4, P5 or P6)\r
+#define PNM_SAVE_ASCII 1 // If set the writer saves in ASCII format (i.e. P1, P2 or P3)\r
+#define PSD_DEFAULT 0\r
+#define RAS_DEFAULT 0\r
+#define RAW_DEFAULT 0 // load the file as linear RGB 48-bit\r
+#define RAW_PREVIEW 1 // try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit\r
+#define RAW_DISPLAY 2 // load the file as RGB 24-bit\r
+#define SGI_DEFAULT 0\r
+#define TARGA_DEFAULT 0\r
+#define TARGA_LOAD_RGB888 1 // If set the loader converts RGB555 and ARGB8888 -> RGB888.\r
+#define TIFF_DEFAULT 0\r
+#define TIFF_CMYK 0x0001 // reads/stores tags for separated CMYK (use | to combine with compression flags)\r
+#define TIFF_PACKBITS 0x0100 // save using PACKBITS compression\r
+#define TIFF_DEFLATE 0x0200 // save using DEFLATE compression (a.k.a. ZLIB compression)\r
+#define TIFF_ADOBE_DEFLATE 0x0400 // save using ADOBE DEFLATE compression\r
+#define TIFF_NONE 0x0800 // save without any compression\r
+#define TIFF_CCITTFAX3 0x1000 // save using CCITT Group 3 fax encoding\r
+#define TIFF_CCITTFAX4 0x2000 // save using CCITT Group 4 fax encoding\r
+#define TIFF_LZW 0x4000 // save using LZW compression\r
+#define TIFF_JPEG 0x8000 // save using JPEG compression\r
+#define WBMP_DEFAULT 0\r
+#define XBM_DEFAULT 0\r
+#define XPM_DEFAULT 0\r
+\r
+// Background filling options ---------------------------------------------------------\r
+// Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas\r
+\r
+#define FI_COLOR_IS_RGB_COLOR 0x00 // RGBQUAD color is a RGB color (contains no valid alpha channel)\r
+#define FI_COLOR_IS_RGBA_COLOR 0x01 // RGBQUAD color is a RGBA color (contains a valid alpha channel)\r
+#define FI_COLOR_FIND_EQUAL_COLOR 0x02 // For palettized images: lookup equal RGB color from palette\r
+#define FI_COLOR_ALPHA_IS_INDEX 0x04 // The color's rgbReserved member (alpha) contains the palette index to be used\r
+#define FI_COLOR_PALETTE_SEARCH_MASK (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX) // No color lookup is performed\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+// Init / Error routines ----------------------------------------------------\r
+\r
+DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));\r
+DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void);\r
+\r
+// Version routines ---------------------------------------------------------\r
+\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void);\r
+\r
+// Message output functions -------------------------------------------------\r
+\r
+typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);\r
+typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg); \r
+\r
+DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf); \r
+DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);\r
+DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);\r
+\r
+// Allocate / Clone / Unload routines ---------------------------------------\r
+\r
+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));\r
+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));\r
+DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);\r
+DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);\r
+\r
+// Load / Save routines -----------------------------------------------------\r
+\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));\r
+\r
+// Memory I/O stream routines -----------------------------------------------\r
+\r
+DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));\r
+DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));\r
+DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);\r
+DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));\r
+\r
+// Plugin Interface ---------------------------------------------------------\r
+\r
+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));\r
+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));\r
+DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);\r
+DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);\r
+DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);\r
+\r
+// Multipaging interface ----------------------------------------------------\r
+\r
+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));\r
+DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));\r
+DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap);\r
+DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data);\r
+DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);\r
+DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page);\r
+DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page);\r
+DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count);\r
+\r
+// Filetype request routines ------------------------------------------------\r
+\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0));\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0));\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));\r
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0));\r
+\r
+// Image type request routine -----------------------------------------------\r
+\r
+DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib);\r
+\r
+// FreeImage helper routines ------------------------------------------------\r
+\r
+DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);\r
+\r
+// Pixel access routines ----------------------------------------------------\r
+\r
+DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib);\r
+DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline);\r
+\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);\r
+\r
+// DIB info routines --------------------------------------------------------\r
+\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib);\r
+DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib);\r
+\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib);\r
+DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res);\r
+DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res);\r
+\r
+DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib);\r
+DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib);\r
+DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib);\r
+\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib);\r
+\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib);\r
+DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib);\r
+DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled);\r
+DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib);\r
+DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index);\r
+DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib);\r
+\r
+DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);\r
+\r
+\r
+// ICC profile routines -----------------------------------------------------\r
+\r
+DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib);\r
+DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size);\r
+DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib);\r
+\r
+// Line conversion routines -------------------------------------------------\r
+\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);\r
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);\r
+\r
+// Smart conversion routines ------------------------------------------------\r
+\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);\r
+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));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);\r
+\r
+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));\r
+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));\r
+\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib);\r
+\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));\r
+\r
+// tone mapping operators\r
+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));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));\r
+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));\r
+\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85));\r
+\r
+// ZLib interface -----------------------------------------------------------\r
+\r
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size);\r
+\r
+// --------------------------------------------------------------------------\r
+// Metadata routines --------------------------------------------------------\r
+// --------------------------------------------------------------------------\r
+\r
+// tag creation / destruction\r
+DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void);\r
+DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag);\r
+DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);\r
+\r
+// tag getters and setters\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);\r
+DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);\r
+DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);\r
+DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);\r
+DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);\r
+DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);\r
+\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value);\r
+\r
+// iterator\r
+DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag);\r
+DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle);\r
+\r
+// metadata setter and getter\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);\r
+\r
+// helpers\r
+DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src);\r
+\r
+// tag to C string conversion\r
+DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));\r
+\r
+// --------------------------------------------------------------------------\r
+// Image manipulation toolkit -----------------------------------------------\r
+// --------------------------------------------------------------------------\r
+\r
+// rotation and flipping\r
+/// @deprecated see FreeImage_Rotate\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL));\r
+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);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib);\r
+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));\r
+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));\r
+\r
+// upsampling / downsampling\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));\r
+\r
+// color manipulation routines (point operations)\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));\r
+DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));\r
+DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap);\r
+DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);\r
+\r
+// channel processing routines\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);\r
+\r
+// copy / paste / composite routines\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));\r
+DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);\r
+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);\r
+DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib);\r
+\r
+// background filling routines\r
+DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0));\r
+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));\r
+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));\r
+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));\r
+\r
+// miscellaneous algorithms\r
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3));\r
+\r
+// restore the borland-specific enum size option\r
+#if defined(__BORLANDC__)\r
+#pragma option pop\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif // FREEIMAGE_H\r
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE\r
+ Version 2, June 1991\r
+\r
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+ Preamble\r
+\r
+ The licenses for most software are designed to take away your\r
+freedom to share and change it. By contrast, the GNU General Public\r
+License is intended to guarantee your freedom to share and change free\r
+software--to make sure the software is free for all its users. This\r
+General Public License applies to most of the Free Software\r
+Foundation's software and to any other program whose authors commit to\r
+using it. (Some other Free Software Foundation software is covered by\r
+the GNU Library General Public License instead.) You can apply it to\r
+your programs, too.\r
+\r
+ When we speak of free software, we are referring to freedom, not\r
+price. Our General Public Licenses are designed to make sure that you\r
+have the freedom to distribute copies of free software (and charge for\r
+this service if you wish), that you receive source code or can get it\r
+if you want it, that you can change the software or use pieces of it\r
+in new free programs; and that you know you can do these things.\r
+\r
+ To protect your rights, we need to make restrictions that forbid\r
+anyone to deny you these rights or to ask you to surrender the rights.\r
+These restrictions translate to certain responsibilities for you if you\r
+distribute copies of the software, or if you modify it.\r
+\r
+ For example, if you distribute copies of such a program, whether\r
+gratis or for a fee, you must give the recipients all the rights that\r
+you have. You must make sure that they, too, receive or can get the\r
+source code. And you must show them these terms so they know their\r
+rights.\r
+\r
+ We protect your rights with two steps: (1) copyright the software, and\r
+(2) offer you this license which gives you legal permission to copy,\r
+distribute and/or modify the software.\r
+\r
+ Also, for each author's protection and ours, we want to make certain\r
+that everyone understands that there is no warranty for this free\r
+software. If the software is modified by someone else and passed on, we\r
+want its recipients to know that what they have is not the original, so\r
+that any problems introduced by others will not reflect on the original\r
+authors' reputations.\r
+\r
+ Finally, any free program is threatened constantly by software\r
+patents. We wish to avoid the danger that redistributors of a free\r
+program will individually obtain patent licenses, in effect making the\r
+program proprietary. To prevent this, we have made it clear that any\r
+patent must be licensed for everyone's free use or not licensed at all.\r
+\r
+ The precise terms and conditions for copying, distribution and\r
+modification follow.\r
+\f\r
+ GNU GENERAL PUBLIC LICENSE\r
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+ 0. This License applies to any program or other work which contains\r
+a notice placed by the copyright holder saying it may be distributed\r
+under the terms of this General Public License. The "Program", below,\r
+refers to any such program or work, and a "work based on the Program"\r
+means either the Program or any derivative work under copyright law:\r
+that is to say, a work containing the Program or a portion of it,\r
+either verbatim or with modifications and/or translated into another\r
+language. (Hereinafter, translation is included without limitation in\r
+the term "modification".) Each licensee is addressed as "you".\r
+\r
+Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope. The act of\r
+running the Program is not restricted, and the output from the Program\r
+is covered only if its contents constitute a work based on the\r
+Program (independent of having been made by running the Program).\r
+Whether that is true depends on what the Program does.\r
+\r
+ 1. You may copy and distribute verbatim copies of the Program's\r
+source code as you receive it, in any medium, provided that you\r
+conspicuously and appropriately publish on each copy an appropriate\r
+copyright notice and disclaimer of warranty; keep intact all the\r
+notices that refer to this License and to the absence of any warranty;\r
+and give any other recipients of the Program a copy of this License\r
+along with the Program.\r
+\r
+You may charge a fee for the physical act of transferring a copy, and\r
+you may at your option offer warranty protection in exchange for a fee.\r
+\r
+ 2. You may modify your copy or copies of the Program or any portion\r
+of it, thus forming a work based on the Program, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+ a) You must cause the modified files to carry prominent notices\r
+ stating that you changed the files and the date of any change.\r
+\r
+ b) You must cause any work that you distribute or publish, that in\r
+ whole or in part contains or is derived from the Program or any\r
+ part thereof, to be licensed as a whole at no charge to all third\r
+ parties under the terms of this License.\r
+\r
+ c) If the modified program normally reads commands interactively\r
+ when run, you must cause it, when started running for such\r
+ interactive use in the most ordinary way, to print or display an\r
+ announcement including an appropriate copyright notice and a\r
+ notice that there is no warranty (or else, saying that you provide\r
+ a warranty) and that users may redistribute the program under\r
+ these conditions, and telling the user how to view a copy of this\r
+ License. (Exception: if the Program itself is interactive but\r
+ does not normally print such an announcement, your work based on\r
+ the Program is not required to print an announcement.)\r
+\f\r
+These requirements apply to the modified work as a whole. If\r
+identifiable sections of that work are not derived from the Program,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works. But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Program, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Program.\r
+\r
+In addition, mere aggregation of another work not based on the Program\r
+with the Program (or with a work based on the Program) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+ 3. You may copy and distribute the Program (or a work based on it,\r
+under Section 2) in object code or executable form under the terms of\r
+Sections 1 and 2 above provided that you also do one of the following:\r
+\r
+ a) Accompany it with the complete corresponding machine-readable\r
+ source code, which must be distributed under the terms of Sections\r
+ 1 and 2 above on a medium customarily used for software interchange; or,\r
+\r
+ b) Accompany it with a written offer, valid for at least three\r
+ years, to give any third party, for a charge no more than your\r
+ cost of physically performing source distribution, a complete\r
+ machine-readable copy of the corresponding source code, to be\r
+ distributed under the terms of Sections 1 and 2 above on a medium\r
+ customarily used for software interchange; or,\r
+\r
+ c) Accompany it with the information you received as to the offer\r
+ to distribute corresponding source code. (This alternative is\r
+ allowed only for noncommercial distribution and only if you\r
+ received the program in object code or executable form with such\r
+ an offer, in accord with Subsection b above.)\r
+\r
+The source code for a work means the preferred form of the work for\r
+making modifications to it. For an executable work, complete source\r
+code means all the source code for all modules it contains, plus any\r
+associated interface definition files, plus the scripts used to\r
+control compilation and installation of the executable. However, as a\r
+special exception, the source code distributed need not include\r
+anything that is normally distributed (in either source or binary\r
+form) with the major components (compiler, kernel, and so on) of the\r
+operating system on which the executable runs, unless that component\r
+itself accompanies the executable.\r
+\r
+If distribution of executable or object code is made by offering\r
+access to copy from a designated place, then offering equivalent\r
+access to copy the source code from the same place counts as\r
+distribution of the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\f\r
+ 4. You may not copy, modify, sublicense, or distribute the Program\r
+except as expressly provided under this License. Any attempt\r
+otherwise to copy, modify, sublicense or distribute the Program is\r
+void, and will automatically terminate your rights under this License.\r
+However, parties who have received copies, or rights, from you under\r
+this License will not have their licenses terminated so long as such\r
+parties remain in full compliance.\r
+\r
+ 5. You are not required to accept this License, since you have not\r
+signed it. However, nothing else grants you permission to modify or\r
+distribute the Program or its derivative works. These actions are\r
+prohibited by law if you do not accept this License. Therefore, by\r
+modifying or distributing the Program (or any work based on the\r
+Program), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Program or works based on it.\r
+\r
+ 6. Each time you redistribute the Program (or any work based on the\r
+Program), the recipient automatically receives a license from the\r
+original licensor to copy, distribute or modify the Program subject to\r
+these terms and conditions. You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties to\r
+this License.\r
+\r
+ 7. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License. If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Program at all. For example, if a patent\r
+license would not permit royalty-free redistribution of the Program by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Program.\r
+\r
+If any portion of this section is held invalid or unenforceable under\r
+any particular circumstance, the balance of the section is intended to\r
+apply and the section as a whole is intended to apply in other\r
+circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system, which is\r
+implemented by public license practices. Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\f\r
+ 8. If the distribution and/or use of the Program is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Program under this License\r
+may add an explicit geographical distribution limitation excluding\r
+those countries, so that distribution is permitted only in or among\r
+countries not thus excluded. In such case, this License incorporates\r
+the limitation as if written in the body of this License.\r
+\r
+ 9. The Free Software Foundation may publish revised and/or new versions\r
+of the General Public License from time to time. Such new versions will\r
+be similar in spirit to the present version, but may differ in detail to\r
+address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number. If the Program\r
+specifies a version number of this License which applies to it and "any\r
+later version", you have the option of following the terms and conditions\r
+either of that version or of any later version published by the Free\r
+Software Foundation. If the Program does not specify a version number of\r
+this License, you may choose any version ever published by the Free Software\r
+Foundation.\r
+\r
+ 10. If you wish to incorporate parts of the Program into other free\r
+programs whose distribution conditions are different, write to the author\r
+to ask for permission. For software which is copyrighted by the Free\r
+Software Foundation, write to the Free Software Foundation; we sometimes\r
+make exceptions for this. Our decision will be guided by the two goals\r
+of preserving the free status of all derivatives of our free software and\r
+of promoting the sharing and reuse of software generally.\r
+\r
+ NO WARRANTY\r
+\r
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\r
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\r
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\r
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
+REPAIR OR CORRECTION.\r
+\r
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGES.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\f\r
+ How to Apply These Terms to Your New Programs\r
+\r
+ If you develop a new program, and you want it to be of the greatest\r
+possible use to the public, the best way to achieve this is to make it\r
+free software which everyone can redistribute and change under these terms.\r
+\r
+ To do so, attach the following notices to the program. It is safest\r
+to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least\r
+the "copyright" line and a pointer to where the full notice is found.\r
+\r
+ <one line to give the program's name and a brief idea of what it does.>\r
+ Copyright (C) <year> <name of author>\r
+\r
+ This program is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation; either version 2 of the License, or\r
+ (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+If the program is interactive, make it output a short notice like this\r
+when it starts in an interactive mode:\r
+\r
+ Gnomovision version 69, Copyright (C) year name of author\r
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
+ This is free software, and you are welcome to redistribute it\r
+ under certain conditions; type `show c' for details.\r
+\r
+The hypothetical commands `show w' and `show c' should show the appropriate\r
+parts of the General Public License. Of course, the commands you use may\r
+be called something other than `show w' and `show c'; they could even be\r
+mouse-clicks or menu items--whatever suits your program.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the program, if\r
+necessary. Here is a sample; alter the names:\r
+\r
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
+\r
+ <signature of Ty Coon>, 1 April 1989\r
+ Ty Coon, President of Vice\r
+\r
+This General Public License does not permit incorporating your program into\r
+proprietary programs. If your program is a subroutine library, you may\r
+consider it more useful to permit linking proprietary applications with the\r
+library. If this is what you want to do, use the GNU Library General\r
+Public License instead of this License.\r
+\r
+\r