diff options
Diffstat (limited to 'src/mesa/main/colormac.h')
-rw-r--r-- | src/mesa/main/colormac.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 5d125e27253..b69f52fbbbf 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -1,4 +1,4 @@ -/* $Id: colormac.h,v 1.1 2000/10/28 20:41:13 brianp Exp $ */ +/* $Id: colormac.h,v 1.2 2000/10/29 18:12:14 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -175,12 +175,20 @@ do { \ #define FLOAT_TO_CHAN(f) (f) #define DOUBLE_TO_CHAN(f) ((GLfloat) (f)) +#define UNCLAMPED_FLOAT_TO_CHAN(f) (f) +#define UNCLAMPED_DOUBLE_TO_CHAN(f) ((GLfloat) (f)) #else #define FLOAT_TO_CHAN(f) ( (GLchan) FloatToInt((f) * CHAN_MAXF + 0.5F) ) #define DOUBLE_TO_CHAN(f) ( (GLchan) FloatToInt((f) * CHAN_MAXF + 0.5F) ) +#define UNCLAMPED_FLOAT_TO_CHAN(f) \ + ( (GLchan) FloatToInt( CLAMP(f, 0.0, 1.0) * CHAN_MAXF + 0.5F) ) + +#define UNCLAMPED_DOUBLE_TO_CHAN(f) \ + ( (GLchan) FloatToInt( CLAMP(f, 0.0, 1.0) * CHAN_MAXF + 0.5F) ) + #endif |