root / rgbdslam / external / siftgpu / include / IL / il.h @ 9240aaa3
History | View | Annotate | Download (23.2 KB)
1 | 9240aaa3 | Alex | //-----------------------------------------------------------------------------
|
---|---|---|---|
2 | //
|
||
3 | // ImageLib Sources
|
||
4 | // Copyright (C) 2000-2009 by Denton Woods
|
||
5 | // Last modified: 02/05/2009
|
||
6 | //
|
||
7 | // Filename: IL/il.h
|
||
8 | //
|
||
9 | // Description: The main include file for DevIL
|
||
10 | //
|
||
11 | //-----------------------------------------------------------------------------
|
||
12 | |||
13 | // Doxygen comment
|
||
14 | /*! \file il.h
|
||
15 | The main include file for DevIL
|
||
16 | */
|
||
17 | |||
18 | #ifndef __il_h_
|
||
19 | #ifndef __IL_H__
|
||
20 | |||
21 | #define __il_h_
|
||
22 | #define __IL_H__
|
||
23 | |||
24 | #ifdef __cplusplus
|
||
25 | extern "C" { |
||
26 | #endif
|
||
27 | |||
28 | //this define controls if floats and doubles are clampled to [0..1]
|
||
29 | //during conversion. It takes a little more time, but it is the correct
|
||
30 | //way of doing this. If you are sure your floats are always valid,
|
||
31 | //you can undefine this value...
|
||
32 | #define CLAMP_HALF 1 |
||
33 | #define CLAMP_FLOATS 1 |
||
34 | #define CLAMP_DOUBLES 1 |
||
35 | |||
36 | /*#ifdef _WIN32_WCE
|
||
37 | #define IL_NO_EXR
|
||
38 | #define IL_NO_GIF
|
||
39 | #define IL_NO_JP2
|
||
40 | #define IL_NO_JPG
|
||
41 | #define IL_NO_MNG
|
||
42 | #define IL_NO_PNG
|
||
43 | #define IL_NO_TIF
|
||
44 | #define IL_NO_LCMS
|
||
45 | #endif //_WIN32_WCE
|
||
46 | |||
47 | #ifdef DJGPP
|
||
48 | #define IL_NO_EXR
|
||
49 | #define IL_NO_GIF
|
||
50 | #define IL_NO_JP2
|
||
51 | #define IL_NO_JPG
|
||
52 | #define IL_NO_MNG
|
||
53 | #define IL_NO_PNG
|
||
54 | #define IL_NO_TIF
|
||
55 | #define IL_NO_LCMS
|
||
56 | #endif //DJGPP*/
|
||
57 | |||
58 | #ifdef _WIN32
|
||
59 | #if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
|
||
60 | #if defined(_MSC_VER) || defined(__BORLANDC__)
|
||
61 | #pragma comment(lib, "DevIL.lib") |
||
62 | #endif
|
||
63 | #endif
|
||
64 | #endif
|
||
65 | |||
66 | #ifdef RESTRICT_KEYWORD
|
||
67 | #define RESTRICT restrict |
||
68 | #define CONST_RESTRICT const restrict |
||
69 | #else
|
||
70 | #define RESTRICT
|
||
71 | #define CONST_RESTRICT const |
||
72 | #endif
|
||
73 | |||
74 | #include <stdio.h> |
||
75 | |||
76 | typedef unsigned int ILenum; |
||
77 | typedef unsigned char ILboolean; |
||
78 | typedef unsigned int ILbitfield; |
||
79 | typedef signed char ILbyte; |
||
80 | typedef signed short ILshort; |
||
81 | typedef int ILint; |
||
82 | typedef size_t ILsizei;
|
||
83 | typedef unsigned char ILubyte; |
||
84 | typedef unsigned short ILushort; |
||
85 | typedef unsigned int ILuint; |
||
86 | typedef float ILfloat; |
||
87 | typedef float ILclampf; |
||
88 | typedef double ILdouble; |
||
89 | typedef double ILclampd; |
||
90 | |||
91 | #ifdef _MSC_VER
|
||
92 | typedef __int64 ILint64;
|
||
93 | typedef unsigned __int64 ILuint64; |
||
94 | #else
|
||
95 | typedef long long int ILint64; |
||
96 | typedef long long unsigned int ILuint64; |
||
97 | #endif
|
||
98 | |||
99 | |||
100 | #include <limits.h> |
||
101 | #ifdef _UNICODE
|
||
102 | #ifndef _WIN32_WCE
|
||
103 | #include <wchar.h> |
||
104 | #endif
|
||
105 | //if we use a define instead of a typedef,
|
||
106 | //ILconst_string works as intended
|
||
107 | #define ILchar wchar_t
|
||
108 | #define ILstring wchar_t*
|
||
109 | #define ILconst_string wchar_t const * |
||
110 | #else
|
||
111 | //if we use a define instead of a typedef,
|
||
112 | //ILconst_string works as intended
|
||
113 | #define ILchar char |
||
114 | #define ILstring char* |
||
115 | #define ILconst_string char const * |
||
116 | #endif //_UNICODE |
||
117 | |||
118 | #define IL_FALSE 0 |
||
119 | #define IL_TRUE 1 |
||
120 | |||
121 | // Matches OpenGL's right now.
|
||
122 | //! Data formats \link Formats Formats\endlink
|
||
123 | #define IL_COLOUR_INDEX 0x1900 |
||
124 | #define IL_COLOR_INDEX 0x1900 |
||
125 | #define IL_ALPHA 0x1906 |
||
126 | #define IL_RGB 0x1907 |
||
127 | #define IL_RGBA 0x1908 |
||
128 | #define IL_BGR 0x80E0 |
||
129 | #define IL_BGRA 0x80E1 |
||
130 | #define IL_LUMINANCE 0x1909 |
||
131 | #define IL_LUMINANCE_ALPHA 0x190A |
||
132 | |||
133 | //! Data types \link Types Types\endlink
|
||
134 | #define IL_BYTE 0x1400 |
||
135 | #define IL_UNSIGNED_BYTE 0x1401 |
||
136 | #define IL_SHORT 0x1402 |
||
137 | #define IL_UNSIGNED_SHORT 0x1403 |
||
138 | #define IL_INT 0x1404 |
||
139 | #define IL_UNSIGNED_INT 0x1405 |
||
140 | #define IL_FLOAT 0x1406 |
||
141 | #define IL_DOUBLE 0x140A |
||
142 | #define IL_HALF 0x140B |
||
143 | |||
144 | |||
145 | #define IL_MAX_BYTE SCHAR_MAX
|
||
146 | #define IL_MAX_UNSIGNED_BYTE UCHAR_MAX
|
||
147 | #define IL_MAX_SHORT SHRT_MAX
|
||
148 | #define IL_MAX_UNSIGNED_SHORT USHRT_MAX
|
||
149 | #define IL_MAX_INT INT_MAX
|
||
150 | #define IL_MAX_UNSIGNED_INT UINT_MAX
|
||
151 | |||
152 | #define IL_LIMIT(x,m,M) (x<m?m:(x>M?M:x))
|
||
153 | #define IL_CLAMP(x) IL_LIMIT(x,0,1) |
||
154 | |||
155 | #define IL_VENDOR 0x1F00 |
||
156 | #define IL_LOAD_EXT 0x1F01 |
||
157 | #define IL_SAVE_EXT 0x1F02 |
||
158 | |||
159 | |||
160 | //
|
||
161 | // IL-specific #define's
|
||
162 | //
|
||
163 | |||
164 | #define IL_VERSION_1_7_7 1 |
||
165 | #define IL_VERSION 177 |
||
166 | |||
167 | |||
168 | // Attribute Bits
|
||
169 | #define IL_ORIGIN_BIT 0x00000001 |
||
170 | #define IL_FILE_BIT 0x00000002 |
||
171 | #define IL_PAL_BIT 0x00000004 |
||
172 | #define IL_FORMAT_BIT 0x00000008 |
||
173 | #define IL_TYPE_BIT 0x00000010 |
||
174 | #define IL_COMPRESS_BIT 0x00000020 |
||
175 | #define IL_LOADFAIL_BIT 0x00000040 |
||
176 | #define IL_FORMAT_SPECIFIC_BIT 0x00000080 |
||
177 | #define IL_ALL_ATTRIB_BITS 0x000FFFFF |
||
178 | |||
179 | |||
180 | // Palette types
|
||
181 | #define IL_PAL_NONE 0x0400 |
||
182 | #define IL_PAL_RGB24 0x0401 |
||
183 | #define IL_PAL_RGB32 0x0402 |
||
184 | #define IL_PAL_RGBA32 0x0403 |
||
185 | #define IL_PAL_BGR24 0x0404 |
||
186 | #define IL_PAL_BGR32 0x0405 |
||
187 | #define IL_PAL_BGRA32 0x0406 |
||
188 | |||
189 | |||
190 | // Image types
|
||
191 | #define IL_TYPE_UNKNOWN 0x0000 |
||
192 | #define IL_BMP 0x0420 //!< Microsoft Windows Bitmap - .bmp extension |
||
193 | #define IL_CUT 0x0421 //!< Dr. Halo - .cut extension |
||
194 | #define IL_DOOM 0x0422 //!< DooM walls - no specific extension |
||
195 | #define IL_DOOM_FLAT 0x0423 //!< DooM flats - no specific extension |
||
196 | #define IL_ICO 0x0424 //!< Microsoft Windows Icons and Cursors - .ico and .cur extensions |
||
197 | #define IL_JPG 0x0425 //!< JPEG - .jpg, .jpe and .jpeg extensions |
||
198 | #define IL_JFIF 0x0425 //!< |
||
199 | #define IL_LBM 0x0426 //!< Interlaced bitmap - .lbm extension |
||
200 | #define IL_PCD 0x0427 //!< Kodak PhotoCD - .pcd extension |
||
201 | #define IL_PCX 0x0428 //!< ZSoft PCX - .pcx extension |
||
202 | #define IL_PIC 0x0429 //!< PIC - .pic extension |
||
203 | #define IL_PNG 0x042A //!< Portable Network Graphics - .png extension |
||
204 | #define IL_PNM 0x042B //!< Portable Any Map - .pbm, .pgm, .ppm and .pnm extensions |
||
205 | #define IL_SGI 0x042C //!< Silicon Graphics - .sgi, .bw, .rgb and .rgba extensions |
||
206 | #define IL_TGA 0x042D //!< TrueVision Targa File - .tga, .vda, .icb and .vst extensions |
||
207 | #define IL_TIF 0x042E //!< Tagged Image File Format - .tif and .tiff extensions |
||
208 | #define IL_CHEAD 0x042F //!< C-Style Header - .h extension |
||
209 | #define IL_RAW 0x0430 //!< Raw Image Data - any extension |
||
210 | #define IL_MDL 0x0431 //!< Half-Life Model Texture - .mdl extension |
||
211 | #define IL_WAL 0x0432 //!< Quake 2 Texture - .wal extension |
||
212 | #define IL_LIF 0x0434 //!< Homeworld Texture - .lif extension |
||
213 | #define IL_MNG 0x0435 //!< Multiple-image Network Graphics - .mng extension |
||
214 | #define IL_JNG 0x0435 //!< |
||
215 | #define IL_GIF 0x0436 //!< Graphics Interchange Format - .gif extension |
||
216 | #define IL_DDS 0x0437 //!< DirectDraw Surface - .dds extension |
||
217 | #define IL_DCX 0x0438 //!< ZSoft Multi-PCX - .dcx extension |
||
218 | #define IL_PSD 0x0439 //!< Adobe PhotoShop - .psd extension |
||
219 | #define IL_EXIF 0x043A //!< |
||
220 | #define IL_PSP 0x043B //!< PaintShop Pro - .psp extension |
||
221 | #define IL_PIX 0x043C //!< PIX - .pix extension |
||
222 | #define IL_PXR 0x043D //!< Pixar - .pxr extension |
||
223 | #define IL_XPM 0x043E //!< X Pixel Map - .xpm extension |
||
224 | #define IL_HDR 0x043F //!< Radiance High Dynamic Range - .hdr extension |
||
225 | #define IL_ICNS 0x0440 //!< Macintosh Icon - .icns extension |
||
226 | #define IL_JP2 0x0441 //!< Jpeg 2000 - .jp2 extension |
||
227 | #define IL_EXR 0x0442 //!< OpenEXR - .exr extension |
||
228 | #define IL_WDP 0x0443 //!< |
||
229 | #define IL_VTF 0x0444 //!< Valve Texture Format - .vtf extension |
||
230 | #define IL_WBMP 0x0445 //!< Wireless Bitmap - .wbmp extension |
||
231 | #define IL_SUN 0x0446 //!< Sun Raster - .sun, .ras, .rs, .im1, .im8, .im24 and .im32 extensions |
||
232 | #define IL_IFF 0x0447 //!< Interchange File Format - .iff extension |
||
233 | #define IL_TPL 0x0448 //!< Gamecube Texture - .tpl extension |
||
234 | |||
235 | |||
236 | #define IL_JASC_PAL 0x0475 //!< PaintShop Pro Palette |
||
237 | |||
238 | |||
239 | // Error Types
|
||
240 | #define IL_NO_ERROR 0x0000 |
||
241 | #define IL_INVALID_ENUM 0x0501 |
||
242 | #define IL_OUT_OF_MEMORY 0x0502 |
||
243 | #define IL_FORMAT_NOT_SUPPORTED 0x0503 |
||
244 | #define IL_INTERNAL_ERROR 0x0504 |
||
245 | #define IL_INVALID_VALUE 0x0505 |
||
246 | #define IL_ILLEGAL_OPERATION 0x0506 |
||
247 | #define IL_ILLEGAL_FILE_VALUE 0x0507 |
||
248 | #define IL_INVALID_FILE_HEADER 0x0508 |
||
249 | #define IL_INVALID_PARAM 0x0509 |
||
250 | #define IL_COULD_NOT_OPEN_FILE 0x050A |
||
251 | #define IL_INVALID_EXTENSION 0x050B |
||
252 | #define IL_FILE_ALREADY_EXISTS 0x050C |
||
253 | #define IL_OUT_FORMAT_SAME 0x050D |
||
254 | #define IL_STACK_OVERFLOW 0x050E |
||
255 | #define IL_STACK_UNDERFLOW 0x050F |
||
256 | #define IL_INVALID_CONVERSION 0x0510 |
||
257 | #define IL_BAD_DIMENSIONS 0x0511 |
||
258 | #define IL_FILE_READ_ERROR 0x0512 // 05/12/2002: Addition by Sam. |
||
259 | #define IL_FILE_WRITE_ERROR 0x0512 |
||
260 | |||
261 | #define IL_LIB_GIF_ERROR 0x05E1 |
||
262 | #define IL_LIB_JPEG_ERROR 0x05E2 |
||
263 | #define IL_LIB_PNG_ERROR 0x05E3 |
||
264 | #define IL_LIB_TIFF_ERROR 0x05E4 |
||
265 | #define IL_LIB_MNG_ERROR 0x05E5 |
||
266 | #define IL_LIB_JP2_ERROR 0x05E6 |
||
267 | #define IL_LIB_EXR_ERROR 0x05E7 |
||
268 | #define IL_UNKNOWN_ERROR 0x05FF |
||
269 | |||
270 | |||
271 | // Origin Definitions
|
||
272 | #define IL_ORIGIN_SET 0x0600 |
||
273 | #define IL_ORIGIN_LOWER_LEFT 0x0601 |
||
274 | #define IL_ORIGIN_UPPER_LEFT 0x0602 |
||
275 | #define IL_ORIGIN_MODE 0x0603 |
||
276 | |||
277 | |||
278 | // Format and Type Mode Definitions
|
||
279 | #define IL_FORMAT_SET 0x0610 |
||
280 | #define IL_FORMAT_MODE 0x0611 |
||
281 | #define IL_TYPE_SET 0x0612 |
||
282 | #define IL_TYPE_MODE 0x0613 |
||
283 | |||
284 | |||
285 | // File definitions
|
||
286 | #define IL_FILE_OVERWRITE 0x0620 |
||
287 | #define IL_FILE_MODE 0x0621 |
||
288 | |||
289 | |||
290 | // Palette definitions
|
||
291 | #define IL_CONV_PAL 0x0630 |
||
292 | |||
293 | |||
294 | // Load fail definitions
|
||
295 | #define IL_DEFAULT_ON_FAIL 0x0632 |
||
296 | |||
297 | |||
298 | // Key colour and alpha definitions
|
||
299 | #define IL_USE_KEY_COLOUR 0x0635 |
||
300 | #define IL_USE_KEY_COLOR 0x0635 |
||
301 | #define IL_BLIT_BLEND 0x0636 |
||
302 | |||
303 | |||
304 | // Interlace definitions
|
||
305 | #define IL_SAVE_INTERLACED 0x0639 |
||
306 | #define IL_INTERLACE_MODE 0x063A |
||
307 | |||
308 | |||
309 | // Quantization definitions
|
||
310 | #define IL_QUANTIZATION_MODE 0x0640 |
||
311 | #define IL_WU_QUANT 0x0641 |
||
312 | #define IL_NEU_QUANT 0x0642 |
||
313 | #define IL_NEU_QUANT_SAMPLE 0x0643 |
||
314 | #define IL_MAX_QUANT_INDEXS 0x0644 //XIX : ILint : Maximum number of colors to reduce to, default of 256. and has a range of 2-256 |
||
315 | #define IL_MAX_QUANT_INDICES 0x0644 // Redefined, since the above #define is misspelled |
||
316 | |||
317 | |||
318 | // Hints
|
||
319 | #define IL_FASTEST 0x0660 |
||
320 | #define IL_LESS_MEM 0x0661 |
||
321 | #define IL_DONT_CARE 0x0662 |
||
322 | #define IL_MEM_SPEED_HINT 0x0665 |
||
323 | #define IL_USE_COMPRESSION 0x0666 |
||
324 | #define IL_NO_COMPRESSION 0x0667 |
||
325 | #define IL_COMPRESSION_HINT 0x0668 |
||
326 | |||
327 | |||
328 | // Compression
|
||
329 | #define IL_NVIDIA_COMPRESS 0x0670 |
||
330 | #define IL_SQUISH_COMPRESS 0x0671 |
||
331 | |||
332 | |||
333 | // Subimage types
|
||
334 | #define IL_SUB_NEXT 0x0680 |
||
335 | #define IL_SUB_MIPMAP 0x0681 |
||
336 | #define IL_SUB_LAYER 0x0682 |
||
337 | |||
338 | |||
339 | // Compression definitions
|
||
340 | #define IL_COMPRESS_MODE 0x0700 |
||
341 | #define IL_COMPRESS_NONE 0x0701 |
||
342 | #define IL_COMPRESS_RLE 0x0702 |
||
343 | #define IL_COMPRESS_LZO 0x0703 |
||
344 | #define IL_COMPRESS_ZLIB 0x0704 |
||
345 | |||
346 | |||
347 | // File format-specific values
|
||
348 | #define IL_TGA_CREATE_STAMP 0x0710 |
||
349 | #define IL_JPG_QUALITY 0x0711 |
||
350 | #define IL_PNG_INTERLACE 0x0712 |
||
351 | #define IL_TGA_RLE 0x0713 |
||
352 | #define IL_BMP_RLE 0x0714 |
||
353 | #define IL_SGI_RLE 0x0715 |
||
354 | #define IL_TGA_ID_STRING 0x0717 |
||
355 | #define IL_TGA_AUTHNAME_STRING 0x0718 |
||
356 | #define IL_TGA_AUTHCOMMENT_STRING 0x0719 |
||
357 | #define IL_PNG_AUTHNAME_STRING 0x071A |
||
358 | #define IL_PNG_TITLE_STRING 0x071B |
||
359 | #define IL_PNG_DESCRIPTION_STRING 0x071C |
||
360 | #define IL_TIF_DESCRIPTION_STRING 0x071D |
||
361 | #define IL_TIF_HOSTCOMPUTER_STRING 0x071E |
||
362 | #define IL_TIF_DOCUMENTNAME_STRING 0x071F |
||
363 | #define IL_TIF_AUTHNAME_STRING 0x0720 |
||
364 | #define IL_JPG_SAVE_FORMAT 0x0721 |
||
365 | #define IL_CHEAD_HEADER_STRING 0x0722 |
||
366 | #define IL_PCD_PICNUM 0x0723 |
||
367 | #define IL_JPG_PROGRESSIVE 0x0725 |
||
368 | |||
369 | #define IL_PNG_ALPHA_INDEX 0x0724 //XIX : ILint : the color in the palette at this index value (0-255) is considered transparent, -1 for no trasparent color |
||
370 | |||
371 | // DXTC definitions
|
||
372 | #define IL_DXTC_FORMAT 0x0705 |
||
373 | #define IL_DXT1 0x0706 |
||
374 | #define IL_DXT2 0x0707 |
||
375 | #define IL_DXT3 0x0708 |
||
376 | #define IL_DXT4 0x0709 |
||
377 | #define IL_DXT5 0x070A |
||
378 | #define IL_DXT_NO_COMP 0x070B |
||
379 | #define IL_KEEP_DXTC_DATA 0x070C |
||
380 | #define IL_DXTC_DATA_FORMAT 0x070D |
||
381 | #define IL_3DC 0x070E |
||
382 | #define IL_RXGB 0x070F |
||
383 | #define IL_ATI1N 0x0710 |
||
384 | #define IL_DXT1A 0x0711 // Normally the same as IL_DXT1, except for nVidia Texture Tools. |
||
385 | |||
386 | // Environment map definitions
|
||
387 | #define IL_CUBEMAP_POSITIVEX 0x00000400 |
||
388 | #define IL_CUBEMAP_NEGATIVEX 0x00000800 |
||
389 | #define IL_CUBEMAP_POSITIVEY 0x00001000 |
||
390 | #define IL_CUBEMAP_NEGATIVEY 0x00002000 |
||
391 | #define IL_CUBEMAP_POSITIVEZ 0x00004000 |
||
392 | #define IL_CUBEMAP_NEGATIVEZ 0x00008000 |
||
393 | #define IL_SPHEREMAP 0x00010000 |
||
394 | |||
395 | |||
396 | // Values
|
||
397 | #define IL_VERSION_NUM 0x0DE2 |
||
398 | #define IL_IMAGE_WIDTH 0x0DE4 |
||
399 | #define IL_IMAGE_HEIGHT 0x0DE5 |
||
400 | #define IL_IMAGE_DEPTH 0x0DE6 |
||
401 | #define IL_IMAGE_SIZE_OF_DATA 0x0DE7 |
||
402 | #define IL_IMAGE_BPP 0x0DE8 |
||
403 | #define IL_IMAGE_BYTES_PER_PIXEL 0x0DE8 |
||
404 | #define IL_IMAGE_BPP 0x0DE8 |
||
405 | #define IL_IMAGE_BITS_PER_PIXEL 0x0DE9 |
||
406 | #define IL_IMAGE_FORMAT 0x0DEA |
||
407 | #define IL_IMAGE_TYPE 0x0DEB |
||
408 | #define IL_PALETTE_TYPE 0x0DEC |
||
409 | #define IL_PALETTE_SIZE 0x0DED |
||
410 | #define IL_PALETTE_BPP 0x0DEE |
||
411 | #define IL_PALETTE_NUM_COLS 0x0DEF |
||
412 | #define IL_PALETTE_BASE_TYPE 0x0DF0 |
||
413 | #define IL_NUM_FACES 0x0DE1 |
||
414 | #define IL_NUM_IMAGES 0x0DF1 |
||
415 | #define IL_NUM_MIPMAPS 0x0DF2 |
||
416 | #define IL_NUM_LAYERS 0x0DF3 |
||
417 | #define IL_ACTIVE_IMAGE 0x0DF4 |
||
418 | #define IL_ACTIVE_MIPMAP 0x0DF5 |
||
419 | #define IL_ACTIVE_LAYER 0x0DF6 |
||
420 | #define IL_ACTIVE_FACE 0x0E00 |
||
421 | #define IL_CUR_IMAGE 0x0DF7 |
||
422 | #define IL_IMAGE_DURATION 0x0DF8 |
||
423 | #define IL_IMAGE_PLANESIZE 0x0DF9 |
||
424 | #define IL_IMAGE_BPC 0x0DFA |
||
425 | #define IL_IMAGE_OFFX 0x0DFB |
||
426 | #define IL_IMAGE_OFFY 0x0DFC |
||
427 | #define IL_IMAGE_CUBEFLAGS 0x0DFD |
||
428 | #define IL_IMAGE_ORIGIN 0x0DFE |
||
429 | #define IL_IMAGE_CHANNELS 0x0DFF |
||
430 | |||
431 | # if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)) |
||
432 | // __attribute__((deprecated)) is supported by GCC 3.1 and later.
|
||
433 | # define DEPRECATED(D) D __attribute__((deprecated))
|
||
434 | # elif defined _MSC_VER && _MSC_VER >= 1300 |
||
435 | // __declspec(deprecated) is supported by MSVC 7.0 and later.
|
||
436 | # define DEPRECATED(D) __declspec(deprecated) D
|
||
437 | # else
|
||
438 | # define DEPRECATED (D) D
|
||
439 | # endif
|
||
440 | |||
441 | //
|
||
442 | // Section shamelessly modified from the glut header.
|
||
443 | //
|
||
444 | |||
445 | // This is from Win32's <windef.h>
|
||
446 | #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) |
||
447 | #define ILAPIENTRY __stdcall
|
||
448 | #define IL_PACKSTRUCT
|
||
449 | //#elif defined(linux) || defined(MACOSX) || defined(__CYGWIN__) //fix bug 840364
|
||
450 | #elif defined( __GNUC__ )
|
||
451 | // this should work for any of the above commented platforms
|
||
452 | // plus any platform using GCC
|
||
453 | #ifdef __MINGW32__
|
||
454 | #define ILAPIENTRY __stdcall
|
||
455 | #else
|
||
456 | #define ILAPIENTRY
|
||
457 | #endif
|
||
458 | #define IL_PACKSTRUCT __attribute__ ((packed))
|
||
459 | #else
|
||
460 | #define ILAPIENTRY
|
||
461 | #define IL_PACKSTRUCT
|
||
462 | #endif
|
||
463 | |||
464 | // This is from Win32's <wingdi.h> and <winnt.h>
|
||
465 | #if defined(__LCC__)
|
||
466 | #define ILAPI __stdcall
|
||
467 | #elif defined(_WIN32) //changed 20031221 to fix bug 840421 |
||
468 | #ifdef IL_STATIC_LIB
|
||
469 | #define ILAPI
|
||
470 | #else
|
||
471 | #ifdef _IL_BUILD_LIBRARY
|
||
472 | #define ILAPI __declspec(dllexport)
|
||
473 | #else
|
||
474 | #define ILAPI __declspec(dllimport)
|
||
475 | #endif
|
||
476 | #endif
|
||
477 | #elif __APPLE__
|
||
478 | #define ILAPI extern |
||
479 | #else
|
||
480 | #define ILAPI
|
||
481 | #endif
|
||
482 | |||
483 | |||
484 | #define IL_SEEK_SET 0 |
||
485 | #define IL_SEEK_CUR 1 |
||
486 | #define IL_SEEK_END 2 |
||
487 | #define IL_EOF -1 |
||
488 | |||
489 | |||
490 | // Callback functions for file reading
|
||
491 | typedef void* ILHANDLE; |
||
492 | typedef void (ILAPIENTRY *fCloseRProc)(ILHANDLE); |
||
493 | typedef ILboolean (ILAPIENTRY *fEofProc) (ILHANDLE);
|
||
494 | typedef ILint (ILAPIENTRY *fGetcProc) (ILHANDLE);
|
||
495 | typedef ILHANDLE (ILAPIENTRY *fOpenRProc) (ILconst_string);
|
||
496 | typedef ILint (ILAPIENTRY *fReadProc) (void*, ILuint, ILuint, ILHANDLE); |
||
497 | typedef ILint (ILAPIENTRY *fSeekRProc) (ILHANDLE, ILint, ILint);
|
||
498 | typedef ILint (ILAPIENTRY *fTellRProc) (ILHANDLE);
|
||
499 | |||
500 | // Callback functions for file writing
|
||
501 | typedef void (ILAPIENTRY *fCloseWProc)(ILHANDLE); |
||
502 | typedef ILHANDLE (ILAPIENTRY *fOpenWProc) (ILconst_string);
|
||
503 | typedef ILint (ILAPIENTRY *fPutcProc) (ILubyte, ILHANDLE);
|
||
504 | typedef ILint (ILAPIENTRY *fSeekWProc) (ILHANDLE, ILint, ILint);
|
||
505 | typedef ILint (ILAPIENTRY *fTellWProc) (ILHANDLE);
|
||
506 | typedef ILint (ILAPIENTRY *fWriteProc) (const void*, ILuint, ILuint, ILHANDLE); |
||
507 | |||
508 | // Callback functions for allocation and deallocation
|
||
509 | typedef void* (ILAPIENTRY *mAlloc)(const ILsizei); |
||
510 | typedef void (ILAPIENTRY *mFree) (const void* CONST_RESTRICT); |
||
511 | |||
512 | // Registered format procedures
|
||
513 | typedef ILenum (ILAPIENTRY *IL_LOADPROC)(ILconst_string);
|
||
514 | typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(ILconst_string);
|
||
515 | |||
516 | |||
517 | // ImageLib Functions
|
||
518 | ILAPI ILboolean ILAPIENTRY ilActiveFace(ILuint Number); |
||
519 | ILAPI ILboolean ILAPIENTRY ilActiveImage(ILuint Number); |
||
520 | ILAPI ILboolean ILAPIENTRY ilActiveLayer(ILuint Number); |
||
521 | ILAPI ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number); |
||
522 | ILAPI ILboolean ILAPIENTRY ilApplyPal(ILconst_string FileName); |
||
523 | ILAPI ILboolean ILAPIENTRY ilApplyProfile(ILstring InProfile, ILstring OutProfile); |
||
524 | ILAPI void ILAPIENTRY ilBindImage(ILuint Image);
|
||
525 | ILAPI ILboolean ILAPIENTRY ilBlit(ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth); |
||
526 | ILAPI ILboolean ILAPIENTRY ilClampNTSC(void);
|
||
527 | ILAPI void ILAPIENTRY ilClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
|
||
528 | ILAPI ILboolean ILAPIENTRY ilClearImage(void);
|
||
529 | ILAPI ILuint ILAPIENTRY ilCloneCurImage(void);
|
||
530 | ILAPI ILubyte* ILAPIENTRY ilCompressDXT(ILubyte *Data, ILuint Width, ILuint Height, ILuint Depth, ILenum DXTCFormat, ILuint *DXTCSize); |
||
531 | ILAPI ILboolean ILAPIENTRY ilCompressFunc(ILenum Mode); |
||
532 | ILAPI ILboolean ILAPIENTRY ilConvertImage(ILenum DestFormat, ILenum DestType); |
||
533 | ILAPI ILboolean ILAPIENTRY ilConvertPal(ILenum DestFormat); |
||
534 | ILAPI ILboolean ILAPIENTRY ilCopyImage(ILuint Src); |
||
535 | ILAPI ILuint ILAPIENTRY ilCopyPixels(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data);
|
||
536 | ILAPI ILuint ILAPIENTRY ilCreateSubImage(ILenum Type, ILuint Num); |
||
537 | ILAPI ILboolean ILAPIENTRY ilDefaultImage(void);
|
||
538 | ILAPI void ILAPIENTRY ilDeleteImage(const ILuint Num); |
||
539 | ILAPI void ILAPIENTRY ilDeleteImages(ILsizei Num, const ILuint *Images); |
||
540 | ILAPI ILenum ILAPIENTRY ilDetermineType(ILconst_string FileName); |
||
541 | ILAPI ILenum ILAPIENTRY ilDetermineTypeF(ILHANDLE File); |
||
542 | ILAPI ILenum ILAPIENTRY ilDetermineTypeL(const void *Lump, ILuint Size); |
||
543 | ILAPI ILboolean ILAPIENTRY ilDisable(ILenum Mode); |
||
544 | ILAPI ILboolean ILAPIENTRY ilDxtcDataToImage(void);
|
||
545 | ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface(void);
|
||
546 | ILAPI ILboolean ILAPIENTRY ilEnable(ILenum Mode); |
||
547 | ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData(void); |
||
548 | ILAPI ILboolean ILAPIENTRY ilFormatFunc(ILenum Mode); |
||
549 | ILAPI void ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
|
||
550 | ILAPI ILuint ILAPIENTRY ilGenImage(void);
|
||
551 | ILAPI ILubyte* ILAPIENTRY ilGetAlpha(ILenum Type); |
||
552 | ILAPI ILboolean ILAPIENTRY ilGetBoolean(ILenum Mode); |
||
553 | ILAPI void ILAPIENTRY ilGetBooleanv(ILenum Mode, ILboolean *Param);
|
||
554 | ILAPI ILubyte* ILAPIENTRY ilGetData(void);
|
||
555 | ILAPI ILuint ILAPIENTRY ilGetDXTCData(void *Buffer, ILuint BufferSize, ILenum DXTCFormat);
|
||
556 | ILAPI ILenum ILAPIENTRY ilGetError(void);
|
||
557 | ILAPI ILint ILAPIENTRY ilGetInteger(ILenum Mode); |
||
558 | ILAPI void ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
|
||
559 | ILAPI ILuint ILAPIENTRY ilGetLumpPos(void);
|
||
560 | ILAPI ILubyte* ILAPIENTRY ilGetPalette(void);
|
||
561 | ILAPI ILconst_string ILAPIENTRY ilGetString(ILenum StringName); |
||
562 | ILAPI void ILAPIENTRY ilHint(ILenum Target, ILenum Mode);
|
||
563 | ILAPI ILboolean ILAPIENTRY ilInvertSurfaceDxtcDataAlpha(void);
|
||
564 | ILAPI void ILAPIENTRY ilInit(void); |
||
565 | ILAPI ILboolean ILAPIENTRY ilImageToDxtcData(ILenum Format); |
||
566 | ILAPI ILboolean ILAPIENTRY ilIsDisabled(ILenum Mode); |
||
567 | ILAPI ILboolean ILAPIENTRY ilIsEnabled(ILenum Mode); |
||
568 | ILAPI ILboolean ILAPIENTRY ilIsImage(ILuint Image); |
||
569 | ILAPI ILboolean ILAPIENTRY ilIsValid(ILenum Type, ILconst_string FileName); |
||
570 | ILAPI ILboolean ILAPIENTRY ilIsValidF(ILenum Type, ILHANDLE File); |
||
571 | ILAPI ILboolean ILAPIENTRY ilIsValidL(ILenum Type, void *Lump, ILuint Size);
|
||
572 | ILAPI void ILAPIENTRY ilKeyColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
|
||
573 | ILAPI ILboolean ILAPIENTRY ilLoad(ILenum Type, ILconst_string FileName); |
||
574 | ILAPI ILboolean ILAPIENTRY ilLoadF(ILenum Type, ILHANDLE File); |
||
575 | ILAPI ILboolean ILAPIENTRY ilLoadImage(ILconst_string FileName); |
||
576 | ILAPI ILboolean ILAPIENTRY ilLoadL(ILenum Type, const void *Lump, ILuint Size); |
||
577 | ILAPI ILboolean ILAPIENTRY ilLoadPal(ILconst_string FileName); |
||
578 | ILAPI void ILAPIENTRY ilModAlpha(ILdouble AlphaValue);
|
||
579 | ILAPI ILboolean ILAPIENTRY ilOriginFunc(ILenum Mode); |
||
580 | ILAPI ILboolean ILAPIENTRY ilOverlayImage(ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord); |
||
581 | ILAPI void ILAPIENTRY ilPopAttrib(void); |
||
582 | ILAPI void ILAPIENTRY ilPushAttrib(ILuint Bits);
|
||
583 | ILAPI void ILAPIENTRY ilRegisterFormat(ILenum Format);
|
||
584 | ILAPI ILboolean ILAPIENTRY ilRegisterLoad(ILconst_string Ext, IL_LOADPROC Load); |
||
585 | ILAPI ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num); |
||
586 | ILAPI ILboolean ILAPIENTRY ilRegisterNumFaces(ILuint Num); |
||
587 | ILAPI ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num); |
||
588 | ILAPI void ILAPIENTRY ilRegisterOrigin(ILenum Origin);
|
||
589 | ILAPI void ILAPIENTRY ilRegisterPal(void *Pal, ILuint Size, ILenum Type); |
||
590 | ILAPI ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save); |
||
591 | ILAPI void ILAPIENTRY ilRegisterType(ILenum Type);
|
||
592 | ILAPI ILboolean ILAPIENTRY ilRemoveLoad(ILconst_string Ext); |
||
593 | ILAPI ILboolean ILAPIENTRY ilRemoveSave(ILconst_string Ext); |
||
594 | ILAPI void ILAPIENTRY ilResetMemory(void); // Deprecated |
||
595 | ILAPI void ILAPIENTRY ilResetRead(void); |
||
596 | ILAPI void ILAPIENTRY ilResetWrite(void); |
||
597 | ILAPI ILboolean ILAPIENTRY ilSave(ILenum Type, ILconst_string FileName); |
||
598 | ILAPI ILuint ILAPIENTRY ilSaveF(ILenum Type, ILHANDLE File); |
||
599 | ILAPI ILboolean ILAPIENTRY ilSaveImage(ILconst_string FileName); |
||
600 | ILAPI ILuint ILAPIENTRY ilSaveL(ILenum Type, void *Lump, ILuint Size);
|
||
601 | ILAPI ILboolean ILAPIENTRY ilSavePal(ILconst_string FileName); |
||
602 | ILAPI ILboolean ILAPIENTRY ilSetAlpha( ILdouble AlphaValue ); |
||
603 | ILAPI ILboolean ILAPIENTRY ilSetData(void *Data);
|
||
604 | ILAPI ILboolean ILAPIENTRY ilSetDuration(ILuint Duration); |
||
605 | ILAPI void ILAPIENTRY ilSetInteger(ILenum Mode, ILint Param);
|
||
606 | ILAPI void ILAPIENTRY ilSetMemory(mAlloc, mFree);
|
||
607 | ILAPI void ILAPIENTRY ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data); |
||
608 | ILAPI void ILAPIENTRY ilSetRead(fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc);
|
||
609 | ILAPI void ILAPIENTRY ilSetString(ILenum Mode, const char *String); |
||
610 | ILAPI void ILAPIENTRY ilSetWrite(fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc);
|
||
611 | ILAPI void ILAPIENTRY ilShutDown(void); |
||
612 | ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData(ILenum Format); |
||
613 | ILAPI ILboolean ILAPIENTRY ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data);
|
||
614 | ILAPI ILboolean ILAPIENTRY ilTexImageDxtc(ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte* data);
|
||
615 | ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName); |
||
616 | ILAPI ILboolean ILAPIENTRY ilTypeFunc(ILenum Mode); |
||
617 | ILAPI ILboolean ILAPIENTRY ilLoadData(ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp); |
||
618 | ILAPI ILboolean ILAPIENTRY ilLoadDataF(ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp); |
||
619 | ILAPI ILboolean ILAPIENTRY ilLoadDataL(void *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
|
||
620 | ILAPI ILboolean ILAPIENTRY ilSaveData(ILconst_string FileName); |
||
621 | |||
622 | // For all those weirdos that spell "colour" without the 'u'.
|
||
623 | #define ilClearColor ilClearColour
|
||
624 | #define ilKeyColor ilKeyColour
|
||
625 | |||
626 | #define imemclear(x,y) memset(x,0,y); |
||
627 | |||
628 | #ifdef __cplusplus
|
||
629 | } |
||
630 | #endif
|
||
631 | |||
632 | #endif // __IL_H__ |
||
633 | #endif // __il_h__ |