Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Mesa 3-D graphics library
  3.  * Version:  6.5.1
  4.  *
  5.  * Copyright (C) 1999-2006  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 _M_TRANSLATE_H_
  27. #define _M_TRANSLATE_H_
  28.  
  29. #include "main/compiler.h"
  30. #include "main/glheader.h"
  31. #include "main/mtypes.h"                /* hack for GLchan */
  32.  
  33.  
  34. /**
  35.  * Array translation.
  36.  * For example, convert array of GLushort[3] to GLfloat[4].
  37.  * The function name specifies the destination format/size.
  38.  * \param  to  the destination address
  39.  * \param  ptr  the source address
  40.  * \param  stride  the source stride (in bytes) between elements
  41.  * \param  type  the source datatype (GL_SHORT, GL_UNSIGNED_INT, etc)
  42.  * \param  size  number of values per element in source array (1,2,3 or 4)
  43.  * \param  start  first element in source array to convert
  44.  * \param  n  number of elements to convert
  45.  *
  46.  * Note: "element" means a tuple like GLfloat[3] or GLubyte[4].
  47.  */
  48.  
  49.  
  50. extern void _math_trans_1f(GLfloat *to,
  51.                            CONST void *ptr,
  52.                            GLuint stride,
  53.                            GLenum type,
  54.                            GLuint start,
  55.                            GLuint n );
  56.  
  57. extern void _math_trans_1ui(GLuint *to,
  58.                             CONST void *ptr,
  59.                             GLuint stride,
  60.                             GLenum type,
  61.                             GLuint start,
  62.                             GLuint n );
  63.  
  64. extern void _math_trans_1ub(GLubyte *to,
  65.                             CONST void *ptr,
  66.                             GLuint stride,
  67.                             GLenum type,
  68.                             GLuint start,
  69.                             GLuint n );
  70.  
  71. extern void _math_trans_4ub(GLubyte (*to)[4],
  72.                             CONST void *ptr,
  73.                             GLuint stride,
  74.                             GLenum type,
  75.                             GLuint size,
  76.                             GLuint start,
  77.                             GLuint n );
  78.  
  79. extern void _math_trans_4chan( GLchan (*to)[4],
  80.                                CONST void *ptr,
  81.                                GLuint stride,
  82.                                GLenum type,
  83.                                GLuint size,
  84.                                GLuint start,
  85.                                GLuint n );
  86.  
  87. extern void _math_trans_4us(GLushort (*to)[4],
  88.                             CONST void *ptr,
  89.                             GLuint stride,
  90.                             GLenum type,
  91.                             GLuint size,
  92.                             GLuint start,
  93.                             GLuint n );
  94.  
  95. /** Convert to floats w/out normalization (i.e. just cast) */
  96. extern void _math_trans_4f(GLfloat (*to)[4],
  97.                            CONST void *ptr,
  98.                            GLuint stride,
  99.                            GLenum type,
  100.                            GLuint size,
  101.                            GLuint start,
  102.                            GLuint n );
  103.  
  104. /** Convert to normalized floats in [0,1] or [-1, 1] */
  105. extern void _math_trans_4fn(GLfloat (*to)[4],
  106.                             CONST void *ptr,
  107.                             GLuint stride,
  108.                             GLenum type,
  109.                             GLuint size,
  110.                             GLuint start,
  111.                             GLuint n );
  112.  
  113. extern void _math_trans_3fn(GLfloat (*to)[3],
  114.                            CONST void *ptr,
  115.                            GLuint stride,
  116.                            GLenum type,
  117.                            GLuint start,
  118.                            GLuint n );
  119.  
  120. extern void _math_init_translate( void );
  121.  
  122.  
  123. #endif
  124.