Removed the old teximage code.
[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_rgb565(STORE_PARAMS);
61 extern GLboolean _mesa_texstore_rgba8888(STORE_PARAMS);
62 extern GLboolean _mesa_texstore_argb8888(STORE_PARAMS);
63 extern GLboolean _mesa_texstore_rgb888(STORE_PARAMS);
64 extern GLboolean _mesa_texstore_argb4444(STORE_PARAMS);
65 extern GLboolean _mesa_texstore_argb1555(STORE_PARAMS);
66 extern GLboolean _mesa_texstore_al88(STORE_PARAMS);
67 extern GLboolean _mesa_texstore_rgb332(STORE_PARAMS);
68 extern GLboolean _mesa_texstore_a8(STORE_PARAMS);
69 extern GLboolean _mesa_texstore_ci8(STORE_PARAMS);
70 extern GLboolean _mesa_texstore_ycbcr(STORE_PARAMS);
71 extern GLboolean _mesa_texstore_rgba_float32(STORE_PARAMS);
72 extern GLboolean _mesa_texstore_rgba_float16(STORE_PARAMS);
73 extern GLboolean _mesa_texstore_rgb_fxt1(STORE_PARAMS);
74 extern GLboolean _mesa_texstore_rgba_fxt1(STORE_PARAMS);
75 extern GLboolean _mesa_texstore_rgb_dxt1(STORE_PARAMS);
76 extern GLboolean _mesa_texstore_rgba_dxt1(STORE_PARAMS);
77 extern GLboolean _mesa_texstore_rgba_dxt3(STORE_PARAMS);
78 extern GLboolean _mesa_texstore_rgba_dxt5(STORE_PARAMS);
79
80
81 extern GLchan *
82 _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
83 GLenum logicalBaseFormat,
84 GLenum textureBaseFormat,
85 GLint srcWidth, GLint srcHeight, GLint srcDepth,
86 GLenum srcFormat, GLenum srcType,
87 const GLvoid *srcAddr,
88 const struct gl_pixelstore_attrib *srcPacking);
89
90
91 #if !NEWTEXSTORE
92
93 extern void
94 _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
95 GLenum baseInternalFormat,
96 const struct gl_texture_format *texDestFormat,
97 GLvoid *texDestAddr,
98 GLint srcWidth, GLint srcHeight, GLint srcDepth,
99 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
100 GLint dstRowStride, GLint dstImageStride,
101 GLenum srcFormat, GLenum srcType,
102 const GLvoid *srcAddr,
103 const struct gl_pixelstore_attrib *srcPacking);
104
105 #endif /* NEWTEXSTORE */
106
107
108 extern void
109 _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
110 GLint internalFormat,
111 GLint width, GLint border,
112 GLenum format, GLenum type, const GLvoid *pixels,
113 const struct gl_pixelstore_attrib *packing,
114 struct gl_texture_object *texObj,
115 struct gl_texture_image *texImage);
116
117
118 extern void
119 _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
120 GLint internalFormat,
121 GLint width, GLint height, GLint border,
122 GLenum format, GLenum type, const GLvoid *pixels,
123 const struct gl_pixelstore_attrib *packing,
124 struct gl_texture_object *texObj,
125 struct gl_texture_image *texImage);
126
127
128 extern void
129 _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
130 GLint internalFormat,
131 GLint width, GLint height, GLint depth, GLint border,
132 GLenum format, GLenum type, const GLvoid *pixels,
133 const struct gl_pixelstore_attrib *packing,
134 struct gl_texture_object *texObj,
135 struct gl_texture_image *texImage);
136
137
138 extern void
139 _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
140 GLint xoffset, GLint width,
141 GLenum format, GLenum type, const GLvoid *pixels,
142 const struct gl_pixelstore_attrib *packing,
143 struct gl_texture_object *texObj,
144 struct gl_texture_image *texImage);
145
146
147 extern void
148 _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
149 GLint xoffset, GLint yoffset,
150 GLint width, GLint height,
151 GLenum format, GLenum type, const GLvoid *pixels,
152 const struct gl_pixelstore_attrib *packing,
153 struct gl_texture_object *texObj,
154 struct gl_texture_image *texImage);
155
156
157 extern void
158 _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
159 GLint xoffset, GLint yoffset, GLint zoffset,
160 GLint width, GLint height, GLint depth,
161 GLenum format, GLenum type, const GLvoid *pixels,
162 const struct gl_pixelstore_attrib *packing,
163 struct gl_texture_object *texObj,
164 struct gl_texture_image *texImage);
165
166
167 extern void
168 _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
169 GLint internalFormat,
170 GLint width, GLint border,
171 GLsizei imageSize, const GLvoid *data,
172 struct gl_texture_object *texObj,
173 struct gl_texture_image *texImage);
174
175 extern void
176 _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
177 GLint internalFormat,
178 GLint width, GLint height, GLint border,
179 GLsizei imageSize, const GLvoid *data,
180 struct gl_texture_object *texObj,
181 struct gl_texture_image *texImage);
182
183 extern void
184 _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
185 GLint internalFormat,
186 GLint width, GLint height, GLint depth,
187 GLint border,
188 GLsizei imageSize, const GLvoid *data,
189 struct gl_texture_object *texObj,
190 struct gl_texture_image *texImage);
191
192
193 extern void
194 _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
195 GLint level,
196 GLint xoffset, GLsizei width,
197 GLenum format,
198 GLsizei imageSize, const GLvoid *data,
199 struct gl_texture_object *texObj,
200 struct gl_texture_image *texImage);
201
202 extern void
203 _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
204 GLint level,
205 GLint xoffset, GLint yoffset,
206 GLsizei width, GLsizei height,
207 GLenum format,
208 GLsizei imageSize, const GLvoid *data,
209 struct gl_texture_object *texObj,
210 struct gl_texture_image *texImage);
211
212 extern void
213 _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
214 GLint level,
215 GLint xoffset, GLint yoffset, GLint zoffset,
216 GLsizei width, GLsizei height, GLsizei depth,
217 GLenum format,
218 GLsizei imageSize, const GLvoid *data,
219 struct gl_texture_object *texObj,
220 struct gl_texture_image *texImage);
221
222
223 extern void
224 _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
225 const struct gl_texture_unit *texUnit,
226 struct gl_texture_object *texObj);
227
228 #endif