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