summaryrefslogtreecommitdiffstats
path: root/rgb16.c
blob: 1f10b6532706533b2182d723057d9f5bf0ecf742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* 
 by prumpf@mandrakesoft.com in 14 minutes
 to use it to make a screen shot of aurora :
 chvt 12; sleep 2; cat /dev/fb0 | ./rgb16 | rawtoppm 800 600 - > foo.xpm
*/

#include <stdio.h>

int main(void)
{
	unsigned short c;

	c = (c>>8) | (c<<8);

	for(;;) {

		fread(&c, 2, 1, stdin);
		
		putchar(((c>>11)&0x1f) << 3);
		putchar(((c>> 5)&0x3f) << 2);
		putchar(((c>> 0)&0x1f) << 3);
	}
	
	return 0;
}