1 /* Values for wmesa->pixelformat: */ 2 3 #define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */ 4 #define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */ 5 #define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */ 6 #define PF_DITHER8 6 /* Dithered RGB using a lookup table */ 7 #define PF_LOOKUP 7 /* Undithered RGB using a lookup table */ 8 #define PF_GRAYSCALE 10 /* Grayscale or StaticGray */ 9 #define PF_BADFORMAT 11 10 #define PF_INDEX8 12 11 12 13 #define BGR8(r,g,b) (unsigned)(((BYTE)((b & 0xc0) | ((g & 0xe0)>>2) | \ 14 ((r & 0xe0)>>5)))) 15 16 /* Windows uses 5,5,5 for 16-bit */ 17 #define BGR16(r,g,b) ( (((unsigned short)b ) >> 3) | \ 18 (((unsigned short)g & 0xf8) << 2) | \ 19 (((unsigned short)r & 0xf8) << 7) ) 20 21 #define BGR24(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)| \ 22 ((WORD)((BYTE)(g))<<8))| \ 23 (((DWORD)(BYTE)(r))<<16))) 24 25 #define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)| \ 26 ((WORD)((BYTE)(g))<<8))| \ 27 (((DWORD)(BYTE)(r))<<16))) 28 29 30