7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 extern const struct gl_pixelstore_attrib _mesa_native_packing
;
42 _mesa_swap2( GLushort
*p
, GLuint n
);
45 _mesa_swap4( GLuint
*p
, GLuint n
);
48 _mesa_sizeof_type( GLenum type
);
51 _mesa_sizeof_packed_type( GLenum type
);
54 _mesa_components_in_format( GLenum format
);
57 _mesa_bytes_per_pixel( GLenum format
, GLenum type
);
60 _mesa_is_legal_format_and_type( GLenum format
, GLenum type
);
64 _mesa_image_address( const struct gl_pixelstore_attrib
*packing
,
65 const GLvoid
*image
, GLsizei width
,
66 GLsizei height
, GLenum format
, GLenum type
,
67 GLint img
, GLint row
, GLint column
);
71 _mesa_image_row_stride( const struct gl_pixelstore_attrib
*packing
,
72 GLint width
, GLenum format
, GLenum type
);
76 _mesa_image_image_stride( const struct gl_pixelstore_attrib
*packing
,
77 GLint width
, GLint height
,
78 GLenum format
, GLenum type
);
81 _mesa_unpack_polygon_stipple( const GLubyte
*pattern
, GLuint dest
[32],
82 const struct gl_pixelstore_attrib
*unpacking
);
86 _mesa_pack_polygon_stipple( const GLuint pattern
[32], GLubyte
*dest
,
87 const struct gl_pixelstore_attrib
*packing
);
91 _mesa_unpack_bitmap( GLint width
, GLint height
, const GLubyte
*pixels
,
92 const struct gl_pixelstore_attrib
*packing
);
95 _mesa_pack_bitmap( GLint width
, GLint height
, const GLubyte
*source
,
96 GLubyte
*dest
, const struct gl_pixelstore_attrib
*packing
);
100 _mesa_pack_float_rgba_span( GLcontext
*ctx
,
101 GLuint n
, CONST GLfloat rgba
[][4],
102 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
103 const struct gl_pixelstore_attrib
*dstPacking
,
104 GLuint transferOps
);
108 _mesa_pack_rgba_span( GLcontext
*ctx
,
109 GLuint n
, CONST GLchan rgba
[][4],
110 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
111 const struct gl_pixelstore_attrib
*dstPacking
,
112 GLuint transferOps
);
116 _mesa_unpack_chan_color_span( GLcontext
*ctx
,
117 GLuint n
, GLenum dstFormat
, GLchan dest
[],
118 GLenum srcFormat
, GLenum srcType
,
119 const GLvoid
*source
,
120 const struct gl_pixelstore_attrib
*srcPacking
,
121 GLuint transferOps
);
125 _mesa_unpack_float_color_span( GLcontext
*ctx
,
126 GLuint n
, GLenum dstFormat
, GLfloat dest
[],
127 GLenum srcFormat
, GLenum srcType
,
128 const GLvoid
*source
,
129 const struct gl_pixelstore_attrib
*srcPacking
,
130 GLuint transferOps
, GLboolean clamp
);
134 _mesa_unpack_index_span( const GLcontext
*ctx
, GLuint n
,
135 GLenum dstType
, GLvoid
*dest
,
136 GLenum srcType
, const GLvoid
*source
,
137 const struct gl_pixelstore_attrib
*srcPacking
,
138 GLuint transferOps
);
142 _mesa_pack_index_span( const GLcontext
*ctx
, GLuint n
,
143 GLenum dstType
, GLvoid
*dest
, const GLuint
*source
,
144 const struct gl_pixelstore_attrib
*dstPacking
,
145 GLuint transferOps
);
149 _mesa_unpack_stencil_span( const GLcontext
*ctx
, GLuint n
,
150 GLenum dstType
, GLvoid
*dest
,
151 GLenum srcType
, const GLvoid
*source
,
152 const struct gl_pixelstore_attrib
*srcPacking
,
153 GLuint transferOps
);
156 _mesa_pack_stencil_span( const GLcontext
*ctx
, GLuint n
,
157 GLenum dstType
, GLvoid
*dest
, const GLstencil
*source
,
158 const struct gl_pixelstore_attrib
*dstPacking
);
162 _mesa_unpack_depth_span( const GLcontext
*ctx
, GLuint n
, GLfloat
*dest
,
163 GLenum srcType
, const GLvoid
*source
,
164 const struct gl_pixelstore_attrib
*srcPacking
);
167 _mesa_pack_depth_span( const GLcontext
*ctx
, GLuint n
, GLvoid
*dest
,
168 GLenum dstType
, const GLfloat
*depthSpan
,
169 const struct gl_pixelstore_attrib
*dstPacking
);
173 _mesa_unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
174 GLenum format
, GLenum type
, const GLvoid
*pixels
,
175 const struct gl_pixelstore_attrib
*unpack
);