5515be6308fb8d1071f6b58b231a518a0355b208
[mesa.git] / src / 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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26
27 #ifndef IMAGE_H
28 #define IMAGE_H
29
30
31 #include "glheader.h"
32
33 struct gl_context;
34 struct gl_pixelstore_attrib;
35
36 extern void
37 _mesa_swap2( GLushort *p, GLuint n );
38
39 extern void
40 _mesa_swap4( GLuint *p, GLuint n );
41
42 extern GLintptr
43 _mesa_image_offset( GLuint dimensions,
44 const struct gl_pixelstore_attrib *packing,
45 GLsizei width, GLsizei height,
46 GLenum format, GLenum type,
47 GLint img, GLint row, GLint column );
48
49 extern GLvoid *
50 _mesa_image_address( GLuint dimensions,
51 const struct gl_pixelstore_attrib *packing,
52 const GLvoid *image,
53 GLsizei width, GLsizei height,
54 GLenum format, GLenum type,
55 GLint img, GLint row, GLint column );
56
57 extern GLvoid *
58 _mesa_image_address1d( const struct gl_pixelstore_attrib *packing,
59 const GLvoid *image,
60 GLsizei width,
61 GLenum format, GLenum type,
62 GLint column );
63
64 extern GLvoid *
65 _mesa_image_address2d( const struct gl_pixelstore_attrib *packing,
66 const GLvoid *image,
67 GLsizei width, GLsizei height,
68 GLenum format, GLenum type,
69 GLint row, GLint column );
70
71 extern GLvoid *
72 _mesa_image_address3d( const struct gl_pixelstore_attrib *packing,
73 const GLvoid *image,
74 GLsizei width, GLsizei height,
75 GLenum format, GLenum type,
76 GLint img, GLint row, GLint column );
77
78
79 extern GLint
80 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
81 GLint width, GLenum format, GLenum type );
82
83
84 extern GLint
85 _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
86 GLint width, GLint height,
87 GLenum format, GLenum type );
88
89
90 extern void
91 _mesa_expand_bitmap(GLsizei width, GLsizei height,
92 const struct gl_pixelstore_attrib *unpack,
93 const GLubyte *bitmap,
94 GLubyte *destBuffer, GLint destStride,
95 GLubyte onValue);
96
97
98 extern void
99 _mesa_convert_colors(GLenum srcType, const GLvoid *src,
100 GLenum dstType, GLvoid *dst,
101 GLuint count, const GLubyte mask[]);
102
103
104 extern GLboolean
105 _mesa_clip_drawpixels(const struct gl_context *ctx,
106 GLint *destX, GLint *destY,
107 GLsizei *width, GLsizei *height,
108 struct gl_pixelstore_attrib *unpack);
109
110
111 extern GLboolean
112 _mesa_clip_readpixels(const struct gl_context *ctx,
113 GLint *srcX, GLint *srcY,
114 GLsizei *width, GLsizei *height,
115 struct gl_pixelstore_attrib *pack);
116
117 extern GLboolean
118 _mesa_clip_copytexsubimage(const struct gl_context *ctx,
119 GLint *destX, GLint *destY,
120 GLint *srcX, GLint *srcY,
121 GLsizei *width, GLsizei *height);
122
123 extern GLboolean
124 _mesa_clip_to_region(GLint xmin, GLint ymin,
125 GLint xmax, GLint ymax,
126 GLint *x, GLint *y,
127 GLsizei *width, GLsizei *height );
128
129 extern GLboolean
130 _mesa_clip_blit(struct gl_context *ctx,
131 GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1,
132 GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1);
133
134
135 #endif