File: il_wrap.h

package info (click to toggle)
devil 1.6.7-5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 11,536 kB
  • ctags: 7,441
  • sloc: ansic: 35,573; sh: 8,075; cpp: 7,465; pascal: 792; makefile: 399; python: 47
file content (205 lines) | stat: -rw-r--r-- 4,559 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#ifndef WRAPPER_H
#define WRAPPER_H

/*#include <il/il.h>
#include <il/ilu.h>*/
#include <IL/ilut.h>  // Probably only have to #include this one

#ifdef _MSC_VER
	#ifndef _IL_WRAP_BUILD_LIB
		#pragma comment(lib, "il_wrap.lib")
	#endif
#endif

class ilImage
{
public:
				ilImage();
				ilImage(char *);
				ilImage(const ilImage &);
	virtual		~ilImage();

	ILboolean	Load(char *);
	ILboolean	Load(char *, ILenum);
	ILboolean	Save(char *);
	ILboolean	Save(char *, ILenum);


	// ImageLib functions
	ILboolean	ActiveImage(ILuint);
	ILboolean	ActiveLayer(ILuint);
	ILboolean	ActiveMipmap(ILuint);
	ILboolean	Clear(ILvoid);
	ILvoid		ClearColour(ILubyte, ILubyte, ILubyte, ILubyte);
	ILboolean	Convert(ILenum);
	ILboolean	Copy(ILuint);
	ILboolean	Default(ILvoid);
	ILboolean	Flip(ILvoid);
	ILboolean	SwapColours(ILvoid);
	ILboolean	Resize(ILuint, ILuint, ILuint);
	ILboolean	TexImage(ILuint, ILuint, ILuint, ILubyte, ILenum, ILenum, ILvoid*);

	
	// Image handling
	ILvoid		Bind(ILvoid) const;
	ILvoid		Bind(ILuint);
	ILvoid		Close(ILvoid) { this->Delete(); }
	ILvoid		Delete(ILvoid);
	ILvoid		iGenBind();


	// Image characteristics
	ILuint		Width(ILvoid);
	ILuint		Height(ILvoid);
	ILuint		Depth(ILvoid);
	ILubyte		Bpp(ILvoid);
	ILubyte		Bitpp(ILvoid);
	ILenum		PaletteType(ILvoid);
	ILenum		Format(ILvoid);
	ILenum		Type(ILvoid);
	ILuint		NumImages(ILvoid);
	ILuint		NumMipmaps(ILvoid);
	ILuint		GetId(ILvoid) const;
    ILenum      GetOrigin(ILvoid);
	ILubyte		*GetData(ILvoid);
	ILubyte		*GetPalette(ILvoid);


	// Rendering
	ILuint		BindImage(ILvoid);
	ILuint		BindImage(ILenum);


	// Operators
	ilImage&	operator = (ILuint);
	ilImage&	operator = (const ilImage &);


protected:
	ILuint		Id;

private:
	ILvoid		iStartUp();


};


class ilFilters
{
public:
	static ILboolean	Alienify(ilImage &);
	static ILboolean	BlurAvg(ilImage &, ILuint Iter);
	static ILboolean	BlurGaussian(ilImage &, ILuint Iter);
	static ILboolean	Contrast(ilImage &, ILfloat Contrast);
	static ILboolean	EdgeDetectE(ilImage &);
	static ILboolean	EdgeDetectP(ilImage &);
	static ILboolean	EdgeDetectS(ilImage &);
	static ILboolean	Emboss(ilImage &);
	static ILboolean	Gamma(ilImage &, ILfloat Gamma);
	static ILboolean	Negative(ilImage &);
	static ILboolean	Noisify(ilImage &, ILubyte Factor);
	static ILboolean	Pixelize(ilImage &, ILuint PixSize);
	static ILboolean	Saturate(ilImage &, ILfloat Saturation);
	static ILboolean	Saturate(ilImage &, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
	static ILboolean	ScaleColours(ilImage &, ILfloat r, ILfloat g, ILfloat b);
	static ILboolean	Sharpen(ilImage &, ILfloat Factor, ILuint Iter);
};


#ifdef ILUT_USE_OPENGL
class ilOgl
{
public:
	static ILvoid		Init(ILvoid);
	static GLuint		BindTex(ilImage &);
	static ILboolean	Upload(ilImage &, ILuint);
	static GLuint		Mipmap(ilImage &);
	static ILboolean	Screen(ILvoid);
	static ILboolean	Screenie(ILvoid);
};
#endif//ILUT_USE_OPENGL


#ifdef ILUT_USE_ALLEGRO
class ilAlleg
{
public:
	static ILvoid	Init(ILvoid);
	static BITMAP	*Convert(ilImage &);
};
#endif//ILUT_USE_ALLEGRO


#ifdef ILUT_USE_WIN32
class ilWin32
{
public:
	static ILvoid		Init(ILvoid);
	static HBITMAP		Convert(ilImage &);
	static ILboolean	GetClipboard(ilImage &);
	static ILvoid		GetInfo(ilImage &, BITMAPINFO *Info);
	static ILubyte		*GetPadData(ilImage &);
	static HPALETTE		GetPal(ilImage &);
	static ILboolean	GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType);
	static ILboolean	GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type);
	static ILboolean	SetClipboard(ilImage &);
};
#endif//ILUT_USE_WIN32


class ilValidate
{
public:
	static ILboolean	Valid(ILenum, char *);
	static ILboolean	Valid(ILenum, FILE *);
	static ILboolean	Valid(ILenum, ILvoid *, ILuint);

protected:

private:

};


class ilState
{
public:
	static ILboolean		Disable(ILenum);
	static ILboolean		Enable(ILenum);
	static ILvoid			Get(ILenum, ILboolean &);
	static ILvoid			Get(ILenum, ILint &);
	static ILboolean		GetBool(ILenum);
	static ILint			GetInt(ILenum);
	static const char		*GetString(ILenum);
	static ILboolean		IsDisabled(ILenum);
	static ILboolean		IsEnabled(ILenum);
	static ILboolean		Origin(ILenum);
	static ILvoid			Pop(ILvoid);
	static ILvoid			Push(ILuint);


protected:

private:

};


class ilError
{
public:
	static ILvoid		Check(ILvoid (*Callback)(const char*));
	static ILvoid		Check(ILvoid (*Callback)(ILenum));
	static ILenum		Get(ILvoid);
	static const char	*String(ILvoid);
	static const char	*String(ILenum);

protected:

private:

};


#endif//WRAPPER_H