texstore.h revision c96974f78cf3bbb94c01d6c84201595b4028d840
1/*
2 * Mesa 3-D graphics library
3 * Version:  6.5.1
4 *
5 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26/**
27 * \file texstore.h
28 * Texture image storage routines.
29 *
30 * \author Brian Paul
31 */
32
33
34#ifndef TEXSTORE_H
35#define TEXSTORE_H
36
37
38#include "mtypes.h"
39
40
41extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS);
42extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS);
43extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS);
44extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS);
45extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS);
46extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS);
47extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS);
48extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS);
49extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS);
50extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS);
51extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS);
52extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS);
53extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS);
54extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS);
55extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS);
56extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS);
57extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS);
58extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS);
59extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS);
60extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS);
61extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS);
62extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS);
63extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS);
64extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS);
65extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS);
66extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS);
67extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS);
68extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS);
69extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS);
70#if FEATURE_EXT_texture_sRGB
71extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS);
72extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS);
73extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS);
74extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS);
75#endif
76
77
78extern GLchan *
79_mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
80                           GLenum logicalBaseFormat,
81                           GLenum textureBaseFormat,
82                           GLint srcWidth, GLint srcHeight, GLint srcDepth,
83                           GLenum srcFormat, GLenum srcType,
84                           const GLvoid *srcAddr,
85                           const struct gl_pixelstore_attrib *srcPacking);
86
87
88extern void
89_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims);
90
91
92extern void
93_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
94                       GLint internalFormat,
95                       GLint width, GLint border,
96                       GLenum format, GLenum type, const GLvoid *pixels,
97                       const struct gl_pixelstore_attrib *packing,
98                       struct gl_texture_object *texObj,
99                       struct gl_texture_image *texImage);
100
101
102extern void
103_mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
104                       GLint internalFormat,
105                       GLint width, GLint height, GLint border,
106                       GLenum format, GLenum type, const GLvoid *pixels,
107                       const struct gl_pixelstore_attrib *packing,
108                       struct gl_texture_object *texObj,
109                       struct gl_texture_image *texImage);
110
111
112extern void
113_mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
114                       GLint internalFormat,
115                       GLint width, GLint height, GLint depth, GLint border,
116                       GLenum format, GLenum type, const GLvoid *pixels,
117                       const struct gl_pixelstore_attrib *packing,
118                       struct gl_texture_object *texObj,
119                       struct gl_texture_image *texImage);
120
121
122extern void
123_mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
124                          GLint xoffset, GLint width,
125                          GLenum format, GLenum type, const GLvoid *pixels,
126                          const struct gl_pixelstore_attrib *packing,
127                          struct gl_texture_object *texObj,
128                          struct gl_texture_image *texImage);
129
130
131extern void
132_mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
133                          GLint xoffset, GLint yoffset,
134                          GLint width, GLint height,
135                          GLenum format, GLenum type, const GLvoid *pixels,
136                          const struct gl_pixelstore_attrib *packing,
137                          struct gl_texture_object *texObj,
138                          struct gl_texture_image *texImage);
139
140
141extern void
142_mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
143                          GLint xoffset, GLint yoffset, GLint zoffset,
144                          GLint width, GLint height, GLint depth,
145                          GLenum format, GLenum type, const GLvoid *pixels,
146                          const struct gl_pixelstore_attrib *packing,
147                          struct gl_texture_object *texObj,
148                          struct gl_texture_image *texImage);
149
150
151extern void
152_mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
153                                  GLint internalFormat,
154                                  GLint width, GLint border,
155                                  GLsizei imageSize, const GLvoid *data,
156                                  struct gl_texture_object *texObj,
157                                  struct gl_texture_image *texImage);
158
159extern void
160_mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
161                                  GLint internalFormat,
162                                  GLint width, GLint height, GLint border,
163                                  GLsizei imageSize, const GLvoid *data,
164                                  struct gl_texture_object *texObj,
165                                  struct gl_texture_image *texImage);
166
167extern void
168_mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
169                                  GLint internalFormat,
170                                  GLint width, GLint height, GLint depth,
171                                  GLint border,
172                                  GLsizei imageSize, const GLvoid *data,
173                                  struct gl_texture_object *texObj,
174                                  struct gl_texture_image *texImage);
175
176
177extern void
178_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
179                                     GLint level,
180                                     GLint xoffset, GLsizei width,
181                                     GLenum format,
182                                     GLsizei imageSize, const GLvoid *data,
183                                     struct gl_texture_object *texObj,
184                                     struct gl_texture_image *texImage);
185
186extern void
187_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
188                                     GLint level,
189                                     GLint xoffset, GLint yoffset,
190                                     GLsizei width, GLsizei height,
191                                     GLenum format,
192                                     GLsizei imageSize, const GLvoid *data,
193                                     struct gl_texture_object *texObj,
194                                     struct gl_texture_image *texImage);
195
196extern void
197_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
198                                GLint level,
199                                GLint xoffset, GLint yoffset, GLint zoffset,
200                                GLsizei width, GLsizei height, GLsizei depth,
201                                GLenum format,
202                                GLsizei imageSize, const GLvoid *data,
203                                struct gl_texture_object *texObj,
204                                struct gl_texture_image *texImage);
205
206
207extern void
208_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
209                   GLenum format, GLenum type, GLvoid *pixels,
210                   struct gl_texture_object *texObj,
211                   struct gl_texture_image *texImage);
212
213
214extern void
215_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
216                              GLvoid *img,
217                              const struct gl_texture_object *texObj,
218                              const struct gl_texture_image *texImage);
219
220extern const GLvoid *
221_mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions,
222			    GLsizei width, GLsizei height, GLsizei depth,
223			    GLenum format, GLenum type, const GLvoid *pixels,
224			    const struct gl_pixelstore_attrib *unpack,
225			    const char *funcName);
226
227extern const GLvoid *
228_mesa_validate_pbo_compressed_teximage(GLcontext *ctx,
229                                    GLsizei imageSize, const GLvoid *pixels,
230                                    const struct gl_pixelstore_attrib *packing,
231                                    const char *funcName);
232
233extern void
234_mesa_unmap_teximage_pbo(GLcontext *ctx,
235                         const struct gl_pixelstore_attrib *unpack);
236
237
238#endif
239