# FreeImagePlus

# FreeImage.h

    00001 // ==========================================================
    00002 // FreeImage 3
    00003 //
    00004 // Design and implementation by
    00005 // - Floris van den Berg (flvdberg@wxs.nl)
    00006 // - Hervé Drolon (drolon@infonie.fr)
    00007 //
    00008 // Contributors:
    00009 // - see changes log named 'Whatsnew.txt', see header of each .h and .cpp file
    00010 //
    00011 // This file is part of FreeImage 3
    00012 //
    00013 // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
    00014 // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
    00015 // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
    00016 // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
    00017 // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
    00018 // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
    00019 // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
    00020 // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
    00021 // THIS DISCLAIMER.
    00022 //
    00023 // Use at your own risk!
    00024 // ==========================================================
    00025
    00026 #ifndef FREEIMAGE_H
    00027 #define FREEIMAGE_H
    00028
    00029 // Version information ------------------------------------------------------
    00030
    00031 #define FREEIMAGE_MAJOR_VERSION   3
    00032 #define FREEIMAGE_MINOR_VERSION   14
    00033 #define FREEIMAGE_RELEASE_SERIAL  0
    00034
    00035 // Compiler options ---------------------------------------------------------
    00036
    00037 #include <wchar.h>      // needed for UNICODE functions
    00038
    00039 #if defined(FREEIMAGE_LIB)
    00040         #define DLL_API
    00041         #define DLL_CALLCONV
    00042 #else
    00043         #if defined(_WIN32) || defined(__WIN32__)
    00044                 #define DLL_CALLCONV __stdcall
    00045                 // The following ifdef block is the standard way of creating macros which make exporting
    00046                 // from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS
    00047                 // symbol defined on the command line. this symbol should not be defined on any project
    00048                 // that uses this DLL. This way any other project whose source files include this file see
    00049                 // DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
    00050                 // defined with this macro as being exported.
    00051                 #ifdef FREEIMAGE_EXPORTS
    00052                         #define DLL_API __declspec(dllexport)
    00053                 #else
    00054                         #define DLL_API __declspec(dllimport)
    00055                 #endif // FREEIMAGE_EXPORTS
    00056         #else
    00057                 // try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)
    00058                 #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
    00059                         #ifndef GCC_HASCLASSVISIBILITY
    00060                                 #define GCC_HASCLASSVISIBILITY
    00061                         #endif
    00062                 #endif // __GNUC__
    00063                 #define DLL_CALLCONV
    00064                 #if defined(GCC_HASCLASSVISIBILITY)
    00065                         #define DLL_API __attribute__ ((visibility("default")))
    00066                 #else
    00067                         #define DLL_API
    00068                 #endif
    00069         #endif // WIN32 / !WIN32
    00070 #endif // FREEIMAGE_LIB
    00071
    00072 // Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined
    00073 // If your big endian system isn't being detected, add an OS specific check
    00074 #if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || \
    00075         (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || \
    00076         defined(__BIG_ENDIAN__)
    00077 #define FREEIMAGE_BIGENDIAN
    00078 #endif // BYTE_ORDER
    00079
    00080 // This really only affects 24 and 32 bit formats, the rest are always RGB order.
    00081 #define FREEIMAGE_COLORORDER_BGR        0
    00082 #define FREEIMAGE_COLORORDER_RGB        1
    00083 #if defined(FREEIMAGE_BIGENDIAN)
    00084 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB
    00085 #else
    00086 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
    00087 #endif
    00088
    00089 // Ensure 4-byte enums if we're using Borland C++ compilers
    00090 #if defined(__BORLANDC__)
    00091 #pragma option push -b
    00092 #endif
    00093
    00094 // For C compatibility --------------------------------------------------------
    00095
    00096 #ifdef __cplusplus
    00097 #define FI_DEFAULT(x)   = x
    00098 #define FI_ENUM(x)      enum x
    00099 #define FI_STRUCT(x)    struct x
    00100 #else
    00101 #define FI_DEFAULT(x)
    00102 #define FI_ENUM(x)      typedef int x; enum x
    00103 #define FI_STRUCT(x)    typedef struct x x; struct x
    00104 #endif
    00105
    00106 // Bitmap types -------------------------------------------------------------
    00107
    00108 FI_STRUCT (FIBITMAP) { void *data; };
    00109 FI_STRUCT (FIMULTIBITMAP) { void *data; };
    00110
    00111 // Types used in the library (directly copied from Windows) -----------------
    00112
    00113 #if defined(__MINGW32__) && defined(_WINDOWS_H)
    00114 #define _WINDOWS_       // prevent a bug in MinGW32
    00115 #endif // __MINGW32__
    00116
    00117 #ifndef _WINDOWS_
    00118 #define _WINDOWS_
    00119
    00120 #ifndef FALSE
    00121 #define FALSE 0
    00122 #endif
    00123 #ifndef TRUE
    00124 #define TRUE 1
    00125 #endif
    00126 #ifndef NULL
    00127 #define NULL 0
    00128 #endif
    00129
    00130 #ifndef SEEK_SET
    00131 #define SEEK_SET  0
    00132 #define SEEK_CUR  1
    00133 #define SEEK_END  2
    00134 #endif
    00135
    00136 #ifndef _MSC_VER
    00137 // define portable types for 32-bit / 64-bit OS
    00138 #include <inttypes.h>
    00139 typedef int32_t BOOL;
    00140 typedef uint8_t BYTE;
    00141 typedef uint16_t WORD;
    00142 typedef uint32_t DWORD;
    00143 typedef int32_t LONG;
    00144 #else
    00145 // MS is not C99 ISO compliant
    00146 typedef long BOOL;
    00147 typedef unsigned char BYTE;
    00148 typedef unsigned short WORD;
    00149 typedef unsigned long DWORD;
    00150 typedef long LONG;
    00151 #endif // _MSC_VER
    00152
    00153 #if (defined(_WIN32) || defined(__WIN32__))
    00154 #pragma pack(push, 1)
    00155 #else
    00156 #pragma pack(1)
    00157 #endif // WIN32
    00158
    00159 typedef struct tagRGBQUAD {
    00160 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
    00161   BYTE rgbBlue;
    00162   BYTE rgbGreen;
    00163   BYTE rgbRed;
    00164 #else
    00165   BYTE rgbRed;
    00166   BYTE rgbGreen;
    00167   BYTE rgbBlue;
    00168 #endif // FREEIMAGE_COLORORDER
    00169   BYTE rgbReserved;
    00170 } RGBQUAD;
    00171
    00172 typedef struct tagRGBTRIPLE {
    00173 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
    00174   BYTE rgbtBlue;
    00175   BYTE rgbtGreen;
    00176   BYTE rgbtRed;
    00177 #else
    00178   BYTE rgbtRed;
    00179   BYTE rgbtGreen;
    00180   BYTE rgbtBlue;
    00181 #endif // FREEIMAGE_COLORORDER
    00182 } RGBTRIPLE;
    00183
    00184 #if (defined(_WIN32) || defined(__WIN32__))
    00185 #pragma pack(pop)
    00186 #else
    00187 #pragma pack()
    00188 #endif // WIN32
    00189
    00190 typedef struct tagBITMAPINFOHEADER{
    00191   DWORD biSize;
    00192   LONG  biWidth;
    00193   LONG  biHeight;
    00194   WORD  biPlanes;
    00195   WORD  biBitCount;
    00196   DWORD biCompression;
    00197   DWORD biSizeImage;
    00198   LONG  biXPelsPerMeter;
    00199   LONG  biYPelsPerMeter;
    00200   DWORD biClrUsed;
    00201   DWORD biClrImportant;
    00202 } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
    00203
    00204 typedef struct tagBITMAPINFO {
    00205   BITMAPINFOHEADER bmiHeader;
    00206   RGBQUAD          bmiColors[1];
    00207 } BITMAPINFO, *PBITMAPINFO;
    00208
    00209 #endif // _WINDOWS_
    00210
    00211 // Types used in the library (specific to FreeImage) ------------------------
    00212
    00213 #if (defined(_WIN32) || defined(__WIN32__))
    00214 #pragma pack(push, 1)
    00215 #else
    00216 #pragma pack(1)
    00217 #endif // WIN32
    00218
    00221 typedef struct tagFIRGB16 {
    00222         WORD red;
    00223         WORD green;
    00224         WORD blue;
    00225 } FIRGB16;
    00226
    00229 typedef struct tagFIRGBA16 {
    00230         WORD red;
    00231         WORD green;
    00232         WORD blue;
    00233         WORD alpha;
    00234 } FIRGBA16;
    00235
    00238 typedef struct tagFIRGBF {
    00239         float red;
    00240         float green;
    00241         float blue;
    00242 } FIRGBF;
    00243
    00246 typedef struct tagFIRGBAF {
    00247         float red;
    00248         float green;
    00249         float blue;
    00250         float alpha;
    00251 } FIRGBAF;
    00252
    00255 typedef struct tagFICOMPLEX {
    00257         double r;
    00259     double i;
    00260 } FICOMPLEX;
    00261
    00262 #if (defined(_WIN32) || defined(__WIN32__))
    00263 #pragma pack(pop)
    00264 #else
    00265 #pragma pack()
    00266 #endif // WIN32
    00267
    00268 // Indexes for byte arrays, masks and shifts for treating pixels as words ---
    00269 // These coincide with the order of RGBQUAD and RGBTRIPLE -------------------
    00270
    00271 #ifndef FREEIMAGE_BIGENDIAN
    00272 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
    00273 // Little Endian (x86 / MS Windows, Linux) : BGR(A) order
    00274 #define FI_RGBA_RED                             2
    00275 #define FI_RGBA_GREEN                   1
    00276 #define FI_RGBA_BLUE                    0
    00277 #define FI_RGBA_ALPHA                   3
    00278 #define FI_RGBA_RED_MASK                0x00FF0000
    00279 #define FI_RGBA_GREEN_MASK              0x0000FF00
    00280 #define FI_RGBA_BLUE_MASK               0x000000FF
    00281 #define FI_RGBA_ALPHA_MASK              0xFF000000
    00282 #define FI_RGBA_RED_SHIFT               16
    00283 #define FI_RGBA_GREEN_SHIFT             8
    00284 #define FI_RGBA_BLUE_SHIFT              0
    00285 #define FI_RGBA_ALPHA_SHIFT             24
    00286 #else
    00287 // Little Endian (x86 / MaxOSX) : RGB(A) order
    00288 #define FI_RGBA_RED                             0
    00289 #define FI_RGBA_GREEN                   1
    00290 #define FI_RGBA_BLUE                    2
    00291 #define FI_RGBA_ALPHA                   3
    00292 #define FI_RGBA_RED_MASK                0x000000FF
    00293 #define FI_RGBA_GREEN_MASK              0x0000FF00
    00294 #define FI_RGBA_BLUE_MASK               0x00FF0000
    00295 #define FI_RGBA_ALPHA_MASK              0xFF000000
    00296 #define FI_RGBA_RED_SHIFT               0
    00297 #define FI_RGBA_GREEN_SHIFT             8
    00298 #define FI_RGBA_BLUE_SHIFT              16
    00299 #define FI_RGBA_ALPHA_SHIFT             24
    00300 #endif // FREEIMAGE_COLORORDER
    00301 #else
    00302 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
    00303 // Big Endian (PPC / none) : BGR(A) order
    00304 #define FI_RGBA_RED                             2
    00305 #define FI_RGBA_GREEN                   1
    00306 #define FI_RGBA_BLUE                    0
    00307 #define FI_RGBA_ALPHA                   3
    00308 #define FI_RGBA_RED_MASK                0x0000FF00
    00309 #define FI_RGBA_GREEN_MASK              0x00FF0000
    00310 #define FI_RGBA_BLUE_MASK               0xFF000000
    00311 #define FI_RGBA_ALPHA_MASK              0x000000FF
    00312 #define FI_RGBA_RED_SHIFT               8
    00313 #define FI_RGBA_GREEN_SHIFT             16
    00314 #define FI_RGBA_BLUE_SHIFT              24
    00315 #define FI_RGBA_ALPHA_SHIFT             0
    00316 #else
    00317 // Big Endian (PPC / Linux, MaxOSX) : RGB(A) order
    00318 #define FI_RGBA_RED                             0
    00319 #define FI_RGBA_GREEN                   1
    00320 #define FI_RGBA_BLUE                    2
    00321 #define FI_RGBA_ALPHA                   3
    00322 #define FI_RGBA_RED_MASK                0xFF000000
    00323 #define FI_RGBA_GREEN_MASK              0x00FF0000
    00324 #define FI_RGBA_BLUE_MASK               0x0000FF00
    00325 #define FI_RGBA_ALPHA_MASK              0x000000FF
    00326 #define FI_RGBA_RED_SHIFT               24
    00327 #define FI_RGBA_GREEN_SHIFT             16
    00328 #define FI_RGBA_BLUE_SHIFT              8
    00329 #define FI_RGBA_ALPHA_SHIFT             0
    00330 #endif // FREEIMAGE_COLORORDER
    00331 #endif // FREEIMAGE_BIGENDIAN
    00332
    00333 #define FI_RGBA_RGB_MASK                (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK)
    00334
    00335 // The 16bit macros only include masks and shifts, since each color element is not byte aligned
    00336
    00337 #define FI16_555_RED_MASK               0x7C00
    00338 #define FI16_555_GREEN_MASK             0x03E0
    00339 #define FI16_555_BLUE_MASK              0x001F
    00340 #define FI16_555_RED_SHIFT              10
    00341 #define FI16_555_GREEN_SHIFT    5
    00342 #define FI16_555_BLUE_SHIFT             0
    00343 #define FI16_565_RED_MASK               0xF800
    00344 #define FI16_565_GREEN_MASK             0x07E0
    00345 #define FI16_565_BLUE_MASK              0x001F
    00346 #define FI16_565_RED_SHIFT              11
    00347 #define FI16_565_GREEN_SHIFT    5
    00348 #define FI16_565_BLUE_SHIFT             0
    00349
    00350 // ICC profile support ------------------------------------------------------
    00351
    00352 #define FIICC_DEFAULT                   0x00
    00353 #define FIICC_COLOR_IS_CMYK             0x01
    00354
    00355 FI_STRUCT (FIICCPROFILE) {
    00356         WORD    flags;  // info flag
    00357         DWORD   size;   // profile's size measured in bytes
    00358         void   *data;   // points to a block of contiguous memory containing the profile
    00359 };
    00360
    00361 // Important enums ----------------------------------------------------------
    00362
    00365 FI_ENUM(FREE_IMAGE_FORMAT) {
    00366         FIF_UNKNOWN = -1,
    00367         FIF_BMP         = 0,
    00368         FIF_ICO         = 1,
    00369         FIF_JPEG        = 2,
    00370         FIF_JNG         = 3,
    00371         FIF_KOALA       = 4,
    00372         FIF_LBM         = 5,
    00373         FIF_IFF = FIF_LBM,
    00374         FIF_MNG         = 6,
    00375         FIF_PBM         = 7,
    00376         FIF_PBMRAW      = 8,
    00377         FIF_PCD         = 9,
    00378         FIF_PCX         = 10,
    00379         FIF_PGM         = 11,
    00380         FIF_PGMRAW      = 12,
    00381         FIF_PNG         = 13,
    00382         FIF_PPM         = 14,
    00383         FIF_PPMRAW      = 15,
    00384         FIF_RAS         = 16,
    00385         FIF_TARGA       = 17,
    00386         FIF_TIFF        = 18,
    00387         FIF_WBMP        = 19,
    00388         FIF_PSD         = 20,
    00389         FIF_CUT         = 21,
    00390         FIF_XBM         = 22,
    00391         FIF_XPM         = 23,
    00392         FIF_DDS         = 24,
    00393         FIF_GIF     = 25,
    00394         FIF_HDR         = 26,
    00395         FIF_FAXG3       = 27,
    00396         FIF_SGI         = 28,
    00397         FIF_EXR         = 29,
    00398         FIF_J2K         = 30,
    00399         FIF_JP2         = 31,
    00400         FIF_PFM         = 32,
    00401         FIF_PICT        = 33,
    00402         FIF_RAW         = 34
    00403 };
    00404
    00407 FI_ENUM(FREE_IMAGE_TYPE) {
    00408         FIT_UNKNOWN = 0,        // unknown type
    00409         FIT_BITMAP  = 1,        // standard image                       : 1-, 4-, 8-, 16-, 24-, 32-bit
    00410         FIT_UINT16      = 2,    // array of unsigned short      : unsigned 16-bit
    00411         FIT_INT16       = 3,    // array of short                       : signed 16-bit
    00412         FIT_UINT32      = 4,    // array of unsigned long       : unsigned 32-bit
    00413         FIT_INT32       = 5,    // array of long                        : signed 32-bit
    00414         FIT_FLOAT       = 6,    // array of float                       : 32-bit IEEE floating point
    00415         FIT_DOUBLE      = 7,    // array of double                      : 64-bit IEEE floating point
    00416         FIT_COMPLEX     = 8,    // array of FICOMPLEX           : 2 x 64-bit IEEE floating point
    00417         FIT_RGB16       = 9,    // 48-bit RGB image                     : 3 x 16-bit
    00418         FIT_RGBA16      = 10,   // 64-bit RGBA image            : 4 x 16-bit
    00419         FIT_RGBF        = 11,   // 96-bit RGB float image       : 3 x 32-bit IEEE floating point
    00420         FIT_RGBAF       = 12    // 128-bit RGBA float image     : 4 x 32-bit IEEE floating point
    00421 };
    00422
    00425 FI_ENUM(FREE_IMAGE_COLOR_TYPE) {
    00426         FIC_MINISWHITE = 0,             // min value is white
    00427     FIC_MINISBLACK = 1,         // min value is black
    00428     FIC_RGB        = 2,         // RGB color model
    00429     FIC_PALETTE    = 3,         // color map indexed
    00430         FIC_RGBALPHA   = 4,             // RGB color model with alpha channel
    00431         FIC_CMYK       = 5              // CMYK color model
    00432 };
    00433
    00437 FI_ENUM(FREE_IMAGE_QUANTIZE) {
    00438     FIQ_WUQUANT = 0,            // Xiaolin Wu color quantization algorithm
    00439     FIQ_NNQUANT = 1                     // NeuQuant neural-net quantization algorithm by Anthony Dekker
    00440 };
    00441
    00445 FI_ENUM(FREE_IMAGE_DITHER) {
    00446     FID_FS                      = 0,    // Floyd & Steinberg error diffusion
    00447         FID_BAYER4x4    = 1,    // Bayer ordered dispersed dot dithering (order 2 dithering matrix)
    00448         FID_BAYER8x8    = 2,    // Bayer ordered dispersed dot dithering (order 3 dithering matrix)
    00449         FID_CLUSTER6x6  = 3,    // Ordered clustered dot dithering (order 3 - 6x6 matrix)
    00450         FID_CLUSTER8x8  = 4,    // Ordered clustered dot dithering (order 4 - 8x8 matrix)
    00451         FID_CLUSTER16x16= 5,    // Ordered clustered dot dithering (order 8 - 16x16 matrix)
    00452         FID_BAYER16x16  = 6             // Bayer ordered dispersed dot dithering (order 4 dithering matrix)
    00453 };
    00454
    00458 FI_ENUM(FREE_IMAGE_JPEG_OPERATION) {
    00459         FIJPEG_OP_NONE                  = 0,    // no transformation
    00460         FIJPEG_OP_FLIP_H                = 1,    // horizontal flip
    00461         FIJPEG_OP_FLIP_V                = 2,    // vertical flip
    00462         FIJPEG_OP_TRANSPOSE             = 3,    // transpose across UL-to-LR axis
    00463         FIJPEG_OP_TRANSVERSE    = 4,    // transpose across UR-to-LL axis
    00464         FIJPEG_OP_ROTATE_90             = 5,    // 90-degree clockwise rotation
    00465         FIJPEG_OP_ROTATE_180    = 6,    // 180-degree rotation
    00466         FIJPEG_OP_ROTATE_270    = 7             // 270-degree clockwise (or 90 ccw)
    00467 };
    00468
    00472 FI_ENUM(FREE_IMAGE_TMO) {
    00473     FITMO_DRAGO03        = 0,   // Adaptive logarithmic mapping (F. Drago, 2003)
    00474         FITMO_REINHARD05 = 1,   // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005)
    00475         FITMO_FATTAL02   = 2    // Gradient domain high dynamic range compression (R. Fattal, 2002)
    00476 };
    00477
    00481 FI_ENUM(FREE_IMAGE_FILTER) {
    00482         FILTER_BOX                = 0,  // Box, pulse, Fourier window, 1st order (constant) b-spline
    00483         FILTER_BICUBIC    = 1,  // Mitchell & Netravali's two-param cubic filter
    00484         FILTER_BILINEAR   = 2,  // Bilinear filter
    00485         FILTER_BSPLINE    = 3,  // 4th order (cubic) b-spline
    00486         FILTER_CATMULLROM = 4,  // Catmull-Rom spline, Overhauser spline
    00487         FILTER_LANCZOS3   = 5   // Lanczos3 filter
    00488 };
    00489
    00493 FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) {
    00494         FICC_RGB        = 0,    // Use red, green and blue channels
    00495         FICC_RED        = 1,    // Use red channel
    00496         FICC_GREEN      = 2,    // Use green channel
    00497         FICC_BLUE       = 3,    // Use blue channel
    00498         FICC_ALPHA      = 4,    // Use alpha channel
    00499         FICC_BLACK      = 5,    // Use black channel
    00500         FICC_REAL       = 6,    // Complex images: use real part
    00501         FICC_IMAG       = 7,    // Complex images: use imaginary part
    00502         FICC_MAG        = 8,    // Complex images: use magnitude
    00503         FICC_PHASE      = 9             // Complex images: use phase
    00504 };
    00505
    00506 // Metadata support ---------------------------------------------------------
    00507
    00513 FI_ENUM(FREE_IMAGE_MDTYPE) {
    00514         FIDT_NOTYPE             = 0,    // placeholder
    00515         FIDT_BYTE               = 1,    // 8-bit unsigned integer
    00516         FIDT_ASCII              = 2,    // 8-bit bytes w/ last byte null
    00517         FIDT_SHORT              = 3,    // 16-bit unsigned integer
    00518         FIDT_LONG               = 4,    // 32-bit unsigned integer
    00519         FIDT_RATIONAL   = 5,    // 64-bit unsigned fraction
    00520         FIDT_SBYTE              = 6,    // 8-bit signed integer
    00521         FIDT_UNDEFINED  = 7,    // 8-bit untyped data
    00522         FIDT_SSHORT             = 8,    // 16-bit signed integer
    00523         FIDT_SLONG              = 9,    // 32-bit signed integer
    00524         FIDT_SRATIONAL  = 10,   // 64-bit signed fraction
    00525         FIDT_FLOAT              = 11,   // 32-bit IEEE floating point
    00526         FIDT_DOUBLE             = 12,   // 64-bit IEEE floating point
    00527         FIDT_IFD                = 13,   // 32-bit unsigned integer (offset)
    00528         FIDT_PALETTE    = 14    // 32-bit RGBQUAD
    00529 };
    00530
    00534 FI_ENUM(FREE_IMAGE_MDMODEL) {
    00535         FIMD_NODATA                     = -1,
    00536         FIMD_COMMENTS           = 0,    // single comment or keywords
    00537         FIMD_EXIF_MAIN          = 1,    // Exif-TIFF metadata
    00538         FIMD_EXIF_EXIF          = 2,    // Exif-specific metadata
    00539         FIMD_EXIF_GPS           = 3,    // Exif GPS metadata
    00540         FIMD_EXIF_MAKERNOTE = 4,        // Exif maker note metadata
    00541         FIMD_EXIF_INTEROP       = 5,    // Exif interoperability metadata
    00542         FIMD_IPTC                       = 6,    // IPTC/NAA metadata
    00543         FIMD_XMP                        = 7,    // Abobe XMP metadata
    00544         FIMD_GEOTIFF            = 8,    // GeoTIFF metadata
    00545         FIMD_ANIMATION          = 9,    // Animation metadata
    00546         FIMD_CUSTOM                     = 10,   // Used to attach other metadata types to a dib
    00547         FIMD_EXIF_RAW           = 11    // Exif metadata as a raw buffer
    00548 };
    00549
    00553 FI_STRUCT (FIMETADATA) { void *data; };
    00554
    00558 FI_STRUCT (FITAG) { void *data; };
    00559
    00560 // File IO routines ---------------------------------------------------------
    00561
    00562 #ifndef FREEIMAGE_IO
    00563 #define FREEIMAGE_IO
    00564
    00565 typedef void* fi_handle;
    00566 typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
    00567 typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
    00568 typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin);
    00569 typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle);
    00570
    00571 #if (defined(_WIN32) || defined(__WIN32__))
    00572 #pragma pack(push, 1)
    00573 #else
    00574 #pragma pack(1)
    00575 #endif // WIN32
    00576
    00577 FI_STRUCT(FreeImageIO) {
    00578         FI_ReadProc  read_proc;     // pointer to the function used to read data
    00579     FI_WriteProc write_proc;    // pointer to the function used to write data
    00580     FI_SeekProc  seek_proc;     // pointer to the function used to seek
    00581     FI_TellProc  tell_proc;     // pointer to the function used to aquire the current position
    00582 };
    00583
    00584 #if (defined(_WIN32) || defined(__WIN32__))
    00585 #pragma pack(pop)
    00586 #else
    00587 #pragma pack()
    00588 #endif // WIN32
    00589
    00593 FI_STRUCT (FIMEMORY) { void *data; };
    00594
    00595 #endif // FREEIMAGE_IO
    00596
    00597 // Plugin routines ----------------------------------------------------------
    00598
    00599 #ifndef PLUGINS
    00600 #define PLUGINS
    00601
    00602 typedef const char *(DLL_CALLCONV *FI_FormatProc)(void);
    00603 typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void);
    00604 typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void);
    00605 typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void);
    00606 typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read);
    00607 typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data);
    00608 typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data);
    00609 typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data);
    00610 typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data);
    00611 typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data);
    00612 typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle);
    00613 typedef const char *(DLL_CALLCONV *FI_MimeProc)(void);
    00614 typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp);
    00615 typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type);
    00616 typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void);
    00617 typedef BOOL (DLL_CALLCONV *FI_SupportsNoPixelsProc)(void);
    00618
    00619 FI_STRUCT (Plugin) {
    00620         FI_FormatProc format_proc;
    00621         FI_DescriptionProc description_proc;
    00622         FI_ExtensionListProc extension_proc;
    00623         FI_RegExprProc regexpr_proc;
    00624         FI_OpenProc open_proc;
    00625         FI_CloseProc close_proc;
    00626         FI_PageCountProc pagecount_proc;
    00627         FI_PageCapabilityProc pagecapability_proc;
    00628         FI_LoadProc load_proc;
    00629         FI_SaveProc save_proc;
    00630         FI_ValidateProc validate_proc;
    00631         FI_MimeProc mime_proc;
    00632         FI_SupportsExportBPPProc supports_export_bpp_proc;
    00633         FI_SupportsExportTypeProc supports_export_type_proc;
    00634         FI_SupportsICCProfilesProc supports_icc_profiles_proc;
    00635         FI_SupportsNoPixelsProc supports_no_pixels_proc;
    00636 };
    00637
    00638 typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id);
    00639
    00640 #endif // PLUGINS
    00641
    00642
    00643 // Load / Save flag constants -----------------------------------------------
    00644
    00645 #define FIF_LOAD_NOPIXELS 0x8000 // loading: load the image header only (not supported by all plugins)
    00646
    00647 #define BMP_DEFAULT         0
    00648 #define BMP_SAVE_RLE        1
    00649 #define CUT_DEFAULT         0
    00650 #define DDS_DEFAULT                     0
    00651 #define EXR_DEFAULT                     0               // save data as half with piz-based wavelet compression
    00652 #define EXR_FLOAT                       0x0001  // save data as float instead of as half (not recommended)
    00653 #define EXR_NONE                        0x0002  // save with no compression
    00654 #define EXR_ZIP                         0x0004  // save with zlib compression, in blocks of 16 scan lines
    00655 #define EXR_PIZ                         0x0008  // save with piz-based wavelet compression
    00656 #define EXR_PXR24                       0x0010  // save with lossy 24-bit float compression
    00657 #define EXR_B44                         0x0020  // save with lossy 44% float compression - goes to 22% when combined with EXR_LC
    00658 #define EXR_LC                          0x0040  // save images with one luminance and two chroma channels, rather than as RGB (lossy compression)
    00659 #define FAXG3_DEFAULT           0
    00660 #define GIF_DEFAULT                     0
    00661 #define GIF_LOAD256                     1               // Load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color
    00662 #define GIF_PLAYBACK            2               // 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading
    00663 #define HDR_DEFAULT                     0
    00664 #define ICO_DEFAULT         0
    00665 #define ICO_MAKEALPHA           1               // convert to 32bpp and create an alpha channel from the AND-mask when loading
    00666 #define IFF_DEFAULT         0
    00667 #define J2K_DEFAULT                     0               // save with a 16:1 rate
    00668 #define JP2_DEFAULT                     0               // save with a 16:1 rate
    00669 #define JPEG_DEFAULT        0           // loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420)
    00670 #define JPEG_FAST           0x0001      // load the file as fast as possible, sacrificing some quality
    00671 #define JPEG_ACCURATE       0x0002      // load the file with the best quality, sacrificing some speed
    00672 #define JPEG_CMYK                       0x0004  // load separated CMYK "as is" (use | to combine with other load flags)
    00673 #define JPEG_EXIFROTATE         0x0008  // load and rotate according to Exif 'Orientation' tag if available
    00674 #define JPEG_QUALITYSUPERB  0x80        // save with superb quality (100:1)
    00675 #define JPEG_QUALITYGOOD    0x0100      // save with good quality (75:1)
    00676 #define JPEG_QUALITYNORMAL  0x0200      // save with normal quality (50:1)
    00677 #define JPEG_QUALITYAVERAGE 0x0400      // save with average quality (25:1)
    00678 #define JPEG_QUALITYBAD     0x0800      // save with bad quality (10:1)
    00679 #define JPEG_PROGRESSIVE        0x2000  // save as a progressive-JPEG (use | to combine with other save flags)
    00680 #define JPEG_SUBSAMPLING_411 0x1000             // save with high 4x1 chroma subsampling (4:1:1)
    00681 #define JPEG_SUBSAMPLING_420 0x4000             // save with medium 2x2 medium chroma subsampling (4:2:0) - default value
    00682 #define JPEG_SUBSAMPLING_422 0x8000             // save with low 2x1 chroma subsampling (4:2:2)
    00683 #define JPEG_SUBSAMPLING_444 0x10000    // save with no chroma subsampling (4:4:4)
    00684 #define JPEG_OPTIMIZE           0x20000         // on saving, compute optimal Huffman coding tables (can reduce a few percent of file size)
    00685 #define KOALA_DEFAULT       0
    00686 #define LBM_DEFAULT         0
    00687 #define MNG_DEFAULT         0
    00688 #define PCD_DEFAULT         0
    00689 #define PCD_BASE            1           // load the bitmap sized 768 x 512
    00690 #define PCD_BASEDIV4        2           // load the bitmap sized 384 x 256
    00691 #define PCD_BASEDIV16       3           // load the bitmap sized 192 x 128
    00692 #define PCX_DEFAULT         0
    00693 #define PFM_DEFAULT         0
    00694 #define PICT_DEFAULT        0
    00695 #define PNG_DEFAULT         0
    00696 #define PNG_IGNOREGAMMA         1               // loading: avoid gamma correction
    00697 #define PNG_Z_BEST_SPEED                        0x0001  // save using ZLib level 1 compression flag (default value is 6)
    00698 #define PNG_Z_DEFAULT_COMPRESSION       0x0006  // save using ZLib level 6 compression flag (default recommended value)
    00699 #define PNG_Z_BEST_COMPRESSION          0x0009  // save using ZLib level 9 compression flag (default value is 6)
    00700 #define PNG_Z_NO_COMPRESSION            0x0100  // save without ZLib compression
    00701 #define PNG_INTERLACED                          0x0200  // save using Adam7 interlacing (use | to combine with other save flags)
    00702 #define PNM_DEFAULT         0
    00703 #define PNM_SAVE_RAW        0       // If set the writer saves in RAW format (i.e. P4, P5 or P6)
    00704 #define PNM_SAVE_ASCII      1       // If set the writer saves in ASCII format (i.e. P1, P2 or P3)
    00705 #define PSD_DEFAULT         0
    00706 #define PSD_CMYK                        1               // reads tags for separated CMYK (default is conversion to RGB)
    00707 #define PSD_LAB                         2               // reads tags for CIELab (default is conversion to RGB)
    00708 #define RAS_DEFAULT         0
    00709 #define RAW_DEFAULT         0           // load the file as linear RGB 48-bit
    00710 #define RAW_PREVIEW                     1               // try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit
    00711 #define RAW_DISPLAY                     2               // load the file as RGB 24-bit
    00712 #define SGI_DEFAULT                     0
    00713 #define TARGA_DEFAULT       0
    00714 #define TARGA_LOAD_RGB888   1       // If set the loader converts RGB555 and ARGB8888 -> RGB888.
    00715 #define TARGA_SAVE_RLE          2               // If set, the writer saves with RLE compression
    00716 #define TIFF_DEFAULT        0
    00717 #define TIFF_CMYK                       0x0001  // reads/stores tags for separated CMYK (use | to combine with compression flags)
    00718 #define TIFF_PACKBITS       0x0100  // save using PACKBITS compression
    00719 #define TIFF_DEFLATE        0x0200  // save using DEFLATE compression (a.k.a. ZLIB compression)
    00720 #define TIFF_ADOBE_DEFLATE  0x0400  // save using ADOBE DEFLATE compression
    00721 #define TIFF_NONE           0x0800  // save without any compression
    00722 #define TIFF_CCITTFAX3          0x1000  // save using CCITT Group 3 fax encoding
    00723 #define TIFF_CCITTFAX4          0x2000  // save using CCITT Group 4 fax encoding
    00724 #define TIFF_LZW                        0x4000  // save using LZW compression
    00725 #define TIFF_JPEG                       0x8000  // save using JPEG compression
    00726 #define TIFF_LOGLUV                     0x10000 // save using LogLuv compression
    00727 #define WBMP_DEFAULT        0
    00728 #define XBM_DEFAULT                     0
    00729 #define XPM_DEFAULT                     0
    00730
    00731 // Background filling options ---------------------------------------------------------
    00732 // Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas
    00733
    00734 #define FI_COLOR_IS_RGB_COLOR                   0x00    // RGBQUAD color is a RGB color (contains no valid alpha channel)
    00735 #define FI_COLOR_IS_RGBA_COLOR                  0x01    // RGBQUAD color is a RGBA color (contains a valid alpha channel)
    00736 #define FI_COLOR_FIND_EQUAL_COLOR               0x02    // For palettized images: lookup equal RGB color from palette
    00737 #define FI_COLOR_ALPHA_IS_INDEX                 0x04    // The color's rgbReserved member (alpha) contains the palette index to be used
    00738 #define FI_COLOR_PALETTE_SEARCH_MASK    (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX)   // No color lookup is performed
    00739
    00740
    00741 #ifdef __cplusplus
    00742 extern "C" {
    00743 #endif
    00744
    00745 // Init / Error routines ----------------------------------------------------
    00746
    00747 DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));
    00748 DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void);
    00749
    00750 // Version routines ---------------------------------------------------------
    00751
    00752 DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);
    00753 DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void);
    00754
    00755 // Message output functions -------------------------------------------------
    00756
    00757 typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);
    00758 typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg);
    00759
    00760 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf);
    00761 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);
    00762 DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);
    00763
    00764 // Allocate / Clone / Unload routines ---------------------------------------
    00765
    00766 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));
    00767 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));
    00768 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);
    00769 DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);
    00770
    00771 // Header loading routines
    00772 DLL_API BOOL DLL_CALLCONV FreeImage_HasPixels(FIBITMAP *dib);
    00773
    00774 // Load / Save routines -----------------------------------------------------
    00775
    00776 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
    00777 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
    00778 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
    00779 DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));
    00780 DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));
    00781 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
    00782
    00783 // Memory I/O stream routines -----------------------------------------------
    00784
    00785 DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
    00786 DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);
    00787 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
    00788 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
    00789 DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);
    00790 DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);
    00791 DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
    00792 DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
    00793 DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
    00794
    00795 DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
    00796 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToMemory(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FIMEMORY *stream, int flags);
    00797
    00798 // Plugin Interface ---------------------------------------------------------
    00799
    00800 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));
    00801 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));
    00802 DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);
    00803 DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);
    00804 DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);
    00805 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);
    00806 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);
    00807 DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);
    00808 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);
    00809 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);
    00810 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);
    00811 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);
    00812 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);
    00813 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);
    00814 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);
    00815 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);
    00816 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);
    00817 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
    00818 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);
    00819 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsNoPixels(FREE_IMAGE_FORMAT fif);
    00820
    00821 // Multipaging interface ----------------------------------------------------
    00822
    00823 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));
    00824 DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
    00825 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToHandle(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
    00826 DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));
    00827 DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap);
    00828 DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data);
    00829 DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);
    00830 DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page);
    00831 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page);
    00832 DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);
    00833 DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source);
    00834 DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count);
    00835
    00836 // Filetype request routines ------------------------------------------------
    00837
    00838 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0));
    00839 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0));
    00840 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));
    00841 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0));
    00842
    00843 // Image type request routine -----------------------------------------------
    00844
    00845 DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib);
    00846
    00847 // FreeImage helper routines ------------------------------------------------
    00848
    00849 DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void);
    00850 DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
    00851 DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
    00852
    00853 // Pixel access routines ----------------------------------------------------
    00854
    00855 DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib);
    00856 DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline);
    00857
    00858 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
    00859 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
    00860 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
    00861 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
    00862
    00863 // DIB info routines --------------------------------------------------------
    00864
    00865 DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib);
    00866 DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib);
    00867 DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib);
    00868 DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib);
    00869 DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib);
    00870 DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib);
    00871 DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib);
    00872 DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib);
    00873
    00874 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib);
    00875 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib);
    00876 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res);
    00877 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res);
    00878
    00879 DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib);
    00880 DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib);
    00881 DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib);
    00882
    00883 DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib);
    00884 DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib);
    00885 DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib);
    00886
    00887 DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib);
    00888 DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib);
    00889 DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled);
    00890 DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count);
    00891 DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib);
    00892 DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index);
    00893 DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib);
    00894
    00895 DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib);
    00896 DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
    00897 DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
    00898
    00899
    00900 // ICC profile routines -----------------------------------------------------
    00901
    00902 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib);
    00903 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size);
    00904 DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib);
    00905
    00906 // Line conversion routines -------------------------------------------------
    00907
    00908 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);
    00909 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00910 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);
    00911 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);
    00912 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);
    00913 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);
    00914 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);
    00915 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);
    00916 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);
    00917 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);
    00918 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);
    00919 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);
    00920 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00921 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00922 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00923 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);
    00924 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);
    00925 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);
    00926 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00927 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00928 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00929 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);
    00930 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);
    00931 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);
    00932 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00933 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00934 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00935 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);
    00936 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);
    00937 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);
    00938 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00939 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00940 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
    00941 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);
    00942 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);
    00943 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);
    00944
    00945 // Smart conversion routines ------------------------------------------------
    00946
    00947 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib);
    00948 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib);
    00949 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib);
    00950 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib);
    00951 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib);
    00952 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib);
    00953 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib);
    00954 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
    00955 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));
    00956 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T);
    00957 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);
    00958
    00959 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));
    00960 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));
    00961
    00962 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToFloat(FIBITMAP *dib);
    00963 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib);
    00964
    00965 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));
    00966 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));
    00967
    00968 // tone mapping operators
    00969 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));
    00970 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));
    00971 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));
    00972 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));
    00973
    00974 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85));
    00975
    00976 // ZLib interface -----------------------------------------------------------
    00977
    00978 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
    00979 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
    00980 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
    00981 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
    00982 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size);
    00983
    00984 // --------------------------------------------------------------------------
    00985 // Metadata routines --------------------------------------------------------
    00986 // --------------------------------------------------------------------------
    00987
    00988 // tag creation / destruction
    00989 DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void);
    00990 DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag);
    00991 DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);
    00992
    00993 // tag getters and setters
    00994 DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);
    00995 DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);
    00996 DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
    00997 DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);
    00998 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);
    00999 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);
    01000 DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);
    01001
    01002 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);
    01003 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);
    01004 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);
    01005 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);
    01006 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);
    01007 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);
    01008 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value);
    01009
    01010 // iterator
    01011 DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);
    01012 DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag);
    01013 DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle);
    01014
    01015 // metadata setter and getter
    01016 DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);
    01017 DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);
    01018
    01019 // helpers
    01020 DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);
    01021 DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src);
    01022
    01023 // tag to C string conversion
    01024 DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));
    01025
    01026 // --------------------------------------------------------------------------
    01027 // Image manipulation toolkit -----------------------------------------------
    01028 // --------------------------------------------------------------------------
    01029
    01030 // rotation and flipping
    01032 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle);
    01033 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL));
    01034 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);
    01035 DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib);
    01036 DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib);
    01037 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));
    01038 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));
    01039
    01040 // upsampling / downsampling
    01041 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter);
    01042 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));
    01043
    01044 // color manipulation routines (point operations)
    01045 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);
    01046 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma);
    01047 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage);
    01048 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);
    01049 DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);
    01050 DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));
    01051 DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);
    01052 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));
    01053 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);
    01054 DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);
    01055 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices,       BYTE *dstindices, unsigned count, BOOL swap);
    01056 DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);
    01057
    01058 // channel processing routines
    01059 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
    01060 DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
    01061 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
    01062 DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
    01063
    01064 // copy / paste / composite routines
    01065 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);
    01066 DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
    01067 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));
    01068 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);
    01069 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);
    01070 DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib);
    01071
    01072 // background filling routines
    01073 DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0));
    01074 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));
    01075 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));
    01076 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));
    01077
    01078 // miscellaneous algorithms
    01079 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3));
    01080
    01081 // restore the borland-specific enum size option
    01082 #if defined(__BORLANDC__)
    01083 #pragma option pop
    01084 #endif
    01085
    01086 #ifdef __cplusplus
    01087 }
    01088 #endif
    01089
    01090 #endif // FREEIMAGE_H