home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / src / image.h < prev    next >
C/C++ Source or Header  |  2000-01-07  |  5KB  |  137 lines

  1. /* $Id: image.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  3.1
  6.  * 
  7.  * Copyright (C) 1999  Brian Paul   All Rights Reserved.
  8.  * 
  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:
  15.  * 
  16.  * The above copyright notice and this permission notice shall be included
  17.  * in all copies or substantial portions of the Software.
  18.  * 
  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.
  25.  */
  26.  
  27.  
  28.  
  29.  
  30.  
  31. #ifndef IMAGE_H
  32. #define IMAGE_H
  33.  
  34.  
  35. #include "types.h"
  36.  
  37.  
  38. extern void gl_flip_bytes( GLubyte *p, GLuint n );
  39.  
  40.  
  41. extern void gl_swap2( GLushort *p, GLuint n );
  42.  
  43. extern void gl_swap4( GLuint *p, GLuint n );
  44.  
  45.  
  46. extern GLint gl_sizeof_type( GLenum type );
  47.  
  48. extern GLint gl_sizeof_packed_type( GLenum type );
  49.  
  50. extern GLint gl_components_in_format( GLenum format );
  51.  
  52. extern GLint gl_bytes_per_pixel( GLenum format, GLenum type );
  53.  
  54. extern GLboolean gl_is_legal_format_and_type( GLenum format, GLenum type );
  55.  
  56.  
  57. extern GLvoid *
  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 );
  62.  
  63.  
  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 );
  68.  
  69.  
  70. extern void gl_unpack_polygon_stipple( const GLcontext *ctx,
  71.                                        const GLubyte *pattern,
  72.                                        GLuint dest[32] );
  73.  
  74.  
  75. extern void gl_pack_polygon_stipple( const GLcontext *ctx,
  76.                                      const GLuint pattern[32],
  77.                                      GLubyte *dest );
  78.  
  79.  
  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 );
  84.  
  85.  
  86.  
  87. struct gl_image *
  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 );
  91.  
  92.  
  93. extern void
  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 );
  99.  
  100.  
  101. extern void gl_free_image( struct gl_image *image );
  102.  
  103.  
  104. extern GLboolean gl_image_error_test( GLcontext *ctx,
  105.                                       const struct gl_image *image,
  106.                                       const char *msg );
  107.  
  108.  
  109. /*
  110.  * New (3.3) functions
  111.  */
  112.  
  113.  
  114. extern void
  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 );
  121.  
  122.  
  123. extern void
  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 );
  129.  
  130. extern void *
  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 );
  134.  
  135.  
  136. #endif
  137.