1 | //-----------------------------------------------------------------------------
|
---|
2 | //
|
---|
3 | // ImageLib Sources
|
---|
4 | // Copyright (C) 2000-2002 by Denton Woods
|
---|
5 | // Last modified: 02/19/2002 <--Y2K Compliant! =]
|
---|
6 | //
|
---|
7 | // Filename: IL/devil_internal_exports.h
|
---|
8 | //
|
---|
9 | // Description: Internal stuff for DevIL (IL, ILU and ILUT)
|
---|
10 | //
|
---|
11 | //-----------------------------------------------------------------------------
|
---|
12 |
|
---|
13 | #ifndef IL_EXPORTS_H
|
---|
14 | #define IL_EXPORTS_H
|
---|
15 |
|
---|
16 | #ifdef __cplusplus
|
---|
17 | extern "C" {
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
|
---|
21 | #define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
|
---|
22 |
|
---|
23 |
|
---|
24 | // Basic Palette struct
|
---|
25 | typedef struct ILpal
|
---|
26 | {
|
---|
27 | ILubyte *Palette; // the image palette (if any)
|
---|
28 | ILuint PalSize; // size of the palette (in bytes)
|
---|
29 | ILenum PalType; // the palette types below (0x0500 range)
|
---|
30 | } ILpal;
|
---|
31 |
|
---|
32 |
|
---|
33 | // The Fundamental Image struct
|
---|
34 | typedef struct ILimage
|
---|
35 | {
|
---|
36 | ILuint Width; // the image's width
|
---|
37 | ILuint Height; // the image's height
|
---|
38 | ILuint Depth; // the image's depth
|
---|
39 | ILubyte Bpp; // bytes per pixel (now number of channels)
|
---|
40 | ILubyte Bpc; // bytes per channel
|
---|
41 | ILuint Bps; // bytes per scanline (components for IL)
|
---|
42 | ILubyte *Data; // the image data
|
---|
43 | ILuint SizeOfData; // the total size of the data (in bytes)
|
---|
44 | ILuint SizeOfPlane; // SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
|
---|
45 | ILenum Format; // image format (in IL enum style)
|
---|
46 | ILenum Type; // image type (in IL enum style)
|
---|
47 | ILenum Origin; // origin of the image
|
---|
48 | ILpal Pal; // palette details
|
---|
49 | ILuint Duration; // length of the time to display this "frame"
|
---|
50 | ILenum CubeFlags; // cube map flags for sides present in chain
|
---|
51 | struct ILimage *Mipmaps; // mipmapped versions of this image terminated by a NULL - usu. NULL
|
---|
52 | struct ILimage *Next; // next image in the chain - usu. NULL
|
---|
53 | struct ILimage *Layers; // subsequent layers in the chain - usu. NULL
|
---|
54 | ILuint NumNext; // number of images following this one (0 when not parent)
|
---|
55 | ILuint NumMips; // number of mipmaps (0 when not parent)
|
---|
56 | ILuint NumLayers; // number of layers (0 when not parent)
|
---|
57 | ILuint *AnimList; // animation list
|
---|
58 | ILuint AnimSize; // animation list size
|
---|
59 | ILvoid *Profile; // colour profile
|
---|
60 | ILuint ProfileSize; // colour profile size
|
---|
61 | ILuint OffX, OffY; // offset of the image
|
---|
62 | ILubyte *DxtcData; // compressed data
|
---|
63 | ILenum DxtcFormat; // compressed data format
|
---|
64 | ILuint DxtcSize; // compressed data size
|
---|
65 | } ILimage;
|
---|
66 |
|
---|
67 |
|
---|
68 | // Memory functions
|
---|
69 | ILAPI ILvoid* ILAPIENTRY ialloc(ILuint Size);
|
---|
70 | ILAPI ILvoid ILAPIENTRY ifree(ILvoid *Ptr);
|
---|
71 | ILAPI ILvoid* ILAPIENTRY icalloc(ILuint Size, ILuint Num);
|
---|
72 |
|
---|
73 |
|
---|
74 |
|
---|
75 | // Internal library functions in IL
|
---|
76 | ILAPI ILimage* ILAPIENTRY ilGetCurImage(ILvoid);
|
---|
77 | ILAPI ILvoid ILAPIENTRY ilSetCurImage(ILimage *Image);
|
---|
78 | ILAPI ILvoid ILAPIENTRY ilSetError(ILenum Error);
|
---|
79 | ILAPI ILvoid ILAPIENTRY ilSetPal(ILpal *Pal);
|
---|
80 |
|
---|
81 | //
|
---|
82 | // Utility functions
|
---|
83 | //
|
---|
84 | ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
|
---|
85 | ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
|
---|
86 | ILAPI ILubyte ILAPIENTRY ilGetBppType(ILenum Type);
|
---|
87 | ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
|
---|
88 | ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
|
---|
89 | ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
|
---|
90 | ILAPI ILenum ILAPIENTRY ilTypeFromExt(const ILstring FileName);
|
---|
91 | ILAPI ILvoid ILAPIENTRY ilReplaceCurImage(ILimage *Image);
|
---|
92 |
|
---|
93 | //
|
---|
94 | // Image functions
|
---|
95 | //
|
---|
96 | ILAPI ILvoid ILAPIENTRY iBindImageTemp(ILvoid);
|
---|
97 | ILAPI ILboolean ILAPIENTRY ilClearImage_(ILimage *Image);
|
---|
98 | ILAPI ILvoid ILAPIENTRY ilCloseImage(ILimage *Image);
|
---|
99 | ILAPI ILvoid ILAPIENTRY ilClosePal(ILpal *Palette);
|
---|
100 | ILAPI ILpal* ILAPIENTRY iCopyPal(ILvoid);
|
---|
101 | ILAPI ILboolean ILAPIENTRY ilCopyImageAttr(ILimage *Dest, ILimage *Src);
|
---|
102 | ILAPI ILimage* ILAPIENTRY ilCopyImage_(ILimage *Src);
|
---|
103 | ILAPI ILvoid ILAPIENTRY ilGetClear(ILvoid *Colours, ILenum Format, ILenum Type);
|
---|
104 | ILAPI ILuint ILAPIENTRY ilGetCurName(ILvoid);
|
---|
105 | ILAPI ILboolean ILAPIENTRY ilIsValidPal(ILpal *Palette);
|
---|
106 | ILAPI ILimage* ILAPIENTRY ilNewImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
|
---|
107 | ILAPI ILboolean ILAPIENTRY ilResizeImage(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
|
---|
108 | ILAPI ILboolean ILAPIENTRY ilTexImage_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
|
---|
109 | ILAPI ILboolean ILAPIENTRY ilTexSubImage_(ILimage *Image, ILvoid *Data);
|
---|
110 | ILAPI ILvoid* ILAPIENTRY ilConvertBuffer(ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILvoid *Buffer);
|
---|
111 | ILAPI ILimage* ILAPIENTRY iConvertImage(ILimage *Image, ILenum DestFormat, ILenum DestType);
|
---|
112 | ILAPI ILpal* ILAPIENTRY iConvertPal(ILpal *Pal, ILenum DestFormat);
|
---|
113 | ILAPI ILubyte* ILAPIENTRY iGetFlipped(ILimage *Image);
|
---|
114 |
|
---|
115 |
|
---|
116 | // Internal library functions in ILU
|
---|
117 | ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
|
---|
118 | ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
|
---|
119 | ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
|
---|
120 |
|
---|
121 | #ifdef __cplusplus
|
---|
122 | }
|
---|
123 | #endif
|
---|
124 |
|
---|
125 | #endif//IL_EXPORTS_H
|
---|