FreeImagePlus - FreeImage 3.17.0
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   17
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 // Endianness:
00073 // Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined.
00074 // If your big endian system isn't being detected, add an OS specific check
00075 // or define any of FREEIMAGE_BIGENDIAN and FREEIMAGE_LITTLEENDIAN directly
00076 // to specify the desired endianness.
00077 #if (!defined(FREEIMAGE_BIGENDIAN) && !defined(FREEIMAGE_LITTLEENDIAN))
00078         #if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || defined(__BIG_ENDIAN__)
00079                 #define FREEIMAGE_BIGENDIAN
00080         #endif // BYTE_ORDER
00081 #endif // !FREEIMAGE_[BIG|LITTLE]ENDIAN
00082 
00083 // Color-Order:
00084 // The specified order of color components red, green and blue affects 24-
00085 // and 32-bit images of type FIT_BITMAP as well as the colors that are part
00086 // of a color palette. All other images always use RGB order. By default,
00087 // color order is coupled to endianness:
00088 // little-endian -> BGR
00089 // big-endian    -> RGB
00090 // However, you can always define FREEIMAGE_COLORORDER to any of the known
00091 // orders FREEIMAGE_COLORORDER_BGR (0) and FREEIMAGE_COLORORDER_RGB (1) to
00092 // specify your preferred color order.
00093 #define FREEIMAGE_COLORORDER_BGR    0
00094 #define FREEIMAGE_COLORORDER_RGB    1
00095 #if (!defined(FREEIMAGE_COLORORDER)) || ((FREEIMAGE_COLORORDER != FREEIMAGE_COLORORDER_BGR) && (FREEIMAGE_COLORORDER != FREEIMAGE_COLORORDER_RGB))
00096         #if defined(FREEIMAGE_BIGENDIAN)
00097                 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB
00098         #else
00099                 #define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
00100         #endif // FREEIMAGE_BIGENDIAN
00101 #endif // FREEIMAGE_COLORORDER
00102 
00103 // Ensure 4-byte enums if we're using Borland C++ compilers
00104 #if defined(__BORLANDC__)
00105 #pragma option push -b
00106 #endif
00107 
00108 // For C compatibility --------------------------------------------------------
00109 
00110 #ifdef __cplusplus
00111 #define FI_DEFAULT(x)   = x
00112 #define FI_ENUM(x)      enum x
00113 #define FI_STRUCT(x)    struct x
00114 #else
00115 #define FI_DEFAULT(x)
00116 #define FI_ENUM(x)      typedef int x; enum x
00117 #define FI_STRUCT(x)    typedef struct x x; struct x
00118 #endif
00119 
00120 // Bitmap types -------------------------------------------------------------
00121 
00122 FI_STRUCT (FIBITMAP) { void *data; };
00123 FI_STRUCT (FIMULTIBITMAP) { void *data; };
00124 
00125 // Types used in the library (directly copied from Windows) -----------------
00126 
00127 #if defined(__MINGW32__) && defined(_WINDOWS_H)
00128 #define _WINDOWS_       // prevent a bug in MinGW32
00129 #endif // __MINGW32__
00130 
00131 #ifndef _WINDOWS_
00132 #define _WINDOWS_
00133 
00134 #ifndef FALSE
00135 #define FALSE 0
00136 #endif
00137 #ifndef TRUE
00138 #define TRUE 1
00139 #endif
00140 #ifndef NULL
00141 #define NULL 0
00142 #endif
00143 
00144 #ifndef SEEK_SET
00145 #define SEEK_SET  0
00146 #define SEEK_CUR  1
00147 #define SEEK_END  2
00148 #endif
00149 
00150 #ifndef _MSC_VER
00151 // define portable types for 32-bit / 64-bit OS
00152 #include <inttypes.h>
00153 typedef int32_t BOOL;
00154 typedef uint8_t BYTE;
00155 typedef uint16_t WORD;
00156 typedef uint32_t DWORD;
00157 typedef int32_t LONG;
00158 typedef int64_t INT64;
00159 typedef uint64_t UINT64;
00160 #else
00161 // MS is not C99 ISO compliant
00162 typedef long BOOL;
00163 typedef unsigned char BYTE;
00164 typedef unsigned short WORD;
00165 typedef unsigned long DWORD;
00166 typedef long LONG;
00167 typedef signed __int64 INT64;
00168 typedef unsigned __int64 UINT64;
00169 #endif // _MSC_VER
00170 
00171 #if (defined(_WIN32) || defined(__WIN32__))
00172 #pragma pack(push, 1)
00173 #else
00174 #pragma pack(1)
00175 #endif // WIN32
00176 
00177 typedef struct tagRGBQUAD {
00178 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
00179   BYTE rgbBlue;
00180   BYTE rgbGreen;
00181   BYTE rgbRed;
00182 #else
00183   BYTE rgbRed;
00184   BYTE rgbGreen;
00185   BYTE rgbBlue;
00186 #endif // FREEIMAGE_COLORORDER
00187   BYTE rgbReserved;
00188 } RGBQUAD;
00189 
00190 typedef struct tagRGBTRIPLE {
00191 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
00192   BYTE rgbtBlue;
00193   BYTE rgbtGreen;
00194   BYTE rgbtRed;
00195 #else
00196   BYTE rgbtRed;
00197   BYTE rgbtGreen;
00198   BYTE rgbtBlue;
00199 #endif // FREEIMAGE_COLORORDER
00200 } RGBTRIPLE;
00201 
00202 #if (defined(_WIN32) || defined(__WIN32__))
00203 #pragma pack(pop)
00204 #else
00205 #pragma pack()
00206 #endif // WIN32
00207 
00208 typedef struct tagBITMAPINFOHEADER{
00209   DWORD biSize;
00210   LONG  biWidth; 
00211   LONG  biHeight; 
00212   WORD  biPlanes; 
00213   WORD  biBitCount;
00214   DWORD biCompression; 
00215   DWORD biSizeImage; 
00216   LONG  biXPelsPerMeter; 
00217   LONG  biYPelsPerMeter; 
00218   DWORD biClrUsed; 
00219   DWORD biClrImportant;
00220 } BITMAPINFOHEADER, *PBITMAPINFOHEADER; 
00221 
00222 typedef struct tagBITMAPINFO { 
00223   BITMAPINFOHEADER bmiHeader; 
00224   RGBQUAD          bmiColors[1];
00225 } BITMAPINFO, *PBITMAPINFO;
00226 
00227 #endif // _WINDOWS_
00228 
00229 // Types used in the library (specific to FreeImage) ------------------------
00230 
00231 #if (defined(_WIN32) || defined(__WIN32__))
00232 #pragma pack(push, 1)
00233 #else
00234 #pragma pack(1)
00235 #endif // WIN32
00236 
00239 typedef struct tagFIRGB16 {
00240         WORD red;
00241         WORD green;
00242         WORD blue;
00243 } FIRGB16;
00244 
00247 typedef struct tagFIRGBA16 {
00248         WORD red;
00249         WORD green;
00250         WORD blue;
00251         WORD alpha;
00252 } FIRGBA16;
00253 
00256 typedef struct tagFIRGBF {
00257         float red;
00258         float green;
00259         float blue;
00260 } FIRGBF;
00261 
00264 typedef struct tagFIRGBAF {
00265         float red;
00266         float green;
00267         float blue;
00268         float alpha;
00269 } FIRGBAF;
00270 
00273 typedef struct tagFICOMPLEX {
00275         double r;
00277     double i;
00278 } FICOMPLEX;
00279 
00280 #if (defined(_WIN32) || defined(__WIN32__))
00281 #pragma pack(pop)
00282 #else
00283 #pragma pack()
00284 #endif // WIN32
00285 
00286 // Indexes for byte arrays, masks and shifts for treating pixels as words ---
00287 // These coincide with the order of RGBQUAD and RGBTRIPLE -------------------
00288 
00289 #ifndef FREEIMAGE_BIGENDIAN
00290 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
00291 // Little Endian (x86 / MS Windows, Linux) : BGR(A) order
00292 #define FI_RGBA_RED                             2
00293 #define FI_RGBA_GREEN                   1
00294 #define FI_RGBA_BLUE                    0
00295 #define FI_RGBA_ALPHA                   3
00296 #define FI_RGBA_RED_MASK                0x00FF0000
00297 #define FI_RGBA_GREEN_MASK              0x0000FF00
00298 #define FI_RGBA_BLUE_MASK               0x000000FF
00299 #define FI_RGBA_ALPHA_MASK              0xFF000000
00300 #define FI_RGBA_RED_SHIFT               16
00301 #define FI_RGBA_GREEN_SHIFT             8
00302 #define FI_RGBA_BLUE_SHIFT              0
00303 #define FI_RGBA_ALPHA_SHIFT             24
00304 #else
00305 // Little Endian (x86 / MaxOSX) : RGB(A) order
00306 #define FI_RGBA_RED                             0
00307 #define FI_RGBA_GREEN                   1
00308 #define FI_RGBA_BLUE                    2
00309 #define FI_RGBA_ALPHA                   3
00310 #define FI_RGBA_RED_MASK                0x000000FF
00311 #define FI_RGBA_GREEN_MASK              0x0000FF00
00312 #define FI_RGBA_BLUE_MASK               0x00FF0000
00313 #define FI_RGBA_ALPHA_MASK              0xFF000000
00314 #define FI_RGBA_RED_SHIFT               0
00315 #define FI_RGBA_GREEN_SHIFT             8
00316 #define FI_RGBA_BLUE_SHIFT              16
00317 #define FI_RGBA_ALPHA_SHIFT             24
00318 #endif // FREEIMAGE_COLORORDER
00319 #else
00320 #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
00321 // Big Endian (PPC / none) : BGR(A) order
00322 #define FI_RGBA_RED                             2
00323 #define FI_RGBA_GREEN                   1
00324 #define FI_RGBA_BLUE                    0
00325 #define FI_RGBA_ALPHA                   3
00326 #define FI_RGBA_RED_MASK                0x0000FF00
00327 #define FI_RGBA_GREEN_MASK              0x00FF0000
00328 #define FI_RGBA_BLUE_MASK               0xFF000000
00329 #define FI_RGBA_ALPHA_MASK              0x000000FF
00330 #define FI_RGBA_RED_SHIFT               8
00331 #define FI_RGBA_GREEN_SHIFT             16
00332 #define FI_RGBA_BLUE_SHIFT              24
00333 #define FI_RGBA_ALPHA_SHIFT             0
00334 #else
00335 // Big Endian (PPC / Linux, MaxOSX) : RGB(A) order
00336 #define FI_RGBA_RED                             0
00337 #define FI_RGBA_GREEN                   1
00338 #define FI_RGBA_BLUE                    2
00339 #define FI_RGBA_ALPHA                   3
00340 #define FI_RGBA_RED_MASK                0xFF000000
00341 #define FI_RGBA_GREEN_MASK              0x00FF0000
00342 #define FI_RGBA_BLUE_MASK               0x0000FF00
00343 #define FI_RGBA_ALPHA_MASK              0x000000FF
00344 #define FI_RGBA_RED_SHIFT               24
00345 #define FI_RGBA_GREEN_SHIFT             16
00346 #define FI_RGBA_BLUE_SHIFT              8
00347 #define FI_RGBA_ALPHA_SHIFT             0
00348 #endif // FREEIMAGE_COLORORDER
00349 #endif // FREEIMAGE_BIGENDIAN
00350 
00351 #define FI_RGBA_RGB_MASK                (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK)
00352 
00353 // The 16bit macros only include masks and shifts, since each color element is not byte aligned
00354 
00355 #define FI16_555_RED_MASK               0x7C00
00356 #define FI16_555_GREEN_MASK             0x03E0
00357 #define FI16_555_BLUE_MASK              0x001F
00358 #define FI16_555_RED_SHIFT              10
00359 #define FI16_555_GREEN_SHIFT    5
00360 #define FI16_555_BLUE_SHIFT             0
00361 #define FI16_565_RED_MASK               0xF800
00362 #define FI16_565_GREEN_MASK             0x07E0
00363 #define FI16_565_BLUE_MASK              0x001F
00364 #define FI16_565_RED_SHIFT              11
00365 #define FI16_565_GREEN_SHIFT    5
00366 #define FI16_565_BLUE_SHIFT             0
00367 
00368 // ICC profile support ------------------------------------------------------
00369 
00370 #define FIICC_DEFAULT                   0x00
00371 #define FIICC_COLOR_IS_CMYK             0x01
00372 
00373 FI_STRUCT (FIICCPROFILE) { 
00374         WORD    flags;  
00375         DWORD   size;   
00376         void   *data;   
00377 };
00378 
00379 // Important enums ----------------------------------------------------------
00380 
00383 FI_ENUM(FREE_IMAGE_FORMAT) {
00384         FIF_UNKNOWN = -1,
00385         FIF_BMP         = 0,
00386         FIF_ICO         = 1,
00387         FIF_JPEG        = 2,
00388         FIF_JNG         = 3,
00389         FIF_KOALA       = 4,
00390         FIF_LBM         = 5,
00391         FIF_IFF = FIF_LBM,
00392         FIF_MNG         = 6,
00393         FIF_PBM         = 7,
00394         FIF_PBMRAW      = 8,
00395         FIF_PCD         = 9,
00396         FIF_PCX         = 10,
00397         FIF_PGM         = 11,
00398         FIF_PGMRAW      = 12,
00399         FIF_PNG         = 13,
00400         FIF_PPM         = 14,
00401         FIF_PPMRAW      = 15,
00402         FIF_RAS         = 16,
00403         FIF_TARGA       = 17,
00404         FIF_TIFF        = 18,
00405         FIF_WBMP        = 19,
00406         FIF_PSD         = 20,
00407         FIF_CUT         = 21,
00408         FIF_XBM         = 22,
00409         FIF_XPM         = 23,
00410         FIF_DDS         = 24,
00411         FIF_GIF     = 25,
00412         FIF_HDR         = 26,
00413         FIF_FAXG3       = 27,
00414         FIF_SGI         = 28,
00415         FIF_EXR         = 29,
00416         FIF_J2K         = 30,
00417         FIF_JP2         = 31,
00418         FIF_PFM         = 32,
00419         FIF_PICT        = 33,
00420         FIF_RAW         = 34,
00421         FIF_WEBP        = 35,
00422         FIF_JXR         = 36
00423 };
00424 
00427 FI_ENUM(FREE_IMAGE_TYPE) {
00428         FIT_UNKNOWN = 0,        
00429         FIT_BITMAP  = 1,        
00430         FIT_UINT16      = 2,    
00431         FIT_INT16       = 3,    
00432         FIT_UINT32      = 4,    
00433         FIT_INT32       = 5,    
00434         FIT_FLOAT       = 6,    
00435         FIT_DOUBLE      = 7,    
00436         FIT_COMPLEX     = 8,    
00437         FIT_RGB16       = 9,    
00438         FIT_RGBA16      = 10,   
00439         FIT_RGBF        = 11,   
00440         FIT_RGBAF       = 12    
00441 };
00442 
00445 FI_ENUM(FREE_IMAGE_COLOR_TYPE) {
00446         FIC_MINISWHITE = 0,             
00447     FIC_MINISBLACK = 1,         
00448     FIC_RGB        = 2,         
00449     FIC_PALETTE    = 3,         
00450         FIC_RGBALPHA   = 4,             
00451         FIC_CMYK       = 5              
00452 };
00453 
00457 FI_ENUM(FREE_IMAGE_QUANTIZE) {
00458     FIQ_WUQUANT = 0,            
00459     FIQ_NNQUANT = 1,            
00460         FIQ_LFPQUANT = 2                
00461 };
00462 
00466 FI_ENUM(FREE_IMAGE_DITHER) {
00467     FID_FS                      = 0,    
00468         FID_BAYER4x4    = 1,    
00469         FID_BAYER8x8    = 2,    
00470         FID_CLUSTER6x6  = 3,    
00471         FID_CLUSTER8x8  = 4,    
00472         FID_CLUSTER16x16= 5,    
00473         FID_BAYER16x16  = 6             
00474 };
00475 
00479 FI_ENUM(FREE_IMAGE_JPEG_OPERATION) {
00480         FIJPEG_OP_NONE                  = 0,    
00481         FIJPEG_OP_FLIP_H                = 1,    
00482         FIJPEG_OP_FLIP_V                = 2,    
00483         FIJPEG_OP_TRANSPOSE             = 3,    
00484         FIJPEG_OP_TRANSVERSE    = 4,    
00485         FIJPEG_OP_ROTATE_90             = 5,    
00486         FIJPEG_OP_ROTATE_180    = 6,    
00487         FIJPEG_OP_ROTATE_270    = 7             
00488 };
00489 
00493 FI_ENUM(FREE_IMAGE_TMO) {
00494     FITMO_DRAGO03        = 0,   
00495         FITMO_REINHARD05 = 1,   
00496         FITMO_FATTAL02   = 2    
00497 };
00498 
00502 FI_ENUM(FREE_IMAGE_FILTER) {
00503         FILTER_BOX                = 0,  
00504         FILTER_BICUBIC    = 1,  
00505         FILTER_BILINEAR   = 2,  
00506         FILTER_BSPLINE    = 3,  
00507         FILTER_CATMULLROM = 4,  
00508         FILTER_LANCZOS3   = 5   
00509 };
00510 
00514 FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) {
00515         FICC_RGB        = 0,    
00516         FICC_RED        = 1,    
00517         FICC_GREEN      = 2,    
00518         FICC_BLUE       = 3,    
00519         FICC_ALPHA      = 4,    
00520         FICC_BLACK      = 5,    
00521         FICC_REAL       = 6,    
00522         FICC_IMAG       = 7,    
00523         FICC_MAG        = 8,    
00524         FICC_PHASE      = 9             
00525 };
00526 
00527 // Metadata support ---------------------------------------------------------
00528 
00534 FI_ENUM(FREE_IMAGE_MDTYPE) {
00535         FIDT_NOTYPE             = 0,    
00536         FIDT_BYTE               = 1,    
00537         FIDT_ASCII              = 2,    
00538         FIDT_SHORT              = 3,    
00539         FIDT_LONG               = 4,    
00540         FIDT_RATIONAL   = 5,    
00541         FIDT_SBYTE              = 6,    
00542         FIDT_UNDEFINED  = 7,    
00543         FIDT_SSHORT             = 8,    
00544         FIDT_SLONG              = 9,    
00545         FIDT_SRATIONAL  = 10,   
00546         FIDT_FLOAT              = 11,   
00547         FIDT_DOUBLE             = 12,   
00548         FIDT_IFD                = 13,   
00549         FIDT_PALETTE    = 14,   
00550         FIDT_LONG8              = 16,   
00551         FIDT_SLONG8             = 17,   
00552         FIDT_IFD8               = 18    
00553 };
00554 
00558 FI_ENUM(FREE_IMAGE_MDMODEL) {
00559         FIMD_NODATA                     = -1,
00560         FIMD_COMMENTS           = 0,    
00561         FIMD_EXIF_MAIN          = 1,    
00562         FIMD_EXIF_EXIF          = 2,    
00563         FIMD_EXIF_GPS           = 3,    
00564         FIMD_EXIF_MAKERNOTE = 4,        
00565         FIMD_EXIF_INTEROP       = 5,    
00566         FIMD_IPTC                       = 6,    
00567         FIMD_XMP                        = 7,    
00568         FIMD_GEOTIFF            = 8,    
00569         FIMD_ANIMATION          = 9,    
00570         FIMD_CUSTOM                     = 10,   
00571         FIMD_EXIF_RAW           = 11    
00572 };
00573 
00577 FI_STRUCT (FIMETADATA) { void *data; };
00578 
00582 FI_STRUCT (FITAG) { void *data; };
00583 
00584 // File IO routines ---------------------------------------------------------
00585 
00586 #ifndef FREEIMAGE_IO
00587 #define FREEIMAGE_IO
00588 
00589 typedef void* fi_handle;
00590 typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
00591 typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
00592 typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin);
00593 typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle);
00594 
00595 #if (defined(_WIN32) || defined(__WIN32__))
00596 #pragma pack(push, 1)
00597 #else
00598 #pragma pack(1)
00599 #endif // WIN32
00600 
00601 FI_STRUCT(FreeImageIO) {
00602         FI_ReadProc  read_proc;     
00603     FI_WriteProc write_proc;    
00604     FI_SeekProc  seek_proc;     
00605     FI_TellProc  tell_proc;     
00606 };
00607 
00608 #if (defined(_WIN32) || defined(__WIN32__))
00609 #pragma pack(pop)
00610 #else
00611 #pragma pack()
00612 #endif // WIN32
00613 
00617 FI_STRUCT (FIMEMORY) { void *data; };
00618 
00619 #endif // FREEIMAGE_IO
00620 
00621 // Plugin routines ----------------------------------------------------------
00622 
00623 #ifndef PLUGINS
00624 #define PLUGINS
00625 
00626 typedef const char *(DLL_CALLCONV *FI_FormatProc)(void);
00627 typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void);
00628 typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void);
00629 typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void);
00630 typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read);
00631 typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data);
00632 typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data);
00633 typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data);
00634 typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data);
00635 typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data);
00636 typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle);
00637 typedef const char *(DLL_CALLCONV *FI_MimeProc)(void);
00638 typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp);
00639 typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type);
00640 typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void);
00641 typedef BOOL (DLL_CALLCONV *FI_SupportsNoPixelsProc)(void);
00642 
00643 FI_STRUCT (Plugin) {
00644         FI_FormatProc format_proc;
00645         FI_DescriptionProc description_proc;
00646         FI_ExtensionListProc extension_proc;
00647         FI_RegExprProc regexpr_proc;
00648         FI_OpenProc open_proc;
00649         FI_CloseProc close_proc;
00650         FI_PageCountProc pagecount_proc;
00651         FI_PageCapabilityProc pagecapability_proc;
00652         FI_LoadProc load_proc;
00653         FI_SaveProc save_proc;
00654         FI_ValidateProc validate_proc;
00655         FI_MimeProc mime_proc;
00656         FI_SupportsExportBPPProc supports_export_bpp_proc;
00657         FI_SupportsExportTypeProc supports_export_type_proc;
00658         FI_SupportsICCProfilesProc supports_icc_profiles_proc;
00659         FI_SupportsNoPixelsProc supports_no_pixels_proc;
00660 };
00661 
00662 typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id);
00663 
00664 #endif // PLUGINS
00665 
00666 
00667 // Load / Save flag constants -----------------------------------------------
00668 
00669 #define FIF_LOAD_NOPIXELS 0x8000        //! loading: load the image header only (not supported by all plugins, default to full loading)
00670 
00671 #define BMP_DEFAULT         0
00672 #define BMP_SAVE_RLE        1
00673 #define CUT_DEFAULT         0
00674 #define DDS_DEFAULT                     0
00675 #define EXR_DEFAULT                     0               //! save data as half with piz-based wavelet compression
00676 #define EXR_FLOAT                       0x0001  //! save data as float instead of as half (not recommended)
00677 #define EXR_NONE                        0x0002  //! save with no compression
00678 #define EXR_ZIP                         0x0004  //! save with zlib compression, in blocks of 16 scan lines
00679 #define EXR_PIZ                         0x0008  //! save with piz-based wavelet compression
00680 #define EXR_PXR24                       0x0010  //! save with lossy 24-bit float compression
00681 #define EXR_B44                         0x0020  //! save with lossy 44% float compression - goes to 22% when combined with EXR_LC
00682 #define EXR_LC                          0x0040  //! save images with one luminance and two chroma channels, rather than as RGB (lossy compression)
00683 #define FAXG3_DEFAULT           0
00684 #define GIF_DEFAULT                     0
00685 #define GIF_LOAD256                     1               //! load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color
00686 #define GIF_PLAYBACK            2               //! 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading
00687 #define HDR_DEFAULT                     0
00688 #define ICO_DEFAULT         0
00689 #define ICO_MAKEALPHA           1               //! convert to 32bpp and create an alpha channel from the AND-mask when loading
00690 #define IFF_DEFAULT         0
00691 #define J2K_DEFAULT                     0               //! save with a 16:1 rate
00692 #define JP2_DEFAULT                     0               //! save with a 16:1 rate
00693 #define JPEG_DEFAULT        0           //! loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420)
00694 #define JPEG_FAST           0x0001      //! load the file as fast as possible, sacrificing some quality
00695 #define JPEG_ACCURATE       0x0002      //! load the file with the best quality, sacrificing some speed
00696 #define JPEG_CMYK                       0x0004  //! load separated CMYK "as is" (use | to combine with other load flags)
00697 #define JPEG_EXIFROTATE         0x0008  //! load and rotate according to Exif 'Orientation' tag if available
00698 #define JPEG_GREYSCALE          0x0010  //! load and convert to a 8-bit greyscale image
00699 #define JPEG_QUALITYSUPERB  0x80        //! save with superb quality (100:1)
00700 #define JPEG_QUALITYGOOD    0x0100      //! save with good quality (75:1)
00701 #define JPEG_QUALITYNORMAL  0x0200      //! save with normal quality (50:1)
00702 #define JPEG_QUALITYAVERAGE 0x0400      //! save with average quality (25:1)
00703 #define JPEG_QUALITYBAD     0x0800      //! save with bad quality (10:1)
00704 #define JPEG_PROGRESSIVE        0x2000  //! save as a progressive-JPEG (use | to combine with other save flags)
00705 #define JPEG_SUBSAMPLING_411 0x1000             //! save with high 4x1 chroma subsampling (4:1:1) 
00706 #define JPEG_SUBSAMPLING_420 0x4000             //! save with medium 2x2 medium chroma subsampling (4:2:0) - default value
00707 #define JPEG_SUBSAMPLING_422 0x8000             //! save with low 2x1 chroma subsampling (4:2:2) 
00708 #define JPEG_SUBSAMPLING_444 0x10000    //! save with no chroma subsampling (4:4:4)
00709 #define JPEG_OPTIMIZE           0x20000         //! on saving, compute optimal Huffman coding tables (can reduce a few percent of file size)
00710 #define JPEG_BASELINE           0x40000         //! save basic JPEG, without metadata or any markers
00711 #define KOALA_DEFAULT       0
00712 #define LBM_DEFAULT         0
00713 #define MNG_DEFAULT         0
00714 #define PCD_DEFAULT         0
00715 #define PCD_BASE            1           //! load the bitmap sized 768 x 512
00716 #define PCD_BASEDIV4        2           //! load the bitmap sized 384 x 256
00717 #define PCD_BASEDIV16       3           //! load the bitmap sized 192 x 128
00718 #define PCX_DEFAULT         0
00719 #define PFM_DEFAULT         0
00720 #define PICT_DEFAULT        0
00721 #define PNG_DEFAULT         0
00722 #define PNG_IGNOREGAMMA         1               //! loading: avoid gamma correction
00723 #define PNG_Z_BEST_SPEED                        0x0001  //! save using ZLib level 1 compression flag (default value is 6)
00724 #define PNG_Z_DEFAULT_COMPRESSION       0x0006  //! save using ZLib level 6 compression flag (default recommended value)
00725 #define PNG_Z_BEST_COMPRESSION          0x0009  //! save using ZLib level 9 compression flag (default value is 6)
00726 #define PNG_Z_NO_COMPRESSION            0x0100  //! save without ZLib compression
00727 #define PNG_INTERLACED                          0x0200  //! save using Adam7 interlacing (use | to combine with other save flags)
00728 #define PNM_DEFAULT         0
00729 #define PNM_SAVE_RAW        0       //! if set the writer saves in RAW format (i.e. P4, P5 or P6)
00730 #define PNM_SAVE_ASCII      1       //! if set the writer saves in ASCII format (i.e. P1, P2 or P3)
00731 #define PSD_DEFAULT         0
00732 #define PSD_CMYK                        1               //! reads tags for separated CMYK (default is conversion to RGB)
00733 #define PSD_LAB                         2               //! reads tags for CIELab (default is conversion to RGB)
00734 #define RAS_DEFAULT         0
00735 #define RAW_DEFAULT         0           //! load the file as linear RGB 48-bit
00736 #define RAW_PREVIEW                     1               //! try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit
00737 #define RAW_DISPLAY                     2               //! load the file as RGB 24-bit
00738 #define RAW_HALFSIZE            4               //! output a half-size color image
00739 #define RAW_UNPROCESSED         8               //! output a FIT_UINT16 raw Bayer image
00740 #define SGI_DEFAULT                     0
00741 #define TARGA_DEFAULT       0
00742 #define TARGA_LOAD_RGB888   1       //! if set the loader converts RGB555 and ARGB8888 -> RGB888.
00743 #define TARGA_SAVE_RLE          2               //! if set, the writer saves with RLE compression
00744 #define TIFF_DEFAULT        0
00745 #define TIFF_CMYK                       0x0001  //! reads/stores tags for separated CMYK (use | to combine with compression flags)
00746 #define TIFF_PACKBITS       0x0100  //! save using PACKBITS compression
00747 #define TIFF_DEFLATE        0x0200  //! save using DEFLATE compression (a.k.a. ZLIB compression)
00748 #define TIFF_ADOBE_DEFLATE  0x0400  //! save using ADOBE DEFLATE compression
00749 #define TIFF_NONE           0x0800  //! save without any compression
00750 #define TIFF_CCITTFAX3          0x1000  //! save using CCITT Group 3 fax encoding
00751 #define TIFF_CCITTFAX4          0x2000  //! save using CCITT Group 4 fax encoding
00752 #define TIFF_LZW                        0x4000  //! save using LZW compression
00753 #define TIFF_JPEG                       0x8000  //! save using JPEG compression
00754 #define TIFF_LOGLUV                     0x10000 //! save using LogLuv compression
00755 #define WBMP_DEFAULT        0
00756 #define XBM_DEFAULT                     0
00757 #define XPM_DEFAULT                     0
00758 #define WEBP_DEFAULT            0               //! save with good quality (75:1)
00759 #define WEBP_LOSSLESS           0x100   //! save in lossless mode
00760 #define JXR_DEFAULT                     0               //! save with quality 80 and no chroma subsampling (4:4:4)
00761 #define JXR_LOSSLESS            0x0064  //! save lossless
00762 #define JXR_PROGRESSIVE         0x2000  //! save as a progressive-JXR (use | to combine with other save flags)
00763 
00764 // Background filling options ---------------------------------------------------------
00765 // Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas
00766 
00767 #define FI_COLOR_IS_RGB_COLOR                   0x00    //! RGBQUAD color is a RGB color (contains no valid alpha channel)
00768 #define FI_COLOR_IS_RGBA_COLOR                  0x01    //! RGBQUAD color is a RGBA color (contains a valid alpha channel)
00769 #define FI_COLOR_FIND_EQUAL_COLOR               0x02    //! For palettized images: lookup equal RGB color from palette
00770 #define FI_COLOR_ALPHA_IS_INDEX                 0x04    //! The color's rgbReserved member (alpha) contains the palette index to be used
00771 #define FI_COLOR_PALETTE_SEARCH_MASK    (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX)   // No color lookup is performed
00772 
00773 // RescaleEx options ---------------------------------------------------------
00774 // Constants used in FreeImage_RescaleEx
00775 
00776 #define FI_RESCALE_DEFAULT                      0x00    //! default options; none of the following other options apply
00777 #define FI_RESCALE_TRUE_COLOR           0x01    //! for non-transparent greyscale images, convert to 24-bit if src bitdepth <= 8 (default is a 8-bit greyscale image). 
00778 #define FI_RESCALE_OMIT_METADATA        0x02    //! do not copy metadata to the rescaled image
00779 
00780 
00781 #ifdef __cplusplus
00782 extern "C" {
00783 #endif
00784 
00785 // Init / Error routines ----------------------------------------------------
00786 
00787 DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));
00788 DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void);
00789 
00790 // Version routines ---------------------------------------------------------
00791 
00792 DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);
00793 DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void);
00794 
00795 // Message output functions -------------------------------------------------
00796 
00797 typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);
00798 typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg); 
00799 
00800 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf); 
00801 DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);
00802 DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);
00803 
00804 // Allocate / Clone / Unload routines ---------------------------------------
00805 
00806 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));
00807 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));
00808 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);
00809 DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);
00810 
00811 // Header loading routines
00812 DLL_API BOOL DLL_CALLCONV FreeImage_HasPixels(FIBITMAP *dib);
00813 
00814 // Load / Save routines -----------------------------------------------------
00815 
00816 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
00817 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
00818 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
00819 DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));
00820 DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));
00821 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
00822 
00823 // Memory I/O stream routines -----------------------------------------------
00824 
00825 DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
00826 DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);
00827 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
00828 DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
00829 DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);
00830 DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);
00831 DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
00832 DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
00833 DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
00834 
00835 DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
00836 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToMemory(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FIMEMORY *stream, int flags);
00837 
00838 // Plugin Interface ---------------------------------------------------------
00839 
00840 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));
00841 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));
00842 DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);
00843 DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);
00844 DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);
00845 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);
00846 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);
00847 DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);
00848 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);
00849 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);
00850 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);
00851 DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);
00852 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);
00853 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);
00854 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);
00855 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);
00856 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);
00857 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
00858 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);
00859 DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsNoPixels(FREE_IMAGE_FORMAT fif);
00860 
00861 // Multipaging interface ----------------------------------------------------
00862 
00863 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));
00864 DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
00865 DLL_API BOOL DLL_CALLCONV FreeImage_SaveMultiBitmapToHandle(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
00866 DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));
00867 DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap);
00868 DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data);
00869 DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);
00870 DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page);
00871 DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page);
00872 DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);
00873 DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source);
00874 DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count);
00875 
00876 // Filetype request routines ------------------------------------------------
00877 
00878 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0));
00879 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0));
00880 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));
00881 DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0));
00882 
00883 // Image type request routine -----------------------------------------------
00884 
00885 DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib);
00886 
00887 // FreeImage helper routines ------------------------------------------------
00888 
00889 DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void);
00890 DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
00891 DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
00892 
00893 // Pixel access routines ----------------------------------------------------
00894 
00895 DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib);
00896 DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline);
00897 
00898 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
00899 DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
00900 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
00901 DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
00902 
00903 // DIB info routines --------------------------------------------------------
00904 
00905 DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib);
00906 DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib);
00907 DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib);
00908 DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib);
00909 DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib);
00910 DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib);
00911 DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib);
00912 DLL_API unsigned DLL_CALLCONV FreeImage_GetMemorySize(FIBITMAP *dib);
00913 DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib);
00914 
00915 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib);
00916 DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib);
00917 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res);
00918 DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res);
00919 
00920 DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib);
00921 DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib);
00922 DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib);
00923 
00924 DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib);
00925 DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib);
00926 DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib);
00927 
00928 DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib);
00929 DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib);
00930 DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled);
00931 DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count);
00932 DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib);
00933 DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index);
00934 DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib);
00935 
00936 DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib);
00937 DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
00938 DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
00939 
00940 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetThumbnail(FIBITMAP *dib);
00941 DLL_API BOOL DLL_CALLCONV FreeImage_SetThumbnail(FIBITMAP *dib, FIBITMAP *thumbnail);
00942 
00943 // ICC profile routines -----------------------------------------------------
00944 
00945 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib);
00946 DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size);
00947 DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib);
00948 
00949 // Line conversion routines -------------------------------------------------
00950 
00951 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);
00952 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00953 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);
00954 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);
00955 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);
00956 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);
00957 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);
00958 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);
00959 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);
00960 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);
00961 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);
00962 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);
00963 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00964 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00965 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00966 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);
00967 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);
00968 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);
00969 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00970 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00971 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00972 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);
00973 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);
00974 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);
00975 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00976 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00977 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00978 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);
00979 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);
00980 DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);
00981 DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00982 DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00983 DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
00984 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);
00985 DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);
00986 DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);
00987 
00988 // Smart conversion routines ------------------------------------------------
00989 
00990 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib);
00991 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib);
00992 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib);
00993 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib);
00994 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib);
00995 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib);
00996 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib);
00997 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
00998 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));
00999 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T);
01000 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);
01001 
01002 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));
01003 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBitsEx(BOOL copySource, BYTE *bits, FREE_IMAGE_TYPE type, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
01004 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));
01005 
01006 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToFloat(FIBITMAP *dib);
01007 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib);
01008 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBAF(FIBITMAP *dib);
01009 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToUINT16(FIBITMAP *dib);
01010 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGB16(FIBITMAP *dib);
01011 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBA16(FIBITMAP *dib);
01012 
01013 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));
01014 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));
01015 
01016 // Tone mapping operators ---------------------------------------------------
01017 
01018 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));
01019 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));
01020 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));
01021 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));
01022 
01023 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85));
01024 
01025 // ZLib interface -----------------------------------------------------------
01026 
01027 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
01028 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
01029 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
01030 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
01031 DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size);
01032 
01033 // --------------------------------------------------------------------------
01034 // Metadata routines
01035 // --------------------------------------------------------------------------
01036 
01037 // tag creation / destruction
01038 DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void);
01039 DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag);
01040 DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);
01041 
01042 // tag getters and setters
01043 DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);
01044 DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);
01045 DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
01046 DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);
01047 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);
01048 DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);
01049 DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);
01050 
01051 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);
01052 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);
01053 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);
01054 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);
01055 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);
01056 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);
01057 DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value);
01058 
01059 // iterator
01060 DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);
01061 DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag);
01062 DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle);
01063 
01064 // metadata setter and getter
01065 DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);
01066 DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);
01067 DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadataKeyValue(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, const char *value);
01068 
01069 // helpers
01070 DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);
01071 DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src);
01072 
01073 // tag to C string conversion
01074 DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));
01075 
01076 // --------------------------------------------------------------------------
01077 // JPEG lossless transformation routines
01078 // --------------------------------------------------------------------------
01079 
01080 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE));
01081 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(TRUE));
01082 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);
01083 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);
01084 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformFromHandle(FreeImageIO* src_io, fi_handle src_handle, FreeImageIO* dst_io, fi_handle dst_handle, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE));
01085 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombined(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE));
01086 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE));
01087 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedFromMemory(FIMEMORY* src_stream, FIMEMORY* dst_stream, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE));
01088 
01089 
01090 // --------------------------------------------------------------------------
01091 // Image manipulation toolkit
01092 // --------------------------------------------------------------------------
01093 
01094 // rotation and flipping
01096 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle);
01097 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL));
01098 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);
01099 DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib);
01100 DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib);
01101 
01102 // upsampling / downsampling
01103 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter FI_DEFAULT(FILTER_CATMULLROM));
01104 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));
01105 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RescaleRect(FIBITMAP *dib, int dst_width, int dst_height, int left, int top, int right, int bottom, FREE_IMAGE_FILTER filter FI_DEFAULT(FILTER_CATMULLROM), unsigned flags FI_DEFAULT(0));
01106 
01107 // color manipulation routines (point operations)
01108 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);
01109 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma);
01110 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage);
01111 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);
01112 DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);
01113 DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));
01114 DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);
01115 DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));
01116 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);
01117 DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);
01118 DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices,       BYTE *dstindices, unsigned count, BOOL swap);
01119 DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);
01120 
01121 // channel processing routines
01122 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
01123 DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
01124 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
01125 DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
01126 
01127 // copy / paste / composite routines
01128 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);
01129 DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
01130 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_CreateView(FIBITMAP *dib, unsigned left, unsigned top, unsigned right, unsigned bottom);
01131 
01132 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));
01133 DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib);
01134 
01135 // background filling routines
01136 DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0));
01137 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));
01138 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));
01139 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));
01140 
01141 // miscellaneous algorithms
01142 DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3));
01143 
01144 // restore the borland-specific enum size option
01145 #if defined(__BORLANDC__)
01146 #pragma option pop
01147 #endif
01148 
01149 #ifdef __cplusplus
01150 }
01151 #endif
01152 
01153 #endif // FREEIMAGE_H