1 | #ifndef WRAPPER_H
|
---|
2 | #define WRAPPER_H
|
---|
3 |
|
---|
4 | /*#include <il/il.h>
|
---|
5 | #include <il/ilu.h>*/
|
---|
6 | #include <il/ilut.h> // Probably only have to #include this one
|
---|
7 |
|
---|
8 | #ifdef _MSC_VER
|
---|
9 | #ifndef _IL_WRAP_BUILD_LIB
|
---|
10 | #pragma comment(lib, "il_wrap.lib")
|
---|
11 | #endif
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | class ilImage
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | ilImage();
|
---|
18 | ilImage(char *);
|
---|
19 | ilImage(const ilImage &);
|
---|
20 | virtual ~ilImage();
|
---|
21 |
|
---|
22 | ILboolean Load(char *);
|
---|
23 | ILboolean Load(char *, ILenum);
|
---|
24 | ILboolean Save(char *);
|
---|
25 | ILboolean Save(char *, ILenum);
|
---|
26 |
|
---|
27 |
|
---|
28 | // ImageLib functions
|
---|
29 | ILboolean ActiveImage(ILuint);
|
---|
30 | ILboolean ActiveLayer(ILuint);
|
---|
31 | ILboolean ActiveMipmap(ILuint);
|
---|
32 | ILboolean Clear(ILvoid);
|
---|
33 | ILvoid ClearColour(ILubyte, ILubyte, ILubyte, ILubyte);
|
---|
34 | ILboolean Convert(ILenum);
|
---|
35 | ILboolean Copy(ILuint);
|
---|
36 | ILboolean Default(ILvoid);
|
---|
37 | ILboolean Flip(ILvoid);
|
---|
38 | ILboolean SwapColours(ILvoid);
|
---|
39 | ILboolean Resize(ILuint, ILuint, ILuint);
|
---|
40 | ILboolean TexImage(ILuint, ILuint, ILuint, ILubyte, ILenum, ILenum, ILvoid*);
|
---|
41 |
|
---|
42 |
|
---|
43 | // Image handling
|
---|
44 | ILvoid Bind(ILvoid) const;
|
---|
45 | ILvoid Bind(ILuint);
|
---|
46 | ILvoid Close(ILvoid) { this->Delete(); }
|
---|
47 | ILvoid Delete(ILvoid);
|
---|
48 | ILvoid iGenBind();
|
---|
49 |
|
---|
50 |
|
---|
51 | // Image characteristics
|
---|
52 | ILuint Width(ILvoid);
|
---|
53 | ILuint Height(ILvoid);
|
---|
54 | ILuint Depth(ILvoid);
|
---|
55 | ILubyte Bpp(ILvoid);
|
---|
56 | ILubyte Bitpp(ILvoid);
|
---|
57 | ILenum PaletteType(ILvoid);
|
---|
58 | ILenum Format(ILvoid);
|
---|
59 | ILenum Type(ILvoid);
|
---|
60 | ILuint NumImages(ILvoid);
|
---|
61 | ILuint NumMipmaps(ILvoid);
|
---|
62 | ILuint GetId(ILvoid) const;
|
---|
63 | ILenum GetOrigin(ILvoid);
|
---|
64 | ILubyte *GetData(ILvoid);
|
---|
65 | ILubyte *GetPalette(ILvoid);
|
---|
66 |
|
---|
67 |
|
---|
68 | // Rendering
|
---|
69 | ILuint BindImage(ILvoid);
|
---|
70 | ILuint BindImage(ILenum);
|
---|
71 |
|
---|
72 |
|
---|
73 | // Operators
|
---|
74 | ilImage& operator = (ILuint);
|
---|
75 | ilImage& operator = (const ilImage &);
|
---|
76 |
|
---|
77 |
|
---|
78 | protected:
|
---|
79 | ILuint Id;
|
---|
80 |
|
---|
81 | private:
|
---|
82 | ILvoid iStartUp();
|
---|
83 |
|
---|
84 |
|
---|
85 | };
|
---|
86 |
|
---|
87 |
|
---|
88 | class ilFilters
|
---|
89 | {
|
---|
90 | public:
|
---|
91 | static ILboolean Alienify(ilImage &);
|
---|
92 | static ILboolean BlurAvg(ilImage &, ILuint Iter);
|
---|
93 | static ILboolean BlurGaussian(ilImage &, ILuint Iter);
|
---|
94 | static ILboolean Contrast(ilImage &, ILfloat Contrast);
|
---|
95 | static ILboolean EdgeDetectE(ilImage &);
|
---|
96 | static ILboolean EdgeDetectP(ilImage &);
|
---|
97 | static ILboolean EdgeDetectS(ilImage &);
|
---|
98 | static ILboolean Emboss(ilImage &);
|
---|
99 | static ILboolean Gamma(ilImage &, ILfloat Gamma);
|
---|
100 | static ILboolean Negative(ilImage &);
|
---|
101 | static ILboolean Noisify(ilImage &, ILubyte Factor);
|
---|
102 | static ILboolean Pixelize(ilImage &, ILuint PixSize);
|
---|
103 | static ILboolean Saturate(ilImage &, ILfloat Saturation);
|
---|
104 | static ILboolean Saturate(ilImage &, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
|
---|
105 | static ILboolean ScaleColours(ilImage &, ILfloat r, ILfloat g, ILfloat b);
|
---|
106 | static ILboolean Sharpen(ilImage &, ILfloat Factor, ILuint Iter);
|
---|
107 | };
|
---|
108 |
|
---|
109 |
|
---|
110 | #ifdef ILUT_USE_OPENGL
|
---|
111 | class ilOgl
|
---|
112 | {
|
---|
113 | public:
|
---|
114 | static ILvoid Init(ILvoid);
|
---|
115 | static GLuint BindTex(ilImage &);
|
---|
116 | static ILboolean Upload(ilImage &, ILuint);
|
---|
117 | static GLuint Mipmap(ilImage &);
|
---|
118 | static ILboolean Screen(ILvoid);
|
---|
119 | static ILboolean Screenie(ILvoid);
|
---|
120 | };
|
---|
121 | #endif//ILUT_USE_OPENGL
|
---|
122 |
|
---|
123 |
|
---|
124 | #ifdef ILUT_USE_ALLEGRO
|
---|
125 | class ilAlleg
|
---|
126 | {
|
---|
127 | public:
|
---|
128 | static ILvoid Init(ILvoid);
|
---|
129 | static BITMAP *Convert(ilImage &);
|
---|
130 | };
|
---|
131 | #endif//ILUT_USE_ALLEGRO
|
---|
132 |
|
---|
133 |
|
---|
134 | #ifdef ILUT_USE_WIN32
|
---|
135 | class ilWin32
|
---|
136 | {
|
---|
137 | public:
|
---|
138 | static ILvoid Init(ILvoid);
|
---|
139 | static HBITMAP Convert(ilImage &);
|
---|
140 | static ILboolean GetClipboard(ilImage &);
|
---|
141 | static ILvoid GetInfo(ilImage &, BITMAPINFO *Info);
|
---|
142 | static ILubyte *GetPadData(ilImage &);
|
---|
143 | static HPALETTE GetPal(ilImage &);
|
---|
144 | static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType);
|
---|
145 | static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type);
|
---|
146 | static ILboolean SetClipboard(ilImage &);
|
---|
147 | };
|
---|
148 | #endif//ILUT_USE_WIN32
|
---|
149 |
|
---|
150 |
|
---|
151 | class ilValidate
|
---|
152 | {
|
---|
153 | public:
|
---|
154 | static ILboolean Valid(ILenum, char *);
|
---|
155 | static ILboolean Valid(ILenum, FILE *);
|
---|
156 | static ILboolean Valid(ILenum, ILvoid *, ILuint);
|
---|
157 |
|
---|
158 | protected:
|
---|
159 |
|
---|
160 | private:
|
---|
161 |
|
---|
162 | };
|
---|
163 |
|
---|
164 |
|
---|
165 | class ilState
|
---|
166 | {
|
---|
167 | public:
|
---|
168 | static ILboolean Disable(ILenum);
|
---|
169 | static ILboolean Enable(ILenum);
|
---|
170 | static ILvoid Get(ILenum, ILboolean &);
|
---|
171 | static ILvoid Get(ILenum, ILint &);
|
---|
172 | static ILboolean GetBool(ILenum);
|
---|
173 | static ILint GetInt(ILenum);
|
---|
174 | static const char *GetString(ILenum);
|
---|
175 | static ILboolean IsDisabled(ILenum);
|
---|
176 | static ILboolean IsEnabled(ILenum);
|
---|
177 | static ILboolean Origin(ILenum);
|
---|
178 | static ILvoid Pop(ILvoid);
|
---|
179 | static ILvoid Push(ILuint);
|
---|
180 |
|
---|
181 |
|
---|
182 | protected:
|
---|
183 |
|
---|
184 | private:
|
---|
185 |
|
---|
186 | };
|
---|
187 |
|
---|
188 |
|
---|
189 | class ilError
|
---|
190 | {
|
---|
191 | public:
|
---|
192 | static ILvoid Check(ILvoid (*Callback)(const char*));
|
---|
193 | static ILvoid Check(ILvoid (*Callback)(ILenum));
|
---|
194 | static ILenum Get(ILvoid);
|
---|
195 | static const char *String(ILvoid);
|
---|
196 | static const char *String(ILenum);
|
---|
197 |
|
---|
198 | protected:
|
---|
199 |
|
---|
200 | private:
|
---|
201 |
|
---|
202 | };
|
---|
203 |
|
---|
204 |
|
---|
205 | #endif//WRAPPER_H |
---|