Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.
[mesa.git] / src / mesa / main / image.h
1
2 /*
3 * Mesa 3-D graphics library
4 * Version: 4.1
5 *
6 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26
27 #ifndef IMAGE_H
28 #define IMAGE_H
29
30
31 #include "mtypes.h"
32
33
34 extern const struct gl_pixelstore_attrib _mesa_native_packing;
35
36
37 extern void
38 _mesa_swap2( GLushort *p, GLuint n );
39
40 extern void
41 _mesa_swap4( GLuint *p, GLuint n );
42
43 extern GLint
44 _mesa_sizeof_type( GLenum type );
45
46 extern GLint
47 _mesa_sizeof_packed_type( GLenum type );
48
49 extern GLint
50 _mesa_components_in_format( GLenum format );
51
52 extern GLint
53 _mesa_bytes_per_pixel( GLenum format, GLenum type );
54
55 extern GLboolean
56 _mesa_is_legal_format_and_type( GLenum format, GLenum type );
57
58
59 extern GLvoid *
60 _mesa_image_address( const struct gl_pixelstore_attrib *packing,
61 const GLvoid *image, GLsizei width,
62 GLsizei height, GLenum format, GLenum type,
63 GLint img, GLint row, GLint column );
64
65
66 extern GLint
67 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
68 GLint width, GLenum format, GLenum type );
69
70
71 extern GLint
72 _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
73 GLint width, GLint height,
74 GLenum format, GLenum type );
75
76 extern void
77 _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
78 const struct gl_pixelstore_attrib *unpacking );
79
80
81 extern void
82 _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
83 const struct gl_pixelstore_attrib *packing );
84
85
86 extern GLvoid *
87 _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
88 const struct gl_pixelstore_attrib *packing );
89
90 extern void
91 _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
92 GLubyte *dest, const struct gl_pixelstore_attrib *packing );
93
94
95 extern void
96 _mesa_pack_float_rgba_span( GLcontext *ctx,
97 GLuint n, CONST GLfloat rgba[][4],
98 GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
99 const struct gl_pixelstore_attrib *dstPacking,
100 GLuint transferOps );
101
102
103 extern void
104 _mesa_pack_rgba_span( GLcontext *ctx,
105 GLuint n, CONST GLchan rgba[][4],
106 GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
107 const struct gl_pixelstore_attrib *dstPacking,
108 GLuint transferOps );
109
110
111 extern void
112 _mesa_unpack_chan_color_span( GLcontext *ctx,
113 GLuint n, GLenum dstFormat, GLchan dest[],
114 GLenum srcFormat, GLenum srcType,
115 const GLvoid *source,
116 const struct gl_pixelstore_attrib *srcPacking,
117 GLuint transferOps );
118
119
120 extern void
121 _mesa_unpack_float_color_span( GLcontext *ctx,
122 GLuint n, GLenum dstFormat, GLfloat dest[],
123 GLenum srcFormat, GLenum srcType,
124 const GLvoid *source,
125 const struct gl_pixelstore_attrib *srcPacking,
126 GLuint transferOps, GLboolean clamp );
127
128
129 extern void
130 _mesa_unpack_index_span( const GLcontext *ctx, GLuint n,
131 GLenum dstType, GLvoid *dest,
132 GLenum srcType, const GLvoid *source,
133 const struct gl_pixelstore_attrib *srcPacking,
134 GLuint transferOps );
135
136
137 extern void
138 _mesa_pack_index_span( const GLcontext *ctx, GLuint n,
139 GLenum dstType, GLvoid *dest, const GLuint *source,
140 const struct gl_pixelstore_attrib *dstPacking,
141 GLuint transferOps );
142
143
144 extern void
145 _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
146 GLenum dstType, GLvoid *dest,
147 GLenum srcType, const GLvoid *source,
148 const struct gl_pixelstore_attrib *srcPacking,
149 GLuint transferOps );
150
151 extern void
152 _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
153 GLenum dstType, GLvoid *dest, const GLstencil *source,
154 const struct gl_pixelstore_attrib *dstPacking );
155
156
157 extern void
158 _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest,
159 GLenum srcType, const GLvoid *source,
160 const struct gl_pixelstore_attrib *srcPacking );
161
162 extern void
163 _mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest,
164 GLenum dstType, const GLfloat *depthSpan,
165 const struct gl_pixelstore_attrib *dstPacking );
166
167
168 extern void *
169 _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
170 GLenum format, GLenum type, const GLvoid *pixels,
171 const struct gl_pixelstore_attrib *unpack );
172
173
174 #endif