Support ARB_texture_env_crossbar. Changes the way programs are
[mesa.git] / src / mesa / main / teximage.h
1 /**
2 * \file teximage.h
3 * Texture images manipulation functions.
4 */
5
6 /*
7 * Mesa 3-D graphics library
8 * Version: 6.1
9 *
10 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 */
29
30
31 #ifndef TEXIMAGE_H
32 #define TEXIMAGE_H
33
34
35 #include "mtypes.h"
36
37
38 /** \name Internal functions */
39 /*@{*/
40
41 extern GLint
42 _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat );
43
44
45 extern struct gl_texture_image *
46 _mesa_new_texture_image( GLcontext *ctx );
47
48
49 extern void
50 _mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *teximage );
51
52
53 extern void
54 _mesa_free_texture_image_data( GLcontext *ctx,
55 struct gl_texture_image *texImage );
56
57
58 extern void
59 _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
60 struct gl_texture_image *img,
61 GLsizei width, GLsizei height, GLsizei depth,
62 GLint border, GLenum internalFormat);
63
64
65 extern void
66 _mesa_set_tex_image(struct gl_texture_object *tObj,
67 GLenum target, GLint level,
68 struct gl_texture_image *texImage);
69
70
71 extern struct gl_texture_object *
72 _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
73 GLenum target);
74
75
76 extern struct gl_texture_image *
77 _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
78 GLenum target, GLint level);
79
80
81 extern struct gl_texture_image *
82 _mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
83 GLenum target, GLint level);
84
85
86 extern struct gl_texture_image *
87 _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level);
88
89
90 extern GLint
91 _mesa_max_texture_levels(GLcontext *ctx, GLenum target);
92
93
94 extern GLboolean
95 _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
96 GLint internalFormat, GLenum format, GLenum type,
97 GLint width, GLint height, GLint depth, GLint border);
98
99 /*@}*/
100
101
102 /** \name API entry point functions */
103 /*@{*/
104
105 extern void GLAPIENTRY
106 _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
107 GLsizei width, GLint border,
108 GLenum format, GLenum type, const GLvoid *pixels );
109
110
111 extern void GLAPIENTRY
112 _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
113 GLsizei width, GLsizei height, GLint border,
114 GLenum format, GLenum type, const GLvoid *pixels );
115
116
117 extern void GLAPIENTRY
118 _mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
119 GLsizei width, GLsizei height, GLsizei depth, GLint border,
120 GLenum format, GLenum type, const GLvoid *pixels );
121
122
123 extern void GLAPIENTRY
124 _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
125 GLsizei width, GLsizei height, GLsizei depth,
126 GLint border, GLenum format, GLenum type,
127 const GLvoid *pixels );
128
129
130 extern void GLAPIENTRY
131 _mesa_GetTexImage( GLenum target, GLint level,
132 GLenum format, GLenum type, GLvoid *pixels );
133
134
135 extern void GLAPIENTRY
136 _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
137 GLsizei width,
138 GLenum format, GLenum type,
139 const GLvoid *pixels );
140
141
142 extern void GLAPIENTRY
143 _mesa_TexSubImage2D( GLenum target, GLint level,
144 GLint xoffset, GLint yoffset,
145 GLsizei width, GLsizei height,
146 GLenum format, GLenum type,
147 const GLvoid *pixels );
148
149
150 extern void GLAPIENTRY
151 _mesa_TexSubImage3D( GLenum target, GLint level,
152 GLint xoffset, GLint yoffset, GLint zoffset,
153 GLsizei width, GLsizei height, GLsizei depth,
154 GLenum format, GLenum type,
155 const GLvoid *pixels );
156
157
158 extern void GLAPIENTRY
159 _mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
160 GLint x, GLint y, GLsizei width, GLint border );
161
162
163 extern void GLAPIENTRY
164 _mesa_CopyTexImage2D( GLenum target, GLint level,
165 GLenum internalformat, GLint x, GLint y,
166 GLsizei width, GLsizei height, GLint border );
167
168
169 extern void GLAPIENTRY
170 _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
171 GLint x, GLint y, GLsizei width );
172
173
174 extern void GLAPIENTRY
175 _mesa_CopyTexSubImage2D( GLenum target, GLint level,
176 GLint xoffset, GLint yoffset,
177 GLint x, GLint y, GLsizei width, GLsizei height );
178
179
180 extern void GLAPIENTRY
181 _mesa_CopyTexSubImage3D( GLenum target, GLint level,
182 GLint xoffset, GLint yoffset, GLint zoffset,
183 GLint x, GLint y, GLsizei width, GLsizei height );
184
185
186
187 extern void GLAPIENTRY
188 _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
189 GLenum internalformat, GLsizei width,
190 GLint border, GLsizei imageSize,
191 const GLvoid *data);
192
193 extern void GLAPIENTRY
194 _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
195 GLenum internalformat, GLsizei width,
196 GLsizei height, GLint border, GLsizei imageSize,
197 const GLvoid *data);
198
199 extern void GLAPIENTRY
200 _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
201 GLenum internalformat, GLsizei width,
202 GLsizei height, GLsizei depth, GLint border,
203 GLsizei imageSize, const GLvoid *data);
204
205 #ifdef VMS
206 #define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
207 #define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
208 #define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
209 #endif
210 extern void GLAPIENTRY
211 _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
212 GLsizei width, GLenum format,
213 GLsizei imageSize, const GLvoid *data);
214
215 extern void GLAPIENTRY
216 _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
217 GLint yoffset, GLsizei width, GLsizei height,
218 GLenum format, GLsizei imageSize,
219 const GLvoid *data);
220
221 extern void GLAPIENTRY
222 _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
223 GLint yoffset, GLint zoffset, GLsizei width,
224 GLsizei height, GLsizei depth, GLenum format,
225 GLsizei imageSize, const GLvoid *data);
226
227 extern void GLAPIENTRY
228 _mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
229
230 /*@}*/
231
232 #endif