In gl_texture_image, replace ImageStride with an ImageOffsets array.
[mesa.git] / src / mesa / main / texstore.h
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
41 extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS);
42 extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS);
43 extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS);
44 extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS);
45 extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS);
46 extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS);
47 extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS);
48 extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS);
49 extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS);
50 extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS);
51 extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS);
52 extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS);
53 extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS);
54 extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS);
55 extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS);
56 extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS);
57 extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS);
58 extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS);
59 extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS);
60 extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS);
61 extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS);
62 extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS);
63 extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS);
64 extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS);
65 extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS);
66 extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS);
67 extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS);
68 extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS);
69 extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS);
70
71
72 extern GLchan *
73 _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
74 GLenum logicalBaseFormat,
75 GLenum textureBaseFormat,
76 GLint srcWidth, GLint srcHeight, GLint srcDepth,
77 GLenum srcFormat, GLenum srcType,
78 const GLvoid *srcAddr,
79 const struct gl_pixelstore_attrib *srcPacking);
80
81
82 extern void
83 _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
84 GLint internalFormat,
85 GLint width, GLint border,
86 GLenum format, GLenum type, const GLvoid *pixels,
87 const struct gl_pixelstore_attrib *packing,
88 struct gl_texture_object *texObj,
89 struct gl_texture_image *texImage);
90
91
92 extern void
93 _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
94 GLint internalFormat,
95 GLint width, GLint height, 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
102 extern void
103 _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
104 GLint internalFormat,
105 GLint width, GLint height, GLint depth, 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
112 extern void
113 _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
114 GLint xoffset, GLint width,
115 GLenum format, GLenum type, const GLvoid *pixels,
116 const struct gl_pixelstore_attrib *packing,
117 struct gl_texture_object *texObj,
118 struct gl_texture_image *texImage);
119
120
121 extern void
122 _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
123 GLint xoffset, GLint yoffset,
124 GLint width, GLint height,
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
131 extern void
132 _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
133 GLint xoffset, GLint yoffset, GLint zoffset,
134 GLint width, GLint height, GLint depth,
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
141 extern void
142 _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
143 GLint internalFormat,
144 GLint width, GLint border,
145 GLsizei imageSize, const GLvoid *data,
146 struct gl_texture_object *texObj,
147 struct gl_texture_image *texImage);
148
149 extern void
150 _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
151 GLint internalFormat,
152 GLint width, GLint height, GLint border,
153 GLsizei imageSize, const GLvoid *data,
154 struct gl_texture_object *texObj,
155 struct gl_texture_image *texImage);
156
157 extern void
158 _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
159 GLint internalFormat,
160 GLint width, GLint height, GLint depth,
161 GLint border,
162 GLsizei imageSize, const GLvoid *data,
163 struct gl_texture_object *texObj,
164 struct gl_texture_image *texImage);
165
166
167 extern void
168 _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
169 GLint level,
170 GLint xoffset, GLsizei width,
171 GLenum format,
172 GLsizei imageSize, const GLvoid *data,
173 struct gl_texture_object *texObj,
174 struct gl_texture_image *texImage);
175
176 extern void
177 _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
178 GLint level,
179 GLint xoffset, GLint yoffset,
180 GLsizei width, GLsizei height,
181 GLenum format,
182 GLsizei imageSize, const GLvoid *data,
183 struct gl_texture_object *texObj,
184 struct gl_texture_image *texImage);
185
186 extern void
187 _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
188 GLint level,
189 GLint xoffset, GLint yoffset, GLint zoffset,
190 GLsizei width, GLsizei height, GLsizei depth,
191 GLenum format,
192 GLsizei imageSize, const GLvoid *data,
193 struct gl_texture_object *texObj,
194 struct gl_texture_image *texImage);
195
196
197 extern void
198 _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
199 const struct gl_texture_unit *texUnit,
200 struct gl_texture_object *texObj);
201
202
203 extern void
204 _mesa_rescale_teximage2d(GLuint bytesPerPixel,
205 GLuint srcStrideInPixels,
206 GLuint dstRowStride,
207 GLint srcWidth, GLint srcHeight,
208 GLint dstWidth, GLint dstHeight,
209 const GLvoid *srcImage, GLvoid *dstImage);
210
211 extern void
212 _mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
213 GLsizei outWidth, GLsizei outHeight,
214 GLint comps, const GLchan *src, GLint srcRowStride,
215 GLchan *dest);
216
217
218 extern void
219 _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
220 GLenum format, GLenum type, GLvoid *pixels,
221 struct gl_texture_object *texObj,
222 struct gl_texture_image *texImage);
223
224
225 extern void
226 _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
227 GLvoid *img,
228 const struct gl_texture_object *texObj,
229 const struct gl_texture_image *texImage);
230
231 extern const GLvoid *
232 _mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions,
233 GLsizei width, GLsizei height, GLsizei depth,
234 GLenum format, GLenum type, const GLvoid *pixels,
235 const struct gl_pixelstore_attrib *unpack,
236 const char *funcName);
237
238 extern const GLvoid *
239 _mesa_validate_pbo_compressed_teximage(GLcontext *ctx,
240 GLsizei imageSize, const GLvoid *pixels,
241 const struct gl_pixelstore_attrib *packing,
242 const char *funcName);
243
244 extern void
245 _mesa_unmap_teximage_pbo(GLcontext *ctx,
246 const struct gl_pixelstore_attrib *unpack);
247
248
249 #endif