ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/hexbit.c
Revision: 3.1
Committed: Sat Feb 22 02:07:27 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R6P1, rad3R5, rad3R6
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# User Rev Content
1 greg 3.1 #ifndef lint
2     static const char RCSid[] = "$Id$";
3     #endif
4     /*
5     * Convert from Radiance picture to bitmap usable by hexbit4x1.fnt
6     *
7     * pipe input from "pvalue -h -b -di [picture]"
8     */
9    
10     #include <stdio.h>
11    
12     main()
13     {
14     int xres, yres;
15     int i, j, i1,i2,i3,i4;
16    
17     if (scanf("-Y %d +X %d\n", &yres, &xres) != 2)
18     exit(1);
19     for (i = 0; i < yres; i++) {
20     for (j = 0; j < xres/4; j++) {
21     if (scanf("%d\n%d\n%d\n%d\n", &i1, &i2, &i3, &i4) != 4)
22     exit(1);
23     printf("%01X", (i1<128)<<3|(i2<128)<<2|(i3<128)<<1|(i4<128));
24     }
25     for (j = xres%4; j--; ) /* should get it, but too lazy */
26     scanf("%*d\n");
27     putchar('\n');
28     }
29     exit(0);
30     }