doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Typedefs
gdefs.h File Reference

Go to the source code of this file.

Macros

#define dabs(a)   (((a)<0) ? -(a) : (a))
 
#define CLAMP(v, l, h)   ((v)<(l) ? (l) : (v)>(h) ? (h) : v)
 
#define xswap(a, b)   { a^=b; b^=a; a^=b; }
 
#define lum(a)   ( 0.2990*(a>>16) + 0.5870*((a>>8)&0xff) + 0.1140*(a&0xff) )
 
#define gsign(a)   ((a) < 0 ? -1 : 1)
 
#define mnint(a)   ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5))
 
#define mmax(a, b)   ((a) > (b) ? (a) : (b))
 
#define mmin(a, b)   ((a) < (b) ? (a) : (b))
 
#define RGBDIST(src0, src1)
 
#define RGBADIST(src0, src1)
 
#define RMULT   0.2990f
 
#define GMULT   0.5870f
 
#define BMULT   0.1140f
 
#define RIEMULT   -0.16874f
 
#define RQEMULT   0.50000f
 
#define GIEMULT   -0.33126f
 
#define GQEMULT   -0.41869f
 
#define BIEMULT   0.50000f
 
#define BQEMULT   -0.08131f
 

Typedefs

typedef unsigned char byte
 
typedef unsigned short word
 

Macro Definition Documentation

#define BIEMULT   0.50000f

Definition at line 65 of file gdefs.h.

#define BMULT   0.1140f

Definition at line 59 of file gdefs.h.

#define BQEMULT   -0.08131f

Definition at line 66 of file gdefs.h.

#define CLAMP (   v,
  l,
 
)    ((v)<(l) ? (l) : (v)>(h) ? (h) : v)

Definition at line 40 of file gdefs.h.

#define dabs (   a)    (((a)<0) ? -(a) : (a))

Definition at line 39 of file gdefs.h.

#define GIEMULT   -0.33126f

Definition at line 63 of file gdefs.h.

#define GMULT   0.5870f

Definition at line 58 of file gdefs.h.

#define GQEMULT   -0.41869f

Definition at line 64 of file gdefs.h.

#define gsign (   a)    ((a) < 0 ? -1 : 1)

Definition at line 43 of file gdefs.h.

#define lum (   a)    ( 0.2990*(a>>16) + 0.5870*((a>>8)&0xff) + 0.1140*(a&0xff) )

Definition at line 42 of file gdefs.h.

#define mmax (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 45 of file gdefs.h.

#define mmin (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 46 of file gdefs.h.

#define mnint (   a)    ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5))

Definition at line 44 of file gdefs.h.

#define RGBADIST (   src0,
  src1 
)
Value:
( ((src0[0]-src1[0])*(src0[0]-src1[0])) + \
((src0[1]-src1[1])*(src0[1]-src1[1])) + \
((src0[2]-src1[2])*(src0[2]-src1[2])) + \
((src0[3]-src1[3])*(src0[3]-src1[3])) )

Definition at line 51 of file gdefs.h.

#define RGBDIST (   src0,
  src1 
)
Value:
( ((src0[0]-src1[0])*(src0[0]-src1[0])) + \
((src0[1]-src1[1])*(src0[1]-src1[1])) + \
((src0[2]-src1[2])*(src0[2]-src1[2])) )

Definition at line 47 of file gdefs.h.

#define RIEMULT   -0.16874f

Definition at line 61 of file gdefs.h.

#define RMULT   0.2990f

Definition at line 57 of file gdefs.h.

#define RQEMULT   0.50000f

Definition at line 62 of file gdefs.h.

#define xswap (   a,
  b 
)    { a^=b; b^=a; a^=b; }

Definition at line 41 of file gdefs.h.

Typedef Documentation

typedef unsigned char byte

Definition at line 35 of file gdefs.h.

typedef unsigned short word

Definition at line 36 of file gdefs.h.