fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots of poten...
[mesa.git] / src / mesa / main / image.h
1 /* $Id: image.h,v 1.17 2001/03/07 05:06:12 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
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:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
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.
25 */
26
27
28 #ifndef IMAGE_H
29 #define IMAGE_H
30
31
32 #include "mtypes.h"
33
34
35 extern const struct gl_pixelstore_attrib _mesa_native_packing;
36
37
38 extern void
39 _mesa_swap2( GLushort *p, GLuint n );
40
41 extern void
42 _mesa_swap4( GLuint *p, GLuint n );
43
44 extern GLint
45 _mesa_sizeof_type( GLenum type );
46
47 extern GLint
48 _mesa_sizeof_packed_type( GLenum type );
49
50 extern GLint
51 _mesa_components_in_format( GLenum format );
52
53 extern GLint
54 _mesa_bytes_per_pixel( GLenum format, GLenum type );
55
56 extern GLboolean
57 _mesa_is_legal_format_and_type( GLenum format, GLenum type );
58
59
60 extern GLvoid *
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 );
65
66
67 extern GLint
68 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
69 GLint width, GLenum format, GLenum type );
70
71
72 extern void
73 _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
74 const struct gl_pixelstore_attrib *unpacking );
75
76
77 extern void
78 _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
79 const struct gl_pixelstore_attrib *packing );
80
81
82 extern GLvoid *
83 _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
84 const struct gl_pixelstore_attrib *packing );
85
86 extern void
87 _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
88 GLubyte *dest, const struct gl_pixelstore_attrib *packing );
89
90
91 extern void
92 _mesa_pack_float_rgba_span( GLcontext *ctx,
93 GLuint n, CONST GLfloat rgba[][4],
94 GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
95 const struct gl_pixelstore_attrib *dstPacking,
96 GLuint transferOps );
97
98
99 extern void
100 _mesa_pack_rgba_span( GLcontext *ctx,
101 GLuint n, CONST GLchan rgba[][4],
102 GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
103 const struct gl_pixelstore_attrib *dstPacking,
104 GLuint transferOps );
105
106
107 extern void
108 _mesa_unpack_chan_color_span( GLcontext *ctx,
109 GLuint n, GLenum dstFormat, GLchan dest[],
110 GLenum srcFormat, GLenum srcType,
111 const GLvoid *source,
112 const struct gl_pixelstore_attrib *srcPacking,
113 GLuint transferOps );
114
115
116 extern void
117 _mesa_unpack_float_color_span( GLcontext *ctx,
118 GLuint n, GLenum dstFormat, GLfloat dest[],
119 GLenum srcFormat, GLenum srcType,
120 const GLvoid *source,
121 const struct gl_pixelstore_attrib *srcPacking,
122 GLuint transferOps, GLboolean clamp );
123
124
125 extern void
126 _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
127 GLenum dstType, GLvoid *dest,
128 GLenum srcType, const GLvoid *source,
129 const struct gl_pixelstore_attrib *srcPacking,
130 GLuint transferOps );
131
132
133 extern void
134 _mesa_pack_index_span( const GLcontext *ctx, GLuint n,
135 GLenum dstType, GLvoid *dest, const GLuint *source,
136 const struct gl_pixelstore_attrib *dstPacking,
137 GLuint transferOps );
138
139
140 extern void
141 _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
142 GLenum dstType, GLvoid *dest,
143 GLenum srcType, const GLvoid *source,
144 const struct gl_pixelstore_attrib *srcPacking,
145 GLuint transferOps );
146
147 extern void
148 _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
149 GLenum dstType, GLvoid *dest, const GLstencil *source,
150 const struct gl_pixelstore_attrib *dstPacking );
151
152
153 extern void
154 _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest,
155 GLenum srcType, const GLvoid *source,
156 const struct gl_pixelstore_attrib *srcPacking );
157
158 extern void
159 _mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest,
160 GLenum dstType, const GLfloat *depthSpan,
161 const struct gl_pixelstore_attrib *dstPacking );
162
163
164 extern void *
165 _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
166 GLenum format, GLenum type, const GLvoid *pixels,
167 const struct gl_pixelstore_attrib *unpack );
168
169
170 #endif