2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
34 _mesa_swap2( GLushort
*p
, GLuint n
);
37 _mesa_swap4( GLuint
*p
, GLuint n
);
40 _mesa_type_is_packed(GLenum type
);
43 _mesa_sizeof_type( GLenum type
);
46 _mesa_sizeof_packed_type( GLenum type
);
49 _mesa_components_in_format( GLenum format
);
52 _mesa_bytes_per_pixel( GLenum format
, GLenum type
);
55 _mesa_is_legal_format_and_type( GLcontext
*ctx
, GLenum format
, GLenum type
);
58 _mesa_is_color_format(GLenum format
);
61 _mesa_is_index_format(GLenum format
);
64 _mesa_is_depth_format(GLenum format
);
67 _mesa_is_stencil_format(GLenum format
);
70 _mesa_is_ycbcr_format(GLenum format
);
73 _mesa_is_depthstencil_format(GLenum format
);
76 _mesa_is_depth_or_stencil_format(GLenum format
);
79 _mesa_is_dudv_format(GLenum format
);
82 _mesa_is_integer_format(GLenum format
);
85 _mesa_is_compressed_format(GLcontext
*ctx
, GLenum format
);
88 _mesa_image_address( GLuint dimensions
,
89 const struct gl_pixelstore_attrib
*packing
,
91 GLsizei width
, GLsizei height
,
92 GLenum format
, GLenum type
,
93 GLint img
, GLint row
, GLint column
);
96 _mesa_image_address1d( const struct gl_pixelstore_attrib
*packing
,
99 GLenum format
, GLenum type
,
103 _mesa_image_address2d( const struct gl_pixelstore_attrib
*packing
,
105 GLsizei width
, GLsizei height
,
106 GLenum format
, GLenum type
,
107 GLint row
, GLint column
);
110 _mesa_image_address3d( const struct gl_pixelstore_attrib
*packing
,
112 GLsizei width
, GLsizei height
,
113 GLenum format
, GLenum type
,
114 GLint img
, GLint row
, GLint column
);
118 _mesa_image_row_stride( const struct gl_pixelstore_attrib
*packing
,
119 GLint width
, GLenum format
, GLenum type
);
123 _mesa_image_image_stride( const struct gl_pixelstore_attrib
*packing
,
124 GLint width
, GLint height
,
125 GLenum format
, GLenum type
);
128 _mesa_unpack_polygon_stipple( const GLubyte
*pattern
, GLuint dest
[32],
129 const struct gl_pixelstore_attrib
*unpacking
);
133 _mesa_pack_polygon_stipple( const GLuint pattern
[32], GLubyte
*dest
,
134 const struct gl_pixelstore_attrib
*packing
);
138 _mesa_unpack_bitmap( GLint width
, GLint height
, const GLubyte
*pixels
,
139 const struct gl_pixelstore_attrib
*packing
);
142 _mesa_pack_bitmap( GLint width
, GLint height
, const GLubyte
*source
,
143 GLubyte
*dest
, const struct gl_pixelstore_attrib
*packing
);
146 _mesa_expand_bitmap(GLsizei width
, GLsizei height
,
147 const struct gl_pixelstore_attrib
*unpack
,
148 const GLubyte
*bitmap
,
149 GLubyte
*destBuffer
, GLint destStride
,
153 /** \name Pixel processing functions */
157 _mesa_scale_and_bias_rgba(GLuint n
, GLfloat rgba
[][4],
158 GLfloat rScale
, GLfloat gScale
,
159 GLfloat bScale
, GLfloat aScale
,
160 GLfloat rBias
, GLfloat gBias
,
161 GLfloat bBias
, GLfloat aBias
);
164 _mesa_map_rgba(const GLcontext
*ctx
, GLuint n
, GLfloat rgba
[][4]);
167 _mesa_lookup_rgba_float(const struct gl_color_table
*table
,
168 GLuint n
, GLfloat rgba
[][4]);
171 _mesa_lookup_rgba_ubyte(const struct gl_color_table
*table
,
172 GLuint n
, GLubyte rgba
[][4]);
176 _mesa_map_ci_to_rgba(const GLcontext
*ctx
,
177 GLuint n
, const GLuint index
[], GLfloat rgba
[][4]);
181 _mesa_map_ci8_to_rgba8(const GLcontext
*ctx
, GLuint n
, const GLubyte index
[],
186 _mesa_scale_and_bias_depth(const GLcontext
*ctx
, GLuint n
,
187 GLfloat depthValues
[]);
190 _mesa_scale_and_bias_depth_uint(const GLcontext
*ctx
, GLuint n
,
191 GLuint depthValues
[]);
194 _mesa_apply_rgba_transfer_ops(GLcontext
*ctx
, GLbitfield transferOps
,
195 GLuint n
, GLfloat rgba
[][4]);
199 _mesa_apply_ci_transfer_ops(const GLcontext
*ctx
, GLbitfield transferOps
,
200 GLuint n
, GLuint indexes
[]);
204 _mesa_apply_stencil_transfer_ops(const GLcontext
*ctx
, GLuint n
,
205 GLstencil stencil
[]);
209 _mesa_pack_rgba_span_float( GLcontext
*ctx
, GLuint n
, GLfloat rgba
[][4],
210 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
211 const struct gl_pixelstore_attrib
*dstPacking
,
212 GLbitfield transferOps
);
216 _mesa_unpack_color_span_chan( GLcontext
*ctx
,
217 GLuint n
, GLenum dstFormat
, GLchan dest
[],
218 GLenum srcFormat
, GLenum srcType
,
219 const GLvoid
*source
,
220 const struct gl_pixelstore_attrib
*srcPacking
,
221 GLbitfield transferOps
);
225 _mesa_unpack_color_span_float( GLcontext
*ctx
,
226 GLuint n
, GLenum dstFormat
, GLfloat dest
[],
227 GLenum srcFormat
, GLenum srcType
,
228 const GLvoid
*source
,
229 const struct gl_pixelstore_attrib
*srcPacking
,
230 GLbitfield transferOps
);
233 _mesa_unpack_dudv_span_byte( GLcontext
*ctx
,
234 GLuint n
, GLenum dstFormat
, GLbyte dest
[],
235 GLenum srcFormat
, GLenum srcType
,
236 const GLvoid
*source
,
237 const struct gl_pixelstore_attrib
*srcPacking
,
238 GLbitfield transferOps
);
241 _mesa_unpack_index_span( const GLcontext
*ctx
, GLuint n
,
242 GLenum dstType
, GLvoid
*dest
,
243 GLenum srcType
, const GLvoid
*source
,
244 const struct gl_pixelstore_attrib
*srcPacking
,
245 GLbitfield transferOps
);
249 _mesa_pack_index_span( const GLcontext
*ctx
, GLuint n
,
250 GLenum dstType
, GLvoid
*dest
, const GLuint
*source
,
251 const struct gl_pixelstore_attrib
*dstPacking
,
252 GLbitfield transferOps
);
256 _mesa_unpack_stencil_span( const GLcontext
*ctx
, GLuint n
,
257 GLenum dstType
, GLvoid
*dest
,
258 GLenum srcType
, const GLvoid
*source
,
259 const struct gl_pixelstore_attrib
*srcPacking
,
260 GLbitfield transferOps
);
263 _mesa_pack_stencil_span( const GLcontext
*ctx
, GLuint n
,
264 GLenum dstType
, GLvoid
*dest
, const GLstencil
*source
,
265 const struct gl_pixelstore_attrib
*dstPacking
);
269 _mesa_unpack_depth_span( const GLcontext
*ctx
, GLuint n
,
270 GLenum dstType
, GLvoid
*dest
, GLuint depthMax
,
271 GLenum srcType
, const GLvoid
*source
,
272 const struct gl_pixelstore_attrib
*srcPacking
);
275 _mesa_pack_depth_span( const GLcontext
*ctx
, GLuint n
, GLvoid
*dest
,
276 GLenum dstType
, const GLfloat
*depthSpan
,
277 const struct gl_pixelstore_attrib
*dstPacking
);
281 _mesa_pack_depth_stencil_span(const GLcontext
*ctx
, GLuint n
, GLuint
*dest
,
282 const GLfloat
*depthVals
,
283 const GLstencil
*stencilVals
,
284 const struct gl_pixelstore_attrib
*dstPacking
);
288 _mesa_unpack_image( GLuint dimensions
,
289 GLsizei width
, GLsizei height
, GLsizei depth
,
290 GLenum format
, GLenum type
, const GLvoid
*pixels
,
291 const struct gl_pixelstore_attrib
*unpack
);
295 _mesa_convert_colors(GLenum srcType
, const GLvoid
*src
,
296 GLenum dstType
, GLvoid
*dst
,
297 GLuint count
, const GLubyte mask
[]);
301 _mesa_clip_drawpixels(const GLcontext
*ctx
,
302 GLint
*destX
, GLint
*destY
,
303 GLsizei
*width
, GLsizei
*height
,
304 struct gl_pixelstore_attrib
*unpack
);
308 _mesa_clip_readpixels(const GLcontext
*ctx
,
309 GLint
*srcX
, GLint
*srcY
,
310 GLsizei
*width
, GLsizei
*height
,
311 struct gl_pixelstore_attrib
*pack
);
314 _mesa_clip_copytexsubimage(const GLcontext
*ctx
,
315 GLint
*destX
, GLint
*destY
,
316 GLint
*srcX
, GLint
*srcY
,
317 GLsizei
*width
, GLsizei
*height
);
320 _mesa_clip_to_region(GLint xmin
, GLint ymin
,
321 GLint xmax
, GLint ymax
,
323 GLsizei
*width
, GLsizei
*height
);
326 _mesa_clip_blit(GLcontext
*ctx
,
327 GLint
*srcX0
, GLint
*srcY0
, GLint
*srcX1
, GLint
*srcY1
,
328 GLint
*dstX0
, GLint
*dstY0
, GLint
*dstX1
, GLint
*dstY1
);