teximage.h revision 1749a25ca889d514889b34cf6311c8014d97bf66
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
41extern GLint
42_mesa_base_tex_format( GLcontext *ctx, GLint internalFormat );
43
44
45extern struct gl_texture_image *
46_mesa_new_texture_image( GLcontext *ctx );
47
48
49extern void
50_mesa_delete_texture_image( struct gl_texture_image *teximage );
51
52
53extern void
54_mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
55                           struct gl_texture_image *img,
56                           GLsizei width, GLsizei height, GLsizei depth,
57                           GLint border, GLenum internalFormat);
58
59
60extern void
61_mesa_set_tex_image(struct gl_texture_object *tObj,
62                    GLenum target, GLint level,
63                    struct gl_texture_image *texImage);
64
65
66extern struct gl_texture_object *
67_mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
68                        GLenum target);
69
70
71extern struct gl_texture_image *
72_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
73                       GLenum target, GLint level);
74
75
76extern struct gl_texture_image *
77_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
78                    GLenum target, GLint level);
79
80
81extern struct gl_texture_image *
82_mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level);
83
84
85extern GLint
86_mesa_max_texture_levels(GLcontext *ctx, GLenum target);
87
88
89extern GLboolean
90_mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
91                         GLint internalFormat, GLenum format, GLenum type,
92                         GLint width, GLint height, GLint depth, GLint border);
93
94/*@}*/
95
96
97/** \name API entry point functions */
98/*@{*/
99
100extern void GLAPIENTRY
101_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
102                  GLsizei width, GLint border,
103                  GLenum format, GLenum type, const GLvoid *pixels );
104
105
106extern void GLAPIENTRY
107_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
108                  GLsizei width, GLsizei height, GLint border,
109                  GLenum format, GLenum type, const GLvoid *pixels );
110
111
112extern void GLAPIENTRY
113_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
114                  GLsizei width, GLsizei height, GLsizei depth, GLint border,
115                  GLenum format, GLenum type, const GLvoid *pixels );
116
117
118extern void GLAPIENTRY
119_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
120                     GLsizei width, GLsizei height, GLsizei depth,
121                     GLint border, GLenum format, GLenum type,
122                     const GLvoid *pixels );
123
124
125extern void GLAPIENTRY
126_mesa_GetTexImage( GLenum target, GLint level,
127                   GLenum format, GLenum type, GLvoid *pixels );
128
129
130extern void GLAPIENTRY
131_mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
132                     GLsizei width,
133                     GLenum format, GLenum type,
134                     const GLvoid *pixels );
135
136
137extern void GLAPIENTRY
138_mesa_TexSubImage2D( GLenum target, GLint level,
139                     GLint xoffset, GLint yoffset,
140                     GLsizei width, GLsizei height,
141                     GLenum format, GLenum type,
142                     const GLvoid *pixels );
143
144
145extern void GLAPIENTRY
146_mesa_TexSubImage3D( GLenum target, GLint level,
147                     GLint xoffset, GLint yoffset, GLint zoffset,
148                     GLsizei width, GLsizei height, GLsizei depth,
149                     GLenum format, GLenum type,
150                     const GLvoid *pixels );
151
152
153extern void GLAPIENTRY
154_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
155                      GLint x, GLint y, GLsizei width, GLint border );
156
157
158extern void GLAPIENTRY
159_mesa_CopyTexImage2D( GLenum target, GLint level,
160                      GLenum internalformat, GLint x, GLint y,
161                      GLsizei width, GLsizei height, GLint border );
162
163
164extern void GLAPIENTRY
165_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
166                         GLint x, GLint y, GLsizei width );
167
168
169extern void GLAPIENTRY
170_mesa_CopyTexSubImage2D( GLenum target, GLint level,
171                         GLint xoffset, GLint yoffset,
172                         GLint x, GLint y, GLsizei width, GLsizei height );
173
174
175extern void GLAPIENTRY
176_mesa_CopyTexSubImage3D( GLenum target, GLint level,
177                         GLint xoffset, GLint yoffset, GLint zoffset,
178                         GLint x, GLint y, GLsizei width, GLsizei height );
179
180
181
182extern void GLAPIENTRY
183_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
184                              GLenum internalformat, GLsizei width,
185                              GLint border, GLsizei imageSize,
186                              const GLvoid *data);
187
188extern void GLAPIENTRY
189_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
190                              GLenum internalformat, GLsizei width,
191                              GLsizei height, GLint border, GLsizei imageSize,
192                              const GLvoid *data);
193
194extern void GLAPIENTRY
195_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
196                              GLenum internalformat, GLsizei width,
197                              GLsizei height, GLsizei depth, GLint border,
198                              GLsizei imageSize, const GLvoid *data);
199
200#ifdef VMS
201#define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
202#define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
203#define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
204#endif
205extern void GLAPIENTRY
206_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
207                                 GLsizei width, GLenum format,
208                                 GLsizei imageSize, const GLvoid *data);
209
210extern void GLAPIENTRY
211_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
212                                 GLint yoffset, GLsizei width, GLsizei height,
213                                 GLenum format, GLsizei imageSize,
214                                 const GLvoid *data);
215
216extern void GLAPIENTRY
217_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
218                                 GLint yoffset, GLint zoffset, GLsizei width,
219                                 GLsizei height, GLsizei depth, GLenum format,
220                                 GLsizei imageSize, const GLvoid *data);
221
222extern void GLAPIENTRY
223_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
224
225/*@}*/
226
227#endif
228