Add GLAPIENTRY function decorations for correct operation on Windows.
[mesa.git] / src / mesa / main / image.h
1 /**
2 * \file image.h
3 * Image handling.
4 */
5
6 /*
7 * Mesa 3-D graphics library
8 * Version: 4.1
9 *
10 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
11 *
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:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
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.
28 */
29
30
31 #ifndef IMAGE_H
32 #define IMAGE_H
33
34
35 #include "mtypes.h"
36
37
38 extern const struct gl_pixelstore_attrib _mesa_native_packing;
39
40
41 extern void
42 _mesa_swap2( GLushort *p, GLuint n );
43
44 extern void
45 _mesa_swap4( GLuint *p, GLuint n );
46
47 extern GLint
48 _mesa_sizeof_type( GLenum type );
49
50 extern GLint
51 _mesa_sizeof_packed_type( GLenum type );
52
53 extern GLint
54 _mesa_components_in_format( GLenum format );
55
56 extern GLint
57 _mesa_bytes_per_pixel( GLenum format, GLenum type );
58
59 extern GLboolean
60 _mesa_is_legal_format_and_type( GLenum format, GLenum type );
61
62
63 extern GLvoid *
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 );
68
69
70 extern GLint
71 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
72 GLint width, GLenum format, GLenum type );
73
74
75 extern GLint
76 _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
77 GLint width, GLint height,
78 GLenum format, GLenum type );
79
80 extern void
81 _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
82 const struct gl_pixelstore_attrib *unpacking );
83
84
85 extern void
86 _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
87 const struct gl_pixelstore_attrib *packing );
88
89
90 extern GLvoid *
91 _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
92 const struct gl_pixelstore_attrib *packing );
93
94 extern void
95 _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
96 GLubyte *dest, const struct gl_pixelstore_attrib *packing );
97
98
99 extern void
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 );
105
106
107 extern void
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 );
113
114
115 extern void
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 );
122
123
124 extern void
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 );
131
132
133 extern void
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 );
139
140
141 extern void
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 );
146
147
148 extern void
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 );
154
155 extern void
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 );
159
160
161 extern void
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 );
165
166 extern void
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 );
170
171
172 extern void *
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 );
176
177
178 #endif