yank bgr233 texformat. minor comment updates.
[mesa.git] / src / mesa / main / texstore.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.1
4 *
5 * Copyright (C) 1999-2004 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 /*** NEWTEXSTORE ***/
41
42 /* Macro just to save some typing */
43 #define STORE_PARAMS \
44 GLcontext *ctx, GLuint dims, \
45 GLenum baseInternalFormat, \
46 const struct gl_texture_format *dstFormat, \
47 GLvoid *dstAddr, \
48 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
49 GLint dstRowStride, GLint dstImageStride, \
50 GLint srcWidth, GLint srcHeight, GLint srcDepth, \
51 GLenum srcFormat, GLenum srcType, \
52 const GLvoid *srcAddr, \
53 const struct gl_pixelstore_attrib *srcPacking
54
55
56 extern GLboolean _mesa_texstore_rgba(STORE_PARAMS);
57 extern GLboolean _mesa_texstore_color_index(STORE_PARAMS);
58 extern GLboolean _mesa_texstore_depth_component16(STORE_PARAMS);
59 extern GLboolean _mesa_texstore_depth_component_float32(STORE_PARAMS);
60 extern GLboolean _mesa_texstore_rgba8888(STORE_PARAMS);
61 extern GLboolean _mesa_texstore_abgr8888(STORE_PARAMS);
62 extern GLboolean _mesa_texstore_argb8888(STORE_PARAMS);
63 extern GLboolean _mesa_texstore_bgra8888(STORE_PARAMS);
64 extern GLboolean _mesa_texstore_rgb888(STORE_PARAMS);
65 extern GLboolean _mesa_texstore_bgr888(STORE_PARAMS);
66 extern GLboolean _mesa_texstore_rgb565(STORE_PARAMS);
67 extern GLboolean _mesa_texstore_bgr565(STORE_PARAMS);
68 extern GLboolean _mesa_texstore_argb4444(STORE_PARAMS);
69 extern GLboolean _mesa_texstore_bgra4444(STORE_PARAMS);
70 extern GLboolean _mesa_texstore_argb1555(STORE_PARAMS);
71 extern GLboolean _mesa_texstore_bgra5551(STORE_PARAMS);
72 extern GLboolean _mesa_texstore_al88(STORE_PARAMS);
73 extern GLboolean _mesa_texstore_la88(STORE_PARAMS);
74 extern GLboolean _mesa_texstore_rgb332(STORE_PARAMS);
75 extern GLboolean _mesa_texstore_a8(STORE_PARAMS);
76 extern GLboolean _mesa_texstore_ci8(STORE_PARAMS);
77 extern GLboolean _mesa_texstore_ycbcr(STORE_PARAMS);
78 extern GLboolean _mesa_texstore_rgba_float32(STORE_PARAMS);
79 extern GLboolean _mesa_texstore_rgba_float16(STORE_PARAMS);
80 extern GLboolean _mesa_texstore_rgb_fxt1(STORE_PARAMS);
81 extern GLboolean _mesa_texstore_rgba_fxt1(STORE_PARAMS);
82 extern GLboolean _mesa_texstore_rgb_dxt1(STORE_PARAMS);
83 extern GLboolean _mesa_texstore_rgba_dxt1(STORE_PARAMS);
84 extern GLboolean _mesa_texstore_rgba_dxt3(STORE_PARAMS);
85 extern GLboolean _mesa_texstore_rgba_dxt5(STORE_PARAMS);
86
87
88 extern GLchan *
89 _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
90 GLenum logicalBaseFormat,
91 GLenum textureBaseFormat,
92 GLint srcWidth, GLint srcHeight, GLint srcDepth,
93 GLenum srcFormat, GLenum srcType,
94 const GLvoid *srcAddr,
95 const struct gl_pixelstore_attrib *srcPacking);
96
97
98 #if !NEWTEXSTORE
99
100 extern void
101 _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
102 GLenum baseInternalFormat,
103 const struct gl_texture_format *texDestFormat,
104 GLvoid *texDestAddr,
105 GLint srcWidth, GLint srcHeight, GLint srcDepth,
106 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
107 GLint dstRowStride, GLint dstImageStride,
108 GLenum srcFormat, GLenum srcType,
109 const GLvoid *srcAddr,
110 const struct gl_pixelstore_attrib *srcPacking);
111
112 #endif /* NEWTEXSTORE */
113
114
115 extern void
116 _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
117 GLint internalFormat,
118 GLint width, GLint border,
119 GLenum format, GLenum type, const GLvoid *pixels,
120 const struct gl_pixelstore_attrib *packing,
121 struct gl_texture_object *texObj,
122 struct gl_texture_image *texImage);
123
124
125 extern void
126 _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
127 GLint internalFormat,
128 GLint width, GLint height, GLint border,
129 GLenum format, GLenum type, const GLvoid *pixels,
130 const struct gl_pixelstore_attrib *packing,
131 struct gl_texture_object *texObj,
132 struct gl_texture_image *texImage);
133
134
135 extern void
136 _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
137 GLint internalFormat,
138 GLint width, GLint height, GLint depth, GLint border,
139 GLenum format, GLenum type, const GLvoid *pixels,
140 const struct gl_pixelstore_attrib *packing,
141 struct gl_texture_object *texObj,
142 struct gl_texture_image *texImage);
143
144
145 extern void
146 _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
147 GLint xoffset, GLint width,
148 GLenum format, GLenum type, const GLvoid *pixels,
149 const struct gl_pixelstore_attrib *packing,
150 struct gl_texture_object *texObj,
151 struct gl_texture_image *texImage);
152
153
154 extern void
155 _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
156 GLint xoffset, GLint yoffset,
157 GLint width, GLint height,
158 GLenum format, GLenum type, const GLvoid *pixels,
159 const struct gl_pixelstore_attrib *packing,
160 struct gl_texture_object *texObj,
161 struct gl_texture_image *texImage);
162
163
164 extern void
165 _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
166 GLint xoffset, GLint yoffset, GLint zoffset,
167 GLint width, GLint height, GLint depth,
168 GLenum format, GLenum type, const GLvoid *pixels,
169 const struct gl_pixelstore_attrib *packing,
170 struct gl_texture_object *texObj,
171 struct gl_texture_image *texImage);
172
173
174 extern void
175 _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
176 GLint internalFormat,
177 GLint width, GLint border,
178 GLsizei imageSize, const GLvoid *data,
179 struct gl_texture_object *texObj,
180 struct gl_texture_image *texImage);
181
182 extern void
183 _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
184 GLint internalFormat,
185 GLint width, GLint height, GLint border,
186 GLsizei imageSize, const GLvoid *data,
187 struct gl_texture_object *texObj,
188 struct gl_texture_image *texImage);
189
190 extern void
191 _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
192 GLint internalFormat,
193 GLint width, GLint height, GLint depth,
194 GLint border,
195 GLsizei imageSize, const GLvoid *data,
196 struct gl_texture_object *texObj,
197 struct gl_texture_image *texImage);
198
199
200 extern void
201 _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
202 GLint level,
203 GLint xoffset, GLsizei width,
204 GLenum format,
205 GLsizei imageSize, const GLvoid *data,
206 struct gl_texture_object *texObj,
207 struct gl_texture_image *texImage);
208
209 extern void
210 _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
211 GLint level,
212 GLint xoffset, GLint yoffset,
213 GLsizei width, GLsizei height,
214 GLenum format,
215 GLsizei imageSize, const GLvoid *data,
216 struct gl_texture_object *texObj,
217 struct gl_texture_image *texImage);
218
219 extern void
220 _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
221 GLint level,
222 GLint xoffset, GLint yoffset, GLint zoffset,
223 GLsizei width, GLsizei height, GLsizei depth,
224 GLenum format,
225 GLsizei imageSize, const GLvoid *data,
226 struct gl_texture_object *texObj,
227 struct gl_texture_image *texImage);
228
229
230 extern void
231 _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
232 const struct gl_texture_unit *texUnit,
233 struct gl_texture_object *texObj);
234
235
236 extern void
237 _mesa_rescale_teximage2d(GLuint bytesPerPixel, GLuint dstRowStride,
238 GLint srcWidth, GLint srcHeight,
239 GLint dstWidth, GLint dstHeight,
240 const GLvoid *srcImage, GLvoid *dstImage);
241
242 extern void
243 _mesa_upscale_teximage2d( GLsizei inWidth, GLsizei inHeight,
244 GLsizei outWidth, GLsizei outHeight,
245 GLint comps, const GLchan *src, GLint srcRowStride,
246 GLchan *dest );
247
248 #endif