Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

color.h

Go to the documentation of this file.
00001 
00010 #ifndef _DRAW_COLOR_H_
00011 #define _DRAW_COLOR_H_
00012 
00022 typedef struct {
00023   float a; 
00024   float r; 
00025   float g; 
00026   float b; 
00027 } draw_color_t;
00028 
00031 typedef unsigned int draw_argb_t;
00032 
00037 draw_argb_t draw_color_float_to_argb(const draw_color_t * col);
00038 
00040 draw_argb_t draw_color_4float_to_argb(const float a, const float r,
00041                                       const float g, const float b);
00042 
00044 void draw_color_argb_to_float(draw_color_t * col, const draw_argb_t argb);
00045 
00049 #define DRAW_ARGB(A,R,G,B) \
00050  (((int)(A)<<24)|\
00051  ((int)(R)<<16)|\
00052  ((int)(G)<<8)|\
00053  (int)(B))
00054 
00056 #define DRAW_ARGB_A(ARGB) ((draw_argb_t)(ARGB)>>24)
00057 
00059 #define DRAW_ARGB_R(ARGB) (((ARGB)>>16)&255)
00060 
00062 #define DRAW_ARGB_G(ARGB) (((ARGB)>>8)&255)
00063 
00065 #define DRAW_ARGB_B(ARGB) ((ARGB)&255)
00066 
00070 #define DRAW_ARGBF(A,R,G,B) \
00071  DRAW_COLOR_ARGB(A*255.0f,R*255.0f,G*255.0f,B*255.0f)
00072 
00079 void draw_color_clip(draw_color_t *d);
00080 
00082 void draw_color_neg(draw_color_t *d);
00083 
00085 void draw_color_clip3(draw_color_t *d, const float min, const float max);
00086 
00090 void draw_color_add(draw_color_t *d,
00091                     const draw_color_t *a, const draw_color_t *b);
00092 
00096 void draw_color_add_clip(draw_color_t *d,
00097                          const draw_color_t *a, const draw_color_t *b);
00098 
00102 void draw_color_mul_clip(draw_color_t *d,
00103                          const draw_color_t *a, const draw_color_t *b);
00104 
00107 void draw_color_mul(draw_color_t *d,
00108                     const draw_color_t *a, const draw_color_t *b);
00109 
00113 void draw_color_scale(draw_color_t *d,
00114                       const draw_color_t *a, const float b);
00115 
00116 
00121 #endif /* #define _DRAW_COLOR_H_ */

dcplaya documentation version 1.2 Generated on January 2004 by doxygen 1.3.5