finished compressed texture support (Bill White)
[mesa.git] / src / mesa / main / teximage.h
1 /* $Id: teximage.h,v 1.12 2000/08/29 23:31:23 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.4
6 *
7 * Copyright (C) 1999-2000 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 "types.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 GLuint
51 _mesa_compressed_image_size(GLcontext *ctx,
52 GLenum internalFormat,
53 GLint numDimensions,
54 GLint width, GLint height, GLint depth);
55
56
57 extern struct gl_texture_object *
58 _mesa_select_tex_object(GLcontext *ctx, struct gl_texture_unit *texUnit,
59 GLenum target);
60
61
62 extern struct gl_texture_image *
63 _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
64 GLenum target, GLint level);
65
66
67 extern void
68 _mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
69 const struct gl_texture_object *texObj );
70
71
72 /*** API entry point functions ***/
73
74
75 extern void
76 _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
77 GLsizei width, GLint border,
78 GLenum format, GLenum type, const GLvoid *pixels );
79
80
81 extern void
82 _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
83 GLsizei width, GLsizei height, GLint border,
84 GLenum format, GLenum type, const GLvoid *pixels );
85
86
87 extern void
88 _mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
89 GLsizei width, GLsizei height, GLsizei depth, GLint border,
90 GLenum format, GLenum type, const GLvoid *pixels );
91
92
93 extern void
94 _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
95 GLsizei width, GLsizei height, GLsizei depth,
96 GLint border, GLenum format, GLenum type,
97 const GLvoid *pixels );
98
99
100 extern void
101 _mesa_GetTexImage( GLenum target, GLint level,
102 GLenum format, GLenum type, GLvoid *pixels );
103
104
105 extern void
106 _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
107 GLsizei width,
108 GLenum format, GLenum type,
109 const GLvoid *pixels );
110
111
112 extern void
113 _mesa_TexSubImage2D( GLenum target, GLint level,
114 GLint xoffset, GLint yoffset,
115 GLsizei width, GLsizei height,
116 GLenum format, GLenum type,
117 const GLvoid *pixels );
118
119
120 extern void
121 _mesa_TexSubImage3D( GLenum target, GLint level,
122 GLint xoffset, GLint yoffset, GLint zoffset,
123 GLsizei width, GLsizei height, GLsizei depth,
124 GLenum format, GLenum type,
125 const GLvoid *pixels );
126
127
128 extern void
129 _mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
130 GLint x, GLint y, GLsizei width, GLint border );
131
132
133 extern void
134 _mesa_CopyTexImage2D( GLenum target, GLint level,
135 GLenum internalformat, GLint x, GLint y,
136 GLsizei width, GLsizei height, GLint border );
137
138
139 extern void
140 _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
141 GLint x, GLint y, GLsizei width );
142
143
144 extern void
145 _mesa_CopyTexSubImage2D( GLenum target, GLint level,
146 GLint xoffset, GLint yoffset,
147 GLint x, GLint y, GLsizei width, GLsizei height );
148
149
150 extern void
151 _mesa_CopyTexSubImage3D( GLenum target, GLint level,
152 GLint xoffset, GLint yoffset, GLint zoffset,
153 GLint x, GLint y, GLsizei width, GLsizei height );
154
155
156
157 extern void
158 _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
159 GLenum internalformat, GLsizei width,
160 GLint border, GLsizei imageSize,
161 const GLvoid *data);
162
163 extern void
164 _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
165 GLenum internalformat, GLsizei width,
166 GLsizei height, GLint border, GLsizei imageSize,
167 const GLvoid *data);
168
169 extern void
170 _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
171 GLenum internalformat, GLsizei width,
172 GLsizei height, GLsizei depth, GLint border,
173 GLsizei imageSize, const GLvoid *data);
174
175 #ifdef VMS
176 #define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
177 #define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
178 #define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
179 #endif
180 extern void
181 _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
182 GLsizei width, GLenum format,
183 GLsizei imageSize, const GLvoid *data);
184
185 extern void
186 _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
187 GLint yoffset, GLsizei width, GLsizei height,
188 GLenum format, GLsizei imageSize,
189 const GLvoid *data);
190
191 extern void
192 _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
193 GLint yoffset, GLint zoffset, GLsizei width,
194 GLsizei height, GLsizei depth, GLenum format,
195 GLsizei imageSize, const GLvoid *data);
196
197 extern void
198 _mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
199
200
201 #endif
202