core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

m_translate.c File Reference

#include "main/glheader.h"
#include "main/mtypes.h"
#include "main/colormac.h"
#include "m_translate.h"
#include "m_trans_tmp.h"

Defines

#define TYPE_IDX(t)   ((t) & 0xf)
#define MAX_TYPES   TYPE_IDX(GL_DOUBLE)+1
#define PTR_ELT(ptr, elt)   (((SRC *)ptr)[elt])
#define TAB(x)   _math_trans##x##_tab
#define ARGS   GLuint start, GLuint n
#define SRC_START   start
#define DST_START   0
#define STRIDE   stride
#define NEXT_F   f += stride
#define NEXT_F2
#define CHECK
#define SRC   GLbyte
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_BYTE)
#define TRX_3FN(f, n)   BYTE_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4F(f, n)   BYTE_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   BYTE_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_UB(ub, f, n)   ub = BYTE_TO_UBYTE( PTR_ELT(f,n) )
#define TRX_US(ch, f, n)   ch = BYTE_TO_USHORT( PTR_ELT(f,n) )
#define TRX_UI(f, n)   (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))
#define SZ   4
#define INIT   init_trans_4_GLbyte_raw
#define DEST_4F   trans_4_GLbyte_4f_raw
#define DEST_4FN   trans_4_GLbyte_4fn_raw
#define DEST_4UB   trans_4_GLbyte_4ub_raw
#define DEST_4US   trans_4_GLbyte_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLbyte_raw
#define DEST_4F   trans_3_GLbyte_4f_raw
#define DEST_4FN   trans_3_GLbyte_4fn_raw
#define DEST_4UB   trans_3_GLbyte_4ub_raw
#define DEST_4US   trans_3_GLbyte_4us_raw
#define DEST_3FN   trans_3_GLbyte_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLbyte_raw
#define DEST_4F   trans_2_GLbyte_4f_raw
#define DEST_4FN   trans_2_GLbyte_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLbyte_raw
#define DEST_4F   trans_1_GLbyte_4f_raw
#define DEST_4FN   trans_1_GLbyte_4fn_raw
#define DEST_1UB   trans_1_GLbyte_1ub_raw
#define DEST_1UI   trans_1_GLbyte_1ui_raw
#define SRC   GLubyte
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_BYTE)
#define TRX_3FN(f, n)   UBYTE_TO_FLOAT(PTR_ELT(f,n))
#define TRX_4F(f, n)   (GLfloat)( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   UBYTE_TO_FLOAT(PTR_ELT(f,n))
#define TRX_UB(ub, f, n)   ub = PTR_ELT(f,n)
#define TRX_US(us, f, n)   us = UBYTE_TO_USHORT(PTR_ELT(f,n))
#define TRX_UI(f, n)   (GLuint)PTR_ELT(f,n)
#define SZ   4
#define INIT   init_trans_4_GLubyte_raw
#define DEST_4F   trans_4_GLubyte_4f_raw
#define DEST_4FN   trans_4_GLubyte_4fn_raw
#define DEST_4US   trans_4_GLubyte_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLubyte_raw
#define DEST_4UB   trans_3_GLubyte_4ub_raw
#define DEST_4US   trans_3_GLubyte_4us_raw
#define DEST_3FN   trans_3_GLubyte_3fn_raw
#define DEST_4F   trans_3_GLubyte_4f_raw
#define DEST_4FN   trans_3_GLubyte_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLubyte_raw
#define DEST_1UI   trans_1_GLubyte_1ui_raw
#define DEST_1UB   trans_1_GLubyte_1ub_raw
#define SRC   GLshort
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_SHORT)
#define TRX_3FN(f, n)   SHORT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4F(f, n)   (GLfloat)( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   SHORT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_UB(ub, f, n)   ub = SHORT_TO_UBYTE(PTR_ELT(f,n))
#define TRX_US(us, f, n)   us = SHORT_TO_USHORT(PTR_ELT(f,n))
#define TRX_UI(f, n)   (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))
#define SZ   4
#define INIT   init_trans_4_GLshort_raw
#define DEST_4F   trans_4_GLshort_4f_raw
#define DEST_4FN   trans_4_GLshort_4fn_raw
#define DEST_4UB   trans_4_GLshort_4ub_raw
#define DEST_4US   trans_4_GLshort_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLshort_raw
#define DEST_4F   trans_3_GLshort_4f_raw
#define DEST_4FN   trans_3_GLshort_4fn_raw
#define DEST_4UB   trans_3_GLshort_4ub_raw
#define DEST_4US   trans_3_GLshort_4us_raw
#define DEST_3FN   trans_3_GLshort_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLshort_raw
#define DEST_4F   trans_2_GLshort_4f_raw
#define DEST_4FN   trans_2_GLshort_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLshort_raw
#define DEST_4F   trans_1_GLshort_4f_raw
#define DEST_4FN   trans_1_GLshort_4fn_raw
#define DEST_1UB   trans_1_GLshort_1ub_raw
#define DEST_1UI   trans_1_GLshort_1ui_raw
#define SRC   GLushort
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_SHORT)
#define TRX_3FN(f, n)   USHORT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4F(f, n)   (GLfloat)( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   USHORT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_UB(ub, f, n)   ub = (GLubyte) (PTR_ELT(f,n) >> 8)
#define TRX_US(us, f, n)   us = PTR_ELT(f,n)
#define TRX_UI(f, n)   (GLuint) PTR_ELT(f,n)
#define SZ   4
#define INIT   init_trans_4_GLushort_raw
#define DEST_4F   trans_4_GLushort_4f_raw
#define DEST_4FN   trans_4_GLushort_4fn_raw
#define DEST_4UB   trans_4_GLushort_4ub_raw
#define DEST_4US   trans_4_GLushort_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLushort_raw
#define DEST_4F   trans_3_GLushort_4f_raw
#define DEST_4FN   trans_3_GLushort_4fn_raw
#define DEST_4UB   trans_3_GLushort_4ub_raw
#define DEST_4US   trans_3_GLushort_4us_raw
#define DEST_3FN   trans_3_GLushort_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLushort_raw
#define DEST_4F   trans_2_GLushort_4f_raw
#define DEST_4FN   trans_2_GLushort_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLushort_raw
#define DEST_4F   trans_1_GLushort_4f_raw
#define DEST_4FN   trans_1_GLushort_4fn_raw
#define DEST_1UB   trans_1_GLushort_1ub_raw
#define DEST_1UI   trans_1_GLushort_1ui_raw
#define SRC   GLint
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_INT)
#define TRX_3FN(f, n)   INT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4F(f, n)   (GLfloat)( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   INT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_UB(ub, f, n)   ub = INT_TO_UBYTE(PTR_ELT(f,n))
#define TRX_US(us, f, n)   us = INT_TO_USHORT(PTR_ELT(f,n))
#define TRX_UI(f, n)   (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))
#define SZ   4
#define INIT   init_trans_4_GLint_raw
#define DEST_4F   trans_4_GLint_4f_raw
#define DEST_4FN   trans_4_GLint_4fn_raw
#define DEST_4UB   trans_4_GLint_4ub_raw
#define DEST_4US   trans_4_GLint_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLint_raw
#define DEST_4F   trans_3_GLint_4f_raw
#define DEST_4FN   trans_3_GLint_4fn_raw
#define DEST_4UB   trans_3_GLint_4ub_raw
#define DEST_4US   trans_3_GLint_4us_raw
#define DEST_3FN   trans_3_GLint_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLint_raw
#define DEST_4F   trans_2_GLint_4f_raw
#define DEST_4FN   trans_2_GLint_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLint_raw
#define DEST_4F   trans_1_GLint_4f_raw
#define DEST_4FN   trans_1_GLint_4fn_raw
#define DEST_1UB   trans_1_GLint_1ub_raw
#define DEST_1UI   trans_1_GLint_1ui_raw
#define SRC   GLuint
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_INT)
#define TRX_3FN(f, n)   INT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_4F(f, n)   (GLfloat)( PTR_ELT(f,n) )
#define TRX_4FN(f, n)   UINT_TO_FLOAT( PTR_ELT(f,n) )
#define TRX_UB(ub, f, n)   ub = (GLubyte) (PTR_ELT(f,n) >> 24)
#define TRX_US(us, f, n)   us = (GLshort) (PTR_ELT(f,n) >> 16)
#define TRX_UI(f, n)   PTR_ELT(f,n)
#define SZ   4
#define INIT   init_trans_4_GLuint_raw
#define DEST_4F   trans_4_GLuint_4f_raw
#define DEST_4FN   trans_4_GLuint_4fn_raw
#define DEST_4UB   trans_4_GLuint_4ub_raw
#define DEST_4US   trans_4_GLuint_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLuint_raw
#define DEST_4F   trans_3_GLuint_4f_raw
#define DEST_4FN   trans_3_GLuint_4fn_raw
#define DEST_4UB   trans_3_GLuint_4ub_raw
#define DEST_4US   trans_3_GLuint_4us_raw
#define DEST_3FN   trans_3_GLuint_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLuint_raw
#define DEST_4F   trans_2_GLuint_4f_raw
#define DEST_4FN   trans_2_GLuint_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLuint_raw
#define DEST_4F   trans_1_GLuint_4f_raw
#define DEST_4FN   trans_1_GLuint_4fn_raw
#define DEST_1UB   trans_1_GLuint_1ub_raw
#define DEST_1UI   trans_1_GLuint_1ui_raw
#define SRC   GLdouble
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_DOUBLE)
#define TRX_3FN(f, n)   (GLfloat) PTR_ELT(f,n)
#define TRX_4F(f, n)   (GLfloat) PTR_ELT(f,n)
#define TRX_4FN(f, n)   (GLfloat) PTR_ELT(f,n)
#define TRX_UB(ub, f, n)   UNCLAMPED_FLOAT_TO_UBYTE(ub, PTR_ELT(f,n))
#define TRX_US(us, f, n)   UNCLAMPED_FLOAT_TO_USHORT(us, PTR_ELT(f,n))
#define TRX_UI(f, n)   (GLuint) (GLint) PTR_ELT(f,n)
#define TRX_1F(f, n)   (GLfloat) PTR_ELT(f,n)
#define SZ   4
#define INIT   init_trans_4_GLdouble_raw
#define DEST_4F   trans_4_GLdouble_4f_raw
#define DEST_4FN   trans_4_GLdouble_4fn_raw
#define DEST_4UB   trans_4_GLdouble_4ub_raw
#define DEST_4US   trans_4_GLdouble_4us_raw
#define SZ   3
#define INIT   init_trans_3_GLdouble_raw
#define DEST_4F   trans_3_GLdouble_4f_raw
#define DEST_4FN   trans_3_GLdouble_4fn_raw
#define DEST_4UB   trans_3_GLdouble_4ub_raw
#define DEST_4US   trans_3_GLdouble_4us_raw
#define DEST_3FN   trans_3_GLdouble_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLdouble_raw
#define DEST_4F   trans_2_GLdouble_4f_raw
#define DEST_4FN   trans_2_GLdouble_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLdouble_raw
#define DEST_4F   trans_1_GLdouble_4f_raw
#define DEST_4FN   trans_1_GLdouble_4fn_raw
#define DEST_1UB   trans_1_GLdouble_1ub_raw
#define DEST_1UI   trans_1_GLdouble_1ui_raw
#define DEST_1F   trans_1_GLdouble_1f_raw
#define SRC   GLfloat
 Translate from GL_BYTE.
#define SRC_IDX   TYPE_IDX(GL_FLOAT)
#define SZ   4
#define INIT   init_trans_4_GLfloat_raw
#define DEST_4UB   trans_4_GLfloat_4ub_raw
#define DEST_4US   trans_4_GLfloat_4us_raw
#define DEST_4F   trans_4_GLfloat_4f_raw
#define DEST_4FN   trans_4_GLfloat_4fn_raw
#define SZ   3
#define INIT   init_trans_3_GLfloat_raw
#define DEST_4F   trans_3_GLfloat_4f_raw
#define DEST_4FN   trans_3_GLfloat_4fn_raw
#define DEST_4UB   trans_3_GLfloat_4ub_raw
#define DEST_4US   trans_3_GLfloat_4us_raw
#define DEST_3FN   trans_3_GLfloat_3fn_raw
#define SZ   2
#define INIT   init_trans_2_GLfloat_raw
#define DEST_4F   trans_2_GLfloat_4f_raw
#define DEST_4FN   trans_2_GLfloat_4fn_raw
#define SZ   1
#define INIT   init_trans_1_GLfloat_raw
#define DEST_4F   trans_1_GLfloat_4f_raw
#define DEST_4FN   trans_1_GLfloat_4fn_raw
#define DEST_1UB   trans_1_GLfloat_1ub_raw
#define DEST_1UI   trans_1_GLfloat_1ui_raw
#define DEST_1F   trans_1_GLfloat_1f_raw

Typedefs

typedef void(* trans_1f_func )(GLfloat *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)
 Translate vectors of numbers between various types.
typedef void(* trans_1ui_func )(GLuint *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)
typedef void(* trans_1ub_func )(GLubyte *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)
typedef void(* trans_4ub_func )(GLubyte(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)
typedef void(* trans_4us_func )(GLushort(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)
typedef void(* trans_4f_func )(GLfloat(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)
typedef void(* trans_3fn_func )(GLfloat(*to)[3], CONST void *ptr, GLuint stride, GLuint start, GLuint n)

Functions

static void trans_4_GLubyte_4ub_raw (GLubyte(*t)[4], CONST void *Ptr, GLuint stride, ARGS)
static void init_translate_raw (void)
void _math_init_translate (void)
void _math_trans_1f (GLfloat *to, CONST void *ptr, GLuint stride, GLenum type, GLuint start, GLuint n)
 Translate vector of values to GLfloat [1].
void _math_trans_1ui (GLuint *to, CONST void *ptr, GLuint stride, GLenum type, GLuint start, GLuint n)
 Translate vector of values to GLuint [1].
void _math_trans_1ub (GLubyte *to, CONST void *ptr, GLuint stride, GLenum type, GLuint start, GLuint n)
 Translate vector of values to GLubyte [1].
void _math_trans_4ub (GLubyte(*to)[4], CONST void *ptr, GLuint stride, GLenum type, GLuint size, GLuint start, GLuint n)
 Translate vector of values to GLubyte [4].
void _math_trans_4chan (GLchan(*to)[4], CONST void *ptr, GLuint stride, GLenum type, GLuint size, GLuint start, GLuint n)
 Translate vector of values to GLchan [4].
void _math_trans_4us (GLushort(*to)[4], CONST void *ptr, GLuint stride, GLenum type, GLuint size, GLuint start, GLuint n)
 Translate vector of values to GLushort [4].
void _math_trans_4f (GLfloat(*to)[4], CONST void *ptr, GLuint stride, GLenum type, GLuint size, GLuint start, GLuint n)
 Translate vector of values to GLfloat [4].
void _math_trans_4fn (GLfloat(*to)[4], CONST void *ptr, GLuint stride, GLenum type, GLuint size, GLuint start, GLuint n)
 Translate vector of values to GLfloat[4], normalized to [-1, 1].
void _math_trans_3fn (GLfloat(*to)[3], CONST void *ptr, GLuint stride, GLenum type, GLuint start, GLuint n)
 Translate vector of values to GLfloat[3], normalized to [-1, 1].

Variables

static trans_1f_func _math_trans_1f_tab [MAX_TYPES]
static trans_1ui_func _math_trans_1ui_tab [MAX_TYPES]
static trans_1ub_func _math_trans_1ub_tab [MAX_TYPES]
static trans_3fn_func _math_trans_3fn_tab [MAX_TYPES]
static trans_4ub_func _math_trans_4ub_tab [5][MAX_TYPES]
static trans_4us_func _math_trans_4us_tab [5][MAX_TYPES]
static trans_4f_func _math_trans_4f_tab [5][MAX_TYPES]
static trans_4f_func _math_trans_4fn_tab [5][MAX_TYPES]


Define Documentation

#define ARGS   GLuint start, GLuint n

#define CHECK

#define DEST_1F   trans_1_GLfloat_1f_raw

#define DEST_1F   trans_1_GLdouble_1f_raw

#define DEST_1UB   trans_1_GLfloat_1ub_raw

#define DEST_1UB   trans_1_GLdouble_1ub_raw

#define DEST_1UB   trans_1_GLuint_1ub_raw

#define DEST_1UB   trans_1_GLint_1ub_raw

#define DEST_1UB   trans_1_GLushort_1ub_raw

#define DEST_1UB   trans_1_GLshort_1ub_raw

#define DEST_1UB   trans_1_GLubyte_1ub_raw

#define DEST_1UB   trans_1_GLbyte_1ub_raw

#define DEST_1UI   trans_1_GLfloat_1ui_raw

#define DEST_1UI   trans_1_GLdouble_1ui_raw

#define DEST_1UI   trans_1_GLuint_1ui_raw

#define DEST_1UI   trans_1_GLint_1ui_raw

#define DEST_1UI   trans_1_GLushort_1ui_raw

#define DEST_1UI   trans_1_GLshort_1ui_raw

#define DEST_1UI   trans_1_GLubyte_1ui_raw

#define DEST_1UI   trans_1_GLbyte_1ui_raw

#define DEST_3FN   trans_3_GLfloat_3fn_raw

#define DEST_3FN   trans_3_GLdouble_3fn_raw

#define DEST_3FN   trans_3_GLuint_3fn_raw

#define DEST_3FN   trans_3_GLint_3fn_raw

#define DEST_3FN   trans_3_GLushort_3fn_raw

#define DEST_3FN   trans_3_GLshort_3fn_raw

#define DEST_3FN   trans_3_GLubyte_3fn_raw

#define DEST_3FN   trans_3_GLbyte_3fn_raw

#define DEST_4F   trans_1_GLfloat_4f_raw

#define DEST_4F   trans_2_GLfloat_4f_raw

#define DEST_4F   trans_3_GLfloat_4f_raw

#define DEST_4F   trans_4_GLfloat_4f_raw

#define DEST_4F   trans_1_GLdouble_4f_raw

#define DEST_4F   trans_2_GLdouble_4f_raw

#define DEST_4F   trans_3_GLdouble_4f_raw

#define DEST_4F   trans_4_GLdouble_4f_raw

#define DEST_4F   trans_1_GLuint_4f_raw

#define DEST_4F   trans_2_GLuint_4f_raw

#define DEST_4F   trans_3_GLuint_4f_raw

#define DEST_4F   trans_4_GLuint_4f_raw

#define DEST_4F   trans_1_GLint_4f_raw

#define DEST_4F   trans_2_GLint_4f_raw

#define DEST_4F   trans_3_GLint_4f_raw

#define DEST_4F   trans_4_GLint_4f_raw

#define DEST_4F   trans_1_GLushort_4f_raw

#define DEST_4F   trans_2_GLushort_4f_raw

#define DEST_4F   trans_3_GLushort_4f_raw

#define DEST_4F   trans_4_GLushort_4f_raw

#define DEST_4F   trans_1_GLshort_4f_raw

#define DEST_4F   trans_2_GLshort_4f_raw

#define DEST_4F   trans_3_GLshort_4f_raw

#define DEST_4F   trans_4_GLshort_4f_raw

#define DEST_4F   trans_3_GLubyte_4f_raw

#define DEST_4F   trans_4_GLubyte_4f_raw

#define DEST_4F   trans_1_GLbyte_4f_raw

#define DEST_4F   trans_2_GLbyte_4f_raw

#define DEST_4F   trans_3_GLbyte_4f_raw

#define DEST_4F   trans_4_GLbyte_4f_raw

#define DEST_4FN   trans_1_GLfloat_4fn_raw

#define DEST_4FN   trans_2_GLfloat_4fn_raw

#define DEST_4FN   trans_3_GLfloat_4fn_raw

#define DEST_4FN   trans_4_GLfloat_4fn_raw

#define DEST_4FN   trans_1_GLdouble_4fn_raw

#define DEST_4FN   trans_2_GLdouble_4fn_raw

#define DEST_4FN   trans_3_GLdouble_4fn_raw

#define DEST_4FN   trans_4_GLdouble_4fn_raw

#define DEST_4FN   trans_1_GLuint_4fn_raw

#define DEST_4FN   trans_2_GLuint_4fn_raw

#define DEST_4FN   trans_3_GLuint_4fn_raw

#define DEST_4FN   trans_4_GLuint_4fn_raw

#define DEST_4FN   trans_1_GLint_4fn_raw

#define DEST_4FN   trans_2_GLint_4fn_raw

#define DEST_4FN   trans_3_GLint_4fn_raw

#define DEST_4FN   trans_4_GLint_4fn_raw

#define DEST_4FN   trans_1_GLushort_4fn_raw

#define DEST_4FN   trans_2_GLushort_4fn_raw

#define DEST_4FN   trans_3_GLushort_4fn_raw

#define DEST_4FN   trans_4_GLushort_4fn_raw

#define DEST_4FN   trans_1_GLshort_4fn_raw

#define DEST_4FN   trans_2_GLshort_4fn_raw

#define DEST_4FN   trans_3_GLshort_4fn_raw

#define DEST_4FN   trans_4_GLshort_4fn_raw

#define DEST_4FN   trans_3_GLubyte_4fn_raw

#define DEST_4FN   trans_4_GLubyte_4fn_raw

#define DEST_4FN   trans_1_GLbyte_4fn_raw

#define DEST_4FN   trans_2_GLbyte_4fn_raw

#define DEST_4FN   trans_3_GLbyte_4fn_raw

#define DEST_4FN   trans_4_GLbyte_4fn_raw

#define DEST_4UB   trans_3_GLfloat_4ub_raw

#define DEST_4UB   trans_4_GLfloat_4ub_raw

#define DEST_4UB   trans_3_GLdouble_4ub_raw

#define DEST_4UB   trans_4_GLdouble_4ub_raw

#define DEST_4UB   trans_3_GLuint_4ub_raw

#define DEST_4UB   trans_4_GLuint_4ub_raw

#define DEST_4UB   trans_3_GLint_4ub_raw

#define DEST_4UB   trans_4_GLint_4ub_raw

#define DEST_4UB   trans_3_GLushort_4ub_raw

#define DEST_4UB   trans_4_GLushort_4ub_raw

#define DEST_4UB   trans_3_GLshort_4ub_raw

#define DEST_4UB   trans_4_GLshort_4ub_raw

#define DEST_4UB   trans_3_GLubyte_4ub_raw

#define DEST_4UB   trans_3_GLbyte_4ub_raw

#define DEST_4UB   trans_4_GLbyte_4ub_raw

#define DEST_4US   trans_3_GLfloat_4us_raw

#define DEST_4US   trans_4_GLfloat_4us_raw

#define DEST_4US   trans_3_GLdouble_4us_raw

#define DEST_4US   trans_4_GLdouble_4us_raw

#define DEST_4US   trans_3_GLuint_4us_raw

#define DEST_4US   trans_4_GLuint_4us_raw

#define DEST_4US   trans_3_GLint_4us_raw

#define DEST_4US   trans_4_GLint_4us_raw

#define DEST_4US   trans_3_GLushort_4us_raw

#define DEST_4US   trans_4_GLushort_4us_raw

#define DEST_4US   trans_3_GLshort_4us_raw

#define DEST_4US   trans_4_GLshort_4us_raw

#define DEST_4US   trans_3_GLubyte_4us_raw

#define DEST_4US   trans_4_GLubyte_4us_raw

#define DEST_4US   trans_3_GLbyte_4us_raw

#define DEST_4US   trans_4_GLbyte_4us_raw

#define DST_START   0

#define INIT   init_trans_1_GLfloat_raw

#define INIT   init_trans_2_GLfloat_raw

#define INIT   init_trans_3_GLfloat_raw

#define INIT   init_trans_4_GLfloat_raw

#define INIT   init_trans_1_GLdouble_raw

#define INIT   init_trans_2_GLdouble_raw

#define INIT   init_trans_3_GLdouble_raw

#define INIT   init_trans_4_GLdouble_raw

#define INIT   init_trans_1_GLuint_raw

#define INIT   init_trans_2_GLuint_raw

#define INIT   init_trans_3_GLuint_raw

#define INIT   init_trans_4_GLuint_raw

#define INIT   init_trans_1_GLint_raw

#define INIT   init_trans_2_GLint_raw

#define INIT   init_trans_3_GLint_raw

#define INIT   init_trans_4_GLint_raw

#define INIT   init_trans_1_GLushort_raw

#define INIT   init_trans_2_GLushort_raw

#define INIT   init_trans_3_GLushort_raw

#define INIT   init_trans_4_GLushort_raw

#define INIT   init_trans_1_GLshort_raw

#define INIT   init_trans_2_GLshort_raw

#define INIT   init_trans_3_GLshort_raw

#define INIT   init_trans_4_GLshort_raw

#define INIT   init_trans_1_GLubyte_raw

#define INIT   init_trans_3_GLubyte_raw

#define INIT   init_trans_4_GLubyte_raw

#define INIT   init_trans_1_GLbyte_raw

#define INIT   init_trans_2_GLbyte_raw

#define INIT   init_trans_3_GLbyte_raw

#define INIT   init_trans_4_GLbyte_raw

#define MAX_TYPES   TYPE_IDX(GL_DOUBLE)+1

#define NEXT_F   f += stride

#define NEXT_F2

#define PTR_ELT ( ptr,
elt   )     (((SRC *)ptr)[elt])

#define SRC   GLfloat

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLdouble

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLuint

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLint

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLushort

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLshort

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLubyte

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC   GLbyte

Translate from GL_BYTE.

Translate from GL_UNSIGNED_BYTE.

#define SRC_IDX   TYPE_IDX(GL_FLOAT)

#define SRC_IDX   TYPE_IDX(GL_DOUBLE)

#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_INT)

#define SRC_IDX   TYPE_IDX(GL_INT)

#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_SHORT)

#define SRC_IDX   TYPE_IDX(GL_SHORT)

#define SRC_IDX   TYPE_IDX(GL_UNSIGNED_BYTE)

#define SRC_IDX   TYPE_IDX(GL_BYTE)

#define SRC_START   start

#define STRIDE   stride

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   3

#define SZ   4

#define SZ   1

#define SZ   2

#define SZ   3

#define SZ   4

#define TAB (  )     _math_trans##x##_tab

#define TRX_1F ( f,
 )     (GLfloat) PTR_ELT(f,n)

#define TRX_3FN ( f,
 )     (GLfloat) PTR_ELT(f,n)

#define TRX_3FN ( f,
 )     INT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_3FN ( f,
 )     INT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_3FN ( f,
 )     USHORT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_3FN ( f,
 )     SHORT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_3FN ( f,
 )     UBYTE_TO_FLOAT(PTR_ELT(f,n))

#define TRX_3FN ( f,
 )     BYTE_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     (GLfloat) PTR_ELT(f,n)

#define TRX_4F ( f,
 )     (GLfloat)( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     (GLfloat)( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     (GLfloat)( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     (GLfloat)( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     (GLfloat)( PTR_ELT(f,n) )

#define TRX_4F ( f,
 )     BYTE_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4FN ( f,
 )     (GLfloat) PTR_ELT(f,n)

#define TRX_4FN ( f,
 )     UINT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4FN ( f,
 )     INT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4FN ( f,
 )     USHORT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4FN ( f,
 )     SHORT_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_4FN ( f,
 )     UBYTE_TO_FLOAT(PTR_ELT(f,n))

#define TRX_4FN ( f,
 )     BYTE_TO_FLOAT( PTR_ELT(f,n) )

#define TRX_UB ( ub,
f,
 )     UNCLAMPED_FLOAT_TO_UBYTE(ub, PTR_ELT(f,n))

#define TRX_UB ( ub,
f,
 )     ub = (GLubyte) (PTR_ELT(f,n) >> 24)

#define TRX_UB ( ub,
f,
 )     ub = INT_TO_UBYTE(PTR_ELT(f,n))

#define TRX_UB ( ub,
f,
 )     ub = (GLubyte) (PTR_ELT(f,n) >> 8)

#define TRX_UB ( ub,
f,
 )     ub = SHORT_TO_UBYTE(PTR_ELT(f,n))

#define TRX_UB ( ub,
f,
 )     ub = PTR_ELT(f,n)

#define TRX_UB ( ub,
f,
 )     ub = BYTE_TO_UBYTE( PTR_ELT(f,n) )

#define TRX_UI ( f,
 )     (GLuint) (GLint) PTR_ELT(f,n)

#define TRX_UI ( f,
 )     PTR_ELT(f,n)

#define TRX_UI ( f,
 )     (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))

#define TRX_UI ( f,
 )     (GLuint) PTR_ELT(f,n)

#define TRX_UI ( f,
 )     (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))

#define TRX_UI ( f,
 )     (GLuint)PTR_ELT(f,n)

#define TRX_UI ( f,
 )     (PTR_ELT(f,n) < 0 ? 0 : (GLuint) PTR_ELT(f,n))

#define TRX_US ( us,
f,
 )     UNCLAMPED_FLOAT_TO_USHORT(us, PTR_ELT(f,n))

#define TRX_US ( us,
f,
 )     us = (GLshort) (PTR_ELT(f,n) >> 16)

#define TRX_US ( us,
f,
 )     us = INT_TO_USHORT(PTR_ELT(f,n))

#define TRX_US ( us,
f,
 )     us = PTR_ELT(f,n)

#define TRX_US ( us,
f,
 )     us = SHORT_TO_USHORT(PTR_ELT(f,n))

#define TRX_US ( us,
f,
 )     us = UBYTE_TO_USHORT(PTR_ELT(f,n))

#define TRX_US ( ch,
f,
 )     ch = BYTE_TO_USHORT( PTR_ELT(f,n) )

#define TYPE_IDX (  )     ((t) & 0xf)


Typedef Documentation

typedef void(* trans_1f_func)(GLfloat *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)

Translate vectors of numbers between various types.

Author:
Keith Whitwell.

typedef void(* trans_1ub_func)(GLubyte *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)

typedef void(* trans_1ui_func)(GLuint *to, CONST void *ptr, GLuint stride, GLuint start, GLuint n)

typedef void(* trans_3fn_func)(GLfloat(*to)[3], CONST void *ptr, GLuint stride, GLuint start, GLuint n)

typedef void(* trans_4f_func)(GLfloat(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)

typedef void(* trans_4ub_func)(GLubyte(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)

typedef void(* trans_4us_func)(GLushort(*to)[4], CONST void *ptr, GLuint stride, GLuint start, GLuint n)


Function Documentation

void _math_init_translate ( void   ) 

void _math_trans_1f ( GLfloat *  to,
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLfloat [1].

Array translation.

void _math_trans_1ub ( GLubyte *  to,
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLubyte [1].

void _math_trans_1ui ( GLuint *  to,
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLuint [1].

void _math_trans_3fn ( GLfloat *  to[3],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLfloat[3], normalized to [-1, 1].

void _math_trans_4chan ( GLchan *  to[4],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  size,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLchan [4].

void _math_trans_4f ( GLfloat *  to[4],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  size,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLfloat [4].

Convert to floats w/out normalization (i.e.

void _math_trans_4fn ( GLfloat *  to[4],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  size,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLfloat[4], normalized to [-1, 1].

Convert to normalized floats in [0,1] or [-1, 1].

void _math_trans_4ub ( GLubyte *  to[4],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  size,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLubyte [4].

void _math_trans_4us ( GLushort *  to[4],
CONST void *  ptr,
GLuint  stride,
GLenum  type,
GLuint  size,
GLuint  start,
GLuint  n 
)

Translate vector of values to GLushort [4].

static void init_translate_raw ( void   )  [static]

static void trans_4_GLubyte_4ub_raw ( GLubyte *  t[4],
CONST void *  Ptr,
GLuint  stride,
ARGS   
) [static]


Variable Documentation

trans_1f_func _math_trans_1f_tab[MAX_TYPES] [static]

trans_1ub_func _math_trans_1ub_tab[MAX_TYPES] [static]

trans_1ui_func _math_trans_1ui_tab[MAX_TYPES] [static]

trans_3fn_func _math_trans_3fn_tab[MAX_TYPES] [static]

trans_4f_func _math_trans_4f_tab[5][MAX_TYPES] [static]

trans_4f_func _math_trans_4fn_tab[5][MAX_TYPES] [static]

trans_4ub_func _math_trans_4ub_tab[5][MAX_TYPES] [static]

trans_4us_func _math_trans_4us_tab[5][MAX_TYPES] [static]


Generated on Sun Sep 27 06:47:50 2009 for Mesa math module by  doxygen 1.5.4