Fixed typo
[reactos.git] / dll / opengl / mesa / main / image.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 7.1
4 *
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26 #ifndef IMAGE_H
27 #define IMAGE_H
28
29
30 #include "glheader.h"
31
32 struct gl_context;
33 struct gl_pixelstore_attrib;
34
35 extern void
36 _mesa_swap2( GLushort *p, GLuint n );
37
38 extern void
39 _mesa_swap4( GLuint *p, GLuint n );
40
41 extern GLboolean
42 _mesa_type_is_packed(GLenum type);
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 GLenum
57 _mesa_error_check_format_and_type(const struct gl_context *ctx,
58 GLenum format, GLenum type);
59
60 extern GLboolean
61 _mesa_is_color_format(GLenum format);
62
63 extern GLboolean
64 _mesa_is_depth_format(GLenum format);
65
66 extern GLboolean
67 _mesa_is_stencil_format(GLenum format);
68
69 extern GLboolean
70 _mesa_is_ycbcr_format(GLenum format);
71
72 extern GLboolean
73 _mesa_is_depth_or_stencil_format(GLenum format);
74
75 extern GLboolean
76 _mesa_is_integer_format(GLenum format);
77
78 extern GLboolean
79 _mesa_base_format_has_channel(GLenum base_format, GLenum pname);
80
81 extern GLintptr
82 _mesa_image_offset( GLuint dimensions,
83 const struct gl_pixelstore_attrib *packing,
84 GLsizei width, GLsizei height,
85 GLenum format, GLenum type,
86 GLint img, GLint row, GLint column );
87
88 extern GLvoid *
89 _mesa_image_address( GLuint dimensions,
90 const struct gl_pixelstore_attrib *packing,
91 const GLvoid *image,
92 GLsizei width, GLsizei height,
93 GLenum format, GLenum type,
94 GLint img, GLint row, GLint column );
95
96 extern GLvoid *
97 _mesa_image_address1d( const struct gl_pixelstore_attrib *packing,
98 const GLvoid *image,
99 GLsizei width,
100 GLenum format, GLenum type,
101 GLint column );
102
103 extern GLvoid *
104 _mesa_image_address2d( const struct gl_pixelstore_attrib *packing,
105 const GLvoid *image,
106 GLsizei width, GLsizei height,
107 GLenum format, GLenum type,
108 GLint row, GLint column );
109
110 extern GLvoid *
111 _mesa_image_address3d( const struct gl_pixelstore_attrib *packing,
112 const GLvoid *image,
113 GLsizei width, GLsizei height,
114 GLenum format, GLenum type,
115 GLint img, GLint row, GLint column );
116
117
118 extern GLint
119 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
120 GLint width, GLenum format, GLenum type );
121
122
123 extern GLint
124 _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
125 GLint width, GLint height,
126 GLenum format, GLenum type );
127
128
129 extern void
130 _mesa_expand_bitmap(GLsizei width, GLsizei height,
131 const struct gl_pixelstore_attrib *unpack,
132 const GLubyte *bitmap,
133 GLubyte *destBuffer, GLint destStride,
134 GLubyte onValue);
135
136
137 extern void
138 _mesa_convert_colors(GLenum srcType, const GLvoid *src,
139 GLenum dstType, GLvoid *dst,
140 GLuint count, const GLubyte mask[]);
141
142
143 extern GLboolean
144 _mesa_clip_drawpixels(const struct gl_context *ctx,
145 GLint *destX, GLint *destY,
146 GLsizei *width, GLsizei *height,
147 struct gl_pixelstore_attrib *unpack);
148
149
150 extern GLboolean
151 _mesa_clip_readpixels(const struct gl_context *ctx,
152 GLint *srcX, GLint *srcY,
153 GLsizei *width, GLsizei *height,
154 struct gl_pixelstore_attrib *pack);
155
156 extern GLboolean
157 _mesa_clip_copytexsubimage(const struct gl_context *ctx,
158 GLint *destX, GLint *destY,
159 GLint *srcX, GLint *srcY,
160 GLsizei *width, GLsizei *height);
161
162 extern GLboolean
163 _mesa_clip_to_region(GLint xmin, GLint ymin,
164 GLint xmax, GLint ymax,
165 GLint *x, GLint *y,
166 GLsizei *width, GLsizei *height );
167
168 extern GLboolean
169 _mesa_clip_blit(struct gl_context *ctx,
170 GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1,
171 GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1);
172
173
174 #endif