1 /* $Id: image.h,v 1.12 2000/08/31 15:24:07 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 extern const struct gl_pixelstore_attrib _mesa_native_packing
;
39 _mesa_swap2( GLushort
*p
, GLuint n
);
42 _mesa_swap4( GLuint
*p
, GLuint n
);
45 _mesa_sizeof_type( GLenum type
);
48 _mesa_sizeof_packed_type( GLenum type
);
51 _mesa_components_in_format( GLenum format
);
54 _mesa_bytes_per_pixel( GLenum format
, GLenum type
);
57 _mesa_is_legal_format_and_type( GLenum format
, GLenum type
);
61 _mesa_image_address( const struct gl_pixelstore_attrib
*packing
,
62 const GLvoid
*image
, GLsizei width
,
63 GLsizei height
, GLenum format
, GLenum type
,
64 GLint img
, GLint row
, GLint column
);
68 _mesa_image_row_stride( const struct gl_pixelstore_attrib
*packing
,
69 GLint width
, GLenum format
, GLenum type
);
73 _mesa_unpack_polygon_stipple( const GLubyte
*pattern
, GLuint dest
[32],
74 const struct gl_pixelstore_attrib
*unpacking
);
78 _mesa_pack_polygon_stipple( const GLuint pattern
[32], GLubyte
*dest
,
79 const struct gl_pixelstore_attrib
*packing
);
83 _mesa_pack_float_rgba_span( GLcontext
*ctx
,
84 GLuint n
, CONST GLfloat rgba
[][4],
85 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
86 const struct gl_pixelstore_attrib
*dstPacking
,
91 _mesa_pack_rgba_span( GLcontext
*ctx
,
92 GLuint n
, CONST GLubyte rgba
[][4],
93 GLenum dstFormat
, GLenum dstType
, GLvoid
*dstAddr
,
94 const struct gl_pixelstore_attrib
*dstPacking
,
99 _mesa_unpack_ubyte_color_span( GLcontext
*ctx
,
100 GLuint n
, GLenum dstFormat
, GLubyte dest
[],
101 GLenum srcFormat
, GLenum srcType
,
102 const GLvoid
*source
,
103 const struct gl_pixelstore_attrib
*srcPacking
,
104 GLuint transferOps
);
108 _mesa_unpack_float_color_span( GLcontext
*ctx
,
109 GLuint n
, GLenum dstFormat
, GLfloat dest
[],
110 GLenum srcFormat
, GLenum srcType
,
111 const GLvoid
*source
,
112 const struct gl_pixelstore_attrib
*srcPacking
,
113 GLuint transferOps
, GLboolean clamp
);
117 _mesa_unpack_index_span( const GLcontext
*ctx
, GLuint n
,
118 GLenum dstType
, GLvoid
*dest
,
119 GLenum srcType
, const GLvoid
*source
,
120 const struct gl_pixelstore_attrib
*srcPacking
,
121 GLuint transferOps
);
125 _mesa_unpack_stencil_span( const GLcontext
*ctx
, GLuint n
,
126 GLenum dstType
, GLvoid
*dest
,
127 GLenum srcType
, const GLvoid
*source
,
128 const struct gl_pixelstore_attrib
*srcPacking
,
129 GLuint transferOps
);
133 _mesa_unpack_depth_span( const GLcontext
*ctx
, GLuint n
, GLdepth
*dest
,
134 GLenum srcType
, const GLvoid
*source
,
135 const struct gl_pixelstore_attrib
*srcPacking
,
136 GLuint transferOps
);
140 _mesa_unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
141 GLenum format
, GLenum type
, const GLvoid
*pixels
,
142 const struct gl_pixelstore_attrib
*unpack
);
146 _mesa_unpack_bitmap( GLint width
, GLint height
, const GLubyte
*pixels
,
147 const struct gl_pixelstore_attrib
*packing
);
150 _mesa_pack_bitmap( GLint width
, GLint height
, const GLubyte
*source
,
151 GLubyte
*dest
, const struct gl_pixelstore_attrib
*packing
);