2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 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_sizeof_type( GLenum type
);
43 _mesa_sizeof_packed_type( GLenum type
);
46 _mesa_components_in_format( GLenum format
);
49 _mesa_bytes_per_pixel( GLenum format
, GLenum type
);
52 _mesa_is_legal_format_and_type( GLcontext
*ctx
, GLenum format
, GLenum type
);
56 _mesa_image_address( GLuint dimensions
,
57 const struct gl_pixelstore_attrib
*packing
,
59 GLsizei width
, GLsizei height
,
60 GLenum format
, GLenum type
,
61 GLint img
, GLint row
, GLint column
);
64 _mesa_image_address1d( const struct gl_pixelstore_attrib
*packing
,
67 GLenum format
, GLenum type
,
71 _mesa_image_address2d( const struct gl_pixelstore_attrib
*packing
,
73 GLsizei width
, GLsizei height
,
74 GLenum format
, GLenum type
,
75 GLint row
, GLint column
);
78 _mesa_image_address3d( const struct gl_pixelstore_attrib
*packing
,
80 GLsizei width
, GLsizei height
,
81 GLenum format
, GLenum type
,
82 GLint img
, GLint row
, GLint column
);
86 _mesa_image_row_stride( const struct gl_pixelstore_attrib
*packing
,
87 GLint width
, GLenum format
, GLenum type
);
91 _mesa_image_image_stride( const struct gl_pixelstore_attrib
*packing
,
92 GLint width
, GLint height
,
93 GLenum format
, GLenum type
);
96 _mesa_unpack_polygon_stipple( const GLubyte
*pattern
, GLuint dest
[32],
97 const struct gl_pixelstore_attrib
*unpacking
);
101 _mesa_pack_polygon_stipple( const GLuint pattern
[32], GLubyte
*dest
,
102 const struct gl_pixelstore_attrib
*packing
);
106 _mesa_unpack_bitmap( GLint width
, GLint height
, const GLubyte
*pixels
,
107 const struct gl_pixelstore_attrib
*packing
);
110 _mesa_pack_bitmap( GLint width
, GLint height
, const GLubyte
*source
,
111 GLubyte
*dest
, const struct gl_pixelstore_attrib
*packing
);
115 _mesa_apply_rgba_transfer_ops(GLcontext
*ctx
, GLuint transferOps
,
116 GLuint n
, GLfloat rgba
[][4]);
119 _mesa_pack_rgba_span_float( GLcontext
*ctx
,
120 GLuint n
, CONST GLfloat rgba
[][4],
121 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
122 const struct gl_pixelstore_attrib
*dstPacking
,
123 GLuint transferOps
);
127 _mesa_pack_rgba_span_chan( GLcontext
*ctx
,
128 GLuint n
, CONST GLchan rgba
[][4],
129 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
130 const struct gl_pixelstore_attrib
*dstPacking
,
131 GLuint transferOps
);
135 _mesa_unpack_color_span_chan( GLcontext
*ctx
,
136 GLuint n
, GLenum dstFormat
, GLchan dest
[],
137 GLenum srcFormat
, GLenum srcType
,
138 const GLvoid
*source
,
139 const struct gl_pixelstore_attrib
*srcPacking
,
140 GLuint transferOps
);
144 _mesa_unpack_color_span_float( GLcontext
*ctx
,
145 GLuint n
, GLenum dstFormat
, GLfloat dest
[],
146 GLenum srcFormat
, GLenum srcType
,
147 const GLvoid
*source
,
148 const struct gl_pixelstore_attrib
*srcPacking
,
149 GLuint transferOps
);
153 _mesa_unpack_index_span( const GLcontext
*ctx
, GLuint n
,
154 GLenum dstType
, GLvoid
*dest
,
155 GLenum srcType
, const GLvoid
*source
,
156 const struct gl_pixelstore_attrib
*srcPacking
,
157 GLuint transferOps
);
161 _mesa_pack_index_span( const GLcontext
*ctx
, GLuint n
,
162 GLenum dstType
, GLvoid
*dest
, const GLuint
*source
,
163 const struct gl_pixelstore_attrib
*dstPacking
,
164 GLuint transferOps
);
168 _mesa_unpack_stencil_span( const GLcontext
*ctx
, GLuint n
,
169 GLenum dstType
, GLvoid
*dest
,
170 GLenum srcType
, const GLvoid
*source
,
171 const struct gl_pixelstore_attrib
*srcPacking
,
172 GLuint transferOps
);
175 _mesa_pack_stencil_span( const GLcontext
*ctx
, GLuint n
,
176 GLenum dstType
, GLvoid
*dest
, const GLstencil
*source
,
177 const struct gl_pixelstore_attrib
*dstPacking
);
181 _mesa_unpack_depth_span( const GLcontext
*ctx
, GLuint n
,
182 GLenum dstType
, GLvoid
*dest
, GLfloat depthScale
,
183 GLenum srcType
, const GLvoid
*source
,
184 const struct gl_pixelstore_attrib
*srcPacking
);
187 _mesa_pack_depth_span( const GLcontext
*ctx
, GLuint n
, GLvoid
*dest
,
188 GLenum dstType
, const GLfloat
*depthSpan
,
189 const struct gl_pixelstore_attrib
*dstPacking
);
193 _mesa_pack_depth_stencil_span(const GLcontext
*ctx
, GLuint n
, GLuint
*dest
,
194 const GLfloat
*depthVals
,
195 const GLstencil
*stencilVals
,
196 const struct gl_pixelstore_attrib
*dstPacking
);
200 _mesa_unpack_image( GLuint dimensions
,
201 GLsizei width
, GLsizei height
, GLsizei depth
,
202 GLenum format
, GLenum type
, const GLvoid
*pixels
,
203 const struct gl_pixelstore_attrib
*unpack
);
207 _mesa_convert_colors(GLenum srcType
, const GLvoid
*src
,
208 GLenum dstType
, GLvoid
*dst
,
209 GLuint count
, const GLubyte mask
[]);
213 _mesa_clip_drawpixels(const GLcontext
*ctx
,
214 GLint
*destX
, GLint
*destY
,
215 GLsizei
*width
, GLsizei
*height
,
216 struct gl_pixelstore_attrib
*unpack
);
220 _mesa_clip_readpixels(const GLcontext
*ctx
,
221 GLint
*destX
, GLint
*destY
,
222 GLsizei
*width
, GLsizei
*height
,
223 struct gl_pixelstore_attrib
*pack
);
226 _mesa_clip_to_region(GLint xmin
, GLint ymin
,
227 GLint xmax
, GLint ymax
,
229 GLsizei
*width
, GLsizei
*height
);