1 /* $Id: image.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
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:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
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.
38 extern void gl_flip_bytes( GLubyte
*p
, GLuint n
);
41 extern void gl_swap2( GLushort
*p
, GLuint n
);
43 extern void gl_swap4( GLuint
*p
, GLuint n
);
46 extern GLint
gl_sizeof_type( GLenum type
);
48 extern GLint
gl_sizeof_packed_type( GLenum type
);
50 extern GLint
gl_components_in_format( GLenum format
);
52 extern GLint
gl_bytes_per_pixel( GLenum format
, GLenum type
);
54 extern GLboolean
gl_is_legal_format_and_type( GLenum format
, GLenum type
);
58 gl_pixel_addr_in_image( const struct gl_pixelstore_attrib
*packing
,
59 const GLvoid
*image
, GLsizei width
,
60 GLsizei height
, GLenum format
, GLenum type
,
61 GLint img
, GLint row
, GLint column
);
64 extern struct gl_image
*
65 gl_unpack_bitmap( GLcontext
*ctx
, GLsizei width
, GLsizei height
,
66 const GLubyte
*bitmap
,
67 const struct gl_pixelstore_attrib
*packing
);
70 extern void gl_unpack_polygon_stipple( const GLcontext
*ctx
,
71 const GLubyte
*pattern
,
75 extern void gl_pack_polygon_stipple( const GLcontext
*ctx
,
76 const GLuint pattern
[32],
80 extern struct gl_image
*
81 gl_unpack_image( GLcontext
*ctx
, GLint width
, GLint height
,
82 GLenum srcFormat
, GLenum srcType
, const GLvoid
*pixels
,
83 const struct gl_pixelstore_attrib
*packing
);
88 gl_unpack_image3D( GLcontext
*ctx
, GLint width
, GLint height
,GLint depth
,
89 GLenum srcFormat
, GLenum srcType
, const GLvoid
*pixels
,
90 const struct gl_pixelstore_attrib
*packing
);
94 gl_pack_rgba_span( const GLcontext
*ctx
,
95 GLuint n
, CONST GLubyte rgba
[][4],
96 GLenum format
, GLenum type
, GLvoid
*dest
,
97 const struct gl_pixelstore_attrib
*packing
,
98 GLboolean applyTransferOps
);
101 extern void gl_free_image( struct gl_image
*image
);
104 extern GLboolean
gl_image_error_test( GLcontext
*ctx
,
105 const struct gl_image
*image
,
110 * New (3.3) functions
115 _mesa_unpack_ubyte_color_span( const GLcontext
*ctx
,
116 GLuint n
, GLenum dstFormat
, GLubyte dest
[],
117 GLenum srcFormat
, GLenum srcType
,
118 const GLvoid
*source
,
119 const struct gl_pixelstore_attrib
*unpacking
,
120 GLboolean applyTransferOps
);
124 _mesa_unpack_index_span( const GLcontext
*ctx
, GLuint n
,
125 GLenum dstType
, GLvoid
*dest
,
126 GLenum srcType
, const GLvoid
*source
,
127 const struct gl_pixelstore_attrib
*unpacking
,
128 GLboolean applyTransferOps
);
131 _mesa_unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
132 GLenum format
, GLenum type
, const GLvoid
*pixels
,
133 const struct gl_pixelstore_attrib
*unpack
);