il.h
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 21k
Development Platform:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2009 by Denton Woods
  5. // Last modified: 03/07/2009
  6. //
  7. // Filename: IL/il.h
  8. //
  9. // Description: The main include file for DevIL
  10. //
  11. //-----------------------------------------------------------------------------
  12. // Doxygen comment
  13. /*! file il.h
  14.     The main include file for DevIL
  15. */
  16. #ifndef __il_h_
  17. #ifndef _IL_H__
  18. #define __il_h_
  19. #define _IL_H__
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #if defined __WIN32__
  24. #define DEVIL_EXPORT __declspec(dllexport)
  25. #define DEVIL_IMPORT __declspec(dllimport)
  26. #elif defined HAVE_VISIBILITY /* This set can overlap with the above, so it goes after it */
  27. #define DEVIL_EXPORT __attribute__((__visibility__("default")))
  28. #define DEVIL_IMPORT /* we don't need this */
  29. #else /* No visibility at all */
  30. #define DEVIL_EXPORT /* we don't need this */
  31. #define DEVIL_IMPORT /* we don't need this */
  32. #endif
  33. #ifdef IL_BUILD_LIBRARY
  34. #define ILAPI DEVIL_EXPORT
  35. #else
  36. #define ILAPI DEVIL_IMPORT
  37. #endif
  38. //this define controls if floats and doubles are clampled to [0..1]
  39. //during conversion. It takes a little more time, but it is the correct
  40. //way of doing this. If you are sure your floats are always valid,
  41. //you can undefine this value...
  42. #define CLAMP_HALF 1
  43. #define CLAMP_FLOATS 1
  44. #define CLAMP_DOUBLES 1
  45. /*#ifdef _WIN32_WCE
  46. #define IL_NO_EXR
  47. #define IL_NO_GIF
  48. #define IL_NO_JP2
  49. #define IL_NO_JPG
  50. #define IL_NO_MNG
  51. #define IL_NO_PNG
  52. #define IL_NO_TIF
  53. #define IL_NO_LCMS
  54. #endif //_WIN32_WCE
  55. #ifdef DJGPP
  56. #define IL_NO_EXR
  57. #define IL_NO_GIF
  58. #define IL_NO_JP2
  59. #define IL_NO_JPG
  60. #define IL_NO_MNG
  61. #define IL_NO_PNG
  62. #define IL_NO_TIF
  63. #define IL_NO_LCMS
  64. #endif //DJGPP*/
  65. #ifdef _WIN32
  66. #if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(IL_BUILD_LIBRARY))
  67. #if defined(_MSC_VER) || defined(__BORLANDC__)
  68. #pragma comment(lib, "DevIL.lib")
  69. #endif
  70. #endif
  71. #endif
  72. #ifdef RESTRICT_KEYWORD
  73. #define RESTRICT restrict
  74. #define CONST_RESTRICT const restrict
  75. #else
  76. #define RESTRICT
  77. #define CONST_RESTRICT const
  78. #endif
  79. #include <stdio.h>
  80. typedef unsigned int   ILenum;
  81. typedef unsigned char  ILboolean;
  82. typedef unsigned int   ILbitfield;
  83. typedef signed char    ILbyte;
  84. typedef signed short   ILshort;
  85. typedef int         ILint;
  86. typedef size_t         ILsizei;
  87. typedef unsigned char  ILubyte;
  88. typedef unsigned short ILushort;
  89. typedef unsigned int   ILuint;
  90. typedef float          ILfloat;
  91. typedef float          ILclampf;
  92. typedef double         ILdouble;
  93. typedef double         ILclampd;
  94. #ifdef _MSC_VER
  95. typedef __int64          ILint64;
  96. typedef unsigned __int64 ILuint64;
  97. #else
  98. typedef long long int          ILint64;
  99. typedef long long unsigned int ILuint64;
  100. #endif
  101. #include <limits.h>
  102. #ifdef _UNICODE
  103. #ifndef _WIN32_WCE
  104. #include <wchar.h>
  105. #endif
  106. //if we use a define instead of a typedef,
  107. //ILconst_string works as intended
  108. #define ILchar wchar_t
  109. #define ILstring wchar_t*
  110. #define ILconst_string  wchar_t const *
  111. #else
  112. //if we use a define instead of a typedef,
  113. //ILconst_string works as intended
  114. #define ILchar char
  115. #define ILstring char*
  116. #define ILconst_string char const *
  117. #endif //_UNICODE
  118. #define IL_FALSE 0
  119. #define IL_TRUE 1
  120. //  Matches OpenGL's right now.
  121. //! Data formats link Formats Formatsendlink
  122. enum {
  123. IL_COLOUR_INDEX = 0x1900,
  124. IL_COLOR_INDEX = 0x1900,
  125. IL_ALPHA = 0x1906,
  126. IL_RGB,
  127. IL_RGBA,
  128. IL_BGR = 0x80E0,
  129. IL_BGRA,
  130. IL_LUMINANCE = 0x1909,
  131. IL_LUMINANCE_ALPHA,
  132. //! Data types link Types Typesendlink
  133. IL_BYTE = 0x1400,
  134. IL_UNSIGNED_BYTE,
  135. IL_SHORT,
  136. IL_UNSIGNED_SHORT,
  137. IL_INT,
  138. IL_UNSIGNED_INT,
  139. IL_FLOAT,
  140. IL_DOUBLE,
  141. IL_HALF,
  142. };
  143. #define IL_MAX_BYTE    SCHAR_MAX
  144. #define IL_MAX_UNSIGNED_BYTE   UCHAR_MAX
  145. #define IL_MAX_SHORT    SHRT_MAX
  146. #define IL_MAX_UNSIGNED_SHORT  USHRT_MAX
  147. #define IL_MAX_INT    INT_MAX
  148. #define IL_MAX_UNSIGNED_INT    UINT_MAX
  149. #define IL_LIMIT(x,m,M) ( (x) < (m) ? (m) : ( (x) > (M) ? (M) : (x) ) )
  150. #define IL_CLAMP(x)  IL_LIMIT( (x), 0, 1)
  151. #define IL_VENDOR   0x1F00
  152. #define IL_LOAD_EXT 0x1F01
  153. #define IL_SAVE_EXT 0x1F02
  154. //
  155. // IL-specific #define's
  156. //
  157. #define IL_VERSION_1_7_8 1
  158. #define IL_VERSION       178
  159. // Attribute Bits
  160. enum {
  161. IL_ORIGIN_BIT = 0x00000001,
  162. IL_FILE_BIT = 0x00000002,
  163. IL_PAL_BIT = 0x00000004,
  164. IL_FORMAT_BIT = 0x00000008,
  165. IL_TYPE_BIT = 0x00000010,
  166. IL_COMPRESS_BIT = 0x00000020,
  167. IL_LOADFAIL_BIT = 0x00000040,
  168. IL_FORMAT_SPECIFIC_BIT = 0x00000080,
  169. IL_ALL_ATTRIB_BITS = 0x000FFFFF,
  170. };
  171. // Palette types
  172. enum {
  173. IL_PAL_NONE = 0x400,
  174. IL_PAL_RGB24,
  175. IL_PAL_RGB32,
  176. IL_PAL_RGBA32,
  177. IL_PAL_BGR24,
  178. IL_PAL_BGR32,
  179. IL_PAL_BGRA32,
  180. };
  181. // Image types
  182. enum {
  183. IL_BMP,  //!< Microsoft Windows Bitmap - .bmp extension
  184. IL_CUT,  //!< Dr. Halo - .cut extension
  185. IL_DOOM,  //!< DooM walls - no specific extension
  186. //IL_DOOM_FLAT,  //!< DooM flats - no specific extension
  187. IL_ICON,  //!< Microsoft Windows Icons and Cursors - .ico and .cur extensions
  188. IL_JPG,  //!< JPEG - .jpg, .jpe and .jpeg extensions
  189. IL_JPEG = IL_JPG,  //!< JPEG - .jpg, .jpe and .jpeg extensions
  190. IL_ILBM, //!< Amiga IFF (FORM ILBM) - .iff, .ilbm, .lbm extensions
  191. IL_PCD,  //!< Kodak PhotoCD - .pcd extension
  192. IL_PCX,  //!< ZSoft PCX - .pcx extension
  193. IL_PIC,  //!< PIC - .pic extension
  194. IL_PNG,  //!< Portable Network Graphics - .png extension
  195. IL_PNM,  //!< Portable Any Map - .pbm, .pgm, .ppm and .pnm extensions
  196. IL_SGI,  //!< Silicon Graphics - .sgi, .bw, .rgb and .rgba extensions
  197. IL_TGA,  //!< TrueVision Targa File - .tga, .vda, .icb and .vst extensions
  198. IL_TIFF,  //!< Tagged Image File Format - .tif and .tiff extensions
  199. IL_CHEAD,  //!< C-Style Header - .h extension
  200. IL_RAW,  //!< Raw Image Data - any extension
  201. IL_MDL,  //!< Half-Life Model Texture - .mdl extension
  202. IL_WAL,  //!< Quake 2 Texture - .wal extension
  203. IL_LIF,  //!< Homeworld Texture - .lif extension
  204. IL_MNG,  //!< Multiple-image Network Graphics - .mng extension
  205. IL_GIF,  //!< Graphics Interchange Format - .gif extension
  206. IL_DDS,  //!< DirectDraw Surface - .dds extension
  207. IL_DCX,  //!< ZSoft Multi-PCX - .dcx extension
  208. IL_PSD,  //!< Adobe PhotoShop - .psd extension
  209. IL_PSP,  //!< PaintShop Pro - .psp extension
  210. IL_PIX,  //!< PIX - .pix extension
  211. IL_PXR,  //!< Pixar - .pxr extension
  212. IL_XPM,  //!< X Pixel Map - .xpm extension
  213. IL_HDR,  //!< Radiance High Dynamic Range - .hdr extension
  214. IL_ICNS,  //!< Macintosh Icon - .icns extension
  215. IL_JP2,  //!< Jpeg 2000 - .jp2 extension
  216. IL_EXR,  //!< OpenEXR - .exr extension
  217. IL_VTF,  //!< Valve Texture Format - .vtf extension
  218. IL_WBMP,  //!< Wireless Bitmap - .wbmp extension
  219. IL_SUN,  //!< Sun Raster - .sun, .ras, .rs, .im1, .im8, .im24 and .im32 extensions
  220. IL_IFF,  //!< Interchange File Format - .iff extension
  221. IL_TPL,  //!< Gamecube Texture - .tpl extension
  222. IL_FITS,  //!< Flexible Image Transport System - .fit and .fits extensions
  223. IL_DICOM,  //!< Digital Imaging and Communications in Medicine (DICOM) - .dcm and .dicom extensions
  224. IL_IWI,  //!< Call of Duty Infinity Ward Image - .iwi extension
  225. IL_BLP,  //!< Blizzard Texture Format - .blp extension
  226. IL_FTX,  //!< Heavy Metal: FAKK2 Texture - .ftx extension
  227. IL_ROT,  //!< Homeworld 2 - Relic Texture - .rot extension
  228. IL_TEXTURE,  //!< Medieval II: Total War Texture - .texture extension
  229. IL_DPX, //!< Digital Picture Exchange - .dpx extension
  230. IL_UTX, //!< Unreal (and Unreal Tournament) Texture - .utx extension
  231. IL_FORMATS_COUNT, /**< How many formats do we have? */
  232. IL_TYPE_UNKNOWN,
  233. IL_JFIF,  //!<
  234. IL_JNG,  //!< 
  235. IL_EXIF,  //!< 
  236. IL_WDP,  //!< 
  237. };
  238. #define IL_MP3 0x0452  //!< MPEG-1 Audio Layer 3 - .mp3 extension
  239. #define IL_JASC_PAL     0x0475  //!< PaintShop Pro Palette
  240. // Error Types
  241. enum {
  242. IL_NO_ERROR = 0,
  243. IL_INVALID_ENUM,
  244. IL_OUT_OF_MEMORY,
  245. IL_FORMAT_NOT_SUPPORTED,
  246. IL_INTERNAL_ERROR,
  247. IL_INVALID_VALUE,
  248. IL_ILLEGAL_OPERATION,
  249. IL_ILLEGAL_FILE_VALUE,
  250. IL_INVALID_FILE_HEADER,
  251. IL_INVALID_PARAM,
  252. IL_COULD_NOT_OPEN_FILE,
  253. IL_INVALID_EXTENSION,
  254. IL_FILE_ALREADY_EXISTS,
  255. IL_STACK_OVERFLOW,
  256. IL_STACK_UNDERFLOW,
  257. IL_INVALID_CONVERSION,
  258. IL_BAD_DIMENSIONS,
  259. IL_FILE_READ_ERROR,  // 05/12/2002: Addition by Sam.
  260. IL_FILE_WRITE_ERROR,
  261. IL_LIB_GIF_ERROR,
  262. IL_LIB_JPEG_ERROR,
  263. IL_LIB_PNG_ERROR,
  264. IL_LIB_TIFF_ERROR,
  265. IL_LIB_MNG_ERROR,
  266. IL_LIB_JP2_ERROR,
  267. IL_LIB_EXR_ERROR,
  268. IL_UNKNOWN_ERROR,
  269. };
  270. enum {
  271. // Origin Definitions
  272. IL_ORIGIN_SET = 0x0600,
  273. IL_ORIGIN_LOWER_LEFT,
  274. IL_ORIGIN_UPPER_LEFT,
  275. IL_ORIGIN_MODE,
  276. // Format and Type Mode Definitions
  277. IL_FORMAT_SET = 0x0610,
  278. IL_FORMAT_MODE,
  279. IL_TYPE_SET,
  280. IL_TYPE_MODE,
  281. // File definitions
  282. IL_FILE_OVERWRITE = 0x0620,
  283. IL_FILE_MODE,
  284. IL_CONV_PAL = 0x0630,
  285. // Load fail definitions
  286. IL_DEFAULT_ON_FAIL = 0x0632,
  287. // Key colour and alpha definitions
  288. IL_USE_KEY_COLOUR = 0x0635,
  289. IL_USE_KEY_COLOR = 0x0635,
  290. IL_BLIT_BLEND,
  291. // Interlace definitions
  292. IL_SAVE_INTERLACED = 0x0639,
  293. IL_INTERLACE_MODE,
  294. // Quantization definitions
  295. IL_QUANTIZATION_MODE  = 0x0640,
  296. IL_WU_QUANT,
  297. IL_NEU_QUANT,
  298. IL_NEU_QUANT_SAMPLE,
  299. IL_MAX_QUANT_INDEXS,
  300. IL_MAX_QUANT_INDICES,
  301. // Hints
  302. IL_FASTEST = 0x0660,
  303. IL_LESS_MEM,
  304. IL_DONT_CARE,
  305. IL_MEM_SPEED_HINT,
  306. IL_USE_COMPRESSION,
  307. IL_NO_COMPRESSION,
  308. IL_COMPRESSION_HINT,
  309. // Compression
  310. IL_NVIDIA_COMPRESS = 0x0670,
  311. IL_SQUISH_COMPRESS,
  312. // Subimage types
  313. IL_SUB_NEXT = 0x0680,
  314. IL_SUB_MIPMAP,
  315. IL_SUB_LAYER,
  316. // Compression definitions
  317. IL_COMPRESS_MODE = 0x0700,
  318. IL_COMPRESS_NONE,
  319. IL_COMPRESS_RLE,
  320. IL_COMPRESS_LZO,
  321. IL_COMPRESS_ZLIB,
  322. };
  323. // not only File format-specific values
  324. enum {
  325. IL_VERSION_NUM,
  326. IL_IMAGE_WIDTH,
  327. IL_IMAGE_HEIGHT,
  328. IL_IMAGE_DEPTH,
  329. IL_IMAGE_SIZE_OF_DATA,
  330. IL_IMAGE_BPP,
  331. IL_IMAGE_BYTES_PER_PIXEL,
  332. IL_IMAGE_BITS_PER_PIXEL,
  333. IL_IMAGE_FORMAT,
  334. IL_IMAGE_TYPE,
  335. IL_PALETTE_TYPE,
  336. IL_PALETTE_SIZE,
  337. IL_PALETTE_BPP,
  338. IL_PALETTE_NUM_COLS,
  339. IL_PALETTE_BASE_TYPE,
  340. IL_NUM_FACES,
  341. IL_NUM_IMAGES,
  342. IL_NUM_MIPMAPS,
  343. IL_NUM_LAYERS,
  344. IL_ACTIVE_IMAGE,
  345. IL_ACTIVE_MIPMAP,
  346. IL_ACTIVE_LAYER,
  347. IL_ACTIVE_FACE,
  348. IL_CUR_IMAGE,
  349. IL_IMAGE_DURATION,
  350. IL_IMAGE_PLANESIZE,
  351. IL_IMAGE_BPC,
  352. IL_IMAGE_OFFX,
  353. IL_IMAGE_OFFY,
  354. IL_IMAGE_CUBEFLAGS,
  355. IL_IMAGE_ORIGIN,
  356. IL_IMAGE_CHANNELS,
  357. IL_TGA_CREATE_STAMP,
  358. IL_JPG_QUALITY,
  359. IL_PNG_INTERLACE,
  360. IL_TGA_RLE,
  361. IL_BMP_RLE,
  362. IL_SGI_RLE,
  363. IL_TGA_ID_STRING,
  364. IL_TGA_AUTHNAME_STRING,
  365. IL_TGA_AUTHCOMMENT_STRING,
  366. IL_PNG_AUTHNAME_STRING,
  367. IL_PNG_TITLE_STRING,
  368. IL_PNG_DESCRIPTION_STRING,
  369. IL_TIFF_DESCRIPTION_STRING,
  370. IL_TIFF_HOSTCOMPUTER_STRING,
  371. IL_TIFF_DOCUMENTNAME_STRING,
  372. IL_TIFF_AUTHNAME_STRING,
  373. IL_JPG_SAVE_FORMAT,
  374. IL_CHEAD_HEADER_STRING,
  375. IL_PCD_PICNUM,
  376. IL_JPG_PROGRESSIVE,
  377. IL_VTF_COMP,
  378. // DXTC definitions
  379. IL_DXTC_FORMAT,
  380. IL_DXT1,
  381. IL_DXT2,
  382. IL_DXT3,
  383. IL_DXT4,
  384. IL_DXT5,
  385. IL_DXT_NO_COMP,
  386. IL_KEEP_DXTC_DATA,
  387. IL_DXTC_DATA_FORMAT,
  388. IL_3DC,
  389. IL_RXGB,
  390. IL_ATI1N,
  391. IL_DXT1A,
  392. IL_PNG_ALPHA_INDEX, //XIX : ILint : the color in the palette at this index value (0-255) is considered transparent, -1 for no trasparent color
  393. };
  394. // Environment map definitions
  395. enum{
  396. IL_CUBEMAP_POSITIVEX = 0x00000400,
  397. IL_CUBEMAP_NEGATIVEX = 0x00000800,
  398. IL_CUBEMAP_POSITIVEY = 0x00001000,
  399. IL_CUBEMAP_NEGATIVEY = 0x00002000,
  400. IL_CUBEMAP_POSITIVEZ = 0x00004000,
  401. IL_CUBEMAP_NEGATIVEZ = 0x00008000,
  402. IL_SPHEREMAP = 0x00010000,
  403. };
  404. # if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0))
  405. // __attribute__((deprecated)) is supported by GCC 3.1 and later.
  406. #  define DEPRECATED(D) D __attribute__((deprecated))
  407. # elif defined _MSC_VER && _MSC_VER >= 1300
  408. // __declspec(deprecated) is supported by MSVC 7.0 and later.
  409. #  define DEPRECATED(D) __declspec(deprecated) D
  410. # else
  411. #  define DEPRECATED (D) D
  412. # endif
  413. //
  414. // Section shamelessly modified from the glut header.
  415. //
  416. // This is from Win32's <windef.h>
  417. #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
  418. #define ILAPIENTRY __stdcall 
  419. #define IL_PACKSTRUCT
  420. //#elif defined(linux) || defined(MACOSX) || defined(__CYGWIN__) //fix bug 840364
  421. #elif defined( __GNUC__ )
  422.   // this should work for any of the above commented platforms 
  423.   // plus any platform using GCC
  424. #ifdef __MINGW32__
  425. #define ILAPIENTRY __stdcall
  426. #else
  427. #define ILAPIENTRY
  428. #endif
  429. #define IL_PACKSTRUCT __attribute__ ((packed))
  430. #else
  431. #define ILAPIENTRY
  432. #define IL_PACKSTRUCT
  433. #endif
  434. #define IL_SEEK_SET 0
  435. #define IL_SEEK_CUR 1
  436. #define IL_SEEK_END 2
  437. #define IL_EOF -1
  438. // Callback functions for file reading
  439. typedef void* ILHANDLE;
  440. typedef void      (ILAPIENTRY *fCloseRProc)(ILHANDLE);
  441. typedef ILboolean (ILAPIENTRY *fEofProc)   (ILHANDLE);
  442. typedef ILint     (ILAPIENTRY *fGetcProc)  (ILHANDLE);
  443. typedef ILHANDLE  (ILAPIENTRY *fOpenRProc) (ILconst_string);
  444. typedef ILint     (ILAPIENTRY *fReadProc)  (void*, ILuint, ILuint, ILHANDLE);
  445. typedef ILint     (ILAPIENTRY *fSeekRProc) (ILHANDLE, ILint, ILint);
  446. typedef ILint     (ILAPIENTRY *fTellRProc) (ILHANDLE);
  447. // Callback functions for file writing
  448. typedef void     (ILAPIENTRY *fCloseWProc)(ILHANDLE);
  449. typedef ILHANDLE (ILAPIENTRY *fOpenWProc) (ILconst_string);
  450. typedef ILint    (ILAPIENTRY *fPutcProc)  (ILubyte, ILHANDLE);
  451. typedef ILint    (ILAPIENTRY *fSeekWProc) (ILHANDLE, ILint, ILint);
  452. typedef ILint    (ILAPIENTRY *fTellWProc) (ILHANDLE);
  453. typedef ILint    (ILAPIENTRY *fWriteProc) (const void*, ILuint, ILuint, ILHANDLE);
  454. // Callback functions for allocation and deallocation
  455. typedef void* (ILAPIENTRY *mAlloc)(const ILsizei);
  456. typedef void  (ILAPIENTRY *mFree) (const void* CONST_RESTRICT);
  457. // Registered format procedures
  458. typedef ILenum (ILAPIENTRY *IL_LOADPROC)(ILconst_string);
  459. typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(ILconst_string);
  460. // ImageLib Functions
  461. ILAPI ILboolean ILAPIENTRY ilActiveFace(ILuint Number);
  462. ILAPI ILboolean ILAPIENTRY ilActiveImage(ILuint Number);
  463. ILAPI ILboolean ILAPIENTRY ilActiveLayer(ILuint Number);
  464. ILAPI ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number);
  465. ILAPI ILboolean ILAPIENTRY ilApplyPal(ILconst_string FileName);
  466. ILAPI ILboolean ILAPIENTRY ilApplyProfile(ILstring InProfile, ILstring OutProfile);
  467. ILAPI void ILAPIENTRY ilBindImage(ILuint Image);
  468. ILAPI ILboolean ILAPIENTRY ilBlit(ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth);
  469. ILAPI ILboolean ILAPIENTRY ilClampNTSC(void);
  470. ILAPI void ILAPIENTRY ilClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
  471. ILAPI ILboolean ILAPIENTRY ilClearImage(void);
  472. ILAPI ILuint    ILAPIENTRY ilCloneCurImage(void);
  473. ILAPI ILubyte* ILAPIENTRY ilCompressDXT(ILubyte *Data, ILuint Width, ILuint Height, ILuint Depth, ILenum DXTCFormat, ILuint *DXTCSize);
  474. ILAPI ILboolean ILAPIENTRY ilCompressFunc(ILenum Mode);
  475. ILAPI ILboolean ILAPIENTRY ilConvertImage(ILenum DestFormat, ILenum DestType);
  476. ILAPI ILboolean ILAPIENTRY ilConvertPal(ILenum DestFormat);
  477. ILAPI ILboolean ILAPIENTRY ilCopyImage(ILuint Src);
  478. ILAPI ILuint    ILAPIENTRY ilCopyPixels(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data);
  479. ILAPI ILuint    ILAPIENTRY ilCreateSubImage(ILenum Type, ILuint Num);
  480. ILAPI ILboolean ILAPIENTRY ilDefaultImage(void);
  481. ILAPI void ILAPIENTRY ilDeleteImage(const ILuint Num);
  482. ILAPI void      ILAPIENTRY ilDeleteImages(ILsizei Num, const ILuint *Images);
  483. ILAPI ILenum ILAPIENTRY ilDetermineType(ILconst_string FileName);
  484. ILAPI ILenum ILAPIENTRY ilDetermineTypeF(ILHANDLE File);
  485. ILAPI ILenum ILAPIENTRY ilDetermineTypeL(const void *Lump, ILuint Size);
  486. ILAPI ILboolean ILAPIENTRY ilDisable(ILenum Mode);
  487. ILAPI ILboolean ILAPIENTRY ilDxtcDataToImage(void);
  488. ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface(void);
  489. ILAPI ILboolean ILAPIENTRY ilEnable(ILenum Mode);
  490. ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData(void);
  491. ILAPI ILboolean ILAPIENTRY ilFormatFunc(ILenum Mode);
  492. ILAPI void     ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
  493. ILAPI ILuint ILAPIENTRY ilGenImage(void);
  494. ILAPI ILubyte*  ILAPIENTRY ilGetAlpha(ILenum Type);
  495. ILAPI ILboolean ILAPIENTRY ilGetBoolean(ILenum Mode);
  496. ILAPI void      ILAPIENTRY ilGetBooleanv(ILenum Mode, ILboolean *Param);
  497. ILAPI ILubyte*  ILAPIENTRY ilGetData(void);
  498. ILAPI ILuint    ILAPIENTRY ilGetDXTCData(void *Buffer, ILuint BufferSize, ILenum DXTCFormat);
  499. ILAPI ILenum    ILAPIENTRY ilGetError(void);
  500. ILAPI ILconst_string ILAPIENTRY ilErrorString(ILenum Error);
  501. ILAPI ILint     ILAPIENTRY ilGetInteger(ILenum Mode);
  502. ILAPI void      ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
  503. ILAPI ILuint    ILAPIENTRY ilGetLumpPos(void);
  504. ILAPI ILubyte*  ILAPIENTRY ilGetPalette(void);
  505. ILAPI ILconst_string  ILAPIENTRY ilGetString(ILenum StringName);
  506. ILAPI void      ILAPIENTRY ilHint(ILenum Target, ILenum Mode);
  507. ILAPI ILboolean ILAPIENTRY ilInvertSurfaceDxtcDataAlpha(void);
  508. ILAPI void      ILAPIENTRY ilInit(void);
  509. ILAPI ILboolean ILAPIENTRY ilImageToDxtcData(ILenum Format);
  510. ILAPI ILboolean ILAPIENTRY ilIsDisabled(ILenum Mode);
  511. ILAPI ILboolean ILAPIENTRY ilIsEnabled(ILenum Mode);
  512. ILAPI ILboolean ILAPIENTRY ilIsImage(ILuint Image);
  513. ILAPI ILboolean ILAPIENTRY ilIsValid(ILenum Type, ILconst_string FileName);
  514. ILAPI ILboolean ILAPIENTRY ilIsValidF(ILenum Type, ILHANDLE File);
  515. ILAPI ILboolean ILAPIENTRY ilIsValidL(ILenum Type, void *Lump, ILuint Size);
  516. ILAPI void      ILAPIENTRY ilKeyColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
  517. ILAPI ILboolean ILAPIENTRY ilLoad(ILenum Type, ILconst_string FileName);
  518. ILAPI ILboolean ILAPIENTRY ilLoadF(ILenum Type, ILHANDLE File);
  519. ILAPI ILboolean ILAPIENTRY ilLoadImage(ILconst_string FileName);
  520. ILAPI ILboolean ILAPIENTRY ilLoadL(ILenum Type, const void *Lump, ILuint Size);
  521. ILAPI ILboolean ILAPIENTRY ilLoad_PAL(ILconst_string FileName);
  522. ILAPI void      ILAPIENTRY ilModAlpha(ILdouble AlphaValue);
  523. ILAPI ILboolean ILAPIENTRY ilOriginFunc(ILenum Mode);
  524. ILAPI ILboolean ILAPIENTRY ilOverlayImage(ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord);
  525. ILAPI void      ILAPIENTRY ilPopAttrib(void);
  526. ILAPI void      ILAPIENTRY ilPushAttrib(ILuint Bits);
  527. ILAPI void      ILAPIENTRY ilRegisterFormat(ILenum Format);
  528. ILAPI ILboolean ILAPIENTRY ilRegisterLoad(ILconst_string Ext, IL_LOADPROC Load);
  529. ILAPI ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num);
  530. ILAPI ILboolean ILAPIENTRY ilRegisterNumFaces(ILuint Num);
  531. ILAPI ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num);
  532. ILAPI void      ILAPIENTRY ilRegisterOrigin(ILenum Origin);
  533. ILAPI void      ILAPIENTRY ilRegisterPal(void *Pal, ILuint Size, ILenum Type);
  534. ILAPI ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save);
  535. ILAPI void      ILAPIENTRY ilRegisterType(ILenum Type);
  536. ILAPI ILboolean ILAPIENTRY ilRemoveLoad(ILconst_string Ext);
  537. ILAPI ILboolean ILAPIENTRY ilRemoveSave(ILconst_string Ext);
  538. ILAPI void      ILAPIENTRY ilResetMemory(void); // Deprecated
  539. ILAPI void      ILAPIENTRY ilResetRead(void);
  540. ILAPI void      ILAPIENTRY ilResetWrite(void);
  541. ILAPI ILboolean ILAPIENTRY ilSave(ILenum Type, ILconst_string FileName);
  542. ILAPI ILuint    ILAPIENTRY ilSaveF(ILenum Type, ILHANDLE File);
  543. ILAPI ILboolean ILAPIENTRY ilSaveImage(ILconst_string FileName);
  544. ILAPI ILuint    ILAPIENTRY ilSaveL(ILenum Type, void *Lump, ILuint Size);
  545. ILAPI ILboolean ILAPIENTRY ilSavePal(ILconst_string FileName);
  546. ILAPI ILboolean ILAPIENTRY ilSetAlpha(ILdouble AlphaValue);
  547. ILAPI ILboolean ILAPIENTRY ilSetData(void *Data);
  548. ILAPI ILboolean ILAPIENTRY ilSetDuration(ILuint Duration);
  549. ILAPI void      ILAPIENTRY ilSetInteger(ILenum Mode, ILint Param);
  550. ILAPI void      ILAPIENTRY ilSetMemory(mAlloc, mFree);
  551. ILAPI void      ILAPIENTRY ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data);
  552. ILAPI void      ILAPIENTRY ilSetRead(fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc);
  553. ILAPI void      ILAPIENTRY ilSetString(ILenum Mode, const char *String);
  554. ILAPI void      ILAPIENTRY ilSetWrite(fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc);
  555. ILAPI void      ILAPIENTRY ilShutDown(void);
  556. ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData(ILenum Format);
  557. ILAPI ILboolean ILAPIENTRY ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data);
  558. ILAPI ILboolean ILAPIENTRY ilTexImageDxtc(ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte* data);
  559. ILAPI ILenum    ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
  560. ILAPI ILboolean ILAPIENTRY ilTypeFunc(ILenum Mode);
  561. ILAPI ILboolean ILAPIENTRY ilLoad_DATA(ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
  562. ILAPI ILboolean ILAPIENTRY ilLoadF_DATA(ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
  563. ILAPI ILboolean ILAPIENTRY ilLoadL_DATA(void *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
  564. ILAPI ILboolean ILAPIENTRY ilSaveData(ILconst_string FileName);
  565. /* How much do we want to log? Goes from virtually nothing (IL_LOG_NONE) to more than everything (IL_LOG_DEBUG) */
  566. enum ILlog_codes {IL_LOG_NONE = 0, IL_LOG_ERROR, IL_LOG_WARNING, IL_LOG_INFO, IL_LOG_VERBOSE, IL_LOG_DEBUG, IL_LOG_CODES_COUNT};
  567. /* Logging control functions */
  568. ILAPI void ILAPIENTRY ilLogInit(ILconst_string logfile, ILint loglevel);
  569. ILAPI void ILAPIENTRY ilLogExit();
  570. // For all those weirdos that spell "colour" without the 'u'.
  571. #define ilClearColor ilClearColour
  572. #define ilKeyColor      ilKeyColour
  573. #define imemclear(x,y) memset(x,0,y);
  574. #ifdef __cplusplus
  575. }
  576. #endif
  577. #endif // _IL_H__
  578. #endif // __il_h__