ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

macros.h File Reference
#include "imports.h"

Go to the source code of this file.

Defines

#define STRIDE_F(p, i)   (p = (GLfloat *)((GLubyte *)p + i))
#define STRIDE_UI(p, i)   (p = (GLuint *)((GLubyte *)p + i))
#define STRIDE_4UB(p, i)   (p = (GLubyte (*)[4])((GLubyte *)p + i))
#define STRIDE_4F(p, i)   (p = (GLfloat (*)[4])((GLubyte *)p + i))
#define STRIDE_4CHAN(p, i)   (p = (GLchan (*)[4])((GLubyte *)p + i))
#define STRIDE_CHAN(p, i)   (p = (GLchan *)((GLubyte *)p + i))
#define STRIDE_T(p, t, i)   (p = (t)((GLubyte *)p + i))
#define CLAMP(X, MIN, MAX)   ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
#define CLAMP_SELF(x, mn, mx)   ( (x)<(mn) ? ((x) = (mn)) : ((x)>(mx) ? ((x)=(mx)) : (x)) )
#define MIN2(A, B)   ( (A)<(B) ? (A) : (B) )
#define MAX2(A, B)   ( (A)>(B) ? (A) : (B) )
#define DOT2(a, b)   ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )
#define DOT3(a, b)   ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] )
#define DOT4(a, b)
#define DOT4V(v, a, b, c, d)   (v[0]*(a) + v[1]*(b) + v[2]*(c) + v[3]*(d))
#define CROSS3(n, u, v)
#define NORMALIZE_3FV(V)
#define LEN_3FV(V)   (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2]))
#define LEN_2FV(V)   (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]))
#define LEN_SQUARED_3FV(V)   ((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2])
#define LEN_SQUARED_2FV(V)   ((V)[0]*(V)[0]+(V)[1]*(V)[1])
#define ENUM_TO_INT(E)   ((GLint)(E))
#define ENUM_TO_FLOAT(E)   ((GLfloat)(GLint)(E))
#define ENUM_TO_DOUBLE(E)   ((GLdouble)(GLint)(E))
#define ENUM_TO_BOOLEAN(E)   ((E) ? GL_TRUE : GL_FALSE)
4-element vector operations
#define ZERO_4V(DST)   (DST)[0] = (DST)[1] = (DST)[2] = (DST)[3] = 0
#define TEST_EQ_4V(a, b)
#define TEST_EQ_4UBV(DST, SRC)   TEST_EQ_4V(DST, SRC)
#define COPY_4V(DST, SRC)
#define COPY_4V_CAST(DST, SRC, CAST)
#define COPY_4UBV(DST, SRC)
#define COPY_4FV(DST, SRC)
#define COPY_SZ_4V(DST, SZ, SRC)
#define COPY_CLEAN_4V(DST, SZ, SRC)
#define SUB_4V(DST, SRCA, SRCB)
#define ADD_4V(DST, SRCA, SRCB)
#define SCALE_4V(DST, SRCA, SRCB)
#define ACC_4V(DST, SRC)
#define ACC_SCALE_4V(DST, SRCA, SRCB)
#define ACC_SCALE_SCALAR_4V(DST, S, SRCB)
#define SCALE_SCALAR_4V(DST, S, SRCB)
#define SELF_SCALE_SCALAR_4V(DST, S)
#define ASSIGN_4V(V, V0, V1, V2, V3)
3-element vector operations
#define ZERO_3V(DST)   (DST)[0] = (DST)[1] = (DST)[2] = 0
#define TEST_EQ_3V(a, b)
#define COPY_3V(DST, SRC)
#define COPY_3V_CAST(DST, SRC, CAST)
#define COPY_3FV(DST, SRC)
#define SUB_3V(DST, SRCA, SRCB)
#define ADD_3V(DST, SRCA, SRCB)
#define SCALE_3V(DST, SRCA, SRCB)
#define SELF_SCALE_3V(DST, SRC)
#define ACC_3V(DST, SRC)
#define ACC_SCALE_3V(DST, SRCA, SRCB)
#define SCALE_SCALAR_3V(DST, S, SRCB)
#define ACC_SCALE_SCALAR_3V(DST, S, SRCB)
#define SELF_SCALE_SCALAR_3V(DST, S)
#define ACC_SCALAR_3V(DST, S)
#define ASSIGN_3V(V, V0, V1, V2)
2-element vector operations
#define ZERO_2V(DST)   (DST)[0] = (DST)[1] = 0
#define COPY_2V(DST, SRC)
#define COPY_2V_CAST(DST, SRC, CAST)
#define COPY_2FV(DST, SRC)
#define SUB_2V(DST, SRCA, SRCB)
#define ADD_2V(DST, SRCA, SRCB)
#define SCALE_2V(DST, SRCA, SRCB)
#define ACC_2V(DST, SRC)
#define ACC_SCALE_2V(DST, SRCA, SRCB)
#define SCALE_SCALAR_2V(DST, S, SRCB)
#define ACC_SCALE_SCALAR_2V(DST, S, SRCB)
#define SELF_SCALE_SCALAR_2V(DST, S)
#define ACC_SCALAR_2V(DST, S)
#define ASSIGN_2V(V, V0, V1)
Linear interpolation macros
#define LINTERP(T, OUT, IN)   ((OUT) + (T) * ((IN) - (OUT)))
#define INTERP_UB(t, dstub, outub, inub)
#define INTERP_CHAN(t, dstc, outc, inc)
#define INTERP_UI(t, dstui, outui, inui)   dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) )
#define INTERP_F(t, dstf, outf, inf)   dstf = LINTERP( t, outf, inf )
#define INTERP_4F(t, dst, out, in)
#define INTERP_3F(t, dst, out, in)
#define INTERP_4CHAN(t, dst, out, in)
#define INTERP_3CHAN(t, dst, out, in)
#define INTERP_SZ(t, vec, to, out, in, sz)

Integer / float conversion for colors, normals, etc.

#define UBYTE_TO_FLOAT(u)   _mesa_ubyte_to_float_color_tab[(unsigned int)(u)]
#define FLOAT_TO_UBYTE(X)   ((GLubyte) (GLint) ((X) * 255.0F))
#define BYTE_TO_FLOAT(B)   ((2.0F * (B) + 1.0F) * (1.0F/255.0F))
#define FLOAT_TO_BYTE(X)   ( (((GLint) (255.0F * (X))) - 1) / 2 )
#define USHORT_TO_FLOAT(S)   ((GLfloat) (S) * (1.0F / 65535.0F))
#define SHORT_TO_FLOAT(S)   ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
#define FLOAT_TO_SHORT(X)   ( (((GLint) (65535.0F * (X))) - 1) / 2 )
#define UINT_TO_FLOAT(U)   ((GLfloat) (U) * (1.0F / 4294967295.0F))
#define FLOAT_TO_UINT(X)   ((GLuint) ((X) * 4294967295.0))
#define INT_TO_FLOAT(I)   ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0F))
#define FLOAT_TO_INT(X)   ( (GLint) (2147483647.0 * (X)) )
#define BYTE_TO_UBYTE(b)   ((GLubyte) ((b) < 0 ? 0 : (GLubyte) (b)))
#define SHORT_TO_UBYTE(s)   ((GLubyte) ((s) < 0 ? 0 : (GLubyte) ((s) >> 7)))
#define USHORT_TO_UBYTE(s)   ((GLubyte) ((s) >> 8))
#define INT_TO_UBYTE(i)   ((GLubyte) ((i) < 0 ? 0 : (GLubyte) ((i) >> 23)))
#define UINT_TO_UBYTE(i)   ((GLubyte) ((i) >> 24))
#define BYTE_TO_USHORT(b)   ((b) < 0 ? 0 : ((GLushort) (((b) * 65535) / 255)))
#define UBYTE_TO_USHORT(b)   (((GLushort) (b) << 8) | (GLushort) (b))
#define SHORT_TO_USHORT(s)   ((s) < 0 ? 0 : ((GLushort) (((s) * 65535 / 32767))))
#define INT_TO_USHORT(i)   ((i) < 0 ? 0 : ((GLushort) ((i) >> 15)))
#define UINT_TO_USHORT(i)   ((i) < 0 ? 0 : ((GLushort) ((i) >> 16)))
#define UNCLAMPED_FLOAT_TO_USHORT(us, f)   us = ( (GLushort) IROUND( CLAMP((f), 0.0, 1.0) * 65535.0F) )
#define CLAMPED_FLOAT_TO_USHORT(us, f)   us = ( (GLushort) IROUND( (f) * 65535.0F) )
GLfloat _mesa_ubyte_to_float_color_tab [256]

Detailed Description

A collection of useful macros.

Definition in file macros.h.


Generated on Sun May 27 2012 04:58:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.