1 #if !defined(__ximadefs_h) 2 #define __ximadefs_h 3 4 #if defined(_AFXDLL)||defined(_USRDLL) 5 #define DLL_EXP __declspec(dllexport) 6 #elif defined(_MSC_VER)&&(_MSC_VER<1200) 7 #define DLL_EXP __declspec(dllimport) 8 #else 9 #define DLL_EXP 10 #endif 11 12 #if CXIMAGE_SUPPORT_JP2 || CXIMAGE_SUPPORT_JPC || CXIMAGE_SUPPORT_PGX || CXIMAGE_SUPPORT_PNM || CXIMAGE_SUPPORT_RAS 13 #define CXIMAGE_SUPPORT_JASPER 1 14 #else 15 #define CXIMAGE_SUPPORT_JASPER 0 16 #endif 17 18 #if CXIMAGE_SUPPORT_DSP 19 #undef CXIMAGE_SUPPORT_TRANSFORMATION 20 #define CXIMAGE_SUPPORT_TRANSFORMATION 1 21 #endif 22 23 #if CXIMAGE_SUPPORT_TRANSFORMATION || CXIMAGE_SUPPORT_TIF || CXIMAGE_SUPPORT_TGA || CXIMAGE_SUPPORT_BMP || CXIMAGE_SUPPORT_WINDOWS 24 #define CXIMAGE_SUPPORT_BASICTRANSFORMATIONS 1 25 #endif 26 27 #if CXIMAGE_SUPPORT_WINCE 28 #undef CXIMAGE_SUPPORT_WMF 29 #define CXIMAGE_SUPPORT_WMF 0 30 #undef CXIMAGE_SUPPORT_WINDOWS 31 #define CXIMAGE_SUPPORT_WINDOWS 0 32 #endif 33 34 #ifndef WIN32 35 #undef CXIMAGE_SUPPORT_WINDOWS 36 #define CXIMAGE_SUPPORT_WINDOWS 0 37 #endif 38 39 #ifndef min 40 #define min(a,b) (((a)<(b))?(a):(b)) 41 #endif 42 #ifndef max 43 #define max(a,b) (((a)>(b))?(a):(b)) 44 #endif 45 46 47 #ifdef WIN32 48 #include <windows.h> 49 //#include <tchar.h> 50 #endif 51 52 #include <stdio.h> 53 #include <math.h> 54 55 56 #ifdef __BORLANDC__ 57 #define _complex complex 58 #define _cabs cabs 59 #endif 60 61 62 #ifndef WIN32 63 64 #include <stdlib.h> 65 #include <string.h> 66 #include <ctype.h> 67 68 typedef unsigned char BYTE; 69 typedef unsigned short WORD; 70 typedef unsigned long DWORD; 71 typedef unsigned int UINT; 72 73 typedef DWORD COLORREF; 74 typedef unsigned int HANDLE; 75 typedef void* HRGN; 76 77 #define BOOL bool 78 #define TRUE true 79 #define FALSE false 80 81 typedef struct tagRECT 82 { 83 long left; 84 long top; 85 long right; 86 long bottom; 87 } RECT; 88 89 typedef struct tagPOINT 90 { 91 long x; 92 long y; 93 } POINT; 94 95 typedef struct tagRGBQUAD { 96 BYTE rgbBlue; 97 BYTE rgbGreen; 98 BYTE rgbRed; 99 BYTE rgbReserved; 100 } RGBQUAD; 101 102 #pragma pack(1) 103 104 typedef struct tagBITMAPINFOHEADER{ 105 DWORD biSize; 106 long biWidth; 107 long biHeight; 108 WORD biPlanes; 109 WORD biBitCount; 110 DWORD biCompression; 111 DWORD biSizeImage; 112 long biXPelsPerMeter; 113 long biYPelsPerMeter; 114 DWORD biClrUsed; 115 DWORD biClrImportant; 116 } BITMAPINFOHEADER; 117 118 typedef struct tagBITMAPFILEHEADER { 119 WORD bfType; 120 DWORD bfSize; 121 WORD bfReserved1; 122 WORD bfReserved2; 123 DWORD bfOffBits; 124 } BITMAPFILEHEADER; 125 126 typedef struct tagBITMAPCOREHEADER { 127 DWORD bcSize; 128 WORD bcWidth; 129 WORD bcHeight; 130 WORD bcPlanes; 131 WORD bcBitCount; 132 } BITMAPCOREHEADER; 133 134 typedef struct tagRGBTRIPLE { 135 BYTE rgbtBlue; 136 BYTE rgbtGreen; 137 BYTE rgbtRed; 138 } RGBTRIPLE; 139 140 #pragma pack() 141 142 #define BI_RGB 0L 143 #define BI_RLE8 1L 144 #define BI_RLE4 2L 145 #define BI_BITFIELDS 3L 146 147 #define GetRValue(rgb) ((BYTE)(rgb)) 148 #define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8)) 149 #define GetBValue(rgb) ((BYTE)((rgb)>>16)) 150 #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) 151 152 #ifndef _COMPLEX_DEFINED 153 154 typedef struct tagcomplex { 155 double x,y; 156 } _complex; 157 158 #endif 159 160 #define _cabs(c) sqrt(c.x*c.x+c.y*c.y) 161 162 #endif 163 164 165 #endif //__ximadefs 166