diff options
author | Gareth Hughes <[email protected]> | 2001-03-18 08:53:49 +0000 |
---|---|---|
committer | Gareth Hughes <[email protected]> | 2001-03-18 08:53:49 +0000 |
commit | 2c3d34c905fa6b831a066afae83b938de05eb241 (patch) | |
tree | 8905ffec020f38687d4e1df313022bb3bef8f467 /src/mesa/main/macros.h | |
parent | 6e550baa0a2b72bb0e4f5b19fdf74e5d3f377565 (diff) |
- Port 3.4 texture utils, texture format work to 3.5 (including new
FetchTexel routines).
- Initial hooks for GL_EXT_texture_filter_anisotropic.
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r-- | src/mesa/main/macros.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 1cfb55552d3..b9ccd906d4c 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -1,4 +1,4 @@ -/* $Id: macros.h,v 1.19 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: macros.h,v 1.20 2001/03/18 08:53:49 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -443,4 +443,31 @@ do { \ } while (0) + +/* Generic color packing macros + */ + +#define PACK_COLOR_8888( a, b, c, d ) \ + (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) + +#define PACK_COLOR_888( a, b, c ) \ + (((a) << 16) | ((b) << 8) | (c)) + +#define PACK_COLOR_565( a, b, c ) \ + ((((a) & 0xf8) << 8) | (((b) & 0xfc) << 3) | (((c) & 0xf8) >> 3)) + +#define PACK_COLOR_1555( a, b, c, d ) \ + ((((b) & 0xf8) << 7) | (((c) & 0xf8) << 2) | (((d) & 0xf8) >> 3) | \ + ((a) ? 0x8000 : 0)) + +#define PACK_COLOR_4444( a, b, c, d ) \ + ((((a) & 0xf0) << 8) | (((b) & 0xf0) << 4) | ((c) & 0xf0) | ((d) >> 4)) + +#define PACK_COLOR_88( a, b ) \ + (((a) << 8) | (b)) + +#define PACK_COLOR_332( a, b, c ) \ + (((a) & 0xe0) | (((b) & 0xe0) >> 3) | (((c) & 0xc0) >> 6)) + + #endif |