dostunnel
diff src/colorbit.h @ 0:c525cfbfd4a2
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 15 Mar 2013 16:46:41 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/colorbit.h Fri Mar 15 16:46:41 2013 +0200 1.3 @@ -0,0 +1,17 @@ 1.4 +#ifndef COLORBIT_H_ 1.5 +#define COLORBIT_H_ 1.6 + 1.7 +#define RSHIFT 0 1.8 +#define GSHIFT 8 1.9 +#define BSHIFT 16 1.10 + 1.11 +#define PACK_COLOR24(r, g, b) \ 1.12 + ((((r) & 0xff) << RSHIFT) | \ 1.13 + (((g) & 0xff) << GSHIFT) | \ 1.14 + (((b) & 0xff) << BSHIFT)) 1.15 + 1.16 +#define UNP_RED32(x) (((x) >> RSHIFT) & 0xff) 1.17 +#define UNP_GREEN32(x) (((x) >> GSHIFT) & 0xff) 1.18 +#define UNP_BLUE32(x) (((x) >> BSHIFT) & 0xff) 1.19 + 1.20 +#endif /* COLORBIT_H_ */